The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jaswinder Singh Rajput <jaswinder@kernel.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>, x86 maintainers <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	akataria@vmware.com
Subject: Re: [PATCH -tip] x86: move vmware to hypervisor
Date: Wed, 25 Mar 2009 10:59:54 +0530	[thread overview]
Message-ID: <1237958994.5556.5.camel@localhost.localdomain> (raw)
In-Reply-To: <49BFC6CB.9070603@zytor.com>

On Tue, 2009-03-17 at 08:50 -0700, H. Peter Anvin wrote:
> Jaswinder Singh Rajput wrote:
> >> I dont really like this one. KVM is a hypervisor too, and so is 
> >> Xen and lguest. VMware is one of the many types of a 
> >> hypervisors.
> > 
> > Can we use common hypervisor for Xen, lguest, vmware, etc.
> > And Xen, lguest, vmware will be the sub-options.
> 
> Obviously.  We spent a lot of time breaking up the cpu stuff into common
> and vendor-specific portions, we shouldn't go backwards w.r.t. hypervisors.
> 	

OK, agreed.

But atleast give freedom to users to disable this who are not willing to
use it.

Currently hypervisor is used only used by VMWARE, so is I prepare this
freedom patch:

From: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Date: Wed, 25 Mar 2009 10:40:01 +0530
Subject: [PATCH] x86: Introduce CONFIG_X86_VMWARE option

Impact: freedom to choose

Gives freedom to users to select or suppress CONFIG_X86_VMWARE option.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
---
 arch/x86/Kconfig                  |    7 +++++++
 arch/x86/include/asm/hypervisor.h |    9 +++++++++
 arch/x86/kernel/cpu/Makefile      |    2 +-
 3 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index f5d7d29..56e1a9c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -554,6 +554,13 @@ config HPET_EMULATE_RTC
 	def_bool y
 	depends on HPET_TIMER && (RTC=y || RTC=m || RTC_DRV_CMOS=m || RTC_DRV_CMOS=y)
 
+config X86_VMWARE
+	bool
+	default n
+	prompt "X86 VMware support"
+	---help---
+	 Enable X86 VMware Hypervisor support.
+
 # Mark as embedded because too many people got it wrong.
 # The code disables itself when not needed.
 config DMI
diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h
index 369f5c5..c08ae75 100644
--- a/arch/x86/include/asm/hypervisor.h
+++ b/arch/x86/include/asm/hypervisor.h
@@ -20,7 +20,16 @@
 #ifndef ASM_X86__HYPERVISOR_H
 #define ASM_X86__HYPERVISOR_H
 
+#ifdef CONFIG_X86_VMWARE
 extern unsigned long get_hypervisor_tsc_freq(void);
 extern void init_hypervisor(struct cpuinfo_x86 *c);
+#else
+static inline unsigned long get_hypervisor_tsc_freq(void)
+{
+	return 0;
+}
+
+static inline void init_hypervisor(struct cpuinfo_x86 *c) {}
+#endif
 
 #endif
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index 3efcb2b..24372f7 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -9,11 +9,11 @@ endif
 
 obj-y			:= intel_cacheinfo.o addon_cpuid_features.o
 obj-y			+= proc.o capflags.o powerflags.o common.o
-obj-y			+= vmware.o hypervisor.o
 
 obj-$(CONFIG_X86_32)	+= bugs.o cmpxchg.o
 obj-$(CONFIG_X86_64)	+= bugs_64.o
 
+obj-$(CONFIG_X86_VMWARE)		+= vmware.o hypervisor.o
 obj-$(CONFIG_X86_CPU_DEBUG)		+= cpu_debug.o
 
 obj-$(CONFIG_CPU_SUP_INTEL)		+= intel.o
-- 
1.6.0.6




  reply	other threads:[~2009-03-25  5:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-17  9:19 [PATCH -tip] x86: move vmware to hypervisor Jaswinder Singh Rajput
2009-03-17  9:39 ` Ingo Molnar
2009-03-17  9:48   ` Jaswinder Singh Rajput
2009-03-17 15:50     ` H. Peter Anvin
2009-03-25  5:29       ` Jaswinder Singh Rajput [this message]
2009-03-25 12:59         ` Ingo Molnar
2009-03-25 16:52           ` Alok Kataria
2009-03-25 17:07             ` Jaswinder Singh Rajput
2009-03-25 17:24               ` Alok Kataria
2009-03-25 17:38                 ` Jaswinder Singh Rajput
2009-03-25 18:18                   ` Alok Kataria
2009-03-26  7:10                     ` david
2009-03-26 16:40                       ` Alok Kataria
2009-03-27  0:10                         ` H. Peter Anvin
2009-03-25 13:38         ` Mark Lord
2009-03-17 17:28 ` Alok Kataria

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=1237958994.5556.5.camel@localhost.localdomain \
    --to=jaswinder@kernel.org \
    --cc=akataria@vmware.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox