public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	kvm-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	caglar@pardus.org.tr, andi@firstfloor.org,
	Avi Kivity <avi@qumranet.com>
Subject: [PATCH] i386: Decouple PAE from CONFIG_CMPXCHG64
Date: Wed, 18 Jul 2007 19:34:47 +0300	[thread overview]
Message-ID: <11847764879-git-send-email-avi@qumranet.com> (raw)

Commit 9d9bbd4d247a674deb43565582151acdc22e90d1 makes CONFIG_CMPXCHG64
dependent on CONFIG_HIGHMEM64G, but KVM guest SMP support now also
requires CMPXCHG64 while not being tied to PAE.  So the effect of that patch
is to disable KVM on non-PAE configs.

Untangle those dependencies by:
 - having KVM select CMPXCHG64
 - having HIGHMEM64G select CMPXCHG64_REQUIRED, a variant that also
   checks for the feature at early boot

No processors that support KVM exist that also do not support CMPXCHG64,
so no additional check is necessary.  This setup allows for a single kernel
that will boot on i486 and also support KVM if available.

Signed-off-by: Avi Kivity <avi@qumranet.com>

diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index c7c9c2a..d894cb2 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -542,6 +542,7 @@ config HIGHMEM4G
 config HIGHMEM64G
 	bool "64GB"
 	depends on !M386 && !M486
+	select X86_CMPXCHG64_REQUIRED
 	help
 	  Select this if you have a 32-bit processor and more than 4
 	  gigabytes of physical RAM.
diff --git a/arch/i386/Kconfig.cpu b/arch/i386/Kconfig.cpu
index 9cbe76c..e11870b 100644
--- a/arch/i386/Kconfig.cpu
+++ b/arch/i386/Kconfig.cpu
@@ -299,8 +299,11 @@ config X86_POPAD_OK
 
 config X86_CMPXCHG64
 	bool
-	depends on X86_PAE
-	default y
+	depends on !M386 && !M486
+
+config X86_CMPXCHG64_REQUIRED
+	bool
+	select X86_CMPXCHG64
 
 config X86_ALIGNMENT_16
 	bool
diff --git a/drivers/kvm/Kconfig b/drivers/kvm/Kconfig
index 33fa28a..6d53316 100644
--- a/drivers/kvm/Kconfig
+++ b/drivers/kvm/Kconfig
@@ -11,7 +11,7 @@ if VIRTUALIZATION
 config KVM
 	tristate "Kernel-based Virtual Machine (KVM) support"
 	depends on X86 && EXPERIMENTAL
-	depends on X86_CMPXCHG64 || 64BIT
+	select X86_CMPXCHG64 if X86_32
 	---help---
 	  Support hosting fully virtualized guest machines using hardware
 	  virtualization extensions.  You will need a fairly recent
diff --git a/include/asm-i386/required-features.h b/include/asm-i386/required-features.h
index 65848a0..e4746fd 100644
--- a/include/asm-i386/required-features.h
+++ b/include/asm-i386/required-features.h
@@ -29,7 +29,7 @@
 # define NEED_CMOV	0
 #endif
 
-#ifdef CONFIG_X86_CMPXCHG64
+#ifdef CONFIG_X86_CMPXCHG64_REQUIRED
 # define NEED_CX8	(1<<(X86_FEATURE_CX8 & 31))
 #else
 # define NEED_CX8	0

             reply	other threads:[~2007-07-18 16:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-18 16:34 Avi Kivity [this message]
     [not found] ` <11847764879-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-18 18:18   ` [PATCH] i386: Decouple PAE from CONFIG_CMPXCHG64 Andi Kleen
     [not found]     ` <20070718181829.GA3848-qrUzlfsMFqo/4alezvVtWx2eb7JE58TQ@public.gmane.org>
2007-07-19  1:20       ` H. Peter Anvin

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=11847764879-git-send-email-avi@qumranet.com \
    --to=avi@qumranet.com \
    --cc=andi@firstfloor.org \
    --cc=caglar@pardus.org.tr \
    --cc=hpa@zytor.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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