Re: [PATCH 3/3] KVM/x86: Use 32bit xor to clear register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/10/2018 19:40, Uros Bizjak wrote:
> x86_64 zero-extends 32bit xor to a full 64bit register. Use %k asm
> operand modifier to force 32bit register and save 268 bytes in kvm.o
> 
> Signed-off-by: Uros Bizjak <ubizjak@xxxxxxxxx>
> ---
>  arch/x86/kvm/vmx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 552af5eba5bc..293a7f107c82 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -61,7 +61,7 @@
>  
>  #define __ex(x) __kvm_handle_fault_on_reboot(x)
>  #define __ex_clear(x, reg) \
> -	____kvm_handle_fault_on_reboot(x, "xor " reg " , " reg)
> +	____kvm_handle_fault_on_reboot(x, "xorl " reg " , " reg)
>  
>  MODULE_AUTHOR("Qumranet");
>  MODULE_LICENSE("GPL");
> @@ -2315,7 +2315,7 @@ static __always_inline unsigned long __vmcs_readl(unsigned long field)
>  {
>  	unsigned long value;
>  
> -	asm volatile (__ex_clear("vmread %1, %0", "%0")
> +	asm volatile (__ex_clear("vmread %1, %0", "%k0")
>  		      : "=r"(value) : "r"(field));
>  	return value;
>  }
> 

Queued all three, thanks!

Paolo



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux