From c8beda268a6b21910d1325584ce1d45bce4f22f0 Mon Sep 17 00:00:00 2001 From: Manuel Ebner Date: Tue, 15 Sep 2026 12:31:37 +0200 Subject: [PATCH 1/5] x86/mtrr: Fix kernel-doc notation of amd_set_mtrr() Add ':' to arguments in kernel-doc comment to fix: $ ./scripts/kernel-doc -none arch/x86/kernel/cpu/mtrr/amd.c Warning: arch/x86/kernel/cpu/mtrr/amd.c:63 function parameter 'reg' not described in 'amd_set_mtrr' Warning: arch/x86/kernel/cpu/mtrr/amd.c:63 function parameter 'base' not described in 'amd_set_mtrr' Warning: arch/x86/kernel/cpu/mtrr/amd.c:63 function parameter 'size' not described in 'amd_set_mtrr' Warning: arch/x86/kernel/cpu/mtrr/amd.c:63 function parameter 'type' not described in 'amd_set_mtrr' [ bp: Massage commit message. ] Signed-off-by: Manuel Ebner Signed-off-by: Borislav Petkov (AMD) Link: https://patch.msgid.link/20260915103136.171924-3-manuelebnerli@mailbox.org --- arch/x86/kernel/cpu/mtrr/amd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/cpu/mtrr/amd.c b/arch/x86/kernel/cpu/mtrr/amd.c index a73715d6f05c..9e440e30c179 100644 --- a/arch/x86/kernel/cpu/mtrr/amd.c +++ b/arch/x86/kernel/cpu/mtrr/amd.c @@ -51,11 +51,10 @@ amd_get_mtrr(unsigned int reg, unsigned long *base, /** * amd_set_mtrr - Set variable MTRR register on the local CPU. - * - * @reg The register to set. - * @base The base address of the region. - * @size The size of the region. If this is 0 the region is disabled. - * @type The type of the region. + * @reg: The register to set. + * @base: The base address of the region. + * @size: The size of the region. If this is 0 the region is disabled. + * @type: The type of the region. * * Returns nothing. */ From 975809caf4b0e07330110b56ca2d8a3fa7e16ff5 Mon Sep 17 00:00:00 2001 From: Mauricio Faria de Oliveira Date: Mon, 24 Aug 2026 16:27:23 -0300 Subject: [PATCH 2/5] x86/asm/string_64: Remove unused linux/jump_label.h include Remove the include from since it is no longer required. This include was introduced for the static key declaration first added by 3637efb00864 ("x86/mce: Add PCI quirks to identify Xeons with machine check recovery"). However, it was left when the static key declaration was later removed by ec6347bb4339 ("x86, powerpc: Rename memcpy_mcsafe() to copy_mc_to_{user, kernel}()"). Signed-off-by: Mauricio Faria de Oliveira Signed-off-by: Borislav Petkov (AMD) Link: https://patch.msgid.link/20260824-x86-inc-asm-str64-jmplbl-v2-1-df4d7bec9616@igalia.com --- arch/x86/include/asm/string_64.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/include/asm/string_64.h b/arch/x86/include/asm/string_64.h index 4635616863f5..0ea680bf403a 100644 --- a/arch/x86/include/asm/string_64.h +++ b/arch/x86/include/asm/string_64.h @@ -3,7 +3,6 @@ #define _ASM_X86_STRING_64_H #ifdef __KERNEL__ -#include /* Written 2002 by Andi Kleen */ From c7243accb48a7987b2e80751f712c3f4fe2b3714 Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Sun, 9 Aug 2026 23:32:25 +0200 Subject: [PATCH 3/5] x86/cpu: Constify struct x86_cpu_id 'struct x86_cpu_id' is not modified in this compilation unit. Constifying this structure moves some data to a read-only section, so increases overall security. It is only used in cpu_has_old_microcode() which is an __init function. So, using __initconst is safe and will save about 6 kB of memory at runtime. On a x86_64, with allmodconfig: text data bss dec hex filename 55725 28774 512 85011 14c13 arch/x86/kernel/cpu/common.o.before 61464 22918 512 84894 14b9e arch/x86/kernel/cpu/common.o.after [ bp: Massage commit message. ] Signed-off-by: Christophe JAILLET Signed-off-by: Borislav Petkov (AMD) Link: https://patch.msgid.link/f08d3a0e7aefe3bad66251927cbd03b8cbf9df73.1786311119.git.christophe.jaillet@wanadoo.fr --- arch/x86/kernel/cpu/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index c7352827f491..593ca8ce3894 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1427,7 +1427,7 @@ static bool __init vulnerable_to_its(u64 x86_arch_cap_msr) return false; } -static struct x86_cpu_id cpu_latest_microcode[] = { +static const struct x86_cpu_id cpu_latest_microcode[] __initconst = { #include "microcode/intel-ucode-defs.h" {} }; From 2c6a75adb15f8fbeb7a8cc6b1f35beb21db20762 Mon Sep 17 00:00:00 2001 From: Ethan Nelson-Moore Date: Thu, 17 Sep 2026 20:18:01 -0700 Subject: [PATCH 4/5] x86/um: Remove unused header arch/x86/um/asm/required-features.h only existed to satisfy dependencies on the non-UML x86 header of the same name, which was removed in 8f97566c8a81 ("x86/cpufeatures: Remove {disabled,required}-features.h"). Remove it. Signed-off-by: Ethan Nelson-Moore Signed-off-by: Borislav Petkov (AMD) Link: https://patch.msgid.link/20260918031807.449816-1-enelsonmoore@gmail.com --- arch/x86/um/asm/required-features.h | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 arch/x86/um/asm/required-features.h diff --git a/arch/x86/um/asm/required-features.h b/arch/x86/um/asm/required-features.h deleted file mode 100644 index dfb967b2d2f3..000000000000 --- a/arch/x86/um/asm/required-features.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef __UM_REQUIRED_FEATURES_H -#define __UM_REQUIRED_FEATURES_H - -/* - * Nothing to see, just need something for the i386 and x86_64 asm - * headers to include. - */ - -#endif From 27441d76b3d6604de9162c4c24d034bcfe3249de Mon Sep 17 00:00:00 2001 From: Brian Gerst Date: Sat, 5 Sep 2026 18:55:19 -0400 Subject: [PATCH 5/5] x86/asm: Remove CR4 read fault handler Remove the fault handler from native_read_cr4() since 486 support has been removed. Signed-off-by: Brian Gerst Signed-off-by: Borislav Petkov (AMD) Link: https://patch.msgid.link/20260905225519.1002976-1-brgerst@gmail.com --- arch/x86/include/asm/special_insns.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h index 46aa2c9c1bda..6c80f69cf62b 100644 --- a/arch/x86/include/asm/special_insns.h +++ b/arch/x86/include/asm/special_insns.h @@ -46,20 +46,7 @@ static __always_inline void native_write_cr3(unsigned long val) static inline unsigned long native_read_cr4(void) { unsigned long val; -#ifdef CONFIG_X86_32 - /* - * This could fault if CR4 does not exist. Non-existent CR4 - * is functionally equivalent to CR4 == 0. Keep it simple and pretend - * that CR4 == 0 on CPUs that don't have CR4. - */ - asm volatile("1: mov %%cr4, %0\n" - "2:\n" - _ASM_EXTABLE(1b, 2b) - : "=r" (val) : "0" (0)); -#else - /* CR4 always exists on x86_64. */ asm volatile("mov %%cr4,%0" : "=r" (val)); -#endif return val; }