From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: kvm@vger.kernel.org, pbonzini@redhat.com
Subject: Re: [PATCH] KVM: VMX: access regs array in vmenter.S in its natural order
Date: Tue, 10 Mar 2020 11:24:22 -0700 [thread overview]
Message-ID: <20200310182422.GG9305@linux.intel.com> (raw)
In-Reply-To: <20200310171024.15528-1-ubizjak@gmail.com>
On Tue, Mar 10, 2020 at 06:10:24PM +0100, Uros Bizjak wrote:
> Registers in "regs" array are indexed as rax/rcx/rdx/.../rsi/rdi/r8/...
> Reorder access to "regs" array in vmenter.S to follow its natural order.
Any reason other than preference? I wouldn't exactly call the register
indices "natural", e.g. IMO it's easier to visually confirm correctness if
A/B/C/D are ordered alphabetically.
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> ---
> arch/x86/kvm/vmx/vmenter.S | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/vmenter.S b/arch/x86/kvm/vmx/vmenter.S
> index 81ada2ce99e7..ca2065166d1d 100644
> --- a/arch/x86/kvm/vmx/vmenter.S
> +++ b/arch/x86/kvm/vmx/vmenter.S
> @@ -135,12 +135,12 @@ SYM_FUNC_START(__vmx_vcpu_run)
> cmpb $0, %bl
>
> /* Load guest registers. Don't clobber flags. */
> - mov VCPU_RBX(%_ASM_AX), %_ASM_BX
> mov VCPU_RCX(%_ASM_AX), %_ASM_CX
> mov VCPU_RDX(%_ASM_AX), %_ASM_DX
> + mov VCPU_RBX(%_ASM_AX), %_ASM_BX
> + mov VCPU_RBP(%_ASM_AX), %_ASM_BP
> mov VCPU_RSI(%_ASM_AX), %_ASM_SI
> mov VCPU_RDI(%_ASM_AX), %_ASM_DI
> - mov VCPU_RBP(%_ASM_AX), %_ASM_BP
> #ifdef CONFIG_X86_64
> mov VCPU_R8 (%_ASM_AX), %r8
> mov VCPU_R9 (%_ASM_AX), %r9
> @@ -168,12 +168,12 @@ SYM_FUNC_START(__vmx_vcpu_run)
>
> /* Save all guest registers, including RAX from the stack */
> __ASM_SIZE(pop) VCPU_RAX(%_ASM_AX)
> - mov %_ASM_BX, VCPU_RBX(%_ASM_AX)
> mov %_ASM_CX, VCPU_RCX(%_ASM_AX)
> mov %_ASM_DX, VCPU_RDX(%_ASM_AX)
> + mov %_ASM_BX, VCPU_RBX(%_ASM_AX)
> + mov %_ASM_BP, VCPU_RBP(%_ASM_AX)
> mov %_ASM_SI, VCPU_RSI(%_ASM_AX)
> mov %_ASM_DI, VCPU_RDI(%_ASM_AX)
> - mov %_ASM_BP, VCPU_RBP(%_ASM_AX)
> #ifdef CONFIG_X86_64
> mov %r8, VCPU_R8 (%_ASM_AX)
> mov %r9, VCPU_R9 (%_ASM_AX)
> @@ -197,12 +197,12 @@ SYM_FUNC_START(__vmx_vcpu_run)
> * free. RSP and RAX are exempt as RSP is restored by hardware during
> * VM-Exit and RAX is explicitly loaded with 0 or 1 to return VM-Fail.
> */
> -1: xor %ebx, %ebx
> - xor %ecx, %ecx
> +1: xor %ecx, %ecx
> xor %edx, %edx
> + xor %ebx, %ebx
> + xor %ebp, %ebp
> xor %esi, %esi
> xor %edi, %edi
> - xor %ebp, %ebp
> #ifdef CONFIG_X86_64
> xor %r8d, %r8d
> xor %r9d, %r9d
> --
> 2.24.1
>
next prev parent reply other threads:[~2020-03-10 18:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-10 17:10 [PATCH] KVM: VMX: access regs array in vmenter.S in its natural order Uros Bizjak
2020-03-10 18:24 ` Sean Christopherson [this message]
2020-03-10 19:16 ` Uros Bizjak
2020-03-11 18:29 ` Paolo Bonzini
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=20200310182422.GG9305@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=ubizjak@gmail.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.