]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
x86/paravirt: Fix build PARAVIRT_XXL=y without XEN_PV x86_paravirt_for_v5.17_rc1
authorKirill A. Shutemov <kirill@shutemov.name>
Tue, 30 Nov 2021 18:55:32 +0000 (21:55 +0300)
committerDave Hansen <dave.hansen@linux.intel.com>
Tue, 30 Nov 2021 21:50:26 +0000 (13:50 -0800)
Kernel fails to compile with PARAVIRT_XXL=y if XEN_PV is not enabled:

ld.lld: error: undefined symbol: xen_iret

It happens because INTERRUPT_RETURN defined to use xen_iret if
CONFIG_PARAVIRT_XXL enabled regardless of CONFIG_XEN_PV.

The issue is not visible in the current kernel because CONFIG_XEN_PV is
the only user of CONFIG_PARAVIRT_XXL and there's no way to enable them
separately.

Rework code to define INTERRUPT_RETURN based on CONFIG_XEN_PV, not
CONFIG_PARAVIRT_XXL.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lkml.kernel.org/r/20211130185533.32658-1-kirill.shutemov@linux.intel.com
arch/x86/include/asm/irqflags.h
arch/x86/include/asm/paravirt.h

index c5ce9845c999841797b0b479d3c5b85aa8638963..87761396e8cc08d4d285e7f62a1fa87cc8ae4509 100644 (file)
@@ -114,8 +114,6 @@ static __always_inline unsigned long arch_local_irq_save(void)
 #define SAVE_FLAGS             pushfq; popq %rax
 #endif
 
-#define INTERRUPT_RETURN       jmp native_iret
-
 #endif
 
 #endif /* __ASSEMBLY__ */
@@ -143,8 +141,13 @@ static __always_inline void arch_local_irq_restore(unsigned long flags)
 #ifdef CONFIG_X86_64
 #ifdef CONFIG_XEN_PV
 #define SWAPGS ALTERNATIVE "swapgs", "", X86_FEATURE_XENPV
+#define INTERRUPT_RETURN                                               \
+       ANNOTATE_RETPOLINE_SAFE;                                        \
+       ALTERNATIVE_TERNARY("jmp *paravirt_iret(%rip);",                \
+               X86_FEATURE_XENPV, "jmp xen_iret;", "jmp native_iret;")
 #else
 #define SWAPGS swapgs
+#define INTERRUPT_RETURN       jmp native_iret
 #endif
 #endif
 #endif /* !__ASSEMBLY__ */
index 21c4a694ca114ecc66862b1efc52e3c6694c9f61..27d276232c8026fbc1d6a098d8d51b66fb6443cc 100644 (file)
@@ -752,11 +752,6 @@ extern void default_banner(void);
 #define PARA_SITE(ptype, ops)  _PVSITE(ptype, ops, .quad, 8)
 #define PARA_INDIRECT(addr)    *addr(%rip)
 
-#define INTERRUPT_RETURN                                               \
-       ANNOTATE_RETPOLINE_SAFE;                                        \
-       ALTERNATIVE_TERNARY("jmp *paravirt_iret(%rip);",                \
-               X86_FEATURE_XENPV, "jmp xen_iret;", "jmp native_iret;")
-
 #ifdef CONFIG_DEBUG_ENTRY
 .macro PARA_IRQ_save_fl
        PARA_SITE(PARA_PATCH(PV_IRQ_save_fl),