Skip to contentSkip to conversation

x86/extable: include asm/processor.h for cpu_relax()

PATCH In review Dmytro Maluka 2 participants 4 messages Apr 18, 2025 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/extable: include asm/processor.h for cpu_relax()

Include asm/processor.h to prevents compilation failures due to implicit declaration of cpu_relax() in ex_handler_msr_mce() when compiling with CONFIG_X86_MCE disabled.

---
 arch/x86/include/asm/extable.h | 1 +
 1 file changed, 1 insertion(+)
arch/x86/include/asm/extable.h +1 -0
index a0e0c6b50155..c22e524276a5 100644
@@ -3,6 +3,7 @@
 #define _ASM_X86_EXTABLE_H
 
 #include <asm/extable_fixup_types.h>
+#include <asm/processor.h>	/* for cpu_relax() */
 
 /*
  * The exception table consists of two addresses relative to the
Signature · 1 line
2.49.0.805.g082f7c87e0-goog
maintainer
#1 lore raw
Quoted 3 lines · Dmytro Maluka

Include asm/processor.h to prevents compilation failures due to implicit declaration of cpu_relax() in ex_handler_msr_mce() when compiling with CONFIG_X86_MCE disabled.

Builds fine here:

$ grep X86_MCE .config
# CONFIG_X86_MCE is not set
$ make -j...
...

OBJCOPY arch/x86/boot/setup.bin
BUILD arch/x86/boot/bzImage
Kernel: arch/x86/boot/bzImage is ready (#1)
$

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#2 lore raw
Quoted 10 lines · Borislav Petkov
Quoted 3 lines · Dmytro Maluka

Include asm/processor.h to prevents compilation failures due to implicit declaration of cpu_relax() in ex_handler_msr_mce() when compiling with CONFIG_X86_MCE disabled.

Builds fine here:

$ grep X86_MCE .config
# CONFIG_X86_MCE is not set
Quoted 7 lines
$ make -j...
...

OBJCOPY arch/x86/boot/setup.bin
BUILD arch/x86/boot/bzImage
Kernel: arch/x86/boot/bzImage is ready (#1)
$

Yeah, I meant precisely: when compiling with CONFIG_X86_MCE disabled and some code enabled that includes asm/extable.h without prior including asm/processor.h.

I encountered that with the out-of-tree-yet code [1] (which is a part of a prototype implementation of pKVM on x86) which includes asm/sections.h which includes asm/extable.h.

[1] https://github.com/intel-staging/pKVM-IA/blob/pvVMCS-POC-v6.12/arch/x86/kvm/pkvm/smp.c

maintainer
#3 lore raw
Quoted 7 lines · Dmytro Maluka

Yeah, I meant precisely: when compiling with CONFIG_X86_MCE disabled and some code enabled that includes asm/extable.h without prior including asm/processor.h.

I encountered that with the out-of-tree-yet code [1] (which is a part of a prototype implementation of pKVM on x86) which includes asm/sections.h which includes asm/extable.h.

Sorry, come back with this when you can trigger this solely with the upstream kernel.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette