Skip to content

Commit 497f702

Browse files
committed
x86/cpu: Move MWAIT leaf definition to common header
Begin constructing a common place to keep all CPUID leaf definitions. Move CPUID_MWAIT_LEAF to the CPUID header and include it where needed. Signed-off-by: Dave Hansen <[email protected]> Reviewed-by: Zhao Liu <[email protected]> Link: https://lore.kernel.org/all/20241213205028.EE94D02A%40davehans-spike.ostc.intel.com
1 parent 5366d89 commit 497f702

File tree

9 files changed

+9
-1
lines changed

9 files changed

+9
-1
lines changed

arch/x86/include/asm/cpuid.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ enum cpuid_regs_idx {
2121
CPUID_EDX,
2222
};
2323

24+
#define CPUID_MWAIT_LEAF 5
25+
2426
#ifdef CONFIG_X86_32
2527
bool have_cpuid_p(void);
2628
#else

arch/x86/include/asm/mwait.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#define MWAIT_HINT2SUBSTATE(hint) ((hint) & MWAIT_CSTATE_MASK)
1616
#define MWAIT_C1_SUBSTATE_MASK 0xf0
1717

18-
#define CPUID_MWAIT_LEAF 5
1918
#define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
2019
#define CPUID5_ECX_INTERRUPT_BREAK 0x2
2120

arch/x86/kernel/acpi/cstate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/sched.h>
1414

1515
#include <acpi/processor.h>
16+
#include <asm/cpuid.h>
1617
#include <asm/mwait.h>
1718
#include <asm/special_insns.h>
1819

arch/x86/kernel/hpet.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/cpu.h>
88
#include <linux/irq.h>
99

10+
#include <asm/cpuid.h>
1011
#include <asm/irq_remapping.h>
1112
#include <asm/hpet.h>
1213
#include <asm/time.h>

arch/x86/kernel/process.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <linux/hw_breakpoint.h>
3131
#include <linux/entry-common.h>
3232
#include <asm/cpu.h>
33+
#include <asm/cpuid.h>
3334
#include <asm/apic.h>
3435
#include <linux/uaccess.h>
3536
#include <asm/mwait.h>

arch/x86/kernel/smpboot.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464

6565
#include <asm/acpi.h>
6666
#include <asm/cacheinfo.h>
67+
#include <asm/cpuid.h>
6768
#include <asm/desc.h>
6869
#include <asm/nmi.h>
6970
#include <asm/irq.h>

arch/x86/xen/enlighten_pv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <xen/hvc-console.h>
5050
#include <xen/acpi.h>
5151

52+
#include <asm/cpuid.h>
5253
#include <asm/paravirt.h>
5354
#include <asm/apic.h>
5455
#include <asm/page.h>

drivers/acpi/acpi_pad.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/acpi.h>
2020
#include <linux/perf_event.h>
2121
#include <linux/platform_device.h>
22+
#include <asm/cpuid.h>
2223
#include <asm/mwait.h>
2324
#include <xen/xen.h>
2425

drivers/idle/intel_idle.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include <linux/notifier.h>
5252
#include <linux/cpu.h>
5353
#include <linux/moduleparam.h>
54+
#include <asm/cpuid.h>
5455
#include <asm/cpu_device_id.h>
5556
#include <asm/intel-family.h>
5657
#include <asm/mwait.h>

0 commit comments

Comments
 (0)