Commit 44c2d667 authored by Uros Bizjak's avatar Uros Bizjak Committed by Paolo Bonzini

KVM/x86: Use 32bit xor to clear register

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: default avatarUros Bizjak <ubizjak@gmail.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 4b1e5478
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
#define __ex(x) __kvm_handle_fault_on_reboot(x) #define __ex(x) __kvm_handle_fault_on_reboot(x)
#define __ex_clear(x, reg) \ #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_AUTHOR("Qumranet");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -2312,7 +2312,7 @@ static __always_inline unsigned long __vmcs_readl(unsigned long field) ...@@ -2312,7 +2312,7 @@ static __always_inline unsigned long __vmcs_readl(unsigned long field)
{ {
unsigned long value; unsigned long value;
asm volatile (__ex_clear("vmread %1, %0", "%0") asm volatile (__ex_clear("vmread %1, %0", "%k0")
: "=r"(value) : "r"(field)); : "=r"(value) : "r"(field));
return value; return value;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment