public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qemu-kvm: Prevent user space APIC code execution with in-kernel irqchip
@ 2012-02-06 11:51 Jan Kiszka
  0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2012-02-06 11:51 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti; +Cc: kvm

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@siemens.com>
---
 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-06 11:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-06 11:51 [PATCH] qemu-kvm: Prevent user space APIC code execution with in-kernel irqchip Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox