[PATCH] qemu-kvm: Prevent user space APIC code execution with in-kernel irqchip

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

 



As qemu-kvm merged the kernel APIC into the user space model, we need to
replicate the kernel APIC's logic here until the mess is cleaned up. So
far we triggered the timer start and apic_update_irq calls unwillingly.

Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
---
 hw/apic.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/apic.c b/hw/apic.c
index dbf05a1..42865da 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -270,6 +270,9 @@ static void apic_set_base(APICCommonState *s, uint64_t val)
 static void apic_set_tpr(APICCommonState *s, uint8_t val)
 {
     s->tpr = (val & 0x0f) << 4;
+    if (kvm_enabled() && kvm_irqchip_in_kernel()) {
+        return;
+    }
     apic_update_irq(s);
 }
 
@@ -878,6 +881,9 @@ void kvm_save_lapic(CPUState *env)
 
 static void apic_post_load(APICCommonState *s)
 {
+    if (kvm_enabled() && kvm_irqchip_in_kernel()) {
+        return;
+    }
     if (s->timer_expiry != -1) {
         qemu_mod_timer(s->timer, s->timer_expiry);
     } else {
-- 
1.7.3.4
--
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