[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.2-testing] x86, vmx: HVM guests are allowed to modify CR2, and the written value



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1206615975 0
# Node ID 7c1dc8be882d89a47098c17319714d9ab8d58f24
# Parent  fb614cdbae0e5c1606161761a364eb300505ed52
x86, vmx: HVM guests are allowed to modify CR2, and the written value
should be remembered by Xen.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
xen-unstable changeset:   17306:a294519d97d2fc59ec286b9c4e9988776166053e
xen-unstable date:        Thu Mar 27 11:03:45 2008 +0000
---
 xen/arch/x86/hvm/vmx/x86_32/exits.S |    4 ++++
 xen/arch/x86/hvm/vmx/x86_64/exits.S |    4 ++++
 2 files changed, 8 insertions(+)

diff -r fb614cdbae0e -r 7c1dc8be882d xen/arch/x86/hvm/vmx/x86_32/exits.S
--- a/xen/arch/x86/hvm/vmx/x86_32/exits.S       Wed Mar 26 09:38:49 2008 +0000
+++ b/xen/arch/x86/hvm/vmx/x86_32/exits.S       Thu Mar 27 11:06:15 2008 +0000
@@ -60,6 +60,7 @@
         ALIGN
 ENTRY(vmx_asm_vmexit_handler)
         HVM_SAVE_ALL_NOSEGREGS
+        GET_CURRENT(%ebx)
 
         movl $GUEST_RIP,%eax
         VMREAD(UREGS_eip)
@@ -67,6 +68,9 @@ ENTRY(vmx_asm_vmexit_handler)
         VMREAD(UREGS_esp)
         movl $GUEST_RFLAGS,%eax
         VMREAD(UREGS_eflags)
+
+        movl %cr2,%eax
+        movl %eax,VCPU_hvm_guest_cr2(%ebx)
 
 #ifndef NDEBUG
         movw $0xbeef,%ax
diff -r fb614cdbae0e -r 7c1dc8be882d xen/arch/x86/hvm/vmx/x86_64/exits.S
--- a/xen/arch/x86/hvm/vmx/x86_64/exits.S       Wed Mar 26 09:38:49 2008 +0000
+++ b/xen/arch/x86/hvm/vmx/x86_64/exits.S       Thu Mar 27 11:06:15 2008 +0000
@@ -76,6 +76,7 @@
         ALIGN
 ENTRY(vmx_asm_vmexit_handler)
         HVM_SAVE_ALL_NOSEGREGS
+        GET_CURRENT(%rbx)
 
         leaq UREGS_rip(%rsp),%rdi
         movl $GUEST_RIP,%eax
@@ -85,6 +86,9 @@ ENTRY(vmx_asm_vmexit_handler)
         VMREAD(UREGS_rsp)
         movl $GUEST_RFLAGS,%eax
         VMREAD(UREGS_eflags)
+
+        movq %cr2,%rax
+        movq %rax,VCPU_hvm_guest_cr2(%rbx)
 
 #ifndef NDEBUG
         movw $0xbeef,%ax

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.