]> xenbits.xensource.com Git - xen.git/commitdiff
x86, vmx: HVM guests are allowed to modify CR2, and the written value
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 27 Mar 2008 11:03:45 +0000 (11:03 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 27 Mar 2008 11:03:45 +0000 (11:03 +0000)
should be remembered by Xen.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/hvm/vmx/x86_32/exits.S
xen/arch/x86/hvm/vmx/x86_64/exits.S

index 70cd1dae36cf891219645820ac0e679b02f91ffb..11db8cfc218198ce9cd73be03767099577181d04 100644 (file)
@@ -60,6 +60,7 @@
         ALIGN
 ENTRY(vmx_asm_vmexit_handler)
         HVM_SAVE_ALL_NOSEGREGS
+        GET_CURRENT(%ebx)
 
         movl $GUEST_RIP,%eax
         VMREAD(UREGS_eip)
@@ -68,6 +69,9 @@ ENTRY(vmx_asm_vmexit_handler)
         movl $GUEST_RFLAGS,%eax
         VMREAD(UREGS_eflags)
 
+        movl %cr2,%eax
+        movl %eax,VCPU_hvm_guest_cr2(%ebx)
+
 #ifndef NDEBUG
         movw $0xbeef,%ax
         movw %ax,UREGS_error_code(%esp)
index fda4f179b119b589157a9fab578d5af02ad4ba33..48da4869bd7abef09a2cec6c5fc63de0769b0494 100644 (file)
@@ -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
@@ -86,6 +87,9 @@ ENTRY(vmx_asm_vmexit_handler)
         movl $GUEST_RFLAGS,%eax
         VMREAD(UREGS_eflags)
 
+        movq %cr2,%rax
+        movq %rax,VCPU_hvm_guest_cr2(%rbx)
+
 #ifndef NDEBUG
         movw $0xbeef,%ax
         movw %ax,UREGS_error_code(%rsp)