These two patches fix CR8 support for x64 Windows. Now when writing to
CR8 in the guest OS, we exit to userspace and update tpr in qemu apic
emulation.
We can boot x64 Windows XP with these patches now.

Signed-off-by: Sheng Yang <[EMAIL PROTECTED]>
---
 drivers/kvm/vmx.c   |    3 ++-
 include/linux/kvm.h |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 906d4fa..8f9a0bb 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1831,7 +1831,8 @@ static int handle_cr(struct kvm_vcpu *vcpu, struct
kvm_run *kvm_run)
                        vcpu_load_rsp_rip(vcpu);
                        set_cr8(vcpu, vcpu->regs[reg]);
                        skip_emulated_instruction(vcpu);
-                       return 1;
+                       kvm_run->exit_reason = KVM_EXIT_SET_TPR;
+                       return 0;
                };
                break;
        case 2: /* clts */
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 91a446f..1d5a49c 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -46,6 +46,7 @@ enum kvm_exit_reason {
        KVM_EXIT_SHUTDOWN         = 8,
        KVM_EXIT_FAIL_ENTRY       = 9,
        KVM_EXIT_INTR             = 10,
+       KVM_EXIT_SET_TPR          = 11
 };
 
 /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
-- 
1.5.2

Attachment: Fix-CR8-support-in-kvm.patch
Description: Fix-CR8-support-in-kvm.patch

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to