[PATCH v4 5/7] KVM: Recalculate destination vcpu map

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Yang Zhang <yang.z.zhang@xxxxxxxxx>

Update RTC interrrupt's destination vcpu map when ioapic entry of RTC
or apic register (id, ldr, dfr) is changed.

Signed-off-by: Yang Zhang <yang.z.zhang@xxxxxxxxx>
---
 virt/kvm/ioapic.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c
index ddf9414..91b4c08 100644
--- a/virt/kvm/ioapic.c
+++ b/virt/kvm/ioapic.c
@@ -121,6 +121,7 @@ void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu,
 {
 	struct kvm_ioapic *ioapic = vcpu->kvm->arch.vioapic;
 	union kvm_ioapic_redirect_entry *e;
+	unsigned long *rtc_map = ioapic->rtc_status.vcpu_map;
 	struct kvm_lapic_irq irqe;
 	int index;
 
@@ -130,15 +131,19 @@ void kvm_ioapic_scan_entry(struct kvm_vcpu *vcpu,
 		if (!e->fields.mask &&
 			(e->fields.trig_mode == IOAPIC_LEVEL_TRIG ||
 			 kvm_irq_has_notifier(ioapic->kvm, KVM_IRQCHIP_IOAPIC,
-				 index))) {
+				 index) || index == 8)) {
 			irqe.dest_id = e->fields.dest_id;
 			irqe.vector = e->fields.vector;
 			irqe.dest_mode = e->fields.dest_mode;
 			irqe.shorthand = 0;
 
 			if (kvm_apic_match_dest(vcpu, NULL, irqe.shorthand,
-						irqe.dest_id, irqe.dest_mode))
+						irqe.dest_id, irqe.dest_mode)) {
 				__set_bit(irqe.vector, eoi_exit_bitmap);
+				if (index == 8)
+					__set_bit(vcpu->vcpu_id, rtc_map);
+			} else if (index == 8)
+				__clear_bit(vcpu->vcpu_id, rtc_map);
 		}
 	}
 	spin_unlock(&ioapic->lock);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux