* [PATCH 1/2]Fix CR8 support in kvm
@ 2007-08-15 14:22 Yang, Sheng
[not found] ` <DB3BD37E3533EE46BED2FBA80995557F6C4C59-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Yang, Sheng @ 2007-08-15 14:22 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]
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 <sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
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 #2: Fix-CR8-support-in-kvm.patch --]
[-- Type: application/octet-stream, Size: 1367 bytes --]
From d3ab1d014d9911ba457d979dbf64322f4056e43d Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
Date: Wed, 15 Aug 2007 16:22:55 +0800
Subject: [PATCH] Fix CR8 support in kvm
This patch fixs 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 this patch now.
Signed-off-by: Sheng Yang <sheng.yang@intel.com>
---
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 #3: Type: text/plain, Size: 315 bytes --]
-------------------------------------------------------------------------
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/
[-- Attachment #4: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2]Fix CR8 support in kvm
[not found] ` <DB3BD37E3533EE46BED2FBA80995557F6C4C59-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-08-16 10:20 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2007-08-16 10:20 UTC (permalink / raw)
To: Yang, Sheng; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Yang, Sheng wrote:
> 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.
>
>
Applied both, thanks. I split the userspace patch into the libkvm part
and the qemu part.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
-------------------------------------------------------------------------
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-16 10:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15 14:22 [PATCH 1/2]Fix CR8 support in kvm Yang, Sheng
[not found] ` <DB3BD37E3533EE46BED2FBA80995557F6C4C59-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-08-16 10:20 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox