2007-02-13 23:26:06

by Dan Hecht

[permalink] [raw]
Subject: Re: [patch 14/21] Xen-paravirt: Add XEN config options and disable unsupported config options.

On 02/13/2007 02:17 PM, Jeremy Fitzhardinge wrote:
> The XEN config option enables the Xen paravirt_ops interface, which is
> installed when the kernel finds itself running under Xen. (By some
> as-yet fully defined mechanism, implemented in a future patch.)
>
> Xen is no longer a sub-architecture, so the X86_XEN subarch config
> option has gone.
>
> The disabled config options are:
> - PREEMPT: Xen doesn't support it
> - HZ: set to 100Hz for now, to cut down on VCPU context switch rate.
> This will be adapted to use tickless later.
> - kexec: not yet supported
>

I assume you plan to eventually get all this stuff working but just want
to prevent configurations that the Xen paravirt-ops isn't ready for at
the moment?

Instead can you do it this way:

config XEN
depends on PARAVIRT && !PREEMPT && HZ_100 && !DOUBLEFAULT && !KEXEC


thanks,
Dan


> Signed-off-by: Jeremy Fitzhardinge <[email protected]>
> Signed-off-by: Ian Pratt <[email protected]>
> Signed-off-by: Christian Limpach <[email protected]>
> Signed-off-by: Chris Wright <[email protected]>
>
> ---
> arch/i386/Kconfig | 7 +++++--
> arch/i386/Kconfig.debug | 1 +
> arch/i386/xen/Kconfig | 10 ++++++++++
> kernel/Kconfig.hz | 4 ++--
> kernel/Kconfig.preempt | 1 +
> 5 files changed, 19 insertions(+), 4 deletions(-)
>
> ===================================================================
> --- a/arch/i386/Kconfig
> +++ b/arch/i386/Kconfig
> @@ -192,6 +192,8 @@ config PARAVIRT
> under a hypervisor, improving performance significantly.
> However, when run without a hypervisor the kernel is
> theoretically slower. If in doubt, say N.
> +
> +source "arch/i386/xen/Kconfig"
>
> config ACPI_SRAT
> bool
> @@ -298,12 +300,12 @@ config X86_UP_IOAPIC
>
> config X86_LOCAL_APIC
> bool
> - depends on X86_UP_APIC || ((X86_VISWS || SMP) && !X86_VOYAGER) || X86_GENERICARCH
> + depends on X86_UP_APIC || (((X86_VISWS || SMP) && !X86_VOYAGER) || X86_GENERICARCH)
> default y
>
> config X86_IO_APIC
> bool
> - depends on X86_UP_IOAPIC || (SMP && !(X86_VISWS || X86_VOYAGER)) || X86_GENERICARCH
> + depends on X86_UP_IOAPIC || ((SMP && !(X86_VISWS || X86_VOYAGER)) || X86_GENERICARCH)
> default y
>
> config X86_VISWS_APIC
> @@ -743,6 +745,7 @@ source kernel/Kconfig.hz
>
> config KEXEC
> bool "kexec system call"
> + depends on !XEN
> help
> kexec is a system call that implements the ability to shutdown your
> current kernel, and to start another kernel. It is like a reboot
> ===================================================================
> --- a/arch/i386/Kconfig.debug
> +++ b/arch/i386/Kconfig.debug
> @@ -79,6 +79,7 @@ config DOUBLEFAULT
> config DOUBLEFAULT
> default y
> bool "Enable doublefault exception handler" if EMBEDDED
> + depends on !XEN
> help
> This option allows trapping of rare doublefault exceptions that
> would otherwise cause a system to silently reboot. Disabling this
> ===================================================================
> --- /dev/null
> +++ b/arch/i386/xen/Kconfig
> @@ -0,0 +1,10 @@
> +#
> +# This Kconfig describes xen options
> +#
> +
> +config XEN
> + bool "Enable support for Xen hypervisor"
> + depends PARAVIRT
> + default y
> + help
> + This is the Linux Xen port.
> ===================================================================
> --- a/kernel/Kconfig.hz
> +++ b/kernel/Kconfig.hz
> @@ -3,7 +3,7 @@
> #
>
> choice
> - prompt "Timer frequency"
> + prompt "Timer frequency" if !XEN
> default HZ_250
> help
> Allows the configuration of the timer frequency. It is customary
> @@ -49,7 +49,7 @@ endchoice
>
> config HZ
> int
> - default 100 if HZ_100
> + default 100 if HZ_100 || XEN
> default 250 if HZ_250
> default 300 if HZ_300
> default 1000 if HZ_1000
> ===================================================================
> --- a/kernel/Kconfig.preempt
> +++ b/kernel/Kconfig.preempt
> @@ -35,6 +35,7 @@ config PREEMPT_VOLUNTARY
>
> config PREEMPT
> bool "Preemptible Kernel (Low-Latency Desktop)"
> + depends on !XEN
> help
> This option reduces the latency of the kernel by making
> all kernel code (that is not executing in a critical section)
>


2007-02-13 23:29:34

by Jeremy Fitzhardinge

[permalink] [raw]
Subject: Re: [patch 14/21] Xen-paravirt: Add XEN config options and disable unsupported config options.

Dan Hecht wrote:
> I assume you plan to eventually get all this stuff working but just
> want to prevent configurations that the Xen paravirt-ops isn't ready
> for at the moment?
>
> Instead can you do it this way:
>
> config XEN
> depends on PARAVIRT && !PREEMPT && HZ_100 && !DOUBLEFAULT && !KEXEC

That's a bit simpler code-wise, but it does make it pretty complex to
get everything just-so to even see the CONFIG_XEN option.

J

2007-02-13 23:58:22

by Zachary Amsden

[permalink] [raw]
Subject: Re: [Xen-devel] Re: [patch 14/21] Xen-paravirt: Add XEN config options and disable unsupported config options.

Jeremy Fitzhardinge wrote:
> Dan Hecht wrote:
>
>> I assume you plan to eventually get all this stuff working but just
>> want to prevent configurations that the Xen paravirt-ops isn't ready
>> for at the moment?
>>
>> Instead can you do it this way:
>>
>> config XEN
>> depends on PARAVIRT && !PREEMPT && HZ_100 && !DOUBLEFAULT && !KEXEC
>>
>
> That's a bit simpler code-wise, but it does make it pretty complex to
> get everything just-so to even see the CONFIG_XEN option.
>

Yes, but that is what you need to do to compile Xen - logically, to
build a Xen kernel, you need to have a kernel configuration which can
enable Xen - not limit the configuration of a kernel because Xen has
been enabled. This is because with paravirt-ops, Xen compiled kernels
may not actually run on Xen, so you can't arbitrarily drop features
because you assume Xen is there.

One of these has an easy solution - doublefault. You don't need to
install the doublefault gate if you don't want it, and the hypervisor
doesn't need to freak out if you install it, it can just ignore the gate
entirely and claim #DF is not supported.

Zach

2007-02-14 00:00:20

by Dan Hecht

[permalink] [raw]
Subject: Re: [patch 14/21] Xen-paravirt: Add XEN config options and disable unsupported config options.

On 02/13/2007 03:29 PM, Jeremy Fitzhardinge wrote:
> Dan Hecht wrote:
>> I assume you plan to eventually get all this stuff working but just
>> want to prevent configurations that the Xen paravirt-ops isn't ready
>> for at the moment?
>>
>> Instead can you do it this way:
>>
>> config XEN
>> depends on PARAVIRT && !PREEMPT && HZ_100 && !DOUBLEFAULT && !KEXEC
>
> That's a bit simpler code-wise, but it does make it pretty complex to
> get everything just-so to even see the CONFIG_XEN option.
>

Not only is it simpler code-wise, but it is more to the point... it is
CONFIG_XEN that needs to be fixed to handle PREEMPT, KEXEC, different HZ
values, etc. Not the other way around.

Enabling the compile of any paravirt-ops backend shouldn't cripple the
kernel in any way... instead, the burden should be on the xen
paravirt-ops backend to be completed. CONFIG_PREEMPT shouldn't care
about which paravirt-ops are compiled in. Instead, CONFIG_XEN is the
one that needs !PREEMPT.

Dan