All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Juergen Gross <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, jgross@suse.com, mingo@kernel.org,
	tglx@linutronix.de, linux-kernel@vger.kernel.org
Subject: [tip:x86/paravirt] x86/paravirt: Move the pv_irq_ops under the PARAVIRT_XXL umbrella
Date: Mon, 3 Sep 2018 08:01:40 -0700	[thread overview]
Message-ID: <tip-6da63eb241a05b0e676d68975e793c0521387141@git.kernel.org> (raw)
In-Reply-To: <20180828074026.820-14-jgross@suse.com>

Commit-ID:  6da63eb241a05b0e676d68975e793c0521387141
Gitweb:     https://git.kernel.org/tip/6da63eb241a05b0e676d68975e793c0521387141
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue, 28 Aug 2018 09:40:24 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 3 Sep 2018 16:50:36 +0200

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: Juergen Gross <jgross@suse.com>
Signed-off-by: Thomas 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

---
 arch/x86/include/asm/irqflags.h       | 8 +-------
 arch/x86/include/asm/paravirt.h       | 6 +++---
 arch/x86/include/asm/paravirt_types.h | 3 ++-
 arch/x86/kernel/asm-offsets.c         | 2 +-
 arch/x86/kernel/asm-offsets_64.c      | 2 +-
 arch/x86/kernel/paravirt.c            | 2 +-
 arch/x86/kernel/paravirt_patch_32.c   | 4 ++--
 arch/x86/kernel/paravirt_patch_64.c   | 4 +++-
 arch/x86/kernel/vsmp_64.c             | 2 +-
 9 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
index 025a1986170c..058e40fed167 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -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
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index 686a68004b5f..512433c56c33 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -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
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index ad87379b2332..f582093b52dd 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -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 {
diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c
index 0fe233d98d17..28e7572ff74d 100644
--- a/arch/x86/kernel/asm-offsets.c
+++ b/arch/x86/kernel/asm-offsets.c
@@ -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);
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
index 2a15d420a84d..ddced33184b5 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
@@ -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
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 1d5f40cc872a..5e8226335eac 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -373,7 +373,6 @@ struct paravirt_patch_template pv_ops = {
 
 	.cpu.start_context_switch	= paravirt_nop,
 	.cpu.end_context_switch		= paravirt_nop,
-#endif /* CONFIG_PARAVIRT_XXL */
 
 	/* Irq ops. */
 	.irq.save_fl		= __PV_IS_CALLEE_SAVE(native_save_fl),
@@ -382,6 +381,7 @@ struct paravirt_patch_template pv_ops = {
 	.irq.irq_enable		= __PV_IS_CALLEE_SAVE(native_irq_enable),
 	.irq.safe_halt		= native_safe_halt,
 	.irq.halt		= native_halt,
+#endif /* CONFIG_PARAVIRT_XXL */
 
 	/* Mmu ops. */
 	.mmu.read_cr2		= native_read_cr2,
diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c
index 5a20aa56efc0..1d44705c6528 100644
--- a/arch/x86/kernel/paravirt_patch_32.c
+++ b/arch/x86/kernel/paravirt_patch_32.c
@@ -1,11 +1,11 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <asm/paravirt.h>
 
+#ifdef CONFIG_PARAVIRT_XXL
 DEF_NATIVE(irq, irq_disable, "cli");
 DEF_NATIVE(irq, irq_enable, "sti");
 DEF_NATIVE(irq, restore_fl, "push %eax; popf");
 DEF_NATIVE(irq, save_fl, "pushf; pop %eax");
-#ifdef CONFIG_PARAVIRT_XXL
 DEF_NATIVE(cpu, iret, "iret");
 #endif
 DEF_NATIVE(mmu, read_cr2, "mov %cr2, %eax");
@@ -43,11 +43,11 @@ unsigned native_patch(u8 type, void *ibuf, unsigned long addr, unsigned len)
 			end = end_##ops##_##x;			\
 			goto patch_site
 	switch (type) {
+#ifdef CONFIG_PARAVIRT_XXL
 		PATCH_SITE(irq, irq_disable);
 		PATCH_SITE(irq, irq_enable);
 		PATCH_SITE(irq, restore_fl);
 		PATCH_SITE(irq, save_fl);
-#ifdef CONFIG_PARAVIRT_XXL
 		PATCH_SITE(cpu, iret);
 #endif
 		PATCH_SITE(mmu, read_cr2);
diff --git a/arch/x86/kernel/paravirt_patch_64.c b/arch/x86/kernel/paravirt_patch_64.c
index 461aba038ada..b00937963a0f 100644
--- a/arch/x86/kernel/paravirt_patch_64.c
+++ b/arch/x86/kernel/paravirt_patch_64.c
@@ -3,10 +3,12 @@
 #include <asm/asm-offsets.h>
 #include <linux/stringify.h>
 
+#ifdef CONFIG_PARAVIRT_XXL
 DEF_NATIVE(irq, irq_disable, "cli");
 DEF_NATIVE(irq, irq_enable, "sti");
 DEF_NATIVE(irq, restore_fl, "pushq %rdi; popfq");
 DEF_NATIVE(irq, save_fl, "pushfq; popq %rax");
+#endif
 DEF_NATIVE(mmu, read_cr2, "movq %cr2, %rax");
 DEF_NATIVE(mmu, read_cr3, "movq %cr3, %rax");
 DEF_NATIVE(mmu, write_cr3, "movq %rdi, %cr3");
@@ -51,11 +53,11 @@ unsigned native_patch(u8 type, void *ibuf, unsigned long addr, unsigned len)
 			end = end_##ops##_##x;			\
 			goto patch_site
 	switch(type) {
+#ifdef CONFIG_PARAVIRT_XXL
 		PATCH_SITE(irq, restore_fl);
 		PATCH_SITE(irq, save_fl);
 		PATCH_SITE(irq, irq_enable);
 		PATCH_SITE(irq, irq_disable);
-#ifdef CONFIG_PARAVIRT_XXL
 		PATCH_SITE(cpu, usergs_sysret64);
 		PATCH_SITE(cpu, swapgs);
 		PATCH_SITE(cpu, wbinvd);
diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c
index 789918d78697..1eae5af491c2 100644
--- a/arch/x86/kernel/vsmp_64.c
+++ b/arch/x86/kernel/vsmp_64.c
@@ -26,7 +26,7 @@
 
 #define TOPOLOGY_REGISTER_OFFSET 0x10
 
-#if defined CONFIG_PCI && defined CONFIG_PARAVIRT
+#if defined CONFIG_PCI && defined CONFIG_PARAVIRT_XXL
 /*
  * Interrupt control on vSMPowered systems:
  * ~AC is a shadow of IF.  If IF is 'on' AC should be 'off'

  reply	other threads:[~2018-09-03 15:01 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28  7:40 [PATCH v3 00/15] x86/paravirt, xen: several cleanups Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-08-28  7:40 ` [PATCH v3 01/15] xen: move pv irq related functions under CONFIG_XEN_PV umbrella Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-09-03 14:54   ` [tip:x86/paravirt] x86/xen: Move " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 02/15] xen: move pv specific parts of arch/x86/xen/mmu.c to mmu_pv.c Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-09-03 14:55   ` [tip:x86/paravirt] x86/xen: Move " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 02/15] xen: move " Juergen Gross
2018-08-28  7:40 ` [PATCH v3 03/15] xen: link platform-pci-unplug.o only if CONFIG_XEN_PVHVM Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-09-03 14:56   ` [tip:x86/paravirt] x86/xen: Link " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 03/15] xen: link " Juergen Gross
2018-08-28  7:40 ` [PATCH v3 04/15] xen: add SPDX identifier in arch/x86/xen files Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-08-28  7:40   ` Juergen Gross
2018-09-03 14:56   ` [tip:x86/paravirt] x86/xen: Add " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 05/15] x86/paravirt: make paravirt_patch_call() and paravirt_patch_jmp() static Juergen Gross
2018-08-28  7:40   ` Juergen Gross
2018-09-03 14:57   ` [tip:x86/paravirt] x86/paravirt: Make " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 05/15] x86/paravirt: make " Juergen Gross
2018-08-28  7:40 ` [PATCH v3 06/15] x86/paravirt: remove clobbers parameter from paravirt patch functions Juergen Gross
2018-09-03 14:57   ` [tip:x86/paravirt] x86/paravirt: Remove " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 06/15] x86/paravirt: remove " Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-08-28  7:40 ` [PATCH v3 07/15] x86/paravirt: remove clobbers from struct paravirt_patch_site Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-09-03 14:58   ` [tip:x86/paravirt] x86/paravirt: Remove " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 08/15] x86/paravirt: use a single ops structure Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-09-03 14:58   ` [tip:x86/paravirt] x86/paravirt: Use " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 08/15] x86/paravirt: use " Juergen Gross
2018-08-28  7:40 ` [PATCH v3 09/15] x86/paravirt: remove unused paravirt bits Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-08-28  7:40   ` Juergen Gross
2018-09-03 14:59   ` [tip:x86/paravirt] x86/paravirt: Remove " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 10/15] x86/paravirt: introduce new config option PARAVIRT_XXL Juergen Gross
2018-09-03 14:59   ` [tip:x86/paravirt] x86/paravirt: Introduce " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 10/15] x86/paravirt: introduce " Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-08-28  7:40 ` [PATCH v3 11/15] x86/paravirt: move items in pv_info under PARAVIRT_XXL umbrella Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-09-03 15:00   ` [tip:x86/paravirt] x86/paravirt: Move " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 12/15] x86/paravirt: move the Xen-only pv_cpu_ops under the " Juergen Gross
2018-09-03 15:01   ` [tip:x86/paravirt] x86/paravirt: Move " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 12/15] x86/paravirt: move " Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-08-28  7:40 ` [PATCH v3 13/15] x86/paravirt: move the pv_irq_ops " Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-09-03 15:01   ` tip-bot for Juergen Gross [this message]
2018-09-07 14:49     ` [tip:x86/paravirt] x86/paravirt: Move " Borislav Petkov
2018-09-07 14:52       ` Juergen Gross
2018-09-07 14:54         ` Borislav Petkov
2018-08-28  7:40 ` [PATCH v3 14/15] x86/paravirt: move the Xen-only pv_mmu_ops " Juergen Gross
2018-09-03 15:02   ` [tip:x86/paravirt] x86/paravirt: Move " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 14/15] x86/paravirt: move " Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-08-28  7:40 ` [PATCH v3 15/15] x86/paravirt: remove unneeded mmu related paravirt ops bits Juergen Gross
2018-08-28  7:40 ` Juergen Gross
2018-09-03 15:02   ` [tip:x86/paravirt] x86/paravirt: Remove " tip-bot for Juergen Gross
2018-08-28  7:40 ` [PATCH v3 15/15] x86/paravirt: remove " Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-6da63eb241a05b0e676d68975e793c0521387141@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.