Skip to content

Commit

Permalink
Merge tag 'x86_paravirt_for_v5.17_rc1' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/linux/kernel/git/tip/tip

Pull x86 paravirtualization fix from Borislav Petkov:
 "Define the INTERRUPT_RETURN macro only when CONFIG_XEN_PV is enabled
  as it is its only user"

* tag 'x86_paravirt_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/paravirt: Fix build PARAVIRT_XXL=y without XEN_PV
  • Loading branch information
torvalds committed Jan 10, 2022
2 parents 191cf7f + 6da5175 commit e59451f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 5 additions & 2 deletions arch/x86/include/asm/irqflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */
Expand Down Expand Up @@ -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__ */
Expand Down
5 changes: 0 additions & 5 deletions arch/x86/include/asm/paravirt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit e59451f

Please sign in to comment.