Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1345891

[PATCH 2/3] kvm: x86: Track irq vectors in ioapic->rtc_status.dest_map

From Joerg Roedel <joro@8bytes.org>
Newsgroups linux.kernel
Subject [PATCH 2/3] kvm: x86: Track irq vectors in ioapic->rtc_status.dest_map
Date 2016-02-29 16:10 +0100
Message-ID <r7xCr-4FN-39@gated-at.bofh.it> (permalink)
References <r7xCq-4FN-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Joerg Roedel <jroedel@suse.de>

This allows backtracking later in case the rtc irq has been
moved to another vcpu/vector.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 arch/x86/kvm/ioapic.h | 7 +++++++
 arch/x86/kvm/lapic.c  | 4 +++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/ioapic.h b/arch/x86/kvm/ioapic.h
index af72989..7d2692a 100644
--- a/arch/x86/kvm/ioapic.h
+++ b/arch/x86/kvm/ioapic.h
@@ -41,7 +41,14 @@ struct kvm_vcpu;
 #endif
 
 struct dest_map {
+	/* vcpu bitmap where IRQ has been sent */
 	DECLARE_BITMAP(map, KVM_MAX_VCPUS);
+
+	/*
+	 * Vector sent to a given vcpu, only valid when
+	 * the vcpu's bit in map is set
+	 */
+	u8 vectors[KVM_MAX_VCPUS];
 };
 
 
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 5b78c97..5ea7ef0 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -839,8 +839,10 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
 
 		result = 1;
 
-		if (dest_map)
+		if (dest_map) {
 			__set_bit(vcpu->vcpu_id, dest_map->map);
+			dest_map->vectors[vcpu->vcpu_id] = vector;
+		}
 
 		if (apic_test_vector(vector, apic->regs + APIC_TMR) != !!trig_mode) {
 			if (trig_mode)
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] KVM: Fix lost IRQ acks for RTC Joerg Roedel <joro@8bytes.org> - 2016-02-29 16:10 +0100
  [PATCH 2/3] kvm: x86: Track irq vectors in ioapic->rtc_status.dest_map Joerg Roedel <joro@8bytes.org> - 2016-02-29 16:10 +0100
  [PATCH 3/3] kvm: x86: Check dest_map->vector to match eoi signals for rtc Joerg Roedel <joro@8bytes.org> - 2016-02-29 16:10 +0100
  Re: [PATCH 0/3] KVM: Fix lost IRQ acks for RTC Paolo Bonzini <pbonzini@redhat.com> - 2016-02-29 16:20 +0100
    Re: [PATCH 0/3] KVM: Fix lost IRQ acks for RTC Joerg Roedel <joro@8bytes.org> - 2016-02-29 16:40 +0100
      Re: [PATCH 0/3] KVM: Fix lost IRQ acks for RTC Steve Rutherford <srutherford@google.com> - 2016-03-02 01:30 +0100

csiph-web