[PATCH v1 05/40] x86/cpu: Remove unnecessary headers and reorder the rest

Ahmed S. Darwish posted 40 patches 1 year ago
There is a newer version of this series
[PATCH v1 05/40] x86/cpu: Remove unnecessary headers and reorder the rest
Posted by Ahmed S. Darwish 1 year ago
Remove the headers at intel.c that are no longer required.

Alphabetically reorder what remains since more headers will be included
in further commits.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
---
 arch/x86/kernel/cpu/intel.c | 35 ++++++++++++-----------------------
 1 file changed, 12 insertions(+), 23 deletions(-)

diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 134368a3f4b1..72f519534e2b 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -1,40 +1,29 @@
 // SPDX-License-Identifier: GPL-2.0
-#include <linux/kernel.h>
-#include <linux/pgtable.h>
 
-#include <linux/string.h>
 #include <linux/bitops.h>
-#include <linux/smp.h>
-#include <linux/sched.h>
-#include <linux/sched/clock.h>
-#include <linux/thread_info.h>
 #include <linux/init.h>
-#include <linux/uaccess.h>
+#include <linux/kernel.h>
+#include <linux/smp.h>
+#include <linux/string.h>
+
+#ifdef CONFIG_X86_64
+#include <linux/topology.h>
+#endif
 
-#include <asm/cpufeature.h>
-#include <asm/msr.h>
 #include <asm/bugs.h>
+#include <asm/cpu_device_id.h>
+#include <asm/cpufeature.h>
 #include <asm/cpu.h>
+#include <asm/hwcap2.h>
 #include <asm/intel-family.h>
 #include <asm/microcode.h>
-#include <asm/hwcap2.h>
-#include <asm/elf.h>
-#include <asm/cpu_device_id.h>
-#include <asm/resctrl.h>
+#include <asm/msr.h>
 #include <asm/numa.h>
+#include <asm/resctrl.h>
 #include <asm/thermal.h>
 
-#ifdef CONFIG_X86_64
-#include <linux/topology.h>
-#endif
-
 #include "cpu.h"
 
-#ifdef CONFIG_X86_LOCAL_APIC
-#include <asm/mpspec.h>
-#include <asm/apic.h>
-#endif
-
 /*
  * Processors which have self-snooping capability can handle conflicting
  * memory type across CPUs by snooping its own cache. However, there exists
-- 
2.48.1
Re: [PATCH v1 05/40] x86/cpu: Remove unnecessary headers and reorder the rest
Posted by Ingo Molnar 1 year ago
* Ahmed S. Darwish <darwi@linutronix.de> wrote:

> Remove the headers at intel.c that are no longer required.
> 
> Alphabetically reorder what remains since more headers will be included
> in further commits.
> 
> Suggested-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
> ---
>  arch/x86/kernel/cpu/intel.c | 35 ++++++++++++-----------------------
>  1 file changed, 12 insertions(+), 23 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
> index 134368a3f4b1..72f519534e2b 100644
> --- a/arch/x86/kernel/cpu/intel.c
> +++ b/arch/x86/kernel/cpu/intel.c
> @@ -1,40 +1,29 @@
>  // SPDX-License-Identifier: GPL-2.0
> -#include <linux/kernel.h>
> -#include <linux/pgtable.h>
>  
> -#include <linux/string.h>
>  #include <linux/bitops.h>
> -#include <linux/smp.h>
> -#include <linux/sched.h>
> -#include <linux/sched/clock.h>
> -#include <linux/thread_info.h>
>  #include <linux/init.h>
> -#include <linux/uaccess.h>
> +#include <linux/kernel.h>
> +#include <linux/smp.h>
> +#include <linux/string.h>
> +
> +#ifdef CONFIG_X86_64
> +#include <linux/topology.h>
> +#endif
>  
> -#include <asm/cpufeature.h>
> -#include <asm/msr.h>
>  #include <asm/bugs.h>
> +#include <asm/cpu_device_id.h>
> +#include <asm/cpufeature.h>
>  #include <asm/cpu.h>
> +#include <asm/hwcap2.h>
>  #include <asm/intel-family.h>
>  #include <asm/microcode.h>
> -#include <asm/hwcap2.h>
> -#include <asm/elf.h>
> -#include <asm/cpu_device_id.h>
> -#include <asm/resctrl.h>
> +#include <asm/msr.h>
>  #include <asm/numa.h>
> +#include <asm/resctrl.h>
>  #include <asm/thermal.h>
>  
> -#ifdef CONFIG_X86_64
> -#include <linux/topology.h>
> -#endif
> -
>  #include "cpu.h"
>  
> -#ifdef CONFIG_X86_LOCAL_APIC
> -#include <asm/mpspec.h>
> -#include <asm/apic.h>
> -#endif

This patch has an unexpected side-effect on i386 allmodconfig builds:

  arch/x86/kernel/cpu/intel.c: In function ‘intel_workarounds’:
  arch/x86/kernel/cpu/intel.c:452:17: error: ‘movsl_mask’ undeclared (first use in this function)
  arch/x86/kernel/cpu/intel.c:452:17: note: each undeclared identifier is reported only once for each function it appears in
  make[5]: *** [scripts/Makefile.build:207: arch/x86/kernel/cpu/intel.o] Error 1

Due to the removal of the <asm/uaccess.h> header.

The attached patch fixes it.

Thanks,

	Ingo

==================>
 arch/x86/kernel/cpu/intel.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index a7d297f6bc11..291c82816797 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -22,6 +22,7 @@
 #include <asm/numa.h>
 #include <asm/resctrl.h>
 #include <asm/thermal.h>
+#include <asm/uaccess.h>
 
 #include "cpu.h"
 
Re: [PATCH v1 05/40] x86/cpu: Remove unnecessary headers and reorder the rest
Posted by Ahmed S. Darwish 1 year ago
On Tue, 04 Mar 2025, Ingo Molnar wrote:
>
> This patch has an unexpected side-effect on i386 allmodconfig builds:
>
>   arch/x86/kernel/cpu/intel.c: In function ‘intel_workarounds’:
>   arch/x86/kernel/cpu/intel.c:452:17: error: ‘movsl_mask’ undeclared (first use in this function)
>   arch/x86/kernel/cpu/intel.c:452:17: note: each undeclared identifier is reported only once for each function it appears in
>   make[5]: *** [scripts/Makefile.build:207: arch/x86/kernel/cpu/intel.o] Error 1
>
> Due to the removal of the <asm/uaccess.h> header.
>
> The attached patch fixes it.
>

Thanks a lot, will do.
[tip: x86/cpu] x86/cpu: Remove unnecessary headers and reorder the rest
Posted by tip-bot2 for Ahmed S. Darwish 1 year ago
The following commit has been merged into the x86/cpu branch of tip:

Commit-ID:     dec7fdc0b79c2ae0a537343b17f5ba1c6c47e1ca
Gitweb:        https://git.kernel.org/tip/dec7fdc0b79c2ae0a537343b17f5ba1c6c47e1ca
Author:        Ahmed S. Darwish <darwi@linutronix.de>
AuthorDate:    Tue, 04 Mar 2025 09:51:16 +01:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 04 Mar 2025 11:17:33 +01:00

x86/cpu: Remove unnecessary headers and reorder the rest

Remove the headers at intel.c that are no longer required.

Alphabetically reorder what remains since more headers will be included
in further commits.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20250304085152.51092-6-darwi@linutronix.de
---
 arch/x86/kernel/cpu/intel.c | 36 +++++++++++++-----------------------
 1 file changed, 13 insertions(+), 23 deletions(-)

diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index c5d833f..60b58b1 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -1,40 +1,30 @@
 // SPDX-License-Identifier: GPL-2.0
-#include <linux/kernel.h>
-#include <linux/pgtable.h>
 
-#include <linux/string.h>
 #include <linux/bitops.h>
-#include <linux/smp.h>
-#include <linux/sched.h>
-#include <linux/sched/clock.h>
-#include <linux/thread_info.h>
 #include <linux/init.h>
-#include <linux/uaccess.h>
+#include <linux/kernel.h>
+#include <linux/smp.h>
+#include <linux/string.h>
+
+#ifdef CONFIG_X86_64
+#include <linux/topology.h>
+#endif
 
-#include <asm/cpufeature.h>
-#include <asm/msr.h>
 #include <asm/bugs.h>
+#include <asm/cpu_device_id.h>
+#include <asm/cpufeature.h>
 #include <asm/cpu.h>
+#include <asm/hwcap2.h>
 #include <asm/intel-family.h>
 #include <asm/microcode.h>
-#include <asm/hwcap2.h>
-#include <asm/elf.h>
-#include <asm/cpu_device_id.h>
-#include <asm/resctrl.h>
+#include <asm/msr.h>
 #include <asm/numa.h>
+#include <asm/resctrl.h>
 #include <asm/thermal.h>
-
-#ifdef CONFIG_X86_64
-#include <linux/topology.h>
-#endif
+#include <asm/uaccess.h>
 
 #include "cpu.h"
 
-#ifdef CONFIG_X86_LOCAL_APIC
-#include <asm/mpspec.h>
-#include <asm/apic.h>
-#endif
-
 /*
  * Processors which have self-snooping capability can handle conflicting
  * memory type across CPUs by snooping its own cache. However, there exists
[tip: x86/cpu] x86/cpu: Remove unnecessary headers and reorder the rest
Posted by tip-bot2 for Ahmed S. Darwish 1 year ago
The following commit has been merged into the x86/cpu branch of tip:

Commit-ID:     fab220ad2128088ebb702e3ac7b10fbc5e4ec10d
Gitweb:        https://git.kernel.org/tip/fab220ad2128088ebb702e3ac7b10fbc5e4ec10d
Author:        Ahmed S. Darwish <darwi@linutronix.de>
AuthorDate:    Tue, 04 Mar 2025 09:51:16 +01:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Tue, 04 Mar 2025 10:15:19 +01:00

x86/cpu: Remove unnecessary headers and reorder the rest

Remove the headers at intel.c that are no longer required.

Alphabetically reorder what remains since more headers will be included
in further commits.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20250304085152.51092-6-darwi@linutronix.de
---
 arch/x86/kernel/cpu/intel.c | 36 +++++++++++++-----------------------
 1 file changed, 13 insertions(+), 23 deletions(-)

diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index c5d833f..60b58b1 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -1,40 +1,30 @@
 // SPDX-License-Identifier: GPL-2.0
-#include <linux/kernel.h>
-#include <linux/pgtable.h>
 
-#include <linux/string.h>
 #include <linux/bitops.h>
-#include <linux/smp.h>
-#include <linux/sched.h>
-#include <linux/sched/clock.h>
-#include <linux/thread_info.h>
 #include <linux/init.h>
-#include <linux/uaccess.h>
+#include <linux/kernel.h>
+#include <linux/smp.h>
+#include <linux/string.h>
+
+#ifdef CONFIG_X86_64
+#include <linux/topology.h>
+#endif
 
-#include <asm/cpufeature.h>
-#include <asm/msr.h>
 #include <asm/bugs.h>
+#include <asm/cpu_device_id.h>
+#include <asm/cpufeature.h>
 #include <asm/cpu.h>
+#include <asm/hwcap2.h>
 #include <asm/intel-family.h>
 #include <asm/microcode.h>
-#include <asm/hwcap2.h>
-#include <asm/elf.h>
-#include <asm/cpu_device_id.h>
-#include <asm/resctrl.h>
+#include <asm/msr.h>
 #include <asm/numa.h>
+#include <asm/resctrl.h>
 #include <asm/thermal.h>
-
-#ifdef CONFIG_X86_64
-#include <linux/topology.h>
-#endif
+#include <asm/uaccess.h>
 
 #include "cpu.h"
 
-#ifdef CONFIG_X86_LOCAL_APIC
-#include <asm/mpspec.h>
-#include <asm/apic.h>
-#endif
-
 /*
  * Processors which have self-snooping capability can handle conflicting
  * memory type across CPUs by snooping its own cache. However, there exists