Commit 6da63eb2 authored by Juergen Gross's avatar Juergen Gross Committed by Thomas Gleixner
Browse files

x86/paravirt: Move the pv_irq_ops under the PARAVIRT_XXL umbrella



All of the paravirt ops defined in pv_irq_ops are for Xen PV guests
or VSMP only. Define them only if CONFIG_PARAVIRT_XXL is set.

Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: xen-devel@lists.xenproject.org
Cc: virtualization@lists.linux-foundation.org
Cc: akataria@vmware.com
Cc: rusty@rustcorp.com.au
Cc: boris.ostrovsky@oracle.com
Cc: hpa@zytor.com
Link: https://lkml.kernel.org/r/20180828074026.820-14-jgross@suse.com
parent 9bad5658
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ static inline __cpuidle void native_halt(void)

#endif

#ifdef CONFIG_PARAVIRT
#ifdef CONFIG_PARAVIRT_XXL
#include <asm/paravirt.h>
#else
#ifndef __ASSEMBLY__
@@ -126,13 +126,7 @@ static inline notrace unsigned long arch_local_irq_save(void)
#ifdef CONFIG_DEBUG_ENTRY
#define SAVE_FLAGS(x)		pushfq; popq %rax
#endif
#endif
#endif /* __ASSEMBLY__ */
#endif /* CONFIG_PARAVIRT */

#ifndef CONFIG_PARAVIRT_XXL
#ifdef __ASSEMBLY__
#ifdef CONFIG_X86_64
#define SWAPGS	swapgs
/*
 * Currently paravirt can't handle swapgs nicely when we
+3 −3
Original line number Diff line number Diff line
@@ -91,7 +91,6 @@ static inline void write_cr8(unsigned long x)
	PVOP_VCALL1(cpu.write_cr8, x);
}
#endif
#endif

static inline void arch_safe_halt(void)
{
@@ -103,7 +102,6 @@ static inline void halt(void)
	PVOP_VCALL0(irq.halt);
}

#ifdef CONFIG_PARAVIRT_XXL
static inline void wbinvd(void)
{
	PVOP_VCALL0(cpu.wbinvd);
@@ -770,6 +768,7 @@ bool __raw_callee_save___native_vcpu_is_preempted(long cpu);
#define __PV_IS_CALLEE_SAVE(func)			\
	((struct paravirt_callee_save) { func })

#ifdef CONFIG_PARAVIRT_XXL
static inline notrace unsigned long arch_local_save_flags(void)
{
	return PVOP_CALLEE0(unsigned long, irq.save_fl);
@@ -798,6 +797,7 @@ static inline notrace unsigned long arch_local_irq_save(void)
	arch_local_irq_disable();
	return f;
}
#endif


/* Make sure as little as possible of this mess escapes. */
@@ -884,7 +884,6 @@ extern void default_banner(void);
	PARA_SITE(PARA_PATCH(PV_CPU_iret),				\
		  ANNOTATE_RETPOLINE_SAFE;				\
		  jmp PARA_INDIRECT(pv_ops+PV_CPU_iret);)
#endif

#define DISABLE_INTERRUPTS(clobbers)					\
	PARA_SITE(PARA_PATCH(PV_IRQ_irq_disable),			\
@@ -899,6 +898,7 @@ extern void default_banner(void);
		  ANNOTATE_RETPOLINE_SAFE;				\
		  call PARA_INDIRECT(pv_ops+PV_IRQ_irq_enable);		\
		  PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);)
#endif

#ifdef CONFIG_X86_64
#ifdef CONFIG_PARAVIRT_XXL
+2 −1
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@ struct pv_cpu_ops {
} __no_randomize_layout;

struct pv_irq_ops {
#ifdef CONFIG_PARAVIRT_XXL
	/*
	 * Get/set interrupt state.  save_fl and restore_fl are only
	 * expected to use X86_EFLAGS_IF; all other bits
@@ -200,7 +201,7 @@ struct pv_irq_ops {

	void (*safe_halt)(void);
	void (*halt)(void);

#endif
} __no_randomize_layout;

struct pv_mmu_ops {
+1 −1
Original line number Diff line number Diff line
@@ -66,9 +66,9 @@ void common(void) {

#ifdef CONFIG_PARAVIRT
	BLANK();
#ifdef CONFIG_PARAVIRT_XXL
	OFFSET(PV_IRQ_irq_disable, paravirt_patch_template, irq.irq_disable);
	OFFSET(PV_IRQ_irq_enable, paravirt_patch_template, irq.irq_enable);
#ifdef CONFIG_PARAVIRT_XXL
	OFFSET(PV_CPU_iret, paravirt_patch_template, cpu.iret);
#endif
	OFFSET(PV_MMU_read_cr2, paravirt_patch_template, mmu.read_cr2);
+1 −1
Original line number Diff line number Diff line
@@ -25,9 +25,9 @@ int main(void)
	OFFSET(PV_CPU_usergs_sysret64, paravirt_patch_template,
	       cpu.usergs_sysret64);
	OFFSET(PV_CPU_swapgs, paravirt_patch_template, cpu.swapgs);
#endif
#ifdef CONFIG_DEBUG_ENTRY
	OFFSET(PV_IRQ_save_fl, paravirt_patch_template, irq.save_fl);
#endif
#endif
	BLANK();
#endif
Loading