Re: [PATCH v3 25/33] KVM: VMX: Move vCPU-run code to a proper assembly routine

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

 



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




[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