Skip to contentSkip to conversation

RFC: [2.6 patch] i386: always enable REGPARM

PATCH Adrian Bunk 3 participants 3 messages Nov 17, 2004

lore
Share & tools
lore
#0 lore raw

Is there still a known reason to disable CONFIG_REGPARM on i386 with gcc 3?

If not, I'd suggest the patch below for -mm to find all remaining bugs (if there are any).

diffstat output:

 arch/i386/Kconfig          |   13 -------------
 arch/i386/Makefile         |    2 +-
 include/asm-i386/linkage.h |    5 +----
 include/asm-i386/module.h  |    8 +-------
 4 files changed, 3 insertions(+), 25 deletions(-)
arch/i386/Kconfig renamed from arch/i386/Kconfig.old +0 -13
@@ -876,19 +876,6 @@
 	depends on (((X86_SUMMIT || X86_GENERICARCH) && NUMA) || (X86 && EFI))
 	default y
 
-config REGPARM
-	bool "Use register arguments (EXPERIMENTAL)"
-	depends on EXPERIMENTAL
-	default n
-	help
-	Compile the kernel with -mregparm=3. This uses an different ABI
-	and passes the first three arguments of a function call in registers.
-	This will probably break binary only modules.
-
-	This feature is only enabled for gcc-3.0 and later - earlier compilers
-	generate incorrect output with certain kernel constructs when
-	-mregparm=3 is used.
-
 source "drivers/perfctr/Kconfig"
 
 config KERN_PHYS_OFFSET
arch/i386/Makefile renamed from arch/i386/Makefile.old +1 -1
@@ -55,7 +55,7 @@
 # -mregparm=3 works ok on gcc-3.0 and later
 #
 GCC_VERSION			:= $(call cc-version)
-cflags-$(CONFIG_REGPARM) 	+= $(shell if [ $(GCC_VERSION) -ge 0300 ] ; then echo "-mregparm=3"; fi ;)
+cflags-y		 	+= $(shell if [ $(GCC_VERSION) -ge 0300 ] ; then echo "-mregparm=3"; fi ;)
 
 # Disable unit-at-a-time mode, it makes gcc use a lot more stack
 # due to the lack of sharing of stacklots.
include/asm-i386/linkage.h renamed from include/asm-i386/linkage.h.old +1 -4
@@ -4,10 +4,7 @@
 #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
 #define FASTCALL(x)	x __attribute__((regparm(3)))
 #define fastcall	__attribute__((regparm(3)))
-
-#ifdef CONFIG_REGPARM
-# define prevent_tail_call(ret) __asm__ ("" : "=r" (ret) : "0" (ret))
-#endif
+#define prevent_tail_call(ret) __asm__ ("" : "=r" (ret) : "0" (ret))
 
 #ifdef CONFIG_X86_ALIGNMENT_16
 #define __ALIGN .align 16,0x90
include/asm-i386/module.h renamed from include/asm-i386/module.h.old +1 -7
@@ -56,18 +56,12 @@
 #error unknown processor family
 #endif
 
-#ifdef CONFIG_REGPARM
-#define MODULE_REGPARM "REGPARM "
-#else
-#define MODULE_REGPARM ""
-#endif
-
 #ifdef CONFIG_4KSTACKS
 #define MODULE_STACKSIZE "4KSTACKS "
 #else
 #define MODULE_STACKSIZE ""
 #endif
 
-#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_REGPARM MODULE_STACKSIZE
+#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_STACKSIZE
 
 #endif /* _ASM_I386_MODULE_H */
#1 lore raw
Quoted 3 lines · Adrian Bunk

Is there still a known reason to disable CONFIG_REGPARM on i386 with
gcc 3?

Well it lets us turn it off again if we suspect a regparm-related bug. That's happened a couple of times.

#2 lore raw
In reply to Adrian Bunk
Quoted 3 lines · Adrian Bunk

Is there still a known reason to disable CONFIG_REGPARM on i386 with gcc 3?

I wouldn't want to remove the config option, but we _can_ turn it around, and just force it to 'y'. And if nobody reports any strange problems in a few months, _then_ we can remove it.

I just make the diff be something like the appended.

Linus

----
===== arch/i386/Kconfig 1.134 vs edited =====

arch/i386/Kconfig +2 -11
@@ -862,17 +862,8 @@
 	default y
 
 config REGPARM
-	bool "Use register arguments (EXPERIMENTAL)"
-	depends on EXPERIMENTAL
-	default n
-	help
-	Compile the kernel with -mregparm=3. This uses an different ABI
-	and passes the first three arguments of a function call in registers.
-	This will probably break binary only modules.
-
-	This feature is only enabled for gcc-3.0 and later - earlier compilers
-	generate incorrect output with certain kernel constructs when
-	-mregparm=3 is used.
+	bool
+	default y
 
 endmenu