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@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Andrew Cooper committed 2026-07-07 17:19:38 +01:00
1 parent a41bba43a7
commit 1557e03579
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -89,7 +89,7 @@ __UNLIKELY_END(nsvm_hap)
vmrun
SAVE_ALL
PUSH_AND_CLEAR_GPRS
GET_CURRENT(bx)
+2 -2
View File
@@ -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
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.