From: Alexander Graf <agraf@suse.de>
Date: Sat, 18 Oct 2008 01:18:24 +0200
Subject: Allow KVM to be built as KMP
References: FATE#303679

As discussed on the kernel mailinglist, we need a helper config
option to enable KVM dependencies in the kernel, so we can
build it as a KMP later on. This patch provides this option.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 arch/ia64/kvm/Kconfig |   13 +++++++++++++
 arch/x86/kvm/Kconfig  |   14 ++++++++++++++
 2 files changed, 27 insertions(+)

--- a/arch/ia64/kvm/Kconfig
+++ b/arch/ia64/kvm/Kconfig
@@ -17,6 +17,19 @@ menuconfig VIRTUALIZATION
 
 if VIRTUALIZATION
 
+config KVM_KMP
+	bool "Build Kernel-based Virtual Machine (KVM) as KMP"
+	depends on HAVE_KVM
+	select PREEMPT_NOTIFIERS
+	select ANON_INODES
+	---help---
+	  Normally KVM has to be enabled in the kernel config to automatically
+	  select depending features. Because we are building KVM as a KMP, we
+	  need the chance to only select the dependencies, but not build KVM
+	  itself.
+
+	  Say Y here.
+
 config KVM
 	tristate "Kernel-based Virtual Machine (KVM) support"
 	depends on HAVE_KVM && MODULES && EXPERIMENTAL
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -17,6 +17,20 @@ menuconfig VIRTUALIZATION
 
 if VIRTUALIZATION
 
+config KVM_KMP
+	bool "Build Kernel-based Virtual Machine (KVM) as KMP"
+	depends on HAVE_KVM
+	select PREEMPT_NOTIFIERS
+	select MMU_NOTIFIER
+	select ANON_INODES
+	---help---
+	  Normally KVM has to be enabled in the kernel config to automatically
+	  select depending features. Because we are building KVM as a KMP, we
+	  need the chance to only select the dependencies, but not build KVM
+	  itself.
+
+	  Say Y here.
+
 config KVM
 	tristate "Kernel-based Virtual Machine (KVM) support"
 	depends on HAVE_KVM
