Skip to content

Commit 153a971

Browse files
committed
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Thomas Gleixner: "Two fixes for the VMWare guest support: - Unbreak VMWare platform detection which got wreckaged by converting an integer constant to a string constant. - Fix the clang build of the VMWAre hypercall by explicitely specifying the ouput register for INL instead of using the short form" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpu/vmware: Fix platform detection VMWARE_PORT macro x86/cpu/vmware: Use the full form of INL in VMWARE_HYPERCALL, for clang/llvm
2 parents 2b776b5 + 6fee2a0 commit 153a971

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

arch/x86/include/asm/vmware.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <asm/cpufeatures.h>
66
#include <asm/alternative.h>
7+
#include <linux/stringify.h>
78

89
/*
910
* The hypercall definitions differ in the low word of the %edx argument
@@ -20,16 +21,17 @@
2021
*/
2122

2223
/* Old port-based version */
23-
#define VMWARE_HYPERVISOR_PORT "0x5658"
24-
#define VMWARE_HYPERVISOR_PORT_HB "0x5659"
24+
#define VMWARE_HYPERVISOR_PORT 0x5658
25+
#define VMWARE_HYPERVISOR_PORT_HB 0x5659
2526

2627
/* Current vmcall / vmmcall version */
2728
#define VMWARE_HYPERVISOR_HB BIT(0)
2829
#define VMWARE_HYPERVISOR_OUT BIT(1)
2930

3031
/* The low bandwidth call. The low word of edx is presumed clear. */
3132
#define VMWARE_HYPERCALL \
32-
ALTERNATIVE_2("movw $" VMWARE_HYPERVISOR_PORT ", %%dx; inl (%%dx)", \
33+
ALTERNATIVE_2("movw $" __stringify(VMWARE_HYPERVISOR_PORT) ", %%dx; " \
34+
"inl (%%dx), %%eax", \
3335
"vmcall", X86_FEATURE_VMCALL, \
3436
"vmmcall", X86_FEATURE_VMW_VMMCALL)
3537

@@ -38,7 +40,8 @@
3840
* HB and OUT bits set.
3941
*/
4042
#define VMWARE_HYPERCALL_HB_OUT \
41-
ALTERNATIVE_2("movw $" VMWARE_HYPERVISOR_PORT_HB ", %%dx; rep outsb", \
43+
ALTERNATIVE_2("movw $" __stringify(VMWARE_HYPERVISOR_PORT_HB) ", %%dx; " \
44+
"rep outsb", \
4245
"vmcall", X86_FEATURE_VMCALL, \
4346
"vmmcall", X86_FEATURE_VMW_VMMCALL)
4447

@@ -47,7 +50,8 @@
4750
* HB bit set.
4851
*/
4952
#define VMWARE_HYPERCALL_HB_IN \
50-
ALTERNATIVE_2("movw $" VMWARE_HYPERVISOR_PORT_HB ", %%dx; rep insb", \
53+
ALTERNATIVE_2("movw $" __stringify(VMWARE_HYPERVISOR_PORT_HB) ", %%dx; " \
54+
"rep insb", \
5155
"vmcall", X86_FEATURE_VMCALL, \
5256
"vmmcall", X86_FEATURE_VMW_VMMCALL)
5357
#endif

0 commit comments

Comments
 (0)