Comments on x86 Generic config

From: George (greerga@nidhogg.ham.muohio.edu)
Date: Thu Feb 17 2000 - 22:04:59 EST


After the discussions about the microcode driver and how it should be
available to everyone because of the 386 being generic condition, I made
these two patches. The second one is incremental.

The idea is to define CONFIG_MX86_GENERIC for those wishing to configure
for all machines. Then the specific processors can be changed to only
produce kernels for that specific processor. For example, the 386 option
gives MTRR and 686 microcode upload options currently. With this patch, it
can be given appropriate CPU classes. Also, the high memory options could
be restricted to just 686+ because I'm sure my lowly Pentium can't do it.
Also, 386's probably don't have an IO-APIC available. This would also allow
the spin_unlock optimization that is currently commented out because
Pentium Pro's have a problem with it.

Anyway, I haven't written help entries on these or adjusted the
dependencies as mentioned above yet. I'd like opinions first.

Patch against 2.3.46:

--- #1 ---

diff -upr linux/arch/i386/Makefile linux.x86/arch/i386/Makefile
--- linux/arch/i386/Makefile Thu Feb 17 23:14:08 2000
+++ linux.x86/arch/i386/Makefile Thu Feb 17 23:15:53 2000
@@ -31,6 +31,11 @@ CFLAGS := $(CFLAGS) $(CFLAGS_PIPE) $(CFL
 # prevent gcc from keeping the stack 16 byte aligned
 CFLAGS += $(shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; fi)
 
+ifdef CONFIG_MX86_GENERIC
+CFLAGS := $(CFLAGS) -m386 -DCPU=386
+AFLAGS := $(AFLAGS) -DCPU=386
+endif
+
 ifdef CONFIG_M386
 CFLAGS := $(CFLAGS) -m386 -DCPU=386
 AFLAGS := $(AFLAGS) -DCPU=386
diff -upr linux/arch/i386/config.in linux.x86/arch/i386/config.in
--- linux/arch/i386/config.in Thu Feb 17 23:15:12 2000
+++ linux.x86/arch/i386/config.in Thu Feb 17 23:20:42 2000
@@ -14,10 +14,15 @@ comment 'Code maturity level options'
 bool 'Prompt for development and/or incomplete code/drivers' CONFIG_EXPERIMENTAL
 endmenu
 
+#
+# CONFIG_MX86 would be better, but see a few lines above
+# for the problem with that. (CONFIG_X86)
+#
 mainmenu_option next_comment
 comment 'Processor type and features'
 choice 'Processor family' \
- "386 CONFIG_M386 \
+ "Generic CONFIG_MX86_GENERIC \
+ 386 CONFIG_M386 \
          486/Cx486 CONFIG_M486 \
          586/K5/5x86/6x86 CONFIG_M586 \
          Pentium/TSC CONFIG_M586TSC \
@@ -27,7 +32,7 @@ choice 'Processor family' \
 #
 # Define implied options from the CPU selection here
 #
-if [ "$CONFIG_M386" != "y" ]; then
+if [ "$CONFIG_M386" != "y" -a "$CONFIG_MX86_GENERIC" != "y" ]; then
    define_bool CONFIG_X86_WP_WORKS_OK y
    define_bool CONFIG_X86_INVLPG y
    define_bool CONFIG_X86_BSWAP y

--- #2 ---

diff -upr linux/arch/i386/config.in linux.x86/arch/i386/config.in
--- linux/arch/i386/config.in Thu Feb 17 23:37:54 2000
+++ linux.x86/arch/i386/config.in Thu Feb 17 23:36:25 2000
@@ -29,6 +29,23 @@ choice 'Processor family' \
          PPro/6x86MX CONFIG_M686 \
          K6/II/III CONFIG_MK6 \
          Athlon CONFIG_MK7" PPro
+
+#
+# Let the user customize their options here.
+#
+if [ "$CONFIG_MX86_GENERIC" = "y" ]; then
+ bool ' Require working memory write protect' CONFIG_X86_WP_WORKS_OK
+ bool ' Require INVLPG instruction' CONFIG_X86_INVLPG
+ bool ' Require BSWAP instruction' CONFIG_X86_BSWAP
+ bool ' Assume no POPAD bug' CONFIG_X86_POPAD_OK
+ bool ' Require Time Stamp Counter (TSC)' CONFIG_X86_TSC
+ if [ "$CONFIG_SMP" = "y" -o "$CONFIG_X86_LOCAL_APIC" = "y" ]; then
+ bool ' Require Pentium Pro or better APIC' CONFIG_X86_GOOD_APIC
+ fi
+ bool ' Require Page Global Enable (PGE)' CONFIG_X86_PGE
+ bool ' Use AMD 3D Now! extensions' CONFIG_X86_USE_3DNOW
+fi
+
 #
 # Define implied options from the CPU selection here
 #

The options marked 'require' above currently panic() if you don't really
have it. I didn't see one for the AMD 3D Now!, but I assume it'll Oops.

The above customization in the second patch would be handy for things like
the F00F bug where you have varying non-Pentium or the spin_unlock
optimization where people could pick it for generic kernels if they don't
have early PPro machines. The goal is smaller, faster, and more specific
while maintaining the usefulness of the generic kernel.

[Tested config, menuconfig, and oldconfig.]

-George Greer

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:20 EST