aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/Kconfig42
-rw-r--r--arch/i386/Makefile13
-rw-r--r--arch/i386/boot/bootsect.S2
-rw-r--r--arch/i386/boot/compressed/misc.c1
-rw-r--r--arch/i386/boot/setup.S6
-rw-r--r--arch/i386/boot/video.S18
-rw-r--r--arch/i386/kernel/Makefile1
-rw-r--r--arch/i386/kernel/acpi/boot.c2
-rw-r--r--arch/i386/kernel/apic.c2
-rw-r--r--arch/i386/kernel/cpu/amd.c4
-rw-r--r--arch/i386/kernel/cpu/mtrr/cyrix.c4
-rw-r--r--arch/i386/kernel/cpu/mtrr/generic.c4
-rw-r--r--arch/i386/kernel/cpu/mtrr/main.c14
-rw-r--r--arch/i386/kernel/cpu/proc.c2
-rw-r--r--arch/i386/kernel/entry.S304
-rw-r--r--arch/i386/kernel/head.S2
-rw-r--r--arch/i386/kernel/i386_ksyms.c4
-rw-r--r--arch/i386/kernel/io_apic.c2
-rw-r--r--arch/i386/kernel/kprobes.c7
-rw-r--r--arch/i386/kernel/nmi.c11
-rw-r--r--arch/i386/kernel/process.c17
-rw-r--r--arch/i386/kernel/ptrace.c24
-rw-r--r--arch/i386/kernel/reboot.c2
-rw-r--r--arch/i386/kernel/reboot_fixups.c56
-rw-r--r--arch/i386/kernel/smpboot.c3
-rw-r--r--arch/i386/kernel/syscall_table.S291
-rw-r--r--arch/i386/kernel/time.c2
-rw-r--r--arch/i386/kernel/time_hpet.c48
-rw-r--r--arch/i386/kernel/timers/timer_hpet.c11
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c2
-rw-r--r--arch/i386/kernel/traps.c6
-rw-r--r--arch/i386/kernel/vm86.c21
-rw-r--r--arch/i386/oprofile/nmi_timer_int.c2
-rw-r--r--arch/i386/pci/irq.c2
34 files changed, 513 insertions, 419 deletions
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 17a0cbce6f30..e382f32d435e 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -183,7 +183,7 @@ config M386
183 - "Winchip-C6" for original IDT Winchip. 183 - "Winchip-C6" for original IDT Winchip.
184 - "Winchip-2" for IDT Winchip 2. 184 - "Winchip-2" for IDT Winchip 2.
185 - "Winchip-2A" for IDT Winchips with 3dNow! capabilities. 185 - "Winchip-2A" for IDT Winchips with 3dNow! capabilities.
186 - "MediaGX/Geode" for Cyrix MediaGX aka Geode. 186 - "GeodeGX1" for Geode GX1 (Cyrix MediaGX).
187 - "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3. 187 - "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3.
188 - "VIA C3-2 for VIA C3-2 "Nehemiah" (model 9 and above). 188 - "VIA C3-2 for VIA C3-2 "Nehemiah" (model 9 and above).
189 189
@@ -311,12 +311,10 @@ config MWINCHIP3D
311 stores for this CPU, which can increase performance of some 311 stores for this CPU, which can increase performance of some
312 operations. 312 operations.
313 313
314config MGEODE 314config MGEODEGX1
315 bool "MediaGX/Geode" 315 bool "GeodeGX1"
316 help 316 help
317 Select this for a Cyrix MediaGX aka Geode chip. Linux and GCC 317 Select this for a Geode GX1 (Cyrix MediaGX) chip.
318 treat this chip as a 586TSC with some extended instructions
319 and alignment reqirements.
320 318
321config MCYRIXIII 319config MCYRIXIII
322 bool "CyrixIII/VIA-C3" 320 bool "CyrixIII/VIA-C3"
@@ -368,7 +366,7 @@ config X86_L1_CACHE_SHIFT
368 int 366 int
369 default "7" if MPENTIUM4 || X86_GENERIC 367 default "7" if MPENTIUM4 || X86_GENERIC
370 default "4" if X86_ELAN || M486 || M386 368 default "4" if X86_ELAN || M486 || M386
371 default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE 369 default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODEGX1
372 default "6" if MK7 || MK8 || MPENTIUMM 370 default "6" if MK7 || MK8 || MPENTIUMM
373 371
374config RWSEM_GENERIC_SPINLOCK 372config RWSEM_GENERIC_SPINLOCK
@@ -387,7 +385,7 @@ config GENERIC_CALIBRATE_DELAY
387 385
388config X86_PPRO_FENCE 386config X86_PPRO_FENCE
389 bool 387 bool
390 depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODE 388 depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODEGX1
391 default y 389 default y
392 390
393config X86_F00F_BUG 391config X86_F00F_BUG
@@ -417,7 +415,7 @@ config X86_POPAD_OK
417 415
418config X86_ALIGNMENT_16 416config X86_ALIGNMENT_16
419 bool 417 bool
420 depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODE 418 depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODEGX1
421 default y 419 default y
422 420
423config X86_GOOD_APIC 421config X86_GOOD_APIC
@@ -442,7 +440,7 @@ config X86_USE_3DNOW
442 440
443config X86_OOSTORE 441config X86_OOSTORE
444 bool 442 bool
445 depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MGEODE) && MTRR 443 depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6) && MTRR
446 default y 444 default y
447 445
448config HPET_TIMER 446config HPET_TIMER
@@ -578,7 +576,7 @@ config X86_VISWS_APIC
578 576
579config X86_TSC 577config X86_TSC
580 bool 578 bool
581 depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODE) && !X86_NUMAQ 579 depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1) && !X86_NUMAQ
582 default y 580 default y
583 581
584config X86_MCE 582config X86_MCE
@@ -653,6 +651,24 @@ config I8K
653 Say Y if you intend to run this kernel on a Dell Inspiron 8000. 651 Say Y if you intend to run this kernel on a Dell Inspiron 8000.
654 Say N otherwise. 652 Say N otherwise.
655 653
654config X86_REBOOTFIXUPS
655 bool "Enable X86 board specific fixups for reboot"
656 depends on X86
657 default n
658 ---help---
659 This enables chipset and/or board specific fixups to be done
660 in order to get reboot to work correctly. This is only needed on
661 some combinations of hardware and BIOS. The symptom, for which
662 this config is intended, is when reboot ends with a stalled/hung
663 system.
664
665 Currently, the only fixup is for the Geode GX1/CS5530A/TROM2.1.
666 combination.
667
668 Say Y if you want to enable the fixup. Currently, it's safe to
669 enable this option even if you don't need it.
670 Say N otherwise.
671
656config MICROCODE 672config MICROCODE
657 tristate "/dev/cpu/microcode - Intel IA32 CPU microcode support" 673 tristate "/dev/cpu/microcode - Intel IA32 CPU microcode support"
658 ---help--- 674 ---help---
@@ -1155,6 +1171,10 @@ source "drivers/pci/pcie/Kconfig"
1155 1171
1156source "drivers/pci/Kconfig" 1172source "drivers/pci/Kconfig"
1157 1173
1174config ISA_DMA_API
1175 bool
1176 default y
1177
1158config ISA 1178config ISA
1159 bool "ISA support" 1179 bool "ISA support"
1160 depends on !(X86_VOYAGER || X86_VISWS) 1180 depends on !(X86_VOYAGER || X86_VISWS)
diff --git a/arch/i386/Makefile b/arch/i386/Makefile
index 314c7146e9bf..1c36ca332a96 100644
--- a/arch/i386/Makefile
+++ b/arch/i386/Makefile
@@ -14,7 +14,7 @@
14# 19990713 Artur Skawina <skawina@geocities.com> 14# 19990713 Artur Skawina <skawina@geocities.com>
15# Added '-march' and '-mpreferred-stack-boundary' support 15# Added '-march' and '-mpreferred-stack-boundary' support
16# 16#
17# Kianusch Sayah Karadji <kianusch@sk-tech.net> 17# 20050320 Kianusch Sayah Karadji <kianusch@sk-tech.net>
18# Added support for GEODE CPU 18# Added support for GEODE CPU
19 19
20LDFLAGS := -m elf_i386 20LDFLAGS := -m elf_i386
@@ -54,8 +54,8 @@ cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)
54# AMD Elan support 54# AMD Elan support
55cflags-$(CONFIG_X86_ELAN) += -march=i486 55cflags-$(CONFIG_X86_ELAN) += -march=i486
56 56
57# MediaGX aka Geode support 57# Geode GX1 support
58cflags-$(CONFIG_MGEODE) += $(call cc-option,-march=pentium-mmx,-march=i586) 58cflags-$(CONFIG_MGEODEGX1) += $(call cc-option,-march=pentium-mmx,-march=i486)
59 59
60# -mregparm=3 works ok on gcc-3.0 and later 60# -mregparm=3 works ok on gcc-3.0 and later
61# 61#
@@ -123,7 +123,7 @@ AFLAGS += $(mflags-y)
123boot := arch/i386/boot 123boot := arch/i386/boot
124 124
125.PHONY: zImage bzImage compressed zlilo bzlilo \ 125.PHONY: zImage bzImage compressed zlilo bzlilo \
126 zdisk bzdisk fdimage fdimage144 fdimage288 install 126 zdisk bzdisk fdimage fdimage144 fdimage288 install kernel_install
127 127
128all: bzImage 128all: bzImage
129 129
@@ -145,8 +145,9 @@ zdisk bzdisk: vmlinux
145fdimage fdimage144 fdimage288: vmlinux 145fdimage fdimage144 fdimage288: vmlinux
146 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ 146 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
147 147
148install: 148install: vmlinux
149 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ 149install kernel_install:
150 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
150 151
151prepare: include/asm-$(ARCH)/asm_offsets.h 152prepare: include/asm-$(ARCH)/asm_offsets.h
152CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h 153CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h
diff --git a/arch/i386/boot/bootsect.S b/arch/i386/boot/bootsect.S
index ba9fe14db6a9..011b7a4993d4 100644
--- a/arch/i386/boot/bootsect.S
+++ b/arch/i386/boot/bootsect.S
@@ -83,7 +83,7 @@ bugger_off_msg:
83 .ascii "\n" 83 .ascii "\n"
84 .ascii "Remove disk and press any key to reboot . . .\r\n" 84 .ascii "Remove disk and press any key to reboot . . .\r\n"
85 .byte 0 85 .byte 0
86 86
87 87
88 # Kernel attributes; used by setup 88 # Kernel attributes; used by setup
89 89
diff --git a/arch/i386/boot/compressed/misc.c b/arch/i386/boot/compressed/misc.c
index fa67045234a3..cedc55cc47de 100644
--- a/arch/i386/boot/compressed/misc.c
+++ b/arch/i386/boot/compressed/misc.c
@@ -12,7 +12,6 @@
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <linux/vmalloc.h> 13#include <linux/vmalloc.h>
14#include <linux/tty.h> 14#include <linux/tty.h>
15#include <video/edid.h>
16#include <asm/io.h> 15#include <asm/io.h>
17 16
18/* 17/*
diff --git a/arch/i386/boot/setup.S b/arch/i386/boot/setup.S
index a934ab32bf8e..caa1fde6904e 100644
--- a/arch/i386/boot/setup.S
+++ b/arch/i386/boot/setup.S
@@ -164,7 +164,7 @@ ramdisk_max: .long (-__PAGE_OFFSET-(512 << 20)-1) & 0x7fffffff
164trampoline: call start_of_setup 164trampoline: call start_of_setup
165 .align 16 165 .align 16
166 # The offset at this point is 0x240 166 # The offset at this point is 0x240
167 .space (0x7ff-0x240+1) # E820 & EDD space (ending at 0x7ff) 167 .space (0xeff-0x240+1) # E820 & EDD space (ending at 0xeff)
168# End of setup header ##################################################### 168# End of setup header #####################################################
169 169
170start_of_setup: 170start_of_setup:
@@ -333,9 +333,9 @@ jmpe820:
333 # sizeof(e820rec). 333 # sizeof(e820rec).
334 # 334 #
335good820: 335good820:
336 movb (E820NR), %al # up to 32 entries 336 movb (E820NR), %al # up to 128 entries
337 cmpb $E820MAX, %al 337 cmpb $E820MAX, %al
338 jnl bail820 338 jae bail820
339 339
340 incb (E820NR) 340 incb (E820NR)
341 movw %di, %ax 341 movw %di, %ax
diff --git a/arch/i386/boot/video.S b/arch/i386/boot/video.S
index 925d3f5a3824..0587477c99f2 100644
--- a/arch/i386/boot/video.S
+++ b/arch/i386/boot/video.S
@@ -1924,36 +1924,36 @@ skip10: movb %ah, %al
1924 ret 1924 ret
1925 1925
1926store_edid: 1926store_edid:
1927 pushw %es # just save all registers 1927 pushw %es # just save all registers
1928 pushw %ax 1928 pushw %ax
1929 pushw %bx 1929 pushw %bx
1930 pushw %cx 1930 pushw %cx
1931 pushw %dx 1931 pushw %dx
1932 pushw %di 1932 pushw %di
1933 1933
1934 pushw %fs 1934 pushw %fs
1935 popw %es 1935 popw %es
1936 1936
1937 movl $0x13131313, %eax # memset block with 0x13 1937 movl $0x13131313, %eax # memset block with 0x13
1938 movw $32, %cx 1938 movw $32, %cx
1939 movw $0x140, %di 1939 movw $0x140, %di
1940 cld 1940 cld
1941 rep 1941 rep
1942 stosl 1942 stosl
1943 1943
1944 movw $0x4f15, %ax # do VBE/DDC 1944 movw $0x4f15, %ax # do VBE/DDC
1945 movw $0x01, %bx 1945 movw $0x01, %bx
1946 movw $0x00, %cx 1946 movw $0x00, %cx
1947 movw $0x01, %dx 1947 movw $0x01, %dx
1948 movw $0x140, %di 1948 movw $0x140, %di
1949 int $0x10 1949 int $0x10
1950 1950
1951 popw %di # restore all registers 1951 popw %di # restore all registers
1952 popw %dx 1952 popw %dx
1953 popw %cx 1953 popw %cx
1954 popw %bx 1954 popw %bx
1955 popw %ax 1955 popw %ax
1956 popw %es 1956 popw %es
1957 ret 1957 ret
1958 1958
1959# VIDEO_SELECT-only variables 1959# VIDEO_SELECT-only variables
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index aacdae6f372d..0fbcfe00dd8d 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -23,6 +23,7 @@ obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o
23obj-$(CONFIG_X86_MPPARSE) += mpparse.o 23obj-$(CONFIG_X86_MPPARSE) += mpparse.o
24obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o 24obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o
25obj-$(CONFIG_X86_IO_APIC) += io_apic.o 25obj-$(CONFIG_X86_IO_APIC) += io_apic.o
26obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups.o
26obj-$(CONFIG_X86_NUMAQ) += numaq.o 27obj-$(CONFIG_X86_NUMAQ) += numaq.o
27obj-$(CONFIG_X86_SUMMIT_NUMA) += summit.o 28obj-$(CONFIG_X86_SUMMIT_NUMA) += summit.o
28obj-$(CONFIG_KPROBES) += kprobes.o 29obj-$(CONFIG_KPROBES) += kprobes.o
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 53eb5cfd5b63..848bb97af7ca 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -650,7 +650,7 @@ acpi_find_rsdp (void)
650 */ 650 */
651 rsdp_phys = acpi_scan_rsdp (0, 0x400); 651 rsdp_phys = acpi_scan_rsdp (0, 0x400);
652 if (!rsdp_phys) 652 if (!rsdp_phys)
653 rsdp_phys = acpi_scan_rsdp (0xE0000, 0xFFFFF); 653 rsdp_phys = acpi_scan_rsdp (0xE0000, 0x20000);
654 654
655 return rsdp_phys; 655 return rsdp_phys;
656} 656}
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index e3879f7625c2..d509836b70c3 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -1265,8 +1265,6 @@ int __init APIC_init_uniprocessor (void)
1265 1265
1266 setup_local_APIC(); 1266 setup_local_APIC();
1267 1267
1268 if (nmi_watchdog == NMI_LOCAL_APIC)
1269 check_nmi_watchdog();
1270#ifdef CONFIG_X86_IO_APIC 1268#ifdef CONFIG_X86_IO_APIC
1271 if (smp_found_config) 1269 if (smp_found_config)
1272 if (!skip_ioapic_setup && nr_ioapics) 1270 if (!skip_ioapic_setup && nr_ioapics)
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c
index 8d182e875cd7..16dbc4151be4 100644
--- a/arch/i386/kernel/cpu/amd.c
+++ b/arch/i386/kernel/cpu/amd.c
@@ -24,7 +24,7 @@ __asm__(".align 4\nvide: ret");
24 24
25static void __init init_amd(struct cpuinfo_x86 *c) 25static void __init init_amd(struct cpuinfo_x86 *c)
26{ 26{
27#ifdef CONFIG_SMP 27#ifdef CONFIG_X86_SMP
28 int cpu = c == &boot_cpu_data ? 0 : c - cpu_data; 28 int cpu = c == &boot_cpu_data ? 0 : c - cpu_data;
29#endif 29#endif
30 u32 l, h; 30 u32 l, h;
@@ -198,7 +198,7 @@ static void __init init_amd(struct cpuinfo_x86 *c)
198 c->x86_num_cores = 1; 198 c->x86_num_cores = 1;
199 } 199 }
200 200
201#ifdef CONFIG_SMP 201#ifdef CONFIG_X86_SMP
202 /* 202 /*
203 * On a AMD dual core setup the lower bits of the APIC id 203 * On a AMD dual core setup the lower bits of the APIC id
204 * distingush the cores. Assumes number of cores is a power 204 * distingush the cores. Assumes number of cores is a power
diff --git a/arch/i386/kernel/cpu/mtrr/cyrix.c b/arch/i386/kernel/cpu/mtrr/cyrix.c
index 933b0dd62f48..9027a987006b 100644
--- a/arch/i386/kernel/cpu/mtrr/cyrix.c
+++ b/arch/i386/kernel/cpu/mtrr/cyrix.c
@@ -218,12 +218,12 @@ typedef struct {
218 mtrr_type type; 218 mtrr_type type;
219} arr_state_t; 219} arr_state_t;
220 220
221static arr_state_t arr_state[8] __initdata = { 221static arr_state_t arr_state[8] __devinitdata = {
222 {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, 222 {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL},
223 {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL} 223 {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}
224}; 224};
225 225
226static unsigned char ccr_state[7] __initdata = { 0, 0, 0, 0, 0, 0, 0 }; 226static unsigned char ccr_state[7] __devinitdata = { 0, 0, 0, 0, 0, 0, 0 };
227 227
228static void cyrix_set_all(void) 228static void cyrix_set_all(void)
229{ 229{
diff --git a/arch/i386/kernel/cpu/mtrr/generic.c b/arch/i386/kernel/cpu/mtrr/generic.c
index 9f7a7ea6388d..f468a979e9aa 100644
--- a/arch/i386/kernel/cpu/mtrr/generic.c
+++ b/arch/i386/kernel/cpu/mtrr/generic.c
@@ -124,8 +124,8 @@ int generic_get_free_region(unsigned long base, unsigned long size)
124 return -ENOSPC; 124 return -ENOSPC;
125} 125}
126 126
127void generic_get_mtrr(unsigned int reg, unsigned long *base, 127static void generic_get_mtrr(unsigned int reg, unsigned long *base,
128 unsigned int *size, mtrr_type * type) 128 unsigned int *size, mtrr_type * type)
129{ 129{
130 unsigned int mask_lo, mask_hi, base_lo, base_hi; 130 unsigned int mask_lo, mask_hi, base_lo, base_hi;
131 131
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c
index 54999e4c55fd..e1c2042b9b7e 100644
--- a/arch/i386/kernel/cpu/mtrr/main.c
+++ b/arch/i386/kernel/cpu/mtrr/main.c
@@ -72,17 +72,21 @@ void set_mtrr_ops(struct mtrr_ops * ops)
72static int have_wrcomb(void) 72static int have_wrcomb(void)
73{ 73{
74 struct pci_dev *dev; 74 struct pci_dev *dev;
75 u8 rev;
75 76
76 if ((dev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) != NULL) { 77 if ((dev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) != NULL) {
77 /* ServerWorks LE chipsets have problems with write-combining 78 /* ServerWorks LE chipsets < rev 6 have problems with write-combining
78 Don't allow it and leave room for other chipsets to be tagged */ 79 Don't allow it and leave room for other chipsets to be tagged */
79 if (dev->vendor == PCI_VENDOR_ID_SERVERWORKS && 80 if (dev->vendor == PCI_VENDOR_ID_SERVERWORKS &&
80 dev->device == PCI_DEVICE_ID_SERVERWORKS_LE) { 81 dev->device == PCI_DEVICE_ID_SERVERWORKS_LE) {
81 printk(KERN_INFO "mtrr: Serverworks LE detected. Write-combining disabled.\n"); 82 pci_read_config_byte(dev, PCI_CLASS_REVISION, &rev);
82 pci_dev_put(dev); 83 if (rev <= 5) {
83 return 0; 84 printk(KERN_INFO "mtrr: Serverworks LE rev < 6 detected. Write-combining disabled.\n");
85 pci_dev_put(dev);
86 return 0;
87 }
84 } 88 }
85 /* Intel 450NX errata # 23. Non ascending cachline evictions to 89 /* Intel 450NX errata # 23. Non ascending cacheline evictions to
86 write combining memory may resulting in data corruption */ 90 write combining memory may resulting in data corruption */
87 if (dev->vendor == PCI_VENDOR_ID_INTEL && 91 if (dev->vendor == PCI_VENDOR_ID_INTEL &&
88 dev->device == PCI_DEVICE_ID_INTEL_82451NX) { 92 dev->device == PCI_DEVICE_ID_INTEL_82451NX) {
diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c
index 4f28eba7fb8a..7323c19f354e 100644
--- a/arch/i386/kernel/cpu/proc.c
+++ b/arch/i386/kernel/cpu/proc.c
@@ -25,7 +25,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
25 "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", "pbe", 25 "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", "pbe",
26 26
27 /* AMD-defined */ 27 /* AMD-defined */
28 "pni", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 28 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
29 NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, 29 NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL,
30 NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL, 30 NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL,
31 NULL, "fxsr_opt", NULL, NULL, NULL, "lm", "3dnowext", "3dnow", 31 NULL, "fxsr_opt", NULL, NULL, NULL, "lm", "3dnowext", "3dnow",
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index 3c73dc865ead..a991d4e5edd2 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -260,11 +260,9 @@ restore_nocheck:
260.section .fixup,"ax" 260.section .fixup,"ax"
261iret_exc: 261iret_exc:
262 sti 262 sti
263 movl $__USER_DS, %edx 263 pushl $0 # no error code
264 movl %edx, %ds 264 pushl $do_iret_error
265 movl %edx, %es 265 jmp error_code
266 movl $11,%eax
267 call do_exit
268.previous 266.previous
269.section __ex_table,"a" 267.section __ex_table,"a"
270 .align 4 268 .align 4
@@ -516,8 +514,6 @@ debug_stack_correct:
516 xorl %edx,%edx # error code 0 514 xorl %edx,%edx # error code 0
517 movl %esp,%eax # pt_regs pointer 515 movl %esp,%eax # pt_regs pointer
518 call do_debug 516 call do_debug
519 testl %eax,%eax
520 jnz restore_all
521 jmp ret_from_exception 517 jmp ret_from_exception
522 518
523/* 519/*
@@ -598,8 +594,6 @@ ENTRY(int3)
598 xorl %edx,%edx # zero error code 594 xorl %edx,%edx # zero error code
599 movl %esp,%eax # pt_regs pointer 595 movl %esp,%eax # pt_regs pointer
600 call do_int3 596 call do_int3
601 testl %eax,%eax
602 jnz restore_all
603 jmp ret_from_exception 597 jmp ret_from_exception
604 598
605ENTRY(overflow) 599ENTRY(overflow)
@@ -658,296 +652,6 @@ ENTRY(spurious_interrupt_bug)
658 pushl $do_spurious_interrupt_bug 652 pushl $do_spurious_interrupt_bug
659 jmp error_code 653 jmp error_code
660 654
661.data 655#include "syscall_table.S"
662ENTRY(sys_call_table)
663 .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */
664 .long sys_exit
665 .long sys_fork
666 .long sys_read
667 .long sys_write
668 .long sys_open /* 5 */
669 .long sys_close
670 .long sys_waitpid
671 .long sys_creat
672 .long sys_link
673 .long sys_unlink /* 10 */
674 .long sys_execve
675 .long sys_chdir
676 .long sys_time
677 .long sys_mknod
678 .long sys_chmod /* 15 */
679 .long sys_lchown16
680 .long sys_ni_syscall /* old break syscall holder */
681 .long sys_stat
682 .long sys_lseek
683 .long sys_getpid /* 20 */
684 .long sys_mount
685 .long sys_oldumount
686 .long sys_setuid16
687 .long sys_getuid16
688 .long sys_stime /* 25 */
689 .long sys_ptrace
690 .long sys_alarm
691 .long sys_fstat
692 .long sys_pause
693 .long sys_utime /* 30 */
694 .long sys_ni_syscall /* old stty syscall holder */
695 .long sys_ni_syscall /* old gtty syscall holder */
696 .long sys_access
697 .long sys_nice
698 .long sys_ni_syscall /* 35 - old ftime syscall holder */
699 .long sys_sync
700 .long sys_kill
701 .long sys_rename
702 .long sys_mkdir
703 .long sys_rmdir /* 40 */
704 .long sys_dup
705 .long sys_pipe
706 .long sys_times
707 .long sys_ni_syscall /* old prof syscall holder */
708 .long sys_brk /* 45 */
709 .long sys_setgid16
710 .long sys_getgid16
711 .long sys_signal
712 .long sys_geteuid16
713 .long sys_getegid16 /* 50 */
714 .long sys_acct
715 .long sys_umount /* recycled never used phys() */
716 .long sys_ni_syscall /* old lock syscall holder */
717 .long sys_ioctl
718 .long sys_fcntl /* 55 */
719 .long sys_ni_syscall /* old mpx syscall holder */
720 .long sys_setpgid
721 .long sys_ni_syscall /* old ulimit syscall holder */
722 .long sys_olduname
723 .long sys_umask /* 60 */
724 .long sys_chroot
725 .long sys_ustat
726 .long sys_dup2
727 .long sys_getppid
728 .long sys_getpgrp /* 65 */
729 .long sys_setsid
730 .long sys_sigaction
731 .long sys_sgetmask
732 .long sys_ssetmask
733 .long sys_setreuid16 /* 70 */
734 .long sys_setregid16
735 .long sys_sigsuspend
736 .long sys_sigpending
737 .long sys_sethostname
738 .long sys_setrlimit /* 75 */
739 .long sys_old_getrlimit
740 .long sys_getrusage
741 .long sys_gettimeofday
742 .long sys_settimeofday
743 .long sys_getgroups16 /* 80 */
744 .long sys_setgroups16
745 .long old_select
746 .long sys_symlink
747 .long sys_lstat
748 .long sys_readlink /* 85 */
749 .long sys_uselib
750 .long sys_swapon
751 .long sys_reboot
752 .long old_readdir
753 .long old_mmap /* 90 */
754 .long sys_munmap
755 .long sys_truncate
756 .long sys_ftruncate
757 .long sys_fchmod
758 .long sys_fchown16 /* 95 */
759 .long sys_getpriority
760 .long sys_setpriority
761 .long sys_ni_syscall /* old profil syscall holder */
762 .long sys_statfs
763 .long sys_fstatfs /* 100 */
764 .long sys_ioperm
765 .long sys_socketcall
766 .long sys_syslog
767 .long sys_setitimer
768 .long sys_getitimer /* 105 */
769 .long sys_newstat
770 .long sys_newlstat
771 .long sys_newfstat
772 .long sys_uname
773 .long sys_iopl /* 110 */
774 .long sys_vhangup
775 .long sys_ni_syscall /* old "idle" system call */
776 .long sys_vm86old
777 .long sys_wait4
778 .long sys_swapoff /* 115 */
779 .long sys_sysinfo
780 .long sys_ipc
781 .long sys_fsync
782 .long sys_sigreturn
783 .long sys_clone /* 120 */
784 .long sys_setdomainname
785 .long sys_newuname
786 .long sys_modify_ldt
787 .long sys_adjtimex
788 .long sys_mprotect /* 125 */
789 .long sys_sigprocmask
790 .long sys_ni_syscall /* old "create_module" */
791 .long sys_init_module
792 .long sys_delete_module
793 .long sys_ni_syscall /* 130: old "get_kernel_syms" */
794 .long sys_quotactl
795 .long sys_getpgid
796 .long sys_fchdir
797 .long sys_bdflush
798 .long sys_sysfs /* 135 */
799 .long sys_personality
800 .long sys_ni_syscall /* reserved for afs_syscall */
801 .long sys_setfsuid16
802 .long sys_setfsgid16
803 .long sys_llseek /* 140 */
804 .long sys_getdents
805 .long sys_select
806 .long sys_flock
807 .long sys_msync
808 .long sys_readv /* 145 */
809 .long sys_writev
810 .long sys_getsid
811 .long sys_fdatasync
812 .long sys_sysctl
813 .long sys_mlock /* 150 */
814 .long sys_munlock
815 .long sys_mlockall
816 .long sys_munlockall
817 .long sys_sched_setparam
818 .long sys_sched_getparam /* 155 */
819 .long sys_sched_setscheduler
820 .long sys_sched_getscheduler
821 .long sys_sched_yield
822 .long sys_sched_get_priority_max
823 .long sys_sched_get_priority_min /* 160 */
824 .long sys_sched_rr_get_interval
825 .long sys_nanosleep
826 .long sys_mremap
827 .long sys_setresuid16
828 .long sys_getresuid16 /* 165 */
829 .long sys_vm86
830 .long sys_ni_syscall /* Old sys_query_module */
831 .long sys_poll
832 .long sys_nfsservctl
833 .long sys_setresgid16 /* 170 */
834 .long sys_getresgid16
835 .long sys_prctl
836 .long sys_rt_sigreturn
837 .long sys_rt_sigaction
838 .long sys_rt_sigprocmask /* 175 */
839 .long sys_rt_sigpending
840 .long sys_rt_sigtimedwait
841 .long sys_rt_sigqueueinfo
842 .long sys_rt_sigsuspend
843 .long sys_pread64 /* 180 */
844 .long sys_pwrite64
845 .long sys_chown16
846 .long sys_getcwd
847 .long sys_capget
848 .long sys_capset /* 185 */
849 .long sys_sigaltstack
850 .long sys_sendfile
851 .long sys_ni_syscall /* reserved for streams1 */
852 .long sys_ni_syscall /* reserved for streams2 */
853 .long sys_vfork /* 190 */
854 .long sys_getrlimit
855 .long sys_mmap2
856 .long sys_truncate64
857 .long sys_ftruncate64
858 .long sys_stat64 /* 195 */
859 .long sys_lstat64
860 .long sys_fstat64
861 .long sys_lchown
862 .long sys_getuid
863 .long sys_getgid /* 200 */
864 .long sys_geteuid
865 .long sys_getegid
866 .long sys_setreuid
867 .long sys_setregid
868 .long sys_getgroups /* 205 */
869 .long sys_setgroups
870 .long sys_fchown
871 .long sys_setresuid
872 .long sys_getresuid
873 .long sys_setresgid /* 210 */
874 .long sys_getresgid
875 .long sys_chown
876 .long sys_setuid
877 .long sys_setgid
878 .long sys_setfsuid /* 215 */
879 .long sys_setfsgid
880 .long sys_pivot_root
881 .long sys_mincore
882 .long sys_madvise
883 .long sys_getdents64 /* 220 */
884 .long sys_fcntl64
885 .long sys_ni_syscall /* reserved for TUX */
886 .long sys_ni_syscall
887 .long sys_gettid
888 .long sys_readahead /* 225 */
889 .long sys_setxattr
890 .long sys_lsetxattr
891 .long sys_fsetxattr
892 .long sys_getxattr
893 .long sys_lgetxattr /* 230 */
894 .long sys_fgetxattr
895 .long sys_listxattr
896 .long sys_llistxattr
897 .long sys_flistxattr
898 .long sys_removexattr /* 235 */
899 .long sys_lremovexattr
900 .long sys_fremovexattr
901 .long sys_tkill
902 .long sys_sendfile64
903 .long sys_futex /* 240 */
904 .long sys_sched_setaffinity
905 .long sys_sched_getaffinity
906 .long sys_set_thread_area
907 .long sys_get_thread_area
908 .long sys_io_setup /* 245 */
909 .long sys_io_destroy
910 .long sys_io_getevents
911 .long sys_io_submit
912 .long sys_io_cancel
913 .long sys_fadvise64 /* 250 */
914 .long sys_ni_syscall
915 .long sys_exit_group
916 .long sys_lookup_dcookie
917 .long sys_epoll_create
918 .long sys_epoll_ctl /* 255 */
919 .long sys_epoll_wait
920 .long sys_remap_file_pages
921 .long sys_set_tid_address
922 .long sys_timer_create
923 .long sys_timer_settime /* 260 */
924 .long sys_timer_gettime
925 .long sys_timer_getoverrun
926 .long sys_timer_delete
927 .long sys_clock_settime
928 .long sys_clock_gettime /* 265 */
929 .long sys_clock_getres
930 .long sys_clock_nanosleep
931 .long sys_statfs64
932 .long sys_fstatfs64
933 .long sys_tgkill /* 270 */
934 .long sys_utimes
935 .long sys_fadvise64_64
936 .long sys_ni_syscall /* sys_vserver */
937 .long sys_mbind
938 .long sys_get_mempolicy
939 .long sys_set_mempolicy
940 .long sys_mq_open
941 .long sys_mq_unlink
942 .long sys_mq_timedsend
943 .long sys_mq_timedreceive /* 280 */
944 .long sys_mq_notify
945 .long sys_mq_getsetattr
946 .long sys_ni_syscall /* reserved for kexec */
947 .long sys_waitid
948 .long sys_ni_syscall /* 285 */ /* available */
949 .long sys_add_key
950 .long sys_request_key
951 .long sys_keyctl
952 656
953syscall_table_size=(.-sys_call_table) 657syscall_table_size=(.-sys_call_table)
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index d273fd746192..e966fc8c44c4 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -380,6 +380,7 @@ rp_sidt:
380 ALIGN 380 ALIGN
381ignore_int: 381ignore_int:
382 cld 382 cld
383#ifdef CONFIG_PRINTK
383 pushl %eax 384 pushl %eax
384 pushl %ecx 385 pushl %ecx
385 pushl %edx 386 pushl %edx
@@ -400,6 +401,7 @@ ignore_int:
400 popl %edx 401 popl %edx
401 popl %ecx 402 popl %ecx
402 popl %eax 403 popl %eax
404#endif
403 iret 405 iret
404 406
405/* 407/*
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
index 14ec354bec92..903190a4b3ff 100644
--- a/arch/i386/kernel/i386_ksyms.c
+++ b/arch/i386/kernel/i386_ksyms.c
@@ -169,10 +169,6 @@ EXPORT_SYMBOL(rtc_lock);
169EXPORT_SYMBOL_GPL(set_nmi_callback); 169EXPORT_SYMBOL_GPL(set_nmi_callback);
170EXPORT_SYMBOL_GPL(unset_nmi_callback); 170EXPORT_SYMBOL_GPL(unset_nmi_callback);
171 171
172#undef memcmp
173extern int memcmp(const void *,const void *,__kernel_size_t);
174EXPORT_SYMBOL(memcmp);
175
176EXPORT_SYMBOL(register_die_notifier); 172EXPORT_SYMBOL(register_die_notifier);
177#ifdef CONFIG_HAVE_DEC_LOCK 173#ifdef CONFIG_HAVE_DEC_LOCK
178EXPORT_SYMBOL(_atomic_dec_and_lock); 174EXPORT_SYMBOL(_atomic_dec_and_lock);
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 5e0d55be5435..7a324e8b86f9 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -2175,7 +2175,6 @@ static inline void check_timer(void)
2175 disable_8259A_irq(0); 2175 disable_8259A_irq(0);
2176 setup_nmi(); 2176 setup_nmi();
2177 enable_8259A_irq(0); 2177 enable_8259A_irq(0);
2178 check_nmi_watchdog();
2179 } 2178 }
2180 return; 2179 return;
2181 } 2180 }
@@ -2198,7 +2197,6 @@ static inline void check_timer(void)
2198 add_pin_to_irq(0, 0, pin2); 2197 add_pin_to_irq(0, 0, pin2);
2199 if (nmi_watchdog == NMI_IO_APIC) { 2198 if (nmi_watchdog == NMI_IO_APIC) {
2200 setup_nmi(); 2199 setup_nmi();
2201 check_nmi_watchdog();
2202 } 2200 }
2203 return; 2201 return;
2204 } 2202 }
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index 671681659243..59ff9b455069 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -217,6 +217,13 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs)
217 *tos &= ~(TF_MASK | IF_MASK); 217 *tos &= ~(TF_MASK | IF_MASK);
218 *tos |= kprobe_old_eflags; 218 *tos |= kprobe_old_eflags;
219 break; 219 break;
220 case 0xc3: /* ret/lret */
221 case 0xcb:
222 case 0xc2:
223 case 0xca:
224 regs->eflags &= ~TF_MASK;
225 /* eip is already adjusted, no more changes required*/
226 return;
220 case 0xe8: /* call relative - Fix return addr */ 227 case 0xe8: /* call relative - Fix return addr */
221 *tos = orig_eip + (*tos - copy_eip); 228 *tos = orig_eip + (*tos - copy_eip);
222 break; 229 break;
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index 2f89d000f954..2c0ee9c2d020 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -102,20 +102,21 @@ int nmi_active;
102 (P4_CCCR_OVF_PMI0|P4_CCCR_THRESHOLD(15)|P4_CCCR_COMPLEMENT| \ 102 (P4_CCCR_OVF_PMI0|P4_CCCR_THRESHOLD(15)|P4_CCCR_COMPLEMENT| \
103 P4_CCCR_COMPARE|P4_CCCR_REQUIRED|P4_CCCR_ESCR_SELECT(4)|P4_CCCR_ENABLE) 103 P4_CCCR_COMPARE|P4_CCCR_REQUIRED|P4_CCCR_ESCR_SELECT(4)|P4_CCCR_ENABLE)
104 104
105int __init check_nmi_watchdog (void) 105static int __init check_nmi_watchdog(void)
106{ 106{
107 unsigned int prev_nmi_count[NR_CPUS]; 107 unsigned int prev_nmi_count[NR_CPUS];
108 int cpu; 108 int cpu;
109 109
110 printk(KERN_INFO "testing NMI watchdog ... "); 110 if (nmi_watchdog == NMI_NONE)
111 return 0;
112
113 printk(KERN_INFO "Testing NMI watchdog ... ");
111 114
112 for (cpu = 0; cpu < NR_CPUS; cpu++) 115 for (cpu = 0; cpu < NR_CPUS; cpu++)
113 prev_nmi_count[cpu] = per_cpu(irq_stat, cpu).__nmi_count; 116 prev_nmi_count[cpu] = per_cpu(irq_stat, cpu).__nmi_count;
114 local_irq_enable(); 117 local_irq_enable();
115 mdelay((10*1000)/nmi_hz); // wait 10 ticks 118 mdelay((10*1000)/nmi_hz); // wait 10 ticks
116 119
117 /* FIXME: Only boot CPU is online at this stage. Check CPUs
118 as they come up. */
119 for (cpu = 0; cpu < NR_CPUS; cpu++) { 120 for (cpu = 0; cpu < NR_CPUS; cpu++) {
120#ifdef CONFIG_SMP 121#ifdef CONFIG_SMP
121 /* Check cpu_callin_map here because that is set 122 /* Check cpu_callin_map here because that is set
@@ -139,6 +140,8 @@ int __init check_nmi_watchdog (void)
139 140
140 return 0; 141 return 0;
141} 142}
143/* This needs to happen later in boot so counters are working */
144late_initcall(check_nmi_watchdog);
142 145
143static int __init setup_nmi_watchdog(char *str) 146static int __init setup_nmi_watchdog(char *str)
144{ 147{
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index b2203e21acb3..96e3ea6b17c7 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -400,11 +400,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
400 int err; 400 int err;
401 401
402 childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p->thread_info)) - 1; 402 childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p->thread_info)) - 1;
403 *childregs = *regs;
404 childregs->eax = 0;
405 childregs->esp = esp;
406
407 p->thread.esp = (unsigned long) childregs;
408 /* 403 /*
409 * The below -8 is to reserve 8 bytes on top of the ring0 stack. 404 * The below -8 is to reserve 8 bytes on top of the ring0 stack.
410 * This is necessary to guarantee that the entire "struct pt_regs" 405 * This is necessary to guarantee that the entire "struct pt_regs"
@@ -415,7 +410,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
415 * "struct pt_regs" is possible, but they may contain the 410 * "struct pt_regs" is possible, but they may contain the
416 * completely wrong values. 411 * completely wrong values.
417 */ 412 */
418 p->thread.esp0 = (unsigned long) (childregs+1) - 8; 413 childregs = (struct pt_regs *) ((unsigned long) childregs - 8);
414 *childregs = *regs;
415 childregs->eax = 0;
416 childregs->esp = esp;
417
418 p->thread.esp = (unsigned long) childregs;
419 p->thread.esp0 = (unsigned long) (childregs+1);
419 420
420 p->thread.eip = (unsigned long) ret_from_fork; 421 p->thread.eip = (unsigned long) ret_from_fork;
421 422
@@ -611,8 +612,8 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
611 * Save away %fs and %gs. No need to save %es and %ds, as 612 * Save away %fs and %gs. No need to save %es and %ds, as
612 * those are always kernel segments while inside the kernel. 613 * those are always kernel segments while inside the kernel.
613 */ 614 */
614 asm volatile("movl %%fs,%0":"=m" (*(int *)&prev->fs)); 615 asm volatile("mov %%fs,%0":"=m" (prev->fs));
615 asm volatile("movl %%gs,%0":"=m" (*(int *)&prev->gs)); 616 asm volatile("mov %%gs,%0":"=m" (prev->gs));
616 617
617 /* 618 /*
618 * Restore %fs and %gs if needed. 619 * Restore %fs and %gs if needed.
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c
index b2f17640ceff..e34f651fa13c 100644
--- a/arch/i386/kernel/ptrace.c
+++ b/arch/i386/kernel/ptrace.c
@@ -16,6 +16,7 @@
16#include <linux/security.h> 16#include <linux/security.h>
17#include <linux/audit.h> 17#include <linux/audit.h>
18#include <linux/seccomp.h> 18#include <linux/seccomp.h>
19#include <linux/signal.h>
19 20
20#include <asm/uaccess.h> 21#include <asm/uaccess.h>
21#include <asm/pgtable.h> 22#include <asm/pgtable.h>
@@ -511,7 +512,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
511 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ 512 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
512 case PTRACE_CONT: /* restart after signal. */ 513 case PTRACE_CONT: /* restart after signal. */
513 ret = -EIO; 514 ret = -EIO;
514 if ((unsigned long) data > _NSIG) 515 if (!valid_signal(data))
515 break; 516 break;
516 if (request == PTRACE_SYSCALL) { 517 if (request == PTRACE_SYSCALL) {
517 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 518 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
@@ -543,7 +544,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
543 544
544 case PTRACE_SINGLESTEP: /* set the trap flag. */ 545 case PTRACE_SINGLESTEP: /* set the trap flag. */
545 ret = -EIO; 546 ret = -EIO;
546 if ((unsigned long) data > _NSIG) 547 if (!valid_signal(data))
547 break; 548 break;
548 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 549 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
549 set_singlestep(child); 550 set_singlestep(child);
@@ -682,24 +683,18 @@ void do_syscall_trace(struct pt_regs *regs, int entryexit)
682 /* do the secure computing check first */ 683 /* do the secure computing check first */
683 secure_computing(regs->orig_eax); 684 secure_computing(regs->orig_eax);
684 685
685 if (unlikely(current->audit_context)) { 686 if (unlikely(current->audit_context) && entryexit)
686 if (!entryexit) 687 audit_syscall_exit(current, AUDITSC_RESULT(regs->eax), regs->eax);
687 audit_syscall_entry(current, regs->orig_eax,
688 regs->ebx, regs->ecx,
689 regs->edx, regs->esi);
690 else
691 audit_syscall_exit(current, regs->eax);
692 }
693 688
694 if (!(current->ptrace & PT_PTRACED)) 689 if (!(current->ptrace & PT_PTRACED))
695 return; 690 goto out;
696 691
697 /* Fake a debug trap */ 692 /* Fake a debug trap */
698 if (test_thread_flag(TIF_SINGLESTEP)) 693 if (test_thread_flag(TIF_SINGLESTEP))
699 send_sigtrap(current, regs, 0); 694 send_sigtrap(current, regs, 0);
700 695
701 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 696 if (!test_thread_flag(TIF_SYSCALL_TRACE))
702 return; 697 goto out;
703 698
704 /* the 0x80 provides a way for the tracing parent to distinguish 699 /* the 0x80 provides a way for the tracing parent to distinguish
705 between a syscall stop and SIGTRAP delivery */ 700 between a syscall stop and SIGTRAP delivery */
@@ -714,4 +709,9 @@ void do_syscall_trace(struct pt_regs *regs, int entryexit)
714 send_sig(current->exit_code, current, 1); 709 send_sig(current->exit_code, current, 1);
715 current->exit_code = 0; 710 current->exit_code = 0;
716 } 711 }
712 out:
713 if (unlikely(current->audit_context) && !entryexit)
714 audit_syscall_entry(current, AUDIT_ARCH_I386, regs->orig_eax,
715 regs->ebx, regs->ecx, regs->edx, regs->esi);
716
717} 717}
diff --git a/arch/i386/kernel/reboot.c b/arch/i386/kernel/reboot.c
index 3d7e994563df..6dc27eb70ee7 100644
--- a/arch/i386/kernel/reboot.c
+++ b/arch/i386/kernel/reboot.c
@@ -13,6 +13,7 @@
13#include <asm/uaccess.h> 13#include <asm/uaccess.h>
14#include <asm/apic.h> 14#include <asm/apic.h>
15#include "mach_reboot.h" 15#include "mach_reboot.h"
16#include <linux/reboot_fixups.h>
16 17
17/* 18/*
18 * Power off function, if any 19 * Power off function, if any
@@ -348,6 +349,7 @@ void machine_restart(char * __unused)
348 /* rebooting needs to touch the page at absolute addr 0 */ 349 /* rebooting needs to touch the page at absolute addr 0 */
349 *((unsigned short *)__va(0x472)) = reboot_mode; 350 *((unsigned short *)__va(0x472)) = reboot_mode;
350 for (;;) { 351 for (;;) {
352 mach_reboot_fixups(); /* for board specific fixups */
351 mach_reboot(); 353 mach_reboot();
352 /* That didn't work - force a triple fault.. */ 354 /* That didn't work - force a triple fault.. */
353 __asm__ __volatile__("lidt %0": :"m" (no_idt)); 355 __asm__ __volatile__("lidt %0": :"m" (no_idt));
diff --git a/arch/i386/kernel/reboot_fixups.c b/arch/i386/kernel/reboot_fixups.c
new file mode 100644
index 000000000000..1b183b378c2c
--- /dev/null
+++ b/arch/i386/kernel/reboot_fixups.c
@@ -0,0 +1,56 @@
1/*
2 * linux/arch/i386/kernel/reboot_fixups.c
3 *
4 * This is a good place to put board specific reboot fixups.
5 *
6 * List of supported fixups:
7 * geode-gx1/cs5530a - Jaya Kumar <jayalk@intworks.biz>
8 *
9 */
10
11#include <asm/delay.h>
12#include <linux/pci.h>
13
14static void cs5530a_warm_reset(struct pci_dev *dev)
15{
16 /* writing 1 to the reset control register, 0x44 causes the
17 cs5530a to perform a system warm reset */
18 pci_write_config_byte(dev, 0x44, 0x1);
19 udelay(50); /* shouldn't get here but be safe and spin-a-while */
20 return;
21}
22
23struct device_fixup {
24 unsigned int vendor;
25 unsigned int device;
26 void (*reboot_fixup)(struct pci_dev *);
27};
28
29static struct device_fixup fixups_table[] = {
30{ PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, cs5530a_warm_reset },
31};
32
33/*
34 * we see if any fixup is available for our current hardware. if there
35 * is a fixup, we call it and we expect to never return from it. if we
36 * do return, we keep looking and then eventually fall back to the
37 * standard mach_reboot on return.
38 */
39void mach_reboot_fixups(void)
40{
41 struct device_fixup *cur;
42 struct pci_dev *dev;
43 int i;
44
45 for (i=0; i < (sizeof(fixups_table)/sizeof(fixups_table[0])); i++) {
46 cur = &(fixups_table[i]);
47 dev = pci_get_device(cur->vendor, cur->device, 0);
48 if (!dev)
49 continue;
50
51 cur->reboot_fixup(dev);
52 }
53
54 printk(KERN_WARNING "No reboot fixup found for your hardware\n");
55}
56
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index fd36d2f65f88..cbea7ac582e5 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -1089,9 +1089,6 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
1089 } 1089 }
1090 } 1090 }
1091 1091
1092 if (nmi_watchdog == NMI_LOCAL_APIC)
1093 check_nmi_watchdog();
1094
1095 smpboot_setup_io_apic(); 1092 smpboot_setup_io_apic();
1096 1093
1097 setup_boot_APIC_clock(); 1094 setup_boot_APIC_clock();
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
new file mode 100644
index 000000000000..6cd1ed311f02
--- /dev/null
+++ b/arch/i386/kernel/syscall_table.S
@@ -0,0 +1,291 @@
1.data
2ENTRY(sys_call_table)
3 .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */
4 .long sys_exit
5 .long sys_fork
6 .long sys_read
7 .long sys_write
8 .long sys_open /* 5 */
9 .long sys_close
10 .long sys_waitpid
11 .long sys_creat
12 .long sys_link
13 .long sys_unlink /* 10 */
14 .long sys_execve
15 .long sys_chdir
16 .long sys_time
17 .long sys_mknod
18 .long sys_chmod /* 15 */
19 .long sys_lchown16
20 .long sys_ni_syscall /* old break syscall holder */
21 .long sys_stat
22 .long sys_lseek
23 .long sys_getpid /* 20 */
24 .long sys_mount
25 .long sys_oldumount
26 .long sys_setuid16
27 .long sys_getuid16
28 .long sys_stime /* 25 */
29 .long sys_ptrace
30 .long sys_alarm
31 .long sys_fstat
32 .long sys_pause
33 .long sys_utime /* 30 */
34 .long sys_ni_syscall /* old stty syscall holder */
35 .long sys_ni_syscall /* old gtty syscall holder */
36 .long sys_access
37 .long sys_nice
38 .long sys_ni_syscall /* 35 - old ftime syscall holder */
39 .long sys_sync
40 .long sys_kill
41 .long sys_rename
42 .long sys_mkdir
43 .long sys_rmdir /* 40 */
44 .long sys_dup
45 .long sys_pipe
46 .long sys_times
47 .long sys_ni_syscall /* old prof syscall holder */
48 .long sys_brk /* 45 */
49 .long sys_setgid16
50 .long sys_getgid16
51 .long sys_signal
52 .long sys_geteuid16
53 .long sys_getegid16 /* 50 */
54 .long sys_acct
55 .long sys_umount /* recycled never used phys() */
56 .long sys_ni_syscall /* old lock syscall holder */
57 .long sys_ioctl
58 .long sys_fcntl /* 55 */
59 .long sys_ni_syscall /* old mpx syscall holder */
60 .long sys_setpgid
61 .long sys_ni_syscall /* old ulimit syscall holder */
62 .long sys_olduname
63 .long sys_umask /* 60 */
64 .long sys_chroot
65 .long sys_ustat
66 .long sys_dup2
67 .long sys_getppid
68 .long sys_getpgrp /* 65 */
69 .long sys_setsid
70 .long sys_sigaction
71 .long sys_sgetmask
72 .long sys_ssetmask
73 .long sys_setreuid16 /* 70 */
74 .long sys_setregid16
75 .long sys_sigsuspend
76 .long sys_sigpending
77 .long sys_sethostname
78 .long sys_setrlimit /* 75 */
79 .long sys_old_getrlimit
80 .long sys_getrusage
81 .long sys_gettimeofday
82 .long sys_settimeofday
83 .long sys_getgroups16 /* 80 */
84 .long sys_setgroups16
85 .long old_select
86 .long sys_symlink
87 .long sys_lstat
88 .long sys_readlink /* 85 */
89 .long sys_uselib
90 .long sys_swapon
91 .long sys_reboot
92 .long old_readdir
93 .long old_mmap /* 90 */
94 .long sys_munmap
95 .long sys_truncate
96 .long sys_ftruncate
97 .long sys_fchmod
98 .long sys_fchown16 /* 95 */
99 .long sys_getpriority
100 .long sys_setpriority
101 .long sys_ni_syscall /* old profil syscall holder */
102 .long sys_statfs
103 .long sys_fstatfs /* 100 */
104 .long sys_ioperm
105 .long sys_socketcall
106 .long sys_syslog
107 .long sys_setitimer
108 .long sys_getitimer /* 105 */
109 .long sys_newstat
110 .long sys_newlstat
111 .long sys_newfstat
112 .long sys_uname
113 .long sys_iopl /* 110 */
114 .long sys_vhangup
115 .long sys_ni_syscall /* old "idle" system call */
116 .long sys_vm86old
117 .long sys_wait4
118 .long sys_swapoff /* 115 */
119 .long sys_sysinfo
120 .long sys_ipc
121 .long sys_fsync
122 .long sys_sigreturn
123 .long sys_clone /* 120 */
124 .long sys_setdomainname
125 .long sys_newuname
126 .long sys_modify_ldt
127 .long sys_adjtimex
128 .long sys_mprotect /* 125 */
129 .long sys_sigprocmask
130 .long sys_ni_syscall /* old "create_module" */
131 .long sys_init_module
132 .long sys_delete_module
133 .long sys_ni_syscall /* 130: old "get_kernel_syms" */
134 .long sys_quotactl
135 .long sys_getpgid
136 .long sys_fchdir
137 .long sys_bdflush
138 .long sys_sysfs /* 135 */
139 .long sys_personality
140 .long sys_ni_syscall /* reserved for afs_syscall */
141 .long sys_setfsuid16
142 .long sys_setfsgid16
143 .long sys_llseek /* 140 */
144 .long sys_getdents
145 .long sys_select
146 .long sys_flock
147 .long sys_msync
148 .long sys_readv /* 145 */
149 .long sys_writev
150 .long sys_getsid
151 .long sys_fdatasync
152 .long sys_sysctl
153 .long sys_mlock /* 150 */
154 .long sys_munlock
155 .long sys_mlockall
156 .long sys_munlockall
157 .long sys_sched_setparam
158 .long sys_sched_getparam /* 155 */
159 .long sys_sched_setscheduler
160 .long sys_sched_getscheduler
161 .long sys_sched_yield
162 .long sys_sched_get_priority_max
163 .long sys_sched_get_priority_min /* 160 */
164 .long sys_sched_rr_get_interval
165 .long sys_nanosleep
166 .long sys_mremap
167 .long sys_setresuid16
168 .long sys_getresuid16 /* 165 */
169 .long sys_vm86
170 .long sys_ni_syscall /* Old sys_query_module */
171 .long sys_poll
172 .long sys_nfsservctl
173 .long sys_setresgid16 /* 170 */
174 .long sys_getresgid16
175 .long sys_prctl
176 .long sys_rt_sigreturn
177 .long sys_rt_sigaction
178 .long sys_rt_sigprocmask /* 175 */
179 .long sys_rt_sigpending
180 .long sys_rt_sigtimedwait
181 .long sys_rt_sigqueueinfo
182 .long sys_rt_sigsuspend
183 .long sys_pread64 /* 180 */
184 .long sys_pwrite64
185 .long sys_chown16
186 .long sys_getcwd
187 .long sys_capget
188 .long sys_capset /* 185 */
189 .long sys_sigaltstack
190 .long sys_sendfile
191 .long sys_ni_syscall /* reserved for streams1 */
192 .long sys_ni_syscall /* reserved for streams2 */
193 .long sys_vfork /* 190 */
194 .long sys_getrlimit
195 .long sys_mmap2
196 .long sys_truncate64
197 .long sys_ftruncate64
198 .long sys_stat64 /* 195 */
199 .long sys_lstat64
200 .long sys_fstat64
201 .long sys_lchown
202 .long sys_getuid
203 .long sys_getgid /* 200 */
204 .long sys_geteuid
205 .long sys_getegid
206 .long sys_setreuid
207 .long sys_setregid
208 .long sys_getgroups /* 205 */
209 .long sys_setgroups
210 .long sys_fchown
211 .long sys_setresuid
212 .long sys_getresuid
213 .long sys_setresgid /* 210 */
214 .long sys_getresgid
215 .long sys_chown
216 .long sys_setuid
217 .long sys_setgid
218 .long sys_setfsuid /* 215 */
219 .long sys_setfsgid
220 .long sys_pivot_root
221 .long sys_mincore
222 .long sys_madvise
223 .long sys_getdents64 /* 220 */
224 .long sys_fcntl64
225 .long sys_ni_syscall /* reserved for TUX */
226 .long sys_ni_syscall
227 .long sys_gettid
228 .long sys_readahead /* 225 */
229 .long sys_setxattr
230 .long sys_lsetxattr
231 .long sys_fsetxattr
232 .long sys_getxattr
233 .long sys_lgetxattr /* 230 */
234 .long sys_fgetxattr
235 .long sys_listxattr
236 .long sys_llistxattr
237 .long sys_flistxattr
238 .long sys_removexattr /* 235 */
239 .long sys_lremovexattr
240 .long sys_fremovexattr
241 .long sys_tkill
242 .long sys_sendfile64
243 .long sys_futex /* 240 */
244 .long sys_sched_setaffinity
245 .long sys_sched_getaffinity
246 .long sys_set_thread_area
247 .long sys_get_thread_area
248 .long sys_io_setup /* 245 */
249 .long sys_io_destroy
250 .long sys_io_getevents
251 .long sys_io_submit
252 .long sys_io_cancel
253 .long sys_fadvise64 /* 250 */
254 .long sys_ni_syscall
255 .long sys_exit_group
256 .long sys_lookup_dcookie
257 .long sys_epoll_create
258 .long sys_epoll_ctl /* 255 */
259 .long sys_epoll_wait
260 .long sys_remap_file_pages
261 .long sys_set_tid_address
262 .long sys_timer_create
263 .long sys_timer_settime /* 260 */
264 .long sys_timer_gettime
265 .long sys_timer_getoverrun
266 .long sys_timer_delete
267 .long sys_clock_settime
268 .long sys_clock_gettime /* 265 */
269 .long sys_clock_getres
270 .long sys_clock_nanosleep
271 .long sys_statfs64
272 .long sys_fstatfs64
273 .long sys_tgkill /* 270 */
274 .long sys_utimes
275 .long sys_fadvise64_64
276 .long sys_ni_syscall /* sys_vserver */
277 .long sys_mbind
278 .long sys_get_mempolicy
279 .long sys_set_mempolicy
280 .long sys_mq_open
281 .long sys_mq_unlink
282 .long sys_mq_timedsend
283 .long sys_mq_timedreceive /* 280 */
284 .long sys_mq_notify
285 .long sys_mq_getsetattr
286 .long sys_ni_syscall /* reserved for kexec */
287 .long sys_waitid
288 .long sys_ni_syscall /* 285 */ /* available */
289 .long sys_add_key
290 .long sys_request_key
291 .long sys_keyctl
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
index 4d75b373f90e..a0dcb7c87c30 100644
--- a/arch/i386/kernel/time.c
+++ b/arch/i386/kernel/time.c
@@ -441,7 +441,7 @@ static void __init hpet_time_init(void)
441 set_normalized_timespec(&wall_to_monotonic, 441 set_normalized_timespec(&wall_to_monotonic,
442 -xtime.tv_sec, -xtime.tv_nsec); 442 -xtime.tv_sec, -xtime.tv_nsec);
443 443
444 if (hpet_enable() >= 0) { 444 if ((hpet_enable() >= 0) && hpet_use_timer) {
445 printk("Using HPET for base-timer\n"); 445 printk("Using HPET for base-timer\n");
446 } 446 }
447 447
diff --git a/arch/i386/kernel/time_hpet.c b/arch/i386/kernel/time_hpet.c
index 244a31b04be7..10a0cbb88e75 100644
--- a/arch/i386/kernel/time_hpet.c
+++ b/arch/i386/kernel/time_hpet.c
@@ -26,6 +26,7 @@
26static unsigned long hpet_period; /* fsecs / HPET clock */ 26static unsigned long hpet_period; /* fsecs / HPET clock */
27unsigned long hpet_tick; /* hpet clks count per tick */ 27unsigned long hpet_tick; /* hpet clks count per tick */
28unsigned long hpet_address; /* hpet memory map physical address */ 28unsigned long hpet_address; /* hpet memory map physical address */
29int hpet_use_timer;
29 30
30static int use_hpet; /* can be used for runtime check of hpet */ 31static int use_hpet; /* can be used for runtime check of hpet */
31static int boot_hpet_disable; /* boottime override for HPET timer */ 32static int boot_hpet_disable; /* boottime override for HPET timer */
@@ -73,27 +74,30 @@ static int hpet_timer_stop_set_go(unsigned long tick)
73 hpet_writel(0, HPET_COUNTER); 74 hpet_writel(0, HPET_COUNTER);
74 hpet_writel(0, HPET_COUNTER + 4); 75 hpet_writel(0, HPET_COUNTER + 4);
75 76
76 /* 77 if (hpet_use_timer) {
77 * Set up timer 0, as periodic with first interrupt to happen at 78 /*
78 * hpet_tick, and period also hpet_tick. 79 * Set up timer 0, as periodic with first interrupt to happen at
79 */ 80 * hpet_tick, and period also hpet_tick.
80 cfg = hpet_readl(HPET_T0_CFG); 81 */
81 cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC | 82 cfg = hpet_readl(HPET_T0_CFG);
82 HPET_TN_SETVAL | HPET_TN_32BIT; 83 cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC |
83 hpet_writel(cfg, HPET_T0_CFG); 84 HPET_TN_SETVAL | HPET_TN_32BIT;
84 85 hpet_writel(cfg, HPET_T0_CFG);
85 /*
86 * The first write after writing TN_SETVAL to the config register sets
87 * the counter value, the second write sets the threshold.
88 */
89 hpet_writel(tick, HPET_T0_CMP);
90 hpet_writel(tick, HPET_T0_CMP);
91 86
87 /*
88 * The first write after writing TN_SETVAL to the config register sets
89 * the counter value, the second write sets the threshold.
90 */
91 hpet_writel(tick, HPET_T0_CMP);
92 hpet_writel(tick, HPET_T0_CMP);
93 }
92 /* 94 /*
93 * Go! 95 * Go!
94 */ 96 */
95 cfg = hpet_readl(HPET_CFG); 97 cfg = hpet_readl(HPET_CFG);
96 cfg |= HPET_CFG_ENABLE | HPET_CFG_LEGACY; 98 if (hpet_use_timer)
99 cfg |= HPET_CFG_LEGACY;
100 cfg |= HPET_CFG_ENABLE;
97 hpet_writel(cfg, HPET_CFG); 101 hpet_writel(cfg, HPET_CFG);
98 102
99 return 0; 103 return 0;
@@ -128,12 +132,11 @@ int __init hpet_enable(void)
128 * However, we can do with one timer otherwise using the 132 * However, we can do with one timer otherwise using the
129 * the single HPET timer for system time. 133 * the single HPET timer for system time.
130 */ 134 */
131 if (
132#ifdef CONFIG_HPET_EMULATE_RTC 135#ifdef CONFIG_HPET_EMULATE_RTC
133 !(id & HPET_ID_NUMBER) || 136 if (!(id & HPET_ID_NUMBER))
134#endif
135 !(id & HPET_ID_LEGSUP))
136 return -1; 137 return -1;
138#endif
139
137 140
138 hpet_period = hpet_readl(HPET_PERIOD); 141 hpet_period = hpet_readl(HPET_PERIOD);
139 if ((hpet_period < HPET_MIN_PERIOD) || (hpet_period > HPET_MAX_PERIOD)) 142 if ((hpet_period < HPET_MIN_PERIOD) || (hpet_period > HPET_MAX_PERIOD))
@@ -152,6 +155,8 @@ int __init hpet_enable(void)
152 if (hpet_tick_rem > (hpet_period >> 1)) 155 if (hpet_tick_rem > (hpet_period >> 1))
153 hpet_tick++; /* rounding the result */ 156 hpet_tick++; /* rounding the result */
154 157
158 hpet_use_timer = id & HPET_ID_LEGSUP;
159
155 if (hpet_timer_stop_set_go(hpet_tick)) 160 if (hpet_timer_stop_set_go(hpet_tick))
156 return -1; 161 return -1;
157 162
@@ -202,7 +207,8 @@ int __init hpet_enable(void)
202#endif 207#endif
203 208
204#ifdef CONFIG_X86_LOCAL_APIC 209#ifdef CONFIG_X86_LOCAL_APIC
205 wait_timer_tick = wait_hpet_tick; 210 if (hpet_use_timer)
211 wait_timer_tick = wait_hpet_tick;
206#endif 212#endif
207 return 0; 213 return 0;
208} 214}
diff --git a/arch/i386/kernel/timers/timer_hpet.c b/arch/i386/kernel/timers/timer_hpet.c
index 713134e71844..f778f471a09a 100644
--- a/arch/i386/kernel/timers/timer_hpet.c
+++ b/arch/i386/kernel/timers/timer_hpet.c
@@ -79,7 +79,7 @@ static unsigned long get_offset_hpet(void)
79 79
80 eax = hpet_readl(HPET_COUNTER); 80 eax = hpet_readl(HPET_COUNTER);
81 eax -= hpet_last; /* hpet delta */ 81 eax -= hpet_last; /* hpet delta */
82 82 eax = min(hpet_tick, eax);
83 /* 83 /*
84 * Time offset = (hpet delta) * ( usecs per HPET clock ) 84 * Time offset = (hpet delta) * ( usecs per HPET clock )
85 * = (hpet delta) * ( usecs per tick / HPET clocks per tick) 85 * = (hpet delta) * ( usecs per tick / HPET clocks per tick)
@@ -105,9 +105,12 @@ static void mark_offset_hpet(void)
105 last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; 105 last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
106 rdtsc(last_tsc_low, last_tsc_high); 106 rdtsc(last_tsc_low, last_tsc_high);
107 107
108 offset = hpet_readl(HPET_T0_CMP) - hpet_tick; 108 if (hpet_use_timer)
109 if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) { 109 offset = hpet_readl(HPET_T0_CMP) - hpet_tick;
110 int lost_ticks = (offset - hpet_last) / hpet_tick; 110 else
111 offset = hpet_readl(HPET_COUNTER);
112 if (unlikely(((offset - hpet_last) >= (2*hpet_tick)) && (hpet_last != 0))) {
113 int lost_ticks = ((offset - hpet_last) / hpet_tick) - 1;
111 jiffies_64 += lost_ticks; 114 jiffies_64 += lost_ticks;
112 } 115 }
113 hpet_last = offset; 116 hpet_last = offset;
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index a685994e5c8e..7926d967be00 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -477,7 +477,7 @@ static int __init init_tsc(char* override)
477 if (cpu_has_tsc) { 477 if (cpu_has_tsc) {
478 unsigned long tsc_quotient; 478 unsigned long tsc_quotient;
479#ifdef CONFIG_HPET_TIMER 479#ifdef CONFIG_HPET_TIMER
480 if (is_hpet_enabled()){ 480 if (is_hpet_enabled() && hpet_use_timer) {
481 unsigned long result, remain; 481 unsigned long result, remain;
482 printk("Using TSC for gettimeofday\n"); 482 printk("Using TSC for gettimeofday\n");
483 tsc_quotient = calibrate_tsc_hpet(NULL); 483 tsc_quotient = calibrate_tsc_hpet(NULL);
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 6c0e383915b6..00c63419c06f 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -451,6 +451,7 @@ DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS)
451DO_ERROR(11, SIGBUS, "segment not present", segment_not_present) 451DO_ERROR(11, SIGBUS, "segment not present", segment_not_present)
452DO_ERROR(12, SIGBUS, "stack segment", stack_segment) 452DO_ERROR(12, SIGBUS, "stack segment", stack_segment)
453DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0) 453DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0)
454DO_ERROR_INFO(32, SIGSEGV, "iret exception", iret_error, ILL_BADSTK, 0)
454 455
455fastcall void do_general_protection(struct pt_regs * regs, long error_code) 456fastcall void do_general_protection(struct pt_regs * regs, long error_code)
456{ 457{
@@ -642,16 +643,15 @@ void unset_nmi_callback(void)
642} 643}
643 644
644#ifdef CONFIG_KPROBES 645#ifdef CONFIG_KPROBES
645fastcall int do_int3(struct pt_regs *regs, long error_code) 646fastcall void do_int3(struct pt_regs *regs, long error_code)
646{ 647{
647 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) 648 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP)
648 == NOTIFY_STOP) 649 == NOTIFY_STOP)
649 return 1; 650 return;
650 /* This is an interrupt gate, because kprobes wants interrupts 651 /* This is an interrupt gate, because kprobes wants interrupts
651 disabled. Normal trap handlers don't. */ 652 disabled. Normal trap handlers don't. */
652 restore_interrupts(regs); 653 restore_interrupts(regs);
653 do_trap(3, SIGTRAP, "int3", 1, regs, error_code, NULL); 654 do_trap(3, SIGTRAP, "int3", 1, regs, error_code, NULL);
654 return 0;
655} 655}
656#endif 656#endif
657 657
diff --git a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c
index 2f3d52dacff7..ec0f68ce6886 100644
--- a/arch/i386/kernel/vm86.c
+++ b/arch/i386/kernel/vm86.c
@@ -222,7 +222,7 @@ asmlinkage int sys_vm86(struct pt_regs regs)
222 goto out; 222 goto out;
223 case VM86_PLUS_INSTALL_CHECK: 223 case VM86_PLUS_INSTALL_CHECK:
224 /* NOTE: on old vm86 stuff this will return the error 224 /* NOTE: on old vm86 stuff this will return the error
225 from verify_area(), because the subfunction is 225 from access_ok(), because the subfunction is
226 interpreted as (invalid) address to vm86_struct. 226 interpreted as (invalid) address to vm86_struct.
227 So the installation check works. 227 So the installation check works.
228 */ 228 */
@@ -294,8 +294,8 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
294 */ 294 */
295 info->regs32->eax = 0; 295 info->regs32->eax = 0;
296 tsk->thread.saved_esp0 = tsk->thread.esp0; 296 tsk->thread.saved_esp0 = tsk->thread.esp0;
297 asm volatile("movl %%fs,%0":"=m" (tsk->thread.saved_fs)); 297 asm volatile("mov %%fs,%0":"=m" (tsk->thread.saved_fs));
298 asm volatile("movl %%gs,%0":"=m" (tsk->thread.saved_gs)); 298 asm volatile("mov %%gs,%0":"=m" (tsk->thread.saved_gs));
299 299
300 tss = &per_cpu(init_tss, get_cpu()); 300 tss = &per_cpu(init_tss, get_cpu());
301 tsk->thread.esp0 = (unsigned long) &info->VM86_TSS_ESP0; 301 tsk->thread.esp0 = (unsigned long) &info->VM86_TSS_ESP0;
@@ -717,12 +717,12 @@ static irqreturn_t irq_handler(int intno, void *dev_id, struct pt_regs * regs)
717 irqbits |= irq_bit; 717 irqbits |= irq_bit;
718 if (vm86_irqs[intno].sig) 718 if (vm86_irqs[intno].sig)
719 send_sig(vm86_irqs[intno].sig, vm86_irqs[intno].tsk, 1); 719 send_sig(vm86_irqs[intno].sig, vm86_irqs[intno].tsk, 1);
720 spin_unlock_irqrestore(&irqbits_lock, flags);
721 /* 720 /*
722 * IRQ will be re-enabled when user asks for the irq (whether 721 * IRQ will be re-enabled when user asks for the irq (whether
723 * polling or as a result of the signal) 722 * polling or as a result of the signal)
724 */ 723 */
725 disable_irq(intno); 724 disable_irq_nosync(intno);
725 spin_unlock_irqrestore(&irqbits_lock, flags);
726 return IRQ_HANDLED; 726 return IRQ_HANDLED;
727 727
728out: 728out:
@@ -754,17 +754,20 @@ static inline int get_and_reset_irq(int irqnumber)
754{ 754{
755 int bit; 755 int bit;
756 unsigned long flags; 756 unsigned long flags;
757 int ret = 0;
757 758
758 if (invalid_vm86_irq(irqnumber)) return 0; 759 if (invalid_vm86_irq(irqnumber)) return 0;
759 if (vm86_irqs[irqnumber].tsk != current) return 0; 760 if (vm86_irqs[irqnumber].tsk != current) return 0;
760 spin_lock_irqsave(&irqbits_lock, flags); 761 spin_lock_irqsave(&irqbits_lock, flags);
761 bit = irqbits & (1 << irqnumber); 762 bit = irqbits & (1 << irqnumber);
762 irqbits &= ~bit; 763 irqbits &= ~bit;
764 if (bit) {
765 enable_irq(irqnumber);
766 ret = 1;
767 }
768
763 spin_unlock_irqrestore(&irqbits_lock, flags); 769 spin_unlock_irqrestore(&irqbits_lock, flags);
764 if (!bit) 770 return ret;
765 return 0;
766 enable_irq(irqnumber);
767 return 1;
768} 771}
769 772
770 773
diff --git a/arch/i386/oprofile/nmi_timer_int.c b/arch/i386/oprofile/nmi_timer_int.c
index b2e462abf337..c58d0c14f274 100644
--- a/arch/i386/oprofile/nmi_timer_int.c
+++ b/arch/i386/oprofile/nmi_timer_int.c
@@ -36,7 +36,7 @@ static void timer_stop(void)
36{ 36{
37 enable_timer_nmi_watchdog(); 37 enable_timer_nmi_watchdog();
38 unset_nmi_callback(); 38 unset_nmi_callback();
39 synchronize_kernel(); 39 synchronize_sched(); /* Allow already-started NMIs to complete. */
40} 40}
41 41
42 42
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
index e07589d04f64..d6598da4b67b 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@ -495,6 +495,8 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route
495 case PCI_DEVICE_ID_INTEL_ICH6_1: 495 case PCI_DEVICE_ID_INTEL_ICH6_1:
496 case PCI_DEVICE_ID_INTEL_ICH7_0: 496 case PCI_DEVICE_ID_INTEL_ICH7_0:
497 case PCI_DEVICE_ID_INTEL_ICH7_1: 497 case PCI_DEVICE_ID_INTEL_ICH7_1:
498 case PCI_DEVICE_ID_INTEL_ICH7_30:
499 case PCI_DEVICE_ID_INTEL_ICH7_31:
498 case PCI_DEVICE_ID_INTEL_ESB2_0: 500 case PCI_DEVICE_ID_INTEL_ESB2_0:
499 r->name = "PIIX/ICH"; 501 r->name = "PIIX/ICH";
500 r->get = pirq_piix_get; 502 r->get = pirq_piix_get;