2006-03-13 18:03:33

by Zachary Amsden

[permalink] [raw]
Subject: [RFC, PATCH 2/24] i386 Vmi config

Introduce the basic VMI sub-arch configuration dependencies. VMI kernels only
are designed to run on modern hardware platforms. As such, they require a
working APIC, and do not support some legacy functionality, including APM BIOS,
ISA and MCA bus systems, PCI BIOS interfaces, or PnP BIOS (by implication of
dropping ISA support). They also require a P6 series CPU.

Signed-off-by: Zachary Amsden <[email protected]>

Index: linux-2.6.16-rc5/arch/i386/Kconfig
===================================================================
--- linux-2.6.16-rc5.orig/arch/i386/Kconfig 2006-03-06 11:25:08.000000000 -0800
+++ linux-2.6.16-rc5/arch/i386/Kconfig 2006-03-06 16:41:25.000000000 -0800
@@ -133,8 +133,33 @@ config X86_ES7000
Only choose this option if you have such a system, otherwise you
should say N here.

+config X86_VMI
+ bool "VMI architecture support"
+ help
+ This option builds a kernel designed to run on top of a virtual
+ machine interface layer (VMI). Say 'N' here unless you are
+ building a kernel to run inside a virtual machine.
+
endchoice

+menu "VMI configurable support"
+ depends on X86_VMI
+
+config VMI_REQUIRE_HYPERVISOR
+ bool "Require hypervisor"
+ default n
+ help
+ This option forces the kernel to run with a hypervisor present.
+ The kernel will panic if booted on native hardware.
+
+config VMI_DEBUG
+ bool "VMI debugging"
+ default n
+ help
+ Provides extra debugging output and testing of VMI interfaces.
+
+endmenu
+
config ACPI_SRAT
bool
default y
@@ -270,7 +295,7 @@ config X86_VISWS_APIC

config X86_MCE
bool "Machine Check Exception"
- depends on !X86_VOYAGER
+ depends on !(X86_VOYAGER)
---help---
Machine Check Exception support allows the processor to notify the
kernel if it detects a problem (e.g. overheating, component failure).
@@ -307,6 +332,7 @@ config X86_MCE_P4THERMAL

config TOSHIBA
tristate "Toshiba Laptop support"
+ depends on !X86_VMI
---help---
This adds a driver to safely access the System Management Mode of
the CPU on Toshiba portables with a genuine Toshiba BIOS. It does
@@ -322,6 +348,7 @@ config TOSHIBA

config I8K
tristate "Dell laptop support"
+ depends on !X86_VMI
---help---
This adds a driver to safely access the System Management Mode
of the CPU on the Dell Inspiron 8000. The System Management Mode
@@ -569,6 +596,7 @@ config HIGHPTE

config MATH_EMULATION
bool "Math emulation"
+ depends on !X86_VMI
---help---
Linux can emulate a math coprocessor (used for floating point
operations) if you don't have one. 486DX and Pentium processors have
@@ -760,7 +788,7 @@ source kernel/power/Kconfig
source "drivers/acpi/Kconfig"

menu "APM (Advanced Power Management) BIOS Support"
-depends on PM && !X86_VISWS
+depends on PM && !(X86_VISWS || X86_VMI)

config APM
tristate "APM (Advanced Power Management) BIOS support"
@@ -930,8 +958,9 @@ config PCI

choice
prompt "PCI access mode"
- depends on PCI && !X86_VISWS
+ depends on PCI && !(X86_VISWS || X86_VMI)
default PCI_GOANY
+
---help---
On PCI systems, the BIOS can be used to detect the PCI devices and
determine their configuration. However, some old PCI motherboards
@@ -963,12 +992,12 @@ endchoice

config PCI_BIOS
bool
- depends on !X86_VISWS && PCI && (PCI_GOBIOS || PCI_GOANY)
+ depends on !(X86_VISWS && X86_VMI) && PCI && (PCI_GOBIOS || PCI_GOANY)
default y

config PCI_DIRECT
bool
- depends on PCI && ((PCI_GODIRECT || PCI_GOANY) || X86_VISWS)
+ depends on PCI && ((PCI_GODIRECT || PCI_GOANY) || X86_VISWS || X86_VMI)
default y

config PCI_MMCONFIG
@@ -986,7 +1015,7 @@ config ISA_DMA_API

config ISA
bool "ISA support"
- depends on !(X86_VOYAGER || X86_VISWS)
+ depends on !(X86_VOYAGER || X86_VISWS || X86_VMI)
help
Find out whether you have ISA slots on your motherboard. ISA is the
name of a bus system, i.e. the way the CPU talks to the other stuff
@@ -1013,7 +1042,7 @@ config EISA
source "drivers/eisa/Kconfig"

config MCA
- bool "MCA support" if !(X86_VISWS || X86_VOYAGER)
+ bool "MCA support" if !(X86_VISWS || X86_VOYAGER || X86_VMI)
default y if X86_VOYAGER
help
MicroChannel Architecture is found in some IBM PS/2 machines and
Index: linux-2.6.16-rc5/arch/i386/Kconfig.cpu
===================================================================
--- linux-2.6.16-rc5.orig/arch/i386/Kconfig.cpu 2006-03-06 11:25:08.000000000 -0800
+++ linux-2.6.16-rc5/arch/i386/Kconfig.cpu 2006-03-06 16:01:41.000000000 -0800
@@ -7,6 +7,7 @@ choice

config M386
bool "386"
+ depends on !X86_VMI
---help---
This is the processor type of your CPU. This information is used for
optimizing purposes. In order to compile a kernel that can run on
@@ -47,6 +48,7 @@ config M386

config M486
bool "486"
+ depends on !X86_VMI
help
Select this for a 486 series processor, either Intel or one of the
compatible processors from AMD, Cyrix, IBM, or Intel. Includes DX,
@@ -55,6 +57,7 @@ config M486

config M586
bool "586/K5/5x86/6x86/6x86MX"
+ depends on !X86_VMI
help
Select this for an 586 or 686 series processor such as the AMD K5,
the Cyrix 5x86, 6x86 and 6x86MX. This choice does not
@@ -62,12 +65,14 @@ config M586

config M586TSC
bool "Pentium-Classic"
+ depends on !X86_VMI
help
Select this for a Pentium Classic processor with the RDTSC (Read
Time Stamp Counter) instruction for benchmarking.

config M586MMX
bool "Pentium-MMX"
+ depends on !X86_VMI
help
Select this for a Pentium with the MMX graphics/multimedia
extended instructions.


2006-03-13 20:23:24

by Sam Vilain

[permalink] [raw]
Subject: Re: [RFC, PATCH 2/24] i386 Vmi config

Zachary Amsden wrote:

>===================================================================
>--- linux-2.6.16-rc5.orig/arch/i386/Kconfig 2006-03-06 11:25:08.000000000 -0800
>+++ linux-2.6.16-rc5/arch/i386/Kconfig 2006-03-06 16:41:25.000000000 -0800
>@@ -133,8 +133,33 @@ config X86_ES7000
> Only choose this option if you have such a system, otherwise you
> should say N here.
>
>+config X86_VMI
>+ bool "VMI architecture support"
>+ help
>+ This option builds a kernel designed to run on top of a virtual
>+ machine interface layer (VMI). Say 'N' here unless you are
>+ building a kernel to run inside a virtual machine.
>+
> endchoice
>
>

I think we should have a top level "Virtualisation" menu for
VMI/Xen/vserver/openvz/etc. While this option might seem to belong
here, it might be better for users to keep the configuration for the
virtualisation approaches together.

Of course I'm not core team so don't go changing your patch, this is a
point of discussion :)

>
>+menu "VMI configurable support"
>+ depends on X86_VMI
>+
>+config VMI_REQUIRE_HYPERVISOR
>+ bool "Require hypervisor"
>+ default n
>+ help
>+ This option forces the kernel to run with a hypervisor present.
>+ The kernel will panic if booted on native hardware.
>+
>+config VMI_DEBUG
>+ bool "VMI debugging"
>+ default n
>+ help
>+ Provides extra debugging output and testing of VMI interfaces.
>+
>+endmenu
>+
> config ACPI_SRAT
> bool
> default y
>@@ -270,7 +295,7 @@ config X86_VISWS_APIC
>
> config X86_MCE
> bool "Machine Check Exception"
>- depends on !X86_VOYAGER
>+ depends on !(X86_VOYAGER)
> ---help---
> Machine Check Exception support allows the processor to notify the
> kernel if it detects a problem (e.g. overheating, component failure).
>@@ -307,6 +332,7 @@ config X86_MCE_P4THERMAL
>
> config TOSHIBA
> tristate "Toshiba Laptop support"
>+ depends on !X86_VMI
> ---help---
> This adds a driver to safely access the System Management Mode of
> the CPU on Toshiba portables with a genuine Toshiba BIOS. It does
>@@ -322,6 +348,7 @@ config TOSHIBA
>
> config I8K
> tristate "Dell laptop support"
>+ depends on !X86_VMI
> ---help---
> This adds a driver to safely access the System Management Mode
> of the CPU on the Dell Inspiron 8000. The System Management Mode
>@@ -569,6 +596,7 @@ config HIGHPTE
>
> config MATH_EMULATION
> bool "Math emulation"
>+ depends on !X86_VMI
> ---help---
> Linux can emulate a math coprocessor (used for floating point
> operations) if you don't have one. 486DX and Pentium processors have
>@@ -760,7 +788,7 @@ source kernel/power/Kconfig
> source "drivers/acpi/Kconfig"
>
> menu "APM (Advanced Power Management) BIOS Support"
>-depends on PM && !X86_VISWS
>+depends on PM && !(X86_VISWS || X86_VMI)
>
> config APM
> tristate "APM (Advanced Power Management) BIOS support"
>@@ -930,8 +958,9 @@ config PCI
>
> choice
> prompt "PCI access mode"
>- depends on PCI && !X86_VISWS
>+ depends on PCI && !(X86_VISWS || X86_VMI)
> default PCI_GOANY
>+
> ---help---
> On PCI systems, the BIOS can be used to detect the PCI devices and
> determine their configuration. However, some old PCI motherboards
>@@ -963,12 +992,12 @@ endchoice
>
> config PCI_BIOS
> bool
>- depends on !X86_VISWS && PCI && (PCI_GOBIOS || PCI_GOANY)
>+ depends on !(X86_VISWS && X86_VMI) && PCI && (PCI_GOBIOS || PCI_GOANY)
> default y
>
> config PCI_DIRECT
> bool
>- depends on PCI && ((PCI_GODIRECT || PCI_GOANY) || X86_VISWS)
>+ depends on PCI && ((PCI_GODIRECT || PCI_GOANY) || X86_VISWS || X86_VMI)
> default y
>
> config PCI_MMCONFIG
>@@ -986,7 +1015,7 @@ config ISA_DMA_API
>
> config ISA
> bool "ISA support"
>- depends on !(X86_VOYAGER || X86_VISWS)
>+ depends on !(X86_VOYAGER || X86_VISWS || X86_VMI)
> help
> Find out whether you have ISA slots on your motherboard. ISA is the
> name of a bus system, i.e. the way the CPU talks to the other stuff
>@@ -1013,7 +1042,7 @@ config EISA
> source "drivers/eisa/Kconfig"
>
> config MCA
>- bool "MCA support" if !(X86_VISWS || X86_VOYAGER)
>+ bool "MCA support" if !(X86_VISWS || X86_VOYAGER || X86_VMI)
> default y if X86_VOYAGER
> help
> MicroChannel Architecture is found in some IBM PS/2 machines and
>Index: linux-2.6.16-rc5/arch/i386/Kconfig.cpu
>===================================================================
>--- linux-2.6.16-rc5.orig/arch/i386/Kconfig.cpu 2006-03-06 11:25:08.000000000 -0800
>+++ linux-2.6.16-rc5/arch/i386/Kconfig.cpu 2006-03-06 16:01:41.000000000 -0800
>@@ -7,6 +7,7 @@ choice
>
> config M386
> bool "386"
>+ depends on !X86_VMI
> ---help---
> This is the processor type of your CPU. This information is used for
> optimizing purposes. In order to compile a kernel that can run on
>@@ -47,6 +48,7 @@ config M386
>
> config M486
> bool "486"
>+ depends on !X86_VMI
> help
> Select this for a 486 series processor, either Intel or one of the
> compatible processors from AMD, Cyrix, IBM, or Intel. Includes DX,
>@@ -55,6 +57,7 @@ config M486
>
> config M586
> bool "586/K5/5x86/6x86/6x86MX"
>+ depends on !X86_VMI
> help
> Select this for an 586 or 686 series processor such as the AMD K5,
> the Cyrix 5x86, 6x86 and 6x86MX. This choice does not
>@@ -62,12 +65,14 @@ config M586
>
> config M586TSC
> bool "Pentium-Classic"
>+ depends on !X86_VMI
> help
> Select this for a Pentium Classic processor with the RDTSC (Read
> Time Stamp Counter) instruction for benchmarking.
>
> config M586MMX
> bool "Pentium-MMX"
>+ depends on !X86_VMI
> help
> Select this for a Pentium with the MMX graphics/multimedia
> extended instructions.
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to [email protected]
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
>
>

2006-03-14 15:23:54

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [RFC, PATCH 2/24] i386 Vmi config

On Mon, Mar 13, 2006 at 10:00:27AM -0800, Zachary Amsden wrote:
> Introduce the basic VMI sub-arch configuration dependencies. VMI kernels only
> are designed to run on modern hardware platforms. As such, they require a
> working APIC, and do not support some legacy functionality, including APM BIOS,
> ISA and MCA bus systems, PCI BIOS interfaces, or PnP BIOS (by implication of
> dropping ISA support). They also require a P6 series CPU.

That's pretty bad because distributors need another kernel still. At least
a working APIC isn't quite as common today as it should.

2006-03-14 15:56:04

by Zachary Amsden

[permalink] [raw]
Subject: Re: [RFC, PATCH 2/24] i386 Vmi config

Christoph Hellwig wrote:
> On Mon, Mar 13, 2006 at 10:00:27AM -0800, Zachary Amsden wrote:
>
>> Introduce the basic VMI sub-arch configuration dependencies. VMI kernels only
>> are designed to run on modern hardware platforms. As such, they require a
>> working APIC, and do not support some legacy functionality, including APM BIOS,
>> ISA and MCA bus systems, PCI BIOS interfaces, or PnP BIOS (by implication of
>> dropping ISA support). They also require a P6 series CPU.
>>
>
> That's pretty bad because distributors need another kernel still. At least
> a working APIC isn't quite as common today as it should.
>

It doesn't need to be a fully functional APIC. It just needs to not
have one particular bug - Pentium processor erratum 11AP. There is no
reason that most of these requirements can't be dropped. We used to
have a lot more functionality and legacy support turned off, and we
gradually turned it back on. Turning on the BIOS interfaces will cause
complications for a VMI kernel running in a hypervisor - since it can't
invoke non-virtualized BIOS code. So it does require a bit of
conditional logic, which is pretty easy, but we haven't got around to
doing yet.

Zach

2006-03-15 22:39:48

by Pavel Machek

[permalink] [raw]
Subject: Re: [RFC, PATCH 2/24] i386 Vmi config

On Po 13-03-06 10:00:27, Zachary Amsden wrote:
> Introduce the basic VMI sub-arch configuration dependencies. VMI kernels only
> are designed to run on modern hardware platforms. As such, they require a
> working APIC, and do not support some legacy functionality, including APM BIOS,
> ISA and MCA bus systems, PCI BIOS interfaces, or PnP BIOS (by implication of
> dropping ISA support). They also require a P6 series CPU.
>
> Signed-off-by: Zachary Amsden <[email protected]>
>
> +menu "VMI configurable support"
> + depends on X86_VMI
> +
> +config VMI_REQUIRE_HYPERVISOR
> + bool "Require hypervisor"
> + default n
> + help
> + This option forces the kernel to run with a hypervisor present.
> + The kernel will panic if booted on native hardware.

This uses spaces instead of tabs...


> @@ -270,7 +295,7 @@ config X86_VISWS_APIC
>
> config X86_MCE
> bool "Machine Check Exception"
> - depends on !X86_VOYAGER
> + depends on !(X86_VOYAGER)
> ---help---
> Machine Check Exception support allows the processor to notify the
> kernel if it detects a problem (e.g. overheating, component

And you probalby do not need this change.

> @@ -307,6 +332,7 @@ config X86_MCE_P4THERMAL
>
> config TOSHIBA
> tristate "Toshiba Laptop support"
> + depends on !X86_VMI
> ---help---
> This adds a driver to safely access the System Management Mode of
> the CPU on Toshiba portables with a genuine Toshiba BIOS. It

In the long run, we'd like to support toshiba laptops :-)

Pavel
--
135: uint Size;

2006-03-16 19:05:14

by Jan Engelhardt

[permalink] [raw]
Subject: Re: [RFC, PATCH 2/24] i386 Vmi config


>> Introduce the basic VMI sub-arch configuration dependencies. VMI
>> kernels only are designed to run on modern hardware platforms. As
>> such, they require a working APIC, and do not support some legacy
>> functionality, including APM BIOS, ISA and MCA bus systems, PCI BIOS
>> interfaces, or PnP BIOS (by implication of dropping ISA support).
>> They also require a P6 series CPU.
>

Maybe I'm mixing things, but if VMware is capable of running on a i586
(=P5?) (like AMD K6 - and it certainly is capable of doing that),
should not VMI be similar?

For example, the TM5800 CPU which is somewhat of a mixture between i586
and i686 but does not have an IOAPIC can run VMware machines (although
painfully slow).

And, the last thing, distributor kernels are often compiled for i586 to
be generic to all users. But some users may actually run them on i686,
and these users would like to have VMI (speculation :-). Which would
include a forceful patch to Kconfig to have the VMI option available
with CONFIG_M586.

>That's pretty bad because distributors need another kernel still. At least
>a working APIC isn't quite as common today as it should.


Jan Engelhardt
--

2006-03-17 00:20:57

by Zachary Amsden

[permalink] [raw]
Subject: Re: [RFC, PATCH 2/24] i386 Vmi config

Jan Engelhardt wrote:
> And, the last thing, distributor kernels are often compiled for i586 to
> be generic to all users. But some users may actually run them on i686,
> and these users would like to have VMI (speculation :-). Which would
> include a forceful patch to Kconfig to have the VMI option available
> with CONFIG_M586.
>

We can reenable all these things eventually. We hacked them out to get
around some of the awful hacks required for these older machines, (F00F
bug protection, broken APICs, etc).