All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: VMX: Move VM-exit RSB stuffing out of line
@ 2022-06-22 22:24 Jim Mattson
  2022-06-27 15:08 ` Sean Christopherson
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Mattson @ 2022-06-22 22:24 UTC (permalink / raw)
  To: kvm, pbonzini; +Cc: Jim Mattson

RSB-stuffing after VM-exit is only needed for legacy CPUs without
eIBRS. Move the RSB-stuffing code out of line.

Preserve the non-sensical correlation of RSB-stuffing with retpoline.

Signed-off-by: Jim Mattson <jmattson@google.com>
---
 arch/x86/kvm/vmx/vmenter.S | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/vmx/vmenter.S b/arch/x86/kvm/vmx/vmenter.S
index 435c187927c4..39009a4c86bd 100644
--- a/arch/x86/kvm/vmx/vmenter.S
+++ b/arch/x86/kvm/vmx/vmenter.S
@@ -76,7 +76,12 @@ SYM_FUNC_END(vmx_vmenter)
  */
 SYM_FUNC_START(vmx_vmexit)
 #ifdef CONFIG_RETPOLINE
-	ALTERNATIVE "jmp .Lvmexit_skip_rsb", "", X86_FEATURE_RETPOLINE
+	ALTERNATIVE "", "jmp .Lvmexit_stuff_rsb", X86_FEATURE_RETPOLINE
+#endif
+.Lvmexit_return:
+	RET
+#ifdef CONFIG_RETPOLINE
+.Lvmexit_stuff_rsb:
 	/* Preserve guest's RAX, it's used to stuff the RSB. */
 	push %_ASM_AX
 
@@ -87,9 +92,8 @@ SYM_FUNC_START(vmx_vmexit)
 	or $1, %_ASM_AX
 
 	pop %_ASM_AX
-.Lvmexit_skip_rsb:
+	jmp .Lvmexit_return
 #endif
-	RET
 SYM_FUNC_END(vmx_vmexit)
 
 /**
-- 
2.37.0.rc0.104.g0611611a94-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-27 18:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-22 22:24 [PATCH] KVM: VMX: Move VM-exit RSB stuffing out of line Jim Mattson
2022-06-27 15:08 ` Sean Christopherson
2022-06-27 17:59   ` Jim Mattson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.