ia64/xen-unstable

changeset 17336:a294519d97d2

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@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Mar 27 11:03:45 2008 +0000 (2008-03-27)
parents ea93383019c8
children b667e220e556
files xen/arch/x86/hvm/vmx/x86_32/exits.S xen/arch/x86/hvm/vmx/x86_64/exits.S
line diff
     1.1 --- a/xen/arch/x86/hvm/vmx/x86_32/exits.S	Thu Mar 27 10:52:54 2008 +0000
     1.2 +++ b/xen/arch/x86/hvm/vmx/x86_32/exits.S	Thu Mar 27 11:03:45 2008 +0000
     1.3 @@ -60,6 +60,7 @@
     1.4          ALIGN
     1.5  ENTRY(vmx_asm_vmexit_handler)
     1.6          HVM_SAVE_ALL_NOSEGREGS
     1.7 +        GET_CURRENT(%ebx)
     1.8  
     1.9          movl $GUEST_RIP,%eax
    1.10          VMREAD(UREGS_eip)
    1.11 @@ -68,6 +69,9 @@ ENTRY(vmx_asm_vmexit_handler)
    1.12          movl $GUEST_RFLAGS,%eax
    1.13          VMREAD(UREGS_eflags)
    1.14  
    1.15 +        movl %cr2,%eax
    1.16 +        movl %eax,VCPU_hvm_guest_cr2(%ebx)
    1.17 +
    1.18  #ifndef NDEBUG
    1.19          movw $0xbeef,%ax
    1.20          movw %ax,UREGS_error_code(%esp)
     2.1 --- a/xen/arch/x86/hvm/vmx/x86_64/exits.S	Thu Mar 27 10:52:54 2008 +0000
     2.2 +++ b/xen/arch/x86/hvm/vmx/x86_64/exits.S	Thu Mar 27 11:03:45 2008 +0000
     2.3 @@ -76,6 +76,7 @@
     2.4          ALIGN
     2.5  ENTRY(vmx_asm_vmexit_handler)
     2.6          HVM_SAVE_ALL_NOSEGREGS
     2.7 +        GET_CURRENT(%rbx)
     2.8  
     2.9          leaq UREGS_rip(%rsp),%rdi
    2.10          movl $GUEST_RIP,%eax
    2.11 @@ -86,6 +87,9 @@ ENTRY(vmx_asm_vmexit_handler)
    2.12          movl $GUEST_RFLAGS,%eax
    2.13          VMREAD(UREGS_eflags)
    2.14  
    2.15 +        movq %cr2,%rax
    2.16 +        movq %rax,VCPU_hvm_guest_cr2(%rbx)
    2.17 +
    2.18  #ifndef NDEBUG
    2.19          movw $0xbeef,%ax
    2.20          movw %ax,UREGS_error_code(%rsp)