Skip to content

Commit dfc53ba

Browse files
Joseph SalisburyKAGA-KOKO
authored andcommitted
x86/hyperv: Remove aliases with X64 in their name
In the architecture independent version of hyperv-tlfs.h, commit c55a844 removed the "X64" in the symbol names so they would make sense for both x86 and ARM64. That commit added aliases with the "X64" in the x86 version of hyperv-tlfs.h so that existing x86 code would continue to compile. As a cleanup, update the x86 code to use the symbols without the "X64", then remove the aliases. There's no functional change. Signed-off-by: Joseph Salisbury <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Acked-by: Paolo Bonzini <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ba4f184 commit dfc53ba

File tree

5 files changed

+19
-52
lines changed

5 files changed

+19
-52
lines changed

arch/x86/hyperv/hv_init.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ static inline bool hv_reenlightenment_available(void)
148148
* Check for required features and priviliges to make TSC frequency
149149
* change notifications work.
150150
*/
151-
return ms_hyperv.features & HV_X64_ACCESS_FREQUENCY_MSRS &&
151+
return ms_hyperv.features & HV_ACCESS_FREQUENCY_MSRS &&
152152
ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE &&
153-
ms_hyperv.features & HV_X64_ACCESS_REENLIGHTENMENT;
153+
ms_hyperv.features & HV_ACCESS_REENLIGHTENMENT;
154154
}
155155

156156
DEFINE_IDTENTRY_SYSVEC(sysvec_hyperv_reenlightenment)
@@ -330,8 +330,8 @@ void __init hyperv_init(void)
330330
return;
331331

332332
/* Absolutely required MSRs */
333-
required_msrs = HV_X64_MSR_HYPERCALL_AVAILABLE |
334-
HV_X64_MSR_VP_INDEX_AVAILABLE;
333+
required_msrs = HV_MSR_HYPERCALL_AVAILABLE |
334+
HV_MSR_VP_INDEX_AVAILABLE;
335335

336336
if ((ms_hyperv.features & required_msrs) != required_msrs)
337337
return;

arch/x86/hyperv/hv_spinlock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void __init hv_init_spinlocks(void)
6666
{
6767
if (!hv_pvspin || !apic ||
6868
!(ms_hyperv.hints & HV_X64_CLUSTER_IPI_RECOMMENDED) ||
69-
!(ms_hyperv.features & HV_X64_MSR_GUEST_IDLE_AVAILABLE)) {
69+
!(ms_hyperv.features & HV_MSR_GUEST_IDLE_AVAILABLE)) {
7070
pr_info("PV spinlocks disabled\n");
7171
return;
7272
}

arch/x86/include/asm/hyperv-tlfs.h

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,6 @@
2727
#define HYPERV_CPUID_MIN 0x40000005
2828
#define HYPERV_CPUID_MAX 0x4000ffff
2929

30-
/*
31-
* Aliases for Group A features that have X64 in the name.
32-
* On x86/x64 these are HYPERV_CPUID_FEATURES.EAX bits.
33-
*/
34-
35-
#define HV_X64_MSR_VP_RUNTIME_AVAILABLE \
36-
HV_MSR_VP_RUNTIME_AVAILABLE
37-
#define HV_X64_MSR_SYNIC_AVAILABLE \
38-
HV_MSR_SYNIC_AVAILABLE
39-
#define HV_X64_MSR_APIC_ACCESS_AVAILABLE \
40-
HV_MSR_APIC_ACCESS_AVAILABLE
41-
#define HV_X64_MSR_HYPERCALL_AVAILABLE \
42-
HV_MSR_HYPERCALL_AVAILABLE
43-
#define HV_X64_MSR_VP_INDEX_AVAILABLE \
44-
HV_MSR_VP_INDEX_AVAILABLE
45-
#define HV_X64_MSR_RESET_AVAILABLE \
46-
HV_MSR_RESET_AVAILABLE
47-
#define HV_X64_MSR_GUEST_IDLE_AVAILABLE \
48-
HV_MSR_GUEST_IDLE_AVAILABLE
49-
#define HV_X64_ACCESS_FREQUENCY_MSRS \
50-
HV_ACCESS_FREQUENCY_MSRS
51-
#define HV_X64_ACCESS_REENLIGHTENMENT \
52-
HV_ACCESS_REENLIGHTENMENT
53-
#define HV_X64_ACCESS_TSC_INVARIANT \
54-
HV_ACCESS_TSC_INVARIANT
55-
56-
/*
57-
* Aliases for Group B features that have X64 in the name.
58-
* On x86/x64 these are HYPERV_CPUID_FEATURES.EBX bits.
59-
*/
60-
#define HV_X64_POST_MESSAGES HV_POST_MESSAGES
61-
#define HV_X64_SIGNAL_EVENTS HV_SIGNAL_EVENTS
62-
6330
/*
6431
* Group D Features. The bit assignments are custom to each architecture.
6532
* On x86/x64 these are HYPERV_CPUID_FEATURES.EDX bits.

arch/x86/kernel/cpu/mshyperv.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static void __init ms_hyperv_init_platform(void)
248248
hv_host_info_edx >> 24, hv_host_info_edx & 0xFFFFFF);
249249
}
250250

251-
if (ms_hyperv.features & HV_X64_ACCESS_FREQUENCY_MSRS &&
251+
if (ms_hyperv.features & HV_ACCESS_FREQUENCY_MSRS &&
252252
ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) {
253253
x86_platform.calibrate_tsc = hv_get_tsc_khz;
254254
x86_platform.calibrate_cpu = hv_get_tsc_khz;
@@ -270,7 +270,7 @@ static void __init ms_hyperv_init_platform(void)
270270
crash_kexec_post_notifiers = true;
271271

272272
#ifdef CONFIG_X86_LOCAL_APIC
273-
if (ms_hyperv.features & HV_X64_ACCESS_FREQUENCY_MSRS &&
273+
if (ms_hyperv.features & HV_ACCESS_FREQUENCY_MSRS &&
274274
ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) {
275275
/*
276276
* Get the APIC frequency.
@@ -296,7 +296,7 @@ static void __init ms_hyperv_init_platform(void)
296296
machine_ops.shutdown = hv_machine_shutdown;
297297
machine_ops.crash_shutdown = hv_machine_crash_shutdown;
298298
#endif
299-
if (ms_hyperv.features & HV_X64_ACCESS_TSC_INVARIANT) {
299+
if (ms_hyperv.features & HV_ACCESS_TSC_INVARIANT) {
300300
wrmsrl(HV_X64_MSR_TSC_INVARIANT_CONTROL, 0x1);
301301
setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
302302
} else {
@@ -330,7 +330,7 @@ static void __init ms_hyperv_init_platform(void)
330330
alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, asm_sysvec_hyperv_callback);
331331

332332
/* Setup the IDT for reenlightenment notifications */
333-
if (ms_hyperv.features & HV_X64_ACCESS_REENLIGHTENMENT) {
333+
if (ms_hyperv.features & HV_ACCESS_REENLIGHTENMENT) {
334334
alloc_intr_gate(HYPERV_REENLIGHTENMENT_VECTOR,
335335
asm_sysvec_hyperv_reenlightenment);
336336
}

arch/x86/kvm/hyperv.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,20 +2000,20 @@ int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid,
20002000
break;
20012001

20022002
case HYPERV_CPUID_FEATURES:
2003-
ent->eax |= HV_X64_MSR_VP_RUNTIME_AVAILABLE;
2003+
ent->eax |= HV_MSR_VP_RUNTIME_AVAILABLE;
20042004
ent->eax |= HV_MSR_TIME_REF_COUNT_AVAILABLE;
2005-
ent->eax |= HV_X64_MSR_SYNIC_AVAILABLE;
2005+
ent->eax |= HV_MSR_SYNIC_AVAILABLE;
20062006
ent->eax |= HV_MSR_SYNTIMER_AVAILABLE;
2007-
ent->eax |= HV_X64_MSR_APIC_ACCESS_AVAILABLE;
2008-
ent->eax |= HV_X64_MSR_HYPERCALL_AVAILABLE;
2009-
ent->eax |= HV_X64_MSR_VP_INDEX_AVAILABLE;
2010-
ent->eax |= HV_X64_MSR_RESET_AVAILABLE;
2007+
ent->eax |= HV_MSR_APIC_ACCESS_AVAILABLE;
2008+
ent->eax |= HV_MSR_HYPERCALL_AVAILABLE;
2009+
ent->eax |= HV_MSR_VP_INDEX_AVAILABLE;
2010+
ent->eax |= HV_MSR_RESET_AVAILABLE;
20112011
ent->eax |= HV_MSR_REFERENCE_TSC_AVAILABLE;
2012-
ent->eax |= HV_X64_ACCESS_FREQUENCY_MSRS;
2013-
ent->eax |= HV_X64_ACCESS_REENLIGHTENMENT;
2012+
ent->eax |= HV_ACCESS_FREQUENCY_MSRS;
2013+
ent->eax |= HV_ACCESS_REENLIGHTENMENT;
20142014

2015-
ent->ebx |= HV_X64_POST_MESSAGES;
2016-
ent->ebx |= HV_X64_SIGNAL_EVENTS;
2015+
ent->ebx |= HV_POST_MESSAGES;
2016+
ent->ebx |= HV_SIGNAL_EVENTS;
20172017

20182018
ent->edx |= HV_FEATURE_FREQUENCY_MSRS_AVAILABLE;
20192019
ent->edx |= HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE;

0 commit comments

Comments
 (0)