Commit 22c4e308 authored by Matt Mackall's avatar Matt Mackall Committed by Linus Torvalds

[PATCH] tiny: Make x86 doublefault handling optional

This adds configurable support for doublefault reporting on x86

add/remove: 0/3 grow/shrink: 0/1 up/down: 0/-13048 (-13048)
function                                     old     new   delta
cpu_init                                     846     786     -60
doublefault_fn                               188       -    -188
doublefault_stack                           4096       -   -4096
doublefault_tss                             8704       -   -8704
Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 18e92b12
...@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds ...@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds
obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \
ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \ ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \ pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \
doublefault.o quirks.o i8237.o quirks.o i8237.o
obj-y += cpu/ obj-y += cpu/
obj-y += timers/ obj-y += timers/
...@@ -33,6 +33,7 @@ obj-y += sysenter.o vsyscall.o ...@@ -33,6 +33,7 @@ obj-y += sysenter.o vsyscall.o
obj-$(CONFIG_ACPI_SRAT) += srat.o obj-$(CONFIG_ACPI_SRAT) += srat.o
obj-$(CONFIG_HPET_TIMER) += time_hpet.o obj-$(CONFIG_HPET_TIMER) += time_hpet.o
obj-$(CONFIG_EFI) += efi.o efi_stub.o obj-$(CONFIG_EFI) += efi.o efi_stub.o
obj-$(CONFIG_DOUBLEFAULT) += doublefault.o
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
EXTRA_AFLAGS := -traditional EXTRA_AFLAGS := -traditional
......
...@@ -609,8 +609,10 @@ void __devinit cpu_init(void) ...@@ -609,8 +609,10 @@ void __devinit cpu_init(void)
load_TR_desc(); load_TR_desc();
load_LDT(&init_mm.context); load_LDT(&init_mm.context);
#ifdef CONFIG_DOUBLEFAULT
/* Set up doublefault TSS pointer in the GDT */ /* Set up doublefault TSS pointer in the GDT */
__set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss); __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss);
#endif
/* Clear %fs and %gs. */ /* Clear %fs and %gs. */
asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs"); asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs");
......
...@@ -309,6 +309,15 @@ config BUG ...@@ -309,6 +309,15 @@ config BUG
option for embedded systems with no facilities for reporting errors. option for embedded systems with no facilities for reporting errors.
Just say Y. Just say Y.
config DOUBLEFAULT
depends X86
default y if X86
bool "Enable doublefault exception handler" if EMBEDDED
help
This option allows trapping of rare doublefault exceptions that
would otherwise cause a system to silently reboot. Disabling this
option saves about 4k.
config BASE_FULL config BASE_FULL
default y default y
bool "Enable full-sized data structures for core" if EMBEDDED bool "Enable full-sized data structures for core" if EMBEDDED
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment