From: Sean Christopherson <seanjc@google.com>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: pbonzini@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH] vmx: use mov instead of lea in __vmx_vcpu_run()
Date: Fri, 18 Nov 2022 00:20:49 +0000 [thread overview]
Message-ID: <Y3bP4U0X3MZvr0zc@google.com> (raw)
In-Reply-To: <Y3abPTOAxbLOpnVN@p183>
KVM: VMX: for the shortlog please.
On Thu, Nov 17, 2022, Alexey Dobriyan wrote:
> "mov rsi, rsp" is equivalent to "lea rsi, [rsp]" but 1 byte shorter.
Eww, Intel syntax ;-)
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
>
> arch/x86/kvm/vmx/vmenter.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/arch/x86/kvm/vmx/vmenter.S
> +++ b/arch/x86/kvm/vmx/vmenter.S
> @@ -72,7 +72,7 @@ SYM_FUNC_START(__vmx_vcpu_run)
> /* Copy @flags to BL, _ASM_ARG3 is volatile. */
> mov %_ASM_ARG3B, %bl
>
> - lea (%_ASM_SP), %_ASM_ARG2
> + mov %_ASM_SP, %_ASM_ARG2
I don't have a strong preference. It's probably worth converting, e.g. move
elimination on modern CPUs might shave a whole uop.
I'm pretty sure LEA is a holdover from when this code pre-calculated RSP before
a series of pushes.
> call vmx_update_host_rsp
>
> ALTERNATIVE "jmp .Lspec_ctrl_done", "", X86_FEATURE_MSR_SPEC_CTRL
prev parent reply other threads:[~2022-11-18 0:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-17 20:36 [PATCH] vmx: use mov instead of lea in __vmx_vcpu_run() Alexey Dobriyan
2022-11-18 0:20 ` 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=Y3bP4U0X3MZvr0zc@google.com \
--to=seanjc@google.com \
--cc=adobriyan@gmail.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.