From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sam Ravnborg Subject: Re: [PATCH 21/54] KVM: Export include/linux/kvm.h only if $ARCH actually supports KVM Date: Tue, 1 Jan 2008 17:22:00 +0100 Message-ID: <20080101162200.GA30024@uranus.ravnborg.org> References: <1199201780-14001-1-git-send-email-avi@qumranet.com> <1199201780-14001-22-git-send-email-avi@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Avi Kivity Return-path: Content-Disposition: inline In-Reply-To: <1199201780-14001-22-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On Tue, Jan 01, 2008 at 05:35:47PM +0200, Avi Kivity wrote: > Currently, make headers_check barfs due to , which > includes, not existing. Rather than add a zillion s, export kvm.h > only if the arch actually supports it. > > Signed-off-by: Avi Kivity > --- > arch/x86/Kconfig | 4 ++++ > drivers/kvm/Kconfig | 4 ++-- > include/linux/Kbuild | 2 +- > 3 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index 80b7ba4..e029a93 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -116,6 +116,10 @@ config ARCH_SUPPORTS_OPROFILE > bool > default y > > +config ARCH_SUPPORTS_KVM > + bool > + default y > + > > config ZONE_DMA32 > bool > diff --git a/drivers/kvm/Kconfig b/drivers/kvm/Kconfig > index 6569206..4086080 100644 > --- a/drivers/kvm/Kconfig > +++ b/drivers/kvm/Kconfig > @@ -3,7 +3,7 @@ > # > menuconfig VIRTUALIZATION > bool "Virtualization" > - depends on X86 > + depends on ARCH_SUPPORTS_KVM || X86 > default y > ---help--- > Say Y here to get to see options for using your Linux host to run other > @@ -16,7 +16,7 @@ if VIRTUALIZATION > > config KVM > tristate "Kernel-based Virtual Machine (KVM) support" > - depends on X86 && EXPERIMENTAL > + depends on ARCH_SUPPORTS_KVM && EXPERIMENTAL > select PREEMPT_NOTIFIERS > select ANON_INODES > ---help--- An approach like the following is preferred: kvm/Kconfig: # config symbols to be selected by archs that implment virtualization/kvm config HAVE_VIRTUALIZATION config HAVE_KVM menuconfig VIRTUALIZATION bool "..." depends on HAVE_VIRTUALIZATION config KVM tristate "..." depends on HAVE_KVM arch/x86/Kconfig: config X86 select HAVE_VIRTUALIZATION select HAVE_KVM I dunno about the additional "HAVE_VIRTUALIZATION" - I added it because I assume virtualization is more than just kvm. The rationales behinds this approach is: -> We do not define a new config variable for each arch -> We have a common way to say that an arch supports a feature -> We have a common naming scheme Sam ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/