From 6069de2206f60e9fee4356e1ba929b02a757514a Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
Date: Thu, 16 Aug 2007 22:02:59 +0800
Subject: [PATCH] kvm: qemu: prevent set wrong cr8 when using irqchip

this allows running 64-bit Windows.

Signed-off-by: Sheng Yang <sheng.yang@intel.com>
---
 qemu/qemu-kvm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index 3fc32f7..af7b1d8 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@@ -516,8 +516,8 @@ static int pre_kvm_run(void *opaque, int vcpu)
 	    usleep(1000);
 	pthread_mutex_lock(&qemu_mutex);
     }
-
-    kvm_set_cr8(kvm_context, vcpu, cpu_get_apic_tpr(env));
+    if (!kvm_irqchip)
+	kvm_set_cr8(kvm_context, vcpu, cpu_get_apic_tpr(env));
     if (env->interrupt_request & CPU_INTERRUPT_EXIT)
 	return 1;
     pthread_mutex_unlock(&qemu_mutex);
-- 
1.5.2

