Skip to content

Commit 86cb654

Browse files
YustasSwampbp3tk0v
authored andcommitted
x86/vmware: Correct macro names
VCPU_RESERVED and LEGACY_X2APIC are not VMware hypercall commands. These are bits in the return value of the VMWARE_CMD_GETVCPU_INFO command. Change VMWARE_CMD_ prefix to GETVCPU_INFO_ one. And move the bit-shift operation into the macro body. Fixes: 4cca6ea ("x86/apic: Allow x2apic without IR on VMware platform") Signed-off-by: Alexey Makhalov <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b2c13c2 commit 86cb654

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/kernel/cpu/vmware.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
#define CPUID_VMWARE_INFO_LEAF 0x40000000
4343
#define CPUID_VMWARE_FEATURES_LEAF 0x40000010
4444

45-
#define VMWARE_CMD_LEGACY_X2APIC 3
46-
#define VMWARE_CMD_VCPU_RESERVED 31
45+
#define GETVCPU_INFO_LEGACY_X2APIC BIT(3)
46+
#define GETVCPU_INFO_VCPU_RESERVED BIT(31)
4747

4848
#define STEALCLOCK_NOT_AVAILABLE (-1)
4949
#define STEALCLOCK_DISABLED 0
@@ -485,8 +485,8 @@ static bool __init vmware_legacy_x2apic_available(void)
485485
u32 eax;
486486

487487
eax = vmware_hypercall1(VMWARE_CMD_GETVCPU_INFO, 0);
488-
return !(eax & BIT(VMWARE_CMD_VCPU_RESERVED)) &&
489-
(eax & BIT(VMWARE_CMD_LEGACY_X2APIC));
488+
return !(eax & GETVCPU_INFO_VCPU_RESERVED) &&
489+
(eax & GETVCPU_INFO_LEGACY_X2APIC);
490490
}
491491

492492
#ifdef CONFIG_AMD_MEM_ENCRYPT

0 commit comments

Comments
 (0)