diff mbox

Don't call kvm_cpu_synchronize_state() if there is no irqchip events to process.

Message ID 1253631112-26124-2-git-send-email-gleb@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gleb Natapov Sept. 22, 2009, 2:51 p.m. UTC
Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 qemu-kvm-x86.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

Comments

Avi Kivity Sept. 23, 2009, 9 a.m. UTC | #1
On 09/22/2009 05:51 PM, Gleb Natapov wrote:
> Signed-off-by: Gleb Natapov<gleb@redhat.com>
>    

Applied, thanks.
diff mbox

Patch

diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index 32561f0..acb1b91 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -1673,9 +1673,12 @@  uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function,
 
 void kvm_arch_process_irqchip_events(CPUState *env)
 {
-    kvm_cpu_synchronize_state(env);
-    if (env->interrupt_request & CPU_INTERRUPT_INIT)
+    if (env->interrupt_request & CPU_INTERRUPT_INIT) {
+        kvm_cpu_synchronize_state(env);
         do_cpu_init(env);
-    if (env->interrupt_request & CPU_INTERRUPT_SIPI)
+    }
+    if (env->interrupt_request & CPU_INTERRUPT_SIPI) {
+        kvm_cpu_synchronize_state(env);
         do_cpu_sipi(env);
+    }
 }