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

[xen master] x86/hvm: Use PUSH_AND_CLEAR_GPRS in preference to SAVE_ALL



commit 1557e0357960e526f4a9ec3e36099cb7f841f27d
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Fri Mar 27 23:17:41 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Tue Jul 7 17:19:38 2026 +0100

    x86/hvm: Use PUSH_AND_CLEAR_GPRS in preference to SAVE_ALL
    
    PUSH_AND_CLEAR_GPRS is shorter than SAVE_ALL in terms of emitted code.
    SAVE_ALL hides a CLD instruction which is not needed anywhere here.
    
     * VMX VMExit always clears flags.  VMX VMentry failure never switched away
       from the host flags, so they're still good.
     * SVM VMRUN always saves and restores the host flags.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/hvm/svm/entry.S | 2 +-
 xen/arch/x86/hvm/vmx/entry.S | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/entry.S b/xen/arch/x86/hvm/svm/entry.S
index b6ea699bb9..d9613a2a8f 100644
--- a/xen/arch/x86/hvm/svm/entry.S
+++ b/xen/arch/x86/hvm/svm/entry.S
@@ -89,7 +89,7 @@ __UNLIKELY_END(nsvm_hap)
 
         vmrun
 
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         GET_CURRENT(bx)
 
diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S
index c34f5a1ee0..cebc700640 100644
--- a/xen/arch/x86/hvm/vmx/entry.S
+++ b/xen/arch/x86/hvm/vmx/entry.S
@@ -22,7 +22,7 @@
 #include <asm/page.h>
 
 FUNC(vmx_asm_vmexit_handler)
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         mov  %cr2,%rax
         GET_CURRENT(bx)
@@ -157,7 +157,7 @@ UNLIKELY_END(realmode)
 
 .Lvmx_vmentry_fail:
         sti
-        SAVE_ALL
+        PUSH_AND_CLEAR_GPRS
 
         /*
          * SPEC_CTRL_ENTRY notes
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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