[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: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Matt Mackall and committed by
Linus Torvalds
22c4e308 18e92b12

+13 -1
+2 -1
arch/i386/kernel/Makefile
··· 7 7 obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ 8 8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \ 9 9 pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \ 10 - doublefault.o quirks.o i8237.o 10 + quirks.o i8237.o 11 11 12 12 obj-y += cpu/ 13 13 obj-y += timers/ ··· 33 33 obj-$(CONFIG_ACPI_SRAT) += srat.o 34 34 obj-$(CONFIG_HPET_TIMER) += time_hpet.o 35 35 obj-$(CONFIG_EFI) += efi.o efi_stub.o 36 + obj-$(CONFIG_DOUBLEFAULT) += doublefault.o 36 37 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 37 38 38 39 EXTRA_AFLAGS := -traditional
+2
arch/i386/kernel/cpu/common.c
··· 609 609 load_TR_desc(); 610 610 load_LDT(&init_mm.context); 611 611 612 + #ifdef CONFIG_DOUBLEFAULT 612 613 /* Set up doublefault TSS pointer in the GDT */ 613 614 __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss); 615 + #endif 614 616 615 617 /* Clear %fs and %gs. */ 616 618 asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs");
+9
init/Kconfig
··· 309 309 option for embedded systems with no facilities for reporting errors. 310 310 Just say Y. 311 311 312 + config DOUBLEFAULT 313 + depends X86 314 + default y if X86 315 + bool "Enable doublefault exception handler" if EMBEDDED 316 + help 317 + This option allows trapping of rare doublefault exceptions that 318 + would otherwise cause a system to silently reboot. Disabling this 319 + option saves about 4k. 320 + 312 321 config BASE_FULL 313 322 default y 314 323 bool "Enable full-sized data structures for core" if EMBEDDED