diff mbox series

KVM/VMX: Use TEST %REG,%REG instead of CMP $0,%REG in vmenter.S

Message ID 20201029140457.126965-1-ubizjak@gmail.com (mailing list archive)
State New, archived
Headers show
Series KVM/VMX: Use TEST %REG,%REG instead of CMP $0,%REG in vmenter.S | expand

Commit Message

Uros Bizjak Oct. 29, 2020, 2:04 p.m. UTC
Saves one byte in __vmx_vcpu_run for the same functionality.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
---
 arch/x86/kvm/vmx/vmenter.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paolo Bonzini Dec. 11, 2020, 7:55 p.m. UTC | #1
On 29/10/20 15:04, Uros Bizjak wrote:
> Saves one byte in __vmx_vcpu_run for the same functionality.
> 
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Sean Christopherson <sean.j.christopherson@intel.com>
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> ---
>   arch/x86/kvm/vmx/vmenter.S | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/vmx/vmenter.S b/arch/x86/kvm/vmx/vmenter.S
> index 90ad7a6246e3..e85aa5faa22d 100644
> --- a/arch/x86/kvm/vmx/vmenter.S
> +++ b/arch/x86/kvm/vmx/vmenter.S
> @@ -132,7 +132,7 @@ SYM_FUNC_START(__vmx_vcpu_run)
>   	mov (%_ASM_SP), %_ASM_AX
>   
>   	/* Check if vmlaunch or vmresume is needed */
> -	cmpb $0, %bl
> +	testb %bl, %bl
>   
>   	/* Load guest registers.  Don't clobber flags. */
>   	mov VCPU_RCX(%_ASM_AX), %_ASM_CX
> 

Queued, thanks.  This was mistakenly marked as read, so I thought I had 
already applied it.

Paolo
diff mbox series

Patch

diff --git a/arch/x86/kvm/vmx/vmenter.S b/arch/x86/kvm/vmx/vmenter.S
index 90ad7a6246e3..e85aa5faa22d 100644
--- a/arch/x86/kvm/vmx/vmenter.S
+++ b/arch/x86/kvm/vmx/vmenter.S
@@ -132,7 +132,7 @@  SYM_FUNC_START(__vmx_vcpu_run)
 	mov (%_ASM_SP), %_ASM_AX
 
 	/* Check if vmlaunch or vmresume is needed */
-	cmpb $0, %bl
+	testb %bl, %bl
 
 	/* Load guest registers.  Don't clobber flags. */
 	mov VCPU_RCX(%_ASM_AX), %_ASM_CX