[PATCH] x86/irqflags: Fix build failure

From: Juergen Gross

Date: Thu Jan 15 2026 - 11:10:22 EST


When building with CONFIG_PARAVIRT, but without CONFIG_PARAVIRT_XXL,
a build failure might happen due to arch/x86/include/asm/irqflags.h
only including asm/paravirt.h when CONFIG_PARAVIRT_XXL is set.

This was spotted when testing a patch removing the
"#include <asm/paravirt.h>" from another header.

Fixes: 22cc5ca5de52 ("x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT")
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202601152203.plJOoOEF-lkp@xxxxxxxxx/
Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
arch/x86/include/asm/irqflags.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
index a1193e9d65f2..4d4d02e31287 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -96,11 +96,11 @@ static __always_inline void halt(void)
native_halt();
}
#endif /* __ASSEMBLY__ */
+#else
+#include <asm/paravirt.h>
#endif /* CONFIG_PARAVIRT */

-#ifdef CONFIG_PARAVIRT_XXL
-#include <asm/paravirt.h>
-#else
+#ifndef CONFIG_PARAVIRT_XXL
#ifndef __ASSEMBLER__
#include <linux/types.h>

--
2.51.0