On 25/01/19 16:41, Sean Christopherson wrote: > +#ifdef CONFIG_X86_64 > +#define WORD_SIZE 8 > +#else > +#define WORD_SIZE 4 > +#endif Making a small change here: diff --git a/arch/x86/kvm/vmx/vmenter.S b/arch/x86/kvm/vmx/vmenter.S index db223cfe9812..e64617f3b196 100644 --- a/arch/x86/kvm/vmx/vmenter.S +++ b/arch/x86/kvm/vmx/vmenter.S @@ -1,13 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0 */ #include <linux/linkage.h> #include <asm/asm.h> +#include <asm/bitsperlong.h> #include <asm/kvm_vcpu_regs.h> -#ifdef CONFIG_X86_64 -#define WORD_SIZE 8 -#else -#define WORD_SIZE 4 -#endif +#define WORD_SIZE (BITS_PER_LONG / 8) #define VCPU_RAX __VCPU_REGS_RAX * WORD_SIZE #define VCPU_RCX __VCPU_REGS_RCX * WORD_SIZE Thanks, Paolo > +#define VCPU_RAX __VCPU_REGS_RAX * WORD_SIZE > +#define VCPU_RCX __VCPU_REGS_RCX * WORD_SIZE > +#define VCPU_RDX __VCPU_REGS_RDX * WORD_SIZE > +#define VCPU_RBX __VCPU_REGS_RBX * WORD_SIZE > +/* Intentionally omit RSP as it's context switched by hardware */ > +#define VCPU_RBP __VCPU_REGS_RBP * WORD_SIZE > +#define VCPU_RSI __VCPU_REGS_RSI * WORD_SIZE > +#define VCPU_RDI __VCPU_REGS_RDI * WORD_SIZE > + > +#ifdef CONFIG_X86_64