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

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1206615825 0
# Node ID a294519d97d2fc59ec286b9c4e9988776166053e
# Parent  ea93383019c8cc607fd128b40701e426dd264903
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/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 ea93383019c8 -r a294519d97d2 xen/arch/x86/hvm/vmx/x86_32/exits.S
--- a/xen/arch/x86/hvm/vmx/x86_32/exits.S       Thu Mar 27 10:52:54 2008 +0000
+++ b/xen/arch/x86/hvm/vmx/x86_32/exits.S       Thu Mar 27 11:03:45 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 ea93383019c8 -r a294519d97d2 xen/arch/x86/hvm/vmx/x86_64/exits.S
--- a/xen/arch/x86/hvm/vmx/x86_64/exits.S       Thu Mar 27 10:52:54 2008 +0000
+++ b/xen/arch/x86/hvm/vmx/x86_64/exits.S       Thu Mar 27 11:03:45 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®.