x86: split out dumpstack code from traps_xx.c
cover x86: split out dumpstack code from traps_xx.c
Hi Ingo,
I intend to keep looking for possibilities to bring traps_32.c and traps_64.c closer to each-other. One trivial way (from my point of view) is to split out code into separate files. These two patches split out a large piece of code that has nothing to do with hardware traps. Are you willing to take those two patches? Or are they to intrusive?
Patches are against the current master branch of the tip tree. The defconfigs compile fine and I ran some simple configs within qemu.
Greetings,
Alexander
PATCH 1/2 i386: split out dumpstack code from traps_32.c
The dumpstack code is logically quite independent from the hardware traps. Split it out into its own file.
--- arch/x86/kernel/Makefile | 2 +- arch/x86/kernel/dumpstack_32.c | 425 ++++++++++++++++++++++++++++++++++++++++ arch/x86/kernel/traps_32.c | 407 -------------------------------------- 3 files changed, 426 insertions(+), 408 deletions(-) create mode 100644 arch/x86/kernel/dumpstack_32.c
arch/x86/kernel/Makefile +1 -1
@@ -29,7 +29,7 @@ obj-y += time_$(BITS).o ioport.o ldt.o obj-y += setup.o i8259.o irqinit_$(BITS).o setup_percpu.o obj-$(CONFIG_X86_VISWS) += visws_quirks.o obj-$(CONFIG_X86_32) += probe_roms_32.o -obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o +obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o dumpstack_32.o obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o obj-y += bootflag.o e820.o
arch/x86/kernel/dumpstack_32.c new file +425 -0
425 lines not on this page · raw message
arch/x86/kernel/traps_32.c +0 -407
423 lines not on this page · raw message
Signature · 1 line
1.5.4.3
PATCH 2/2 x86_64: split out dumpstack code from traps_64.c
The dumpstack code is logically quite independent from the hardware traps. Split it out into its own file.
--- arch/x86/kernel/Makefile | 4 +- arch/x86/kernel/dumpstack_64.c | 567 ++++++++++++++++++++++++++++++++++++++++ arch/x86/kernel/traps_64.c | 549 -------------------------------------- 3 files changed, 569 insertions(+), 551 deletions(-) create mode 100644 arch/x86/kernel/dumpstack_64.c
arch/x86/kernel/Makefile +2 -2
@@ -24,12 +24,12 @@ CFLAGS_tsc.o := $(nostackp) CFLAGS_paravirt.o := $(nostackp) obj-y := process_$(BITS).o signal_$(BITS).o entry_$(BITS).o -obj-y += traps_$(BITS).o irq_$(BITS).o +obj-y += traps_$(BITS).o irq_$(BITS).o dumpstack_$(BITS).o obj-y += time_$(BITS).o ioport.o ldt.o obj-y += setup.o i8259.o irqinit_$(BITS).o setup_percpu.o obj-$(CONFIG_X86_VISWS) += visws_quirks.o obj-$(CONFIG_X86_32) += probe_roms_32.o -obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o dumpstack_32.o +obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_32.o obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o obj-y += bootflag.o e820.o
arch/x86/kernel/dumpstack_64.c new file +567 -0
567 lines not on this page · raw message
arch/x86/kernel/traps_64.c +0 -549
565 lines not on this page · raw message
Signature · 1 line
1.5.4.3
Quoted 8 lines · Alexander van Heukelum
Hi Ingo,
I intend to keep looking for possibilities to bring
traps_32.candtraps_64.ccloser to each-other. One trivial way (from my point of view) is to split out code into separate files. These two patches split out a large piece of code that has nothing to do with hardware traps. Are you willing to take those two patches? Or are they to intrusive?
they are not intrusive at all! The right way to do such things is to keep them in reasonably small files.
Quoted 2 lines
Patches are against the current master branch of the tip tree. The defconfigs compile fine and I ran some simple configs within qemu.
would be nice to bring dumpstack_32.c and dumpstack_64.c together as well. While some of the details like IST stack logic (which dont exist on 32-bit) are special, most of the glue, the iterators, the boot parameters, and even the output should be unified some more.
Ingo
Ingo Molnar
AppliedQuoted 2 lines · Alexander van Heukelum
Patches are against the current master branch of the tip tree. The defconfigs compile fine and I ran some simple configs within qemu.
applied to tip/x86/traps:
# 9bb2b4f: x86_64: split out dumpstack code from traps_64.c # f616942: i386: split out dumpstack code from traps_32.c
there were some interactions with other branches:
054efa5: Merge branch 'tracing/nmisafe' into x86/traps 9ecb7cf: Merge branch 'kmemcheck' into x86/traps 8955b63: Merge branch 'core/signal' into x86/traps
ff1b7a8: Merge branch 'x86/signal' into x86/traps 76b22d8: Merge commit 'v2.6.27-rc8' into x86/traps
b58c936: Merge branch 'x86/core' into x86/traps
I hope i sorted them out right.
Ingo