From: Sean Christopherson <seanjc@google.com>
To: Jim Mattson <jmattson@google.com>
Cc: kvm@vger.kernel.org, pbonzini@redhat.com
Subject: Re: [PATCH v2] KVM: VMX: Move VM-exit RSB stuffing out of line
Date: Thu, 7 Jul 2022 19:47:19 +0000 [thread overview]
Message-ID: <Ysc4R3JDqnIFUfZ6@google.com> (raw)
In-Reply-To: <20220630225424.1389578-1-jmattson@google.com>
On Thu, Jun 30, 2022, Jim Mattson wrote:
> RSB-stuffing after VM-exit is only needed for legacy CPUs without
> eIBRS. Move the RSB-stuffing code out of line to avoid the JMP on
> modern CPUs.
The shortlog and this sentence need to be updated, the stuffing code is still
in-line, but the JMP is being dropped.
> Note that CPUs that are subject to SpectreRSB attacks need
> RSB-stuffing on VM-exit whether or not RETPOLINE is in use as a
> SpectreBTB mitigation. However, I am leaving the existing mitigation
> strategy alone.
>
> Signed-off-by: Jim Mattson <jmattson@google.com>
> ---
> arch/x86/kvm/vmx/vmenter.S | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/vmenter.S b/arch/x86/kvm/vmx/vmenter.S
> index 435c187927c4..ea5986b96004 100644
> --- a/arch/x86/kvm/vmx/vmenter.S
> +++ b/arch/x86/kvm/vmx/vmenter.S
> @@ -76,7 +76,8 @@ SYM_FUNC_END(vmx_vmenter)
> */
> SYM_FUNC_START(vmx_vmexit)
> #ifdef CONFIG_RETPOLINE
> - ALTERNATIVE "jmp .Lvmexit_skip_rsb", "", X86_FEATURE_RETPOLINE
> + ALTERNATIVE "RET", "", X86_FEATURE_RETPOLINE
> +
> /* Preserve guest's RAX, it's used to stuff the RSB. */
> push %_ASM_AX
>
> @@ -87,7 +88,6 @@ SYM_FUNC_START(vmx_vmexit)
> or $1, %_ASM_AX
>
> pop %_ASM_AX
> -.Lvmexit_skip_rsb:
> #endif
> RET
> SYM_FUNC_END(vmx_vmexit)
> --
> 2.37.0.rc0.161.g10f37bed90-goog
>
prev parent reply other threads:[~2022-07-07 19:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 22:54 [PATCH v2] KVM: VMX: Move VM-exit RSB stuffing out of line Jim Mattson
2022-07-07 19:47 ` Sean Christopherson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ysc4R3JDqnIFUfZ6@google.com \
--to=seanjc@google.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.