* [PATCH] x86/extable: include asm/processor.h for cpu_relax()
@ 2025-04-18 11:57 Dmytro Maluka
2025-04-18 12:12 ` Borislav Petkov
0 siblings, 1 reply; 4+ messages in thread
From: Dmytro Maluka @ 2025-04-18 11:57 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Dmytro Maluka, Ingo Molnar, Borislav Petkov, Dave Hansen,
maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin,
Yue Haibing, open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)
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.
Signed-off-by: Dmytro Maluka <dmaluka@chromium.org>
---
arch/x86/include/asm/extable.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/include/asm/extable.h b/arch/x86/include/asm/extable.h
index a0e0c6b50155..c22e524276a5 100644
--- a/arch/x86/include/asm/extable.h
+++ b/arch/x86/include/asm/extable.h
@@ -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
--
2.49.0.805.g082f7c87e0-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/extable: include asm/processor.h for cpu_relax()
2025-04-18 11:57 [PATCH] x86/extable: include asm/processor.h for cpu_relax() Dmytro Maluka
@ 2025-04-18 12:12 ` Borislav Petkov
2025-04-18 12:36 ` Dmytro Maluka
0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2025-04-18 12:12 UTC (permalink / raw)
To: Dmytro Maluka
Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen,
maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin,
Yue Haibing, open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)
On Fri, Apr 18, 2025 at 11:57:00AM +0000, Dmytro Maluka wrote:
> 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)
$
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] x86/extable: include asm/processor.h for cpu_relax()
2025-04-18 12:12 ` Borislav Petkov
@ 2025-04-18 12:36 ` Dmytro Maluka
2025-04-18 12:38 ` Borislav Petkov
0 siblings, 1 reply; 4+ messages in thread
From: Dmytro Maluka @ 2025-04-18 12:36 UTC (permalink / raw)
To: Borislav Petkov
Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen,
maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin,
Yue Haibing, open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)
On Fri, Apr 18, 2025 at 02:12:03PM +0200, Borislav Petkov wrote:
> On Fri, Apr 18, 2025 at 11:57:00AM +0000, Dmytro Maluka wrote:
> > 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)
> $
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/extable: include asm/processor.h for cpu_relax()
2025-04-18 12:36 ` Dmytro Maluka
@ 2025-04-18 12:38 ` Borislav Petkov
0 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2025-04-18 12:38 UTC (permalink / raw)
To: Dmytro Maluka
Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen,
maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), H. Peter Anvin,
Yue Haibing, open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)
On Fri, Apr 18, 2025 at 02:36:02PM +0200, Dmytro Maluka wrote:
> 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.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-04-18 12:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-18 11:57 [PATCH] x86/extable: include asm/processor.h for cpu_relax() Dmytro Maluka
2025-04-18 12:12 ` Borislav Petkov
2025-04-18 12:36 ` Dmytro Maluka
2025-04-18 12:38 ` Borislav Petkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox