All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@kernel.org>
Cc: X86 ML <x86@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com,
	jasowang@redhat.com, Thomas Gleixner <tglx@linutronix.de>,
	JBeulich@suse.com, Borislav Petkov <bp@suse.de>,
	Dmitry Torokhov <dtor@vmware.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>
Subject: [PATCH -v3 2/2] x86: Make Linux guest support optional
Date: Sun, 27 Jan 2013 00:10:51 +0100	[thread overview]
Message-ID: <1359241851-7594-2-git-send-email-bp@alien8.de> (raw)
In-Reply-To: <20130125190340.GC4973@pd.tnic>

From: Borislav Petkov <bp@suse.de>

Put all config options needed to run Linux as a guest behind a
CONFIG_HYPERVISOR_GUEST menu so that they don't get built-in by default
but be selectable by the user. Also, make all units which depend on
x86_hyper, depend on this new symbol so that compilation doesn't fail
when CONFIG_HYPERVISOR_GUEST is disabled but those units assume its
presence.

While at it, adjust text to changes, remove redundant select.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Dmitry Torokhov <dtor@vmware.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: devel@linuxdriverproject.org
---
 arch/x86/Kconfig                  | 21 +++++++++++----------
 arch/x86/include/asm/hypervisor.h | 12 ++++++++----
 arch/x86/kernel/cpu/Makefile      |  3 ++-
 drivers/hv/Kconfig                |  2 +-
 drivers/misc/Kconfig              |  2 +-
 5 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 201b8aa93f8f..2380a52f0c8c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -379,7 +379,7 @@ config X86_NUMACHIP
 
 config X86_VSMP
 	bool "ScaleMP vSMP"
-	select PARAVIRT_GUEST
+	select HYPERVISOR_GUEST
 	select PARAVIRT
 	depends on X86_64 && PCI
 	depends on X86_EXTENDED_PLATFORM
@@ -568,15 +568,17 @@ config SCHED_OMIT_FRAME_POINTER
 
 	  If in doubt, say "Y".
 
-menuconfig PARAVIRT_GUEST
-	bool "Paravirtualized guest support"
+menuconfig HYPERVISOR_GUEST
+	bool "Linux guest support"
 	---help---
-	  Say Y here to get to see options related to running Linux under
-	  various hypervisors.  This option alone does not add any kernel code.
+	  Say Y here to enable options for running Linux under various hyper-
+	  visors. This option enables basic hypervisor detection and platform
+	  setup.
 
-	  If you say N, all options in this submenu will be skipped and disabled.
+	  If you say N, all options in this submenu will be skipped and
+	  disabled, and Linux guest support won't be built in.
 
-if PARAVIRT_GUEST
+if HYPERVISOR_GUEST
 
 config PARAVIRT_TIME_ACCOUNTING
 	bool "Paravirtual steal time accounting"
@@ -595,9 +597,8 @@ source "arch/x86/xen/Kconfig"
 config KVM_GUEST
 	bool "KVM Guest support (including kvmclock)"
 	select PARAVIRT
-	select PARAVIRT
 	select PARAVIRT_CLOCK
-	default y if PARAVIRT_GUEST
+	default y
 	---help---
 	  This option enables various optimizations for running under the KVM
 	  hypervisor. It includes a paravirtualized clock, so that instead
@@ -638,7 +639,7 @@ config PARAVIRT_DEBUG
 	  Enable to debug paravirt_ops internals.  Specifically, BUG if
 	  a paravirt_op is missing when it is called.
 
-endif #PARAVIRT_GUEST
+endif #HYPERVISOR_GUEST
 
 config NO_BOOTMEM
 	def_bool y
diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h
index b518c7509933..cd06ed8733cb 100644
--- a/arch/x86/include/asm/hypervisor.h
+++ b/arch/x86/include/asm/hypervisor.h
@@ -23,9 +23,6 @@
 #include <asm/kvm_para.h>
 #include <asm/xen/hypervisor.h>
 
-extern void init_hypervisor(struct cpuinfo_x86 *c);
-extern void init_hypervisor_platform(void);
-
 /*
  * x86 hypervisor information
  */
@@ -60,4 +57,11 @@ static inline bool hypervisor_x2apic_available(void)
 	return false;
 }
 
-#endif
+#ifdef CONFIG_PARAVIRT
+extern void init_hypervisor(struct cpuinfo_x86 *c);
+extern void init_hypervisor_platform(void);
+#else
+static inline void init_hypervisor(struct cpuinfo_x86 *c) { }
+static inline void init_hypervisor_platform(void) { }
+#endif /* CONFIG_PARAVIRT */
+#endif /* _ASM_X86_HYPERVISOR_H */
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index a0e067d3d96c..8d04c7cd7cd3 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -14,7 +14,6 @@ CFLAGS_common.o		:= $(nostackp)
 
 obj-y			:= intel_cacheinfo.o scattered.o topology.o
 obj-y			+= proc.o capflags.o powerflags.o common.o
-obj-y			+= vmware.o hypervisor.o mshyperv.o
 obj-y			+= rdrand.o
 obj-y			+= match.o
 
@@ -42,6 +41,8 @@ obj-$(CONFIG_MTRR)			+= mtrr/
 
 obj-$(CONFIG_X86_LOCAL_APIC)		+= perfctr-watchdog.o perf_event_amd_ibs.o
 
+obj-$(CONFIG_PARAVIRT)			+= vmware.o hypervisor.o mshyperv.o
+
 quiet_cmd_mkcapflags = MKCAP   $@
       cmd_mkcapflags = $(PERL) $(srctree)/$(src)/mkcapflags.pl $< $@
 
diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig
index b38ef6d8d049..e05efc46744f 100644
--- a/drivers/hv/Kconfig
+++ b/drivers/hv/Kconfig
@@ -2,7 +2,7 @@ menu "Microsoft Hyper-V guest support"
 
 config HYPERV
 	tristate "Microsoft Hyper-V client drivers"
-	depends on X86 && ACPI && PCI
+	depends on X86 && ACPI && PCI && HYPERVISOR_GUEST
 	help
 	  Select this option to run Linux as a Hyper-V client operating
 	  system.
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index b151b7c1bd59..c7092d5078e1 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -418,7 +418,7 @@ config TI_DAC7512
 
 config VMWARE_BALLOON
 	tristate "VMware Balloon Driver"
-	depends on X86
+	depends on X86 && HYPERVISOR_GUEST
 	help
 	  This is VMware physical memory management driver which acts
 	  like a "balloon" that can be inflated to reclaim physical pages
-- 
1.8.1.rc3


  parent reply	other threads:[~2013-01-26 23:08 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24  1:56 [PATCH RESEND 1/1] X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts K. Y. Srinivasan
2013-01-24  9:28 ` Borislav Petkov
2013-01-24 12:11   ` H. Peter Anvin
2013-01-24 17:35     ` Borislav Petkov
2013-01-24 17:36       ` H. Peter Anvin
2013-01-24 17:39       ` [PATCH 1/2] x86, Kconfig: Move PARAVIRT_DEBUG into the paravirt menu Borislav Petkov
2013-01-24 17:39         ` [PATCH 2/2] x86: Make Linux guest support optional Borislav Petkov
2013-01-25  8:21         ` [PATCH 1/2] x86, Kconfig: Move PARAVIRT_DEBUG into the paravirt menu Ingo Molnar
2013-01-25  8:51           ` Borislav Petkov
2013-01-25  9:20             ` Ingo Molnar
2013-01-25  9:29               ` Borislav Petkov
2013-01-25  9:32                 ` Ingo Molnar
2013-01-25 10:06                   ` Borislav Petkov
2013-01-25 17:59                     ` [PATCH -v2 " Borislav Petkov
2013-01-25 17:59                     ` [PATCH -v2 2/2] x86: Make Linux guest support optional Borislav Petkov
2013-01-25 18:07                       ` Dmitry Torokhov
2013-01-25 18:23                         ` Borislav Petkov
2013-01-25 18:29                           ` Dmitry Torokhov
2013-01-25 18:35                             ` Borislav Petkov
2013-01-25 18:43                               ` Borislav Petkov
2013-01-27  1:26                                 ` H. Peter Anvin
2013-01-27 10:30                                   ` Borislav Petkov
2013-01-25 18:12                       ` Dmitry Torokhov
2013-01-25 18:32                         ` Borislav Petkov
2013-01-25 18:42                           ` Dmitry Torokhov
2013-01-25 19:03                             ` Borislav Petkov
2013-01-26 23:10                               ` [PATCH -v3 1/2] x86, Kconfig: Move PARAVIRT_DEBUG into the paravirt menu Borislav Petkov
2013-01-26 23:10                               ` Borislav Petkov [this message]
2013-01-27 11:06                                 ` [PATCH -v3 2/2] x86: Make Linux guest support optional Borislav Petkov
2013-01-28 10:18                                   ` [PATCH -v3.1] " Borislav Petkov
2013-01-24 17:42   ` [PATCH RESEND 1/1] X86: Handle Hyper-V vmbus interrupts as special hypervisor interrupts KY Srinivasan

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=1359241851-7594-2-git-send-email-bp@alien8.de \
    --to=bp@alien8.de \
    --cc=JBeulich@suse.com \
    --cc=apw@canonical.com \
    --cc=bp@suse.de \
    --cc=devel@linuxdriverproject.org \
    --cc=dtor@vmware.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=jasowang@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=olaf@aepfle.de \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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.