This series kill the old i386 and x86_64 directories.
The relevant files are moved and adapted and
Kconfig.debug was consolidated (thanks to Randy).
I had to modify both the top-lvel Makefile and the kconfig
Makefile to accomplish this. It was done in such a way that
it is trivial for other archs to use the same mechanism
should they have the need.
To solve the defconfig issue (i386 and x86_64 cannot share one)
the arch/x86/configs/ directory were introduced. This has
been used by other archs for some time now but x86 had not had
the need until now.
The Kconfig files could be consolidated much more - I only
did the minimal changes to make it work in the new place.
Total diffstat (in git format):
Makefile | 7 ++-
arch/i386/.gitignore | 1 -
arch/{i386 => x86}/Kconfig.cpu | 0
arch/{i386 => x86}/Kconfig.debug | 51 +++++++++++++---
arch/{i386/Kconfig => x86/Kconfig.i386} | 4 +-
arch/{x86_64/Kconfig => x86/Kconfig.x86_64} | 6 +--
arch/x86/Makefile | 16 +++++
arch/{i386/Makefile => x86/Makefile_32} | 7 +--
arch/{i386/Makefile.cpu => x86/Makefile_32.cpu} | 0
arch/{x86_64/Makefile => x86/Makefile_64} | 5 +-
.../{i386/defconfig => x86/configs/i386_defconfig} | 0
.../defconfig => x86/configs/x86_64_defconfig} | 0
arch/x86_64/.gitignore | 1 -
arch/x86_64/Kconfig.debug | 61 --------------------
scripts/kconfig/Makefile | 35 +++++++-----
15 files changed, 89 insertions(+), 105 deletions(-)
Patches follows.
The full serie can be pulled from:
git://git.kernel.org/pub/scm/linux/kernel/git/sam/x86.git
Note: The serie were slightly modfied compared to the fist published
version.
Sam
-
From 9d80894bef9805c70795f73ce1758d2a9e4cb077 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Thu, 25 Oct 2007 19:42:04 +0200
Subject: [PATCH] x86: move i386 and x86_64 Makefiles to arch/x86
Moving the ARCH specific Makefiles for i386 and x86_64
required a litle bit tweaking in the top-lvel Makefile.
SRCARCH is now set in the top-level Makefile
because we need this info to include the correct
arch Makefile.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
Makefile | 7 +++++--
arch/x86/Makefile | 13 +++++++++++++
arch/{i386/Makefile => x86/Makefile_32} | 7 ++-----
arch/{i386/Makefile.cpu => x86/Makefile_32.cpu} | 0
arch/{x86_64/Makefile => x86/Makefile_64} | 5 +----
5 files changed, 21 insertions(+), 11 deletions(-)
create mode 100644 arch/x86/Makefile
rename arch/{i386/Makefile => x86/Makefile_32} (98%)
rename arch/{i386/Makefile.cpu => x86/Makefile_32.cpu} (100%)
rename arch/{x86_64/Makefile => x86/Makefile_64} (99%)
diff --git a/Makefile b/Makefile
index 2a47290..8816060 100644
--- a/Makefile
+++ b/Makefile
@@ -196,6 +196,9 @@ CROSS_COMPILE ?=
UTS_MACHINE := $(ARCH)
SRCARCH := $(ARCH)
+# for i386 and x86_64 we use SRCARCH equal to x86
+SRCARCH := $(if $(filter x86_64 i386,$(SRCARCH)),x86,$(SRCARCH))
+
KCONFIG_CONFIG ?= .config
# SHELL used by kbuild
@@ -418,7 +421,7 @@ ifeq ($(config-targets),1)
# Read arch specific Makefile to set KBUILD_DEFCONFIG as needed.
# KBUILD_DEFCONFIG may point out an alternative default configuration
# used for 'make defconfig'
-include $(srctree)/arch/$(ARCH)/Makefile
+include $(srctree)/arch/$(SRCARCH)/Makefile
export KBUILD_DEFCONFIG
config %config: scripts_basic outputmakefile FORCE
@@ -497,7 +500,7 @@ else
KBUILD_CFLAGS += -O2
endif
-include $(srctree)/arch/$(ARCH)/Makefile
+include $(srctree)/arch/$(SRCARCH)/Makefile
ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS += ...From 81ee173db26217c54731bbc4c5b864fa01c6f28c Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Thu, 25 Oct 2007 20:31:19 +0200
Subject: [PATCH] x86: move defconfig files for i386 and x86_64 to x86
With some small changes to kconfig makefile we can now
locate the defconfig files for i386 and x86_64 in
the configs/ subdirectory under x86.
make ARCH=i386 defconfig and make defconfig
works as expected also after this change.
But arch maintainers shall now update a defconfig file in
the configs/ directory.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
arch/x86/Makefile | 5 ++++-
.../{i386/defconfig => x86/configs/i386_defconfig} | 0
.../defconfig => x86/configs/x86_64_defconfig} | 0
scripts/kconfig/Makefile | 6 +++---
4 files changed, 7 insertions(+), 4 deletions(-)
rename arch/{i386/defconfig => x86/configs/i386_defconfig} (100%)
rename arch/{x86_64/defconfig => x86/configs/x86_64_defconfig} (100%)
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 65077d7..3095973 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -1,6 +1,9 @@
# Unified Makefile for i386 and x86_64
-# No need to remake these files
+# select defconfig based on actual architecture
+KBUILD_DEFCONFIG := $(ARCH)_defconfig
+
+# # No need to remake these files
$(srctree)/arch/x86/Makefile%: ;
ifeq ($(ARCH),i386)
diff --git a/arch/i386/defconfig b/arch/x86/configs/i386_defconfig
similarity index 100%
rename from arch/i386/defconfig
rename to arch/x86/configs/i386_defconfig
diff --git a/arch/x86_64/defconfig b/arch/x86/configs/x86_64_defconfig
similarity index 100%
rename from arch/x86_64/defconfig
rename to arch/x86/configs/x86_64_defconfig
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 83c5e76..fbf39cc 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -60,12 +60,12 @@ defconfig: $(obj)/conf
ifeq ($(KBUILD_DEFCONFIG),)
$< -d ...From 16b853f53463e43bfce341965ac10a78a3755a14 Mon Sep 17 00:00:00 2001
From: Randy Dunlap <rdunlap@xenotime.net>
Date: Wed, 24 Oct 2007 15:50:43 -0700
Subject: [PATCH] x86: unification of i386 and x86_64 Kconfig.debug
Adding proper dependencies so the two Kconfig.debug files
are now identical.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
arch/i386/Kconfig.debug | 51 ++++++++++++++++++++++++++++-------
arch/x86_64/Kconfig | 4 ---
arch/{i386 => x86_64}/Kconfig.debug | 51 ++++++++++++++++++++++++++++-------
3 files changed, 82 insertions(+), 24 deletions(-)
copy arch/{i386 => x86_64}/Kconfig.debug (65%)
diff --git a/arch/i386/Kconfig.debug b/arch/i386/Kconfig.debug
index f03531e..970b2de 100644
--- a/arch/i386/Kconfig.debug
+++ b/arch/i386/Kconfig.debug
@@ -1,14 +1,14 @@
menu "Kernel hacking"
config TRACE_IRQFLAGS_SUPPORT
- bool
- default y
+ def_bool y
source "lib/Kconfig.debug"
config EARLY_PRINTK
bool "Early printk" if EMBEDDED && DEBUG_KERNEL
default y
+ depends on X86_32
help
Write kernel log output directly into the VGA buffer or to a serial
port.
@@ -37,10 +37,12 @@ config DEBUG_STACK_USAGE
comment "Page alloc debug is incompatible with Software Suspend on i386"
depends on DEBUG_KERNEL && HIBERNATION
+ depends on X86_32
config DEBUG_PAGEALLOC
bool "Debug page memory allocations"
depends on DEBUG_KERNEL && !HIBERNATION && !HUGETLBFS
+ depends on X86_32
help
Unmap pages from the kernel linear mapping after free_pages().
This results in a large slowdown, but helps to find certain types
@@ -59,6 +61,7 @@ config DEBUG_RODATA
config 4KSTACKS
bool "Use 4Kb for kernel stacks instead of 8Kb"
depends on DEBUG_KERNEL
+ depends on X86_32
help
If you say Y here the kernel will use a 4Kb stacksize for the
kernel stack attached to each process/thread. This facilitates
@@ -67,22 +70,50 @@ config ...... why disabling early_printk for x86_64? YH -
It doesn't do that. EARLY_PRINTK for x86_64 lives in arch/x86_64/Kconfig (i.e., a different file). Patches welcome. --- ~Randy -
I think Sam's patchset already takes care of that. -hpa -
arch/x86_64/Kconfig.debug will be removed. in 5/6 patch. and in the same patch arch/i386/Kconfig.debug will be arch/x86/Kconfig.debug and it make EARLY_PRINTK depend on x86_32 YH -
The abovce disables the prompt but arch/x86_64/Kconifg.x86_64 set the value to y so EARLY_PRINTK is always enabled (see answer I wrote to Kay). This patchset leaves room for futher clean-up which is welcome. The aim was to unify the two Kconfig.debug file where Randy did a quick and good job. The aim was not maximum unification of the Kconfig files used for the two ARCH's this comes later - and there are much to be done here. Please let me know if you see other issues woth the patch serie. Sam -
From 7cadfc607d91f536996a46c186711c82378e75ec Mon Sep 17 00:00:00 2001 From: Sam Ravnborg <sam@ravnborg.org> Date: Thu, 25 Oct 2007 20:42:18 +0200 Subject: [PATCH] kconfig: small code refactoring in kconfig Makefile Do not hardcode the arch/$(ARCH)/Kconfig name all over Signed-off-by: Sam Ravnborg <sam@ravnborg.org> --- scripts/kconfig/Makefile | 28 +++++++++++++++------------- 1 files changed, 15 insertions(+), 13 deletions(-) diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index fbf39cc..3c9db07 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -4,23 +4,25 @@ PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config +Kconfig := arch/$(ARCH)/Kconfig + xconfig: $(obj)/qconf - $< arch/$(ARCH)/Kconfig + $< $(Kconfig) gconfig: $(obj)/gconf - $< arch/$(ARCH)/Kconfig + $< $(Kconfig) menuconfig: $(obj)/mconf - $< arch/$(ARCH)/Kconfig + $< $(Kconfig) config: $(obj)/conf - $< arch/$(ARCH)/Kconfig + $< $(Kconfig) oldconfig: $(obj)/conf - $< -o arch/$(ARCH)/Kconfig + $< -o $(Kconfig) silentoldconfig: $(obj)/conf - $< -s arch/$(ARCH)/Kconfig + $< -s $(Kconfig) # Create new linux.po file # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files @@ -45,27 +47,27 @@ update-po-config: $(obj)/kxgettext PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig randconfig: $(obj)/conf - $< -r arch/$(ARCH)/Kconfig + $< -r $(Kconfig) allyesconfig: $(obj)/conf - $< -y arch/$(ARCH)/Kconfig + $< -y $(Kconfig) allnoconfig: $(obj)/conf - $< -n arch/$(ARCH)/Kconfig + $< -n $(Kconfig) allmodconfig: $(obj)/conf - $< -m arch/$(ARCH)/Kconfig + $< -m $(Kconfig) defconfig: $(obj)/conf ifeq ($(KBUILD_DEFCONFIG),) - $< -d arch/$(ARCH)/Kconfig + $< -d $(Kconfig) else @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" - $(Q)$< -D arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) arch/$(ARCH)/Kconfig + $(Q)$< -D ...
From 6654a98eb8587f0538904c9bdb9aeaf9d577f182 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Thu, 25 Oct 2007 21:04:16 +0200
Subject: [PATCH] x86: move i386 and x86_64 Kconfig files to x86 directory
After a small change in kconfig Makefile we could
move all x86 Kconfig files to x86 directory.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
arch/{i386 => x86}/Kconfig.cpu | 0
arch/{i386 => x86}/Kconfig.debug | 0
arch/{i386/Kconfig => x86/Kconfig.i386} | 4 +-
arch/{x86_64/Kconfig => x86/Kconfig.x86_64} | 2 +-
arch/x86_64/Kconfig.debug | 119 ---------------------------
scripts/kconfig/Makefile | 7 ++-
6 files changed, 9 insertions(+), 123 deletions(-)
rename arch/{i386 => x86}/Kconfig.cpu (100%)
rename arch/{i386 => x86}/Kconfig.debug (100%)
rename arch/{i386/Kconfig => x86/Kconfig.i386} (99%)
rename arch/{x86_64/Kconfig => x86/Kconfig.x86_64} (99%)
delete mode 100644 arch/x86_64/Kconfig.debug
diff --git a/arch/i386/Kconfig.cpu b/arch/x86/Kconfig.cpu
similarity index 100%
rename from arch/i386/Kconfig.cpu
rename to arch/x86/Kconfig.cpu
diff --git a/arch/i386/Kconfig.debug b/arch/x86/Kconfig.debug
similarity index 100%
rename from arch/i386/Kconfig.debug
rename to arch/x86/Kconfig.debug
diff --git a/arch/i386/Kconfig b/arch/x86/Kconfig.i386
similarity index 99%
rename from arch/i386/Kconfig
rename to arch/x86/Kconfig.i386
index b4437ce..7331efe 100644
--- a/arch/i386/Kconfig
+++ b/arch/x86/Kconfig.i386
@@ -287,7 +287,7 @@ config ES7000_CLUSTERED_APIC
default y
depends on SMP && X86_ES7000 && MPENTIUMIII
-source "arch/i386/Kconfig.cpu"
+source "arch/x86/Kconfig.cpu"
config HPET_TIMER
bool "HPET Timer Support"
@@ -1272,7 +1272,7 @@ source "fs/Kconfig"
source "kernel/Kconfig.instrumentation"
-source "arch/i386/Kconfig.debug"
+source "arch/x86/Kconfig.debug"
source "security/Kconfig"
diff --git a/arch/x86_64/Kconfig ...arch/i386/Kconfig.debug will be arch/x86/Kconfig.debug in it, EARLY_PRINTK will depend on X86_32 YH -
| but EARLY_PRINTK for x86_64 is here ------------------------------- ^ so we didn't lose it. However, they should live in the same place so that confusion like this does not continue. You can make a patch. or I can. or Sam can. or someone else can... --- ~Randy -
in PATCH 3/5 that Sam sent out.
From 16b853f53463e43bfce341965ac10a78a3755a14 Mon Sep 17 00:00:00 2001
From: Randy Dunlap <rdunlap@xenotime.net>
Date: Wed, 24 Oct 2007 15:50:43 -0700
Subject: [PATCH] x86: unification of i386 and x86_64 Kconfig.debug
Adding proper dependencies so the two Kconfig.debug files
are now identical.
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
arch/i386/Kconfig.debug | 51 ++++++++++++++++++++++++++++-------
arch/x86_64/Kconfig | 4 ---
arch/{i386 => x86_64}/Kconfig.debug | 51 ++++++++++++++++++++++++++++-------
3 files changed, 82 insertions(+), 24 deletions(-)
copy arch/{i386 => x86_64}/Kconfig.debug (65%)
...
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 308970a..1bc0268 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -97,10 +97,6 @@ config X86_CMPXCHG
bool
default y
-config EARLY_PRINTK
- bool
- default y
-
config GENERIC_ISA_DMA
bool
default y
but
in git
http://git.kernel.org/?p=linux/kernel/git/sam/x86.git;a=commitdiff;h=d013a27cb79a01b32...
doesn't include that removing..
interesting.
YH
-
Oh, OK. We'll get it fixed (if it needs fixing). --- ~Randy -
That's the bug Kay noticed. It should not have been removed so I fixedit and pushed out a new change. Again - please see reply to Kay and read the [GIT PULL] mail. Sam -
Good. that compiles without problem on x86_64. BTW: why not using Kconfig.x86_32 instead of Kconfig.i386? YH YH -
See scripts/kconfig/Makefile: Here we use (in the x86 case): Kconfig := arch/$(SRCARCH)/Kconfig.$(ARCH) So the "i386" comes from ARCH equals to i386. The advantage is that the patch to kconfig is generic so other arch's can use SRCARCH if they like without having a hardcoded list in the kconfig Makefile. Sam -
From c54efdb8c66e1850be60e2320a24c96957c87372 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg <sam@ravnborg.org> Date: Thu, 25 Oct 2007 21:06:56 +0200 Subject: [PATCH] x86: kill the old i386 and x86_64 directories The last remaining bits were two .gitignore files. Deleting them and we have no more use of the directories. git will most likely not delete the directories for you, so this is a thing to do manually (or create a fresh clone). Signed-off-by: Sam Ravnborg <sam@ravnborg.org> --- arch/i386/.gitignore | 1 - arch/x86_64/.gitignore | 1 - 2 files changed, 0 insertions(+), 2 deletions(-) delete mode 100644 arch/i386/.gitignore delete mode 100644 arch/x86_64/.gitignore diff --git a/arch/i386/.gitignore b/arch/i386/.gitignore deleted file mode 100644 index 36ef4c3..0000000 --- a/arch/i386/.gitignore +++ /dev/null @@ -1 +0,0 @@ -boot diff --git a/arch/x86_64/.gitignore b/arch/x86_64/.gitignore deleted file mode 100644 index 36ef4c3..0000000 --- a/arch/x86_64/.gitignore +++ /dev/null @@ -1 +0,0 @@ -boot -- 1.5.3.4.1157.g0e74-dirty -
Hey Sam, I get this after a simple pull from your tree and a: make clean; make: LD init/built-in.o LD .tmp_vmlinux1 arch/x86/kernel/head_64.o: In function `early_idt_handler': (.text.head+0x1e5): undefined reference to `early_printk' arch/x86/kernel/head64.o: In function `x86_64_start_kernel': head64.c:(.init.text+0xa8): undefined reference to `early_printk' arch/x86/kernel/built-in.o: In function `early_panic': (.text+0x9c07): undefined reference to `early_printk' arch/x86/mm/built-in.o: In function `init_memory_mapping': (.init.text+0xc0a): undefined reference to `early_printk' make: *** [.tmp_vmlinux1] Error 1 Cheers, Kay -
I think this is my changes to the Kconfig.debug path I received from Randy. Checking.... Yup - reverting my change bring back EARLY_PRINTK wich is always required on x86_64. I will redo the series - and build test a bit more. Thanks. Sam -
Sam, Thanks for doing this. I think the last remaining bit to cleanup is the symlink from arch/x86/boot/bzImage. Now that the old directories are gone it does not make much sense to keep them alive. Andrew will survive it :) Please send it Linus wards and feel free to add my Acked-by to all of them. Thanks, tglx -
Hi Linus.
This patch serie kill the old i386 and x86_64 directories.
Introducing a few trivial changes in top-level Makefile
and kconfig Makefile allows us to move all files to
arch/x86/ where they belong.
Kay Sievers hit a bug in the first patch-set - this is now fixed and
the updated patch set is uploaded to my x86.git tree.
Build tested on both i386 and x86_64.
I test builded a few other archs just to check that I did not break them.
Shortlog:
Randy Dunlap (1):
x86: unification of i386 and x86_64 Kconfig.debug
Sam Ravnborg (5):
x86: move i386 and x86_64 Makefiles to arch/x86
x86: move defconfig files for i386 and x86_64 to x86
kconfig: small code refactoring in kconfig Makefile
x86: move i386 and x86_64 Kconfig files to x86 directory
x86: kill the old i386 and x86_64 directories
diffstat:
Makefile | 7 ++-
arch/i386/.gitignore | 1 -
arch/{i386 => x86}/Kconfig.cpu | 0
arch/{i386 => x86}/Kconfig.debug | 51 +++++++++++++---
arch/{i386/Kconfig => x86/Kconfig.i386} | 4 +-
arch/{x86_64/Kconfig => x86/Kconfig.x86_64} | 2 +-
arch/x86/Makefile | 16 +++++
arch/{i386/Makefile => x86/Makefile_32} | 7 +--
arch/{i386/Makefile.cpu => x86/Makefile_32.cpu} | 0
arch/{x86_64/Makefile => x86/Makefile_64} | 5 +-
.../{i386/defconfig => x86/configs/i386_defconfig} | 0
.../defconfig => x86/configs/x86_64_defconfig} | 0
arch/x86_64/.gitignore | 1 -
arch/x86_64/Kconfig.debug | 61 --------------------
scripts/kconfig/Makefile | 35 +++++++-----
15 files changed, 89 insertions(+), 101 deletions(-)
A nice patch serie that deletes more lines than it adds.
Under normal circumstances I would not send this to you after the
merge ...It is not just Andrew I'm afraid. We got a Debian bug-report too when we did not have the symlink and I asume this is true for several others. We should let it stay in 2.6.24 and remove the symlink for 2.6.25 IMO. Sam -
On Fri, 26 Oct 2007 08:23:36 +0200 I would put it on the list and leave it for a couple of years so that people using old distros have all upgraded at that point. Adrian will remember to delete it if its on the list to go .... -
On Fri, 26 Oct 2007 08:23:36 +0200 that's the worst of all things to do... either make a change in ONE go, when you do all the changes anyway (users will remmeber 2.6.24 was the unification kernel, but 2.6.25 breaking stuff will be a total surprise)... or keep them around forever. As long as it works, nobody will change the scripts. -
