public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
To: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
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	[thread overview]
Message-ID: <20080101162200.GA30024@uranus.ravnborg.org> (raw)
In-Reply-To: <1199201780-14001-22-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

On Tue, Jan 01, 2008 at 05:35:47PM +0200, Avi Kivity wrote:
> Currently, make headers_check barfs due to <asm/kvm.h>, which <linux/kvm.h>
> includes, not existing.  Rather than add a zillion <asm/kvm.h>s, export kvm.h
> only if the arch actually supports it.
> 
> Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
> ---
>  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/

  parent reply	other threads:[~2008-01-01 16:22 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-01 15:35 [PATCH 00/54] KVM patch queue review for 2.6.25 merge window (part IV) Avi Kivity
2008-01-01 15:35 ` [PATCH 01/54] KVM: MMU: Remove gva_to_hpa() Avi Kivity
     [not found] ` <1199201780-14001-1-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-01 15:35   ` [PATCH 02/54] KVM: Remove gpa_to_hpa() Avi Kivity
2008-01-01 15:35   ` [PATCH 03/54] KVM: MMU: Rename variables of type 'struct kvm_mmu_page *' Avi Kivity
2008-01-01 15:35   ` [PATCH 04/54] KVM: MMU: Rename 'release_page' Avi Kivity
2008-01-01 15:35   ` [PATCH 05/54] KVM: Disallow fork() and similar games when using a VM Avi Kivity
2008-01-01 15:35   ` [PATCH 06/54] KVM: Enhance guest cpuid management Avi Kivity
2008-01-01 15:35   ` [PATCH 07/54] KVM: VMX: Remove the secondary execute control dependency on irqchip Avi Kivity
2008-01-01 15:35   ` [PATCH 08/54] KVM: Portability: Move unalias_gfn to arch dependent file Avi Kivity
2008-01-01 15:35   ` [PATCH 09/54] KVM: x86 emulator: Make a distinction between repeat prefixes F3 and F2 Avi Kivity
2008-01-01 15:35   ` [PATCH 10/54] KVM: x86 emulator: address size and operand size overrides are sticky Avi Kivity
2008-01-01 15:35   ` [PATCH 11/54] KVM: Remove misleading check for mmio during event injection Avi Kivity
2008-01-01 15:35   ` [PATCH 12/54] KVM: MMU: mark pages that were inserted to the shadow pages table as accessed Avi Kivity
2008-01-01 15:35   ` [PATCH 13/54] KVM: x86 emulator: Rename 'cr2' to 'memop' Avi Kivity
2008-01-01 15:35   ` [PATCH 14/54] KVM: x86 emulator: cmps instruction Avi Kivity
2008-01-01 15:35   ` [PATCH 15/54] KVM: Add ifdef in irqchip struct for x86 only structures Avi Kivity
2008-01-01 15:35   ` [PATCH 16/54] KVM: x86 emulator: Move rep processing before instruction execution Avi Kivity
2008-01-01 15:35   ` [PATCH 17/54] KVM: x86 emulator: unify two switches Avi Kivity
2008-01-01 15:35   ` [PATCH 18/54] KVM: x86 emulator: unify four switch statements into two Avi Kivity
2008-01-01 15:35   ` [PATCH 19/54] KVM: Portability: Move KVM_INTERRUPT vcpu ioctl to x86.c Avi Kivity
2008-01-01 15:35   ` [PATCH 20/54] KVM: Correct kvm_init() error paths not freeing bad_pge Avi Kivity
2008-01-01 15:35   ` [PATCH 21/54] KVM: Export include/linux/kvm.h only if $ARCH actually supports KVM Avi Kivity
     [not found]     ` <1199201780-14001-22-git-send-email-avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-01 16:22       ` Sam Ravnborg [this message]
     [not found]         ` <20080101162200.GA30024-QabhHTsIXMSnlFQ6Q1D1Y0B+6BGkLq7r@public.gmane.org>
2008-01-01 16:35           ` Avi Kivity
2008-01-01 15:35   ` [PATCH 22/54] KVM: SVM: Remove KVM specific defines for MSR_EFER Avi Kivity
2008-01-01 15:35   ` [PATCH 23/54] KVM: Replace kvm_lapic with kvm_vcpu in ioapic/lapic interface Avi Kivity
2008-01-01 15:35   ` [PATCH 24/54] KVM: Replace dest_Lowest_Prio and dest_Fixed with self-defined macros Avi Kivity
2008-01-01 15:35   ` [PATCH 25/54] KVM: Extend ioapic code to support iosapic Avi Kivity
2008-01-01 15:35   ` [PATCH 26/54] KVM: Portability: Move address types to their own header file Avi Kivity
2008-01-01 15:35   ` [PATCH 27/54] KVM: Portability: Move IO device definitions to its " Avi Kivity
2008-01-01 15:35   ` [PATCH 28/54] KVM: Portability: Stop including x86-specific headers in kvm_main.c Avi Kivity
2008-01-01 15:35   ` [PATCH 29/54] KVM: Portability: Create kvm_arch_vcpu_runnable() function Avi Kivity
2008-01-01 15:35   ` [PATCH 30/54] KVM: Convert KVM from ->nopage() to ->fault() Avi Kivity
2008-01-01 15:35   ` [PATCH 31/54] KVM: MMU: Remove unused prev_shadow_ent variable from fetch() Avi Kivity
2008-01-01 15:35   ` [PATCH 32/54] KVM: Generalize exception injection mechanism Avi Kivity
2008-01-01 15:35   ` [PATCH 33/54] KVM: Replace page fault injection by the generalized exception queue Avi Kivity
2008-01-01 15:36   ` [PATCH 34/54] KVM: Replace #GP " Avi Kivity
2008-01-01 15:36   ` [PATCH 35/54] KVM: Use generalized exception queue for injecting #UD Avi Kivity
2008-01-01 15:36   ` [PATCH 36/54] KVM: x86 emulator: fix eflags preparation for emulation Avi Kivity
2008-01-01 15:36   ` [PATCH 37/54] KVM: VMX: Avoid exit when setting cr8 if the local apic is in the kernel Avi Kivity
2008-01-01 15:36   ` [PATCH 38/54] KVM: SVM: Emulate read/write access to cr8 Avi Kivity
2008-01-01 15:36   ` [PATCH 39/54] KVM: x86 emulator: Fix stack instructions on 64-bit mode Avi Kivity
2008-01-01 15:36   ` [PATCH 40/54] KVM: SVM: Trap access to the cr8 register Avi Kivity
2008-01-01 15:36   ` [PATCH 41/54] KVM: MMU: Use cmpxchg for pte updates on walk_addr() Avi Kivity
2008-01-01 15:36   ` [PATCH 42/54] KVM: MMU: Simplify calculation of pte access Avi Kivity
2008-01-01 15:36   ` [PATCH 43/54] KVM: MMU: Set nx bit correctly on shadow ptes Avi Kivity
2008-01-01 15:36   ` [PATCH 44/54] KVM: MMU: Move pte access calculation into a helper function Avi Kivity
2008-01-01 15:36   ` [PATCH 45/54] KVM: MMU: Fix inherited permissions for emulated guest pte updates Avi Kivity
2008-01-01 15:36   ` [PATCH 46/54] KVM: MMU: No need to pick up nx bit from guest pte Avi Kivity
2008-01-01 15:36   ` [PATCH 47/54] KVM: MMU: Pass pte dirty flag to set_pte() instead of calculating it on-site Avi Kivity
2008-01-01 15:36   ` [PATCH 48/54] KVM: MMU: Remove walker argument to set_pte() Avi Kivity
2008-01-01 15:36   ` [PATCH 49/54] KVM: MMU: Move set_pte() into guest paging mode independent code Avi Kivity
2008-01-01 15:36   ` [PATCH 50/54] KVM: MMU: Adjust mmu_set_spte() debug code for gpte removal Avi Kivity
2008-01-01 15:36   ` [PATCH 51/54] KVM: MMU: Use mmu_set_spte() for real-mode shadows Avi Kivity
2008-01-01 15:36   ` [PATCH 52/54] KVM: SVM: Exit to userspace if write to cr8 and not using in-kernel apic Avi Kivity
2008-01-01 15:36   ` [PATCH 53/54] KVM: MMU: Fix SMP shadow instantiation race Avi Kivity
2008-01-01 15:36   ` [PATCH 54/54] KVM: LAPIC: minor debugging compile fix Avi Kivity

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=20080101162200.GA30024@uranus.ravnborg.org \
    --to=sam-uyr5n9q2vtjg9huczpvpmw@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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