]> xenbits.xensource.com Git - xen.git/commitdiff
x86/hvm: Use SAVE_ALL to construct the cpu_user_regs frame after VMExit
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 17 Aug 2017 14:23:21 +0000 (15:23 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 5 Jan 2018 19:57:08 +0000 (19:57 +0000)
No practical change.

One side effect in debug builds is that %rbp is inverted in the manner
expected by the stack unwinder to indicate a interrupt frame.

This is part of XSA-254.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
xen/arch/x86/hvm/svm/entry.S
xen/arch/x86/hvm/vmx/entry.S

index 4a72e38e8b35738a85e94838c77224a4753e5e10..df86da0a81fc07abc76cf6d75b30226e9faf008a 100644 (file)
@@ -98,24 +98,10 @@ UNLIKELY_END(svm_trace)
 
         VMRUN
 
-        GET_CURRENT(ax)
-        push %rdi
-        push %rsi
-        push %rdx
-        push %rcx
-        mov  VCPU_svm_vmcb(%rax),%rcx
-        push %rax
-        push %r8
-        push %r9
-        push %r10
-        push %r11
-        push %rbx
-        mov  %rax,%rbx
-        push %rbp
-        push %r12
-        push %r13
-        push %r14
-        push %r15
+        SAVE_ALL
+
+        GET_CURRENT(bx)
+        mov  VCPU_svm_vmcb(%rbx),%rcx
 
         movb $0,VCPU_svm_vmcb_in_sync(%rbx)
         mov  VMCB_rax(%rcx),%rax
index 47cd67426053b090804ef365d4bf82cd739a539b..b2f98be7f55100fc8746a85d02789de693f8de79 100644 (file)
 #define VMLAUNCH     .byte 0x0f,0x01,0xc2
 
 ENTRY(vmx_asm_vmexit_handler)
-        push %rdi
-        push %rsi
-        push %rdx
-        push %rcx
-        push %rax
+        SAVE_ALL
+
         mov  %cr2,%rax
-        push %r8
-        push %r9
-        push %r10
-        push %r11
-        push %rbx
         GET_CURRENT(bx)
-        push %rbp
-        push %r12
-        push %r13
-        push %r14
-        push %r15
 
         movb $1,VCPU_vmx_launched(%rbx)
         mov  %rax,VCPU_hvm_guest_cr2(%rbx)