aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64')
-rw-r--r--arch/x86_64/Kconfig16
-rw-r--r--arch/x86_64/defconfig40
-rw-r--r--arch/x86_64/ia32/ia32entry.S2
-rw-r--r--arch/x86_64/ia32/sys_ia32.c22
-rw-r--r--arch/x86_64/kernel/Makefile2
-rw-r--r--arch/x86_64/kernel/aperture.c2
-rw-r--r--arch/x86_64/kernel/apic.c3
-rw-r--r--arch/x86_64/kernel/entry.S1
-rw-r--r--arch/x86_64/kernel/head.S7
-rw-r--r--arch/x86_64/kernel/io_apic.c42
-rw-r--r--arch/x86_64/kernel/mpparse.c4
-rw-r--r--arch/x86_64/kernel/nmi.c19
-rw-r--r--arch/x86_64/kernel/pci-gart.c20
-rw-r--r--arch/x86_64/kernel/setup.c6
-rw-r--r--arch/x86_64/kernel/smpboot.c4
-rw-r--r--arch/x86_64/kernel/time.c37
-rw-r--r--arch/x86_64/kernel/traps.c18
-rw-r--r--arch/x86_64/mm/k8topology.c2
-rw-r--r--arch/x86_64/mm/numa.c2
-rw-r--r--arch/x86_64/mm/srat.c5
20 files changed, 169 insertions, 85 deletions
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 2f9deca31cc9..e18eb79bf855 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -354,21 +354,6 @@ config HPET_TIMER
354 as it is off-chip. You can find the HPET spec at 354 as it is off-chip. You can find the HPET spec at
355 <http://www.intel.com/hardwaredesign/hpetspec.htm>. 355 <http://www.intel.com/hardwaredesign/hpetspec.htm>.
356 356
357config X86_PM_TIMER
358 bool "PM timer" if EMBEDDED
359 depends on ACPI
360 default y
361 help
362 Support the ACPI PM timer for time keeping. This is slow,
363 but is useful on some chipsets without HPET on systems with more
364 than one CPU. On a single processor or single socket multi core
365 system it is normally not required.
366 When the PM timer is active 64bit vsyscalls are disabled
367 and should not be enabled (/proc/sys/kernel/vsyscall64 should
368 not be changed).
369 The kernel selects the PM timer only as a last resort, so it is
370 useful to enable just in case.
371
372config HPET_EMULATE_RTC 357config HPET_EMULATE_RTC
373 bool "Provide RTC interrupt" 358 bool "Provide RTC interrupt"
374 depends on HPET_TIMER && RTC=y 359 depends on HPET_TIMER && RTC=y
@@ -592,6 +577,7 @@ source "arch/x86_64/oprofile/Kconfig"
592 577
593config KPROBES 578config KPROBES
594 bool "Kprobes (EXPERIMENTAL)" 579 bool "Kprobes (EXPERIMENTAL)"
580 depends on EXPERIMENTAL && MODULES
595 help 581 help
596 Kprobes allows you to trap at almost any kernel address and 582 Kprobes allows you to trap at almost any kernel address and
597 execute a callback function. register_kprobe() establishes 583 execute a callback function. register_kprobe() establishes
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index 56832929a543..ce4de61ed85d 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.16-rc1-git2 3# Linux kernel version: 2.6.16-rc3-git9
4# Thu Jan 19 10:05:21 2006 4# Sat Feb 18 00:27:03 2006
5# 5#
6CONFIG_X86_64=y 6CONFIG_X86_64=y
7CONFIG_64BIT=y 7CONFIG_64BIT=y
@@ -21,7 +21,6 @@ CONFIG_DMI=y
21# Code maturity level options 21# Code maturity level options
22# 22#
23CONFIG_EXPERIMENTAL=y 23CONFIG_EXPERIMENTAL=y
24CONFIG_CLEAN_COMPILE=y
25CONFIG_LOCK_KERNEL=y 24CONFIG_LOCK_KERNEL=y
26CONFIG_INIT_ENV_ARG_LIMIT=32 25CONFIG_INIT_ENV_ARG_LIMIT=32
27 26
@@ -267,6 +266,7 @@ CONFIG_NET=y
267# 266#
268# Networking options 267# Networking options
269# 268#
269# CONFIG_NETDEBUG is not set
270CONFIG_PACKET=y 270CONFIG_PACKET=y
271# CONFIG_PACKET_MMAP is not set 271# CONFIG_PACKET_MMAP is not set
272CONFIG_UNIX=y 272CONFIG_UNIX=y
@@ -446,7 +446,6 @@ CONFIG_BLK_DEV_PIIX=y
446# CONFIG_BLK_DEV_NS87415 is not set 446# CONFIG_BLK_DEV_NS87415 is not set
447# CONFIG_BLK_DEV_PDC202XX_OLD is not set 447# CONFIG_BLK_DEV_PDC202XX_OLD is not set
448CONFIG_BLK_DEV_PDC202XX_NEW=y 448CONFIG_BLK_DEV_PDC202XX_NEW=y
449# CONFIG_PDC202XX_FORCE is not set
450# CONFIG_BLK_DEV_SVWKS is not set 449# CONFIG_BLK_DEV_SVWKS is not set
451# CONFIG_BLK_DEV_SIIMAGE is not set 450# CONFIG_BLK_DEV_SIIMAGE is not set
452# CONFIG_BLK_DEV_SIS5513 is not set 451# CONFIG_BLK_DEV_SIS5513 is not set
@@ -573,7 +572,33 @@ CONFIG_FUSION_MAX_SGE=128
573# 572#
574# IEEE 1394 (FireWire) support 573# IEEE 1394 (FireWire) support
575# 574#
576# CONFIG_IEEE1394 is not set 575CONFIG_IEEE1394=y
576
577#
578# Subsystem Options
579#
580# CONFIG_IEEE1394_VERBOSEDEBUG is not set
581# CONFIG_IEEE1394_OUI_DB is not set
582# CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set
583# CONFIG_IEEE1394_EXPORT_FULL_API is not set
584
585#
586# Device Drivers
587#
588
589#
590# Texas Instruments PCILynx requires I2C
591#
592CONFIG_IEEE1394_OHCI1394=y
593
594#
595# Protocol Drivers
596#
597# CONFIG_IEEE1394_VIDEO1394 is not set
598# CONFIG_IEEE1394_SBP2 is not set
599# CONFIG_IEEE1394_ETH1394 is not set
600# CONFIG_IEEE1394_DV1394 is not set
601CONFIG_IEEE1394_RAWIO=y
577 602
578# 603#
579# I2O device support 604# I2O device support
@@ -772,6 +797,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4
772# 797#
773CONFIG_SERIAL_CORE=y 798CONFIG_SERIAL_CORE=y
774CONFIG_SERIAL_CORE_CONSOLE=y 799CONFIG_SERIAL_CORE_CONSOLE=y
800# CONFIG_SERIAL_JSM is not set
775CONFIG_UNIX98_PTYS=y 801CONFIG_UNIX98_PTYS=y
776CONFIG_LEGACY_PTYS=y 802CONFIG_LEGACY_PTYS=y
777CONFIG_LEGACY_PTY_COUNT=256 803CONFIG_LEGACY_PTY_COUNT=256
@@ -871,6 +897,7 @@ CONFIG_HPET_MMAP=y
871# 897#
872CONFIG_HWMON=y 898CONFIG_HWMON=y
873# CONFIG_HWMON_VID is not set 899# CONFIG_HWMON_VID is not set
900# CONFIG_SENSORS_F71805F is not set
874# CONFIG_SENSORS_HDAPS is not set 901# CONFIG_SENSORS_HDAPS is not set
875# CONFIG_HWMON_DEBUG_CHIP is not set 902# CONFIG_HWMON_DEBUG_CHIP is not set
876 903
@@ -1101,7 +1128,6 @@ CONFIG_USB_MON=y
1101# EDAC - error detection and reporting (RAS) 1128# EDAC - error detection and reporting (RAS)
1102# 1129#
1103# CONFIG_EDAC is not set 1130# CONFIG_EDAC is not set
1104# CONFIG_EDAC_POLL is not set
1105 1131
1106# 1132#
1107# Firmware Drivers 1133# Firmware Drivers
@@ -1296,9 +1322,7 @@ CONFIG_DEBUG_FS=y
1296# CONFIG_DEBUG_VM is not set 1322# CONFIG_DEBUG_VM is not set
1297# CONFIG_FRAME_POINTER is not set 1323# CONFIG_FRAME_POINTER is not set
1298# CONFIG_FORCED_INLINING is not set 1324# CONFIG_FORCED_INLINING is not set
1299# CONFIG_UNWIND_INFO is not set
1300# CONFIG_RCU_TORTURE_TEST is not set 1325# CONFIG_RCU_TORTURE_TEST is not set
1301CONFIG_INIT_DEBUG=y
1302# CONFIG_DEBUG_RODATA is not set 1326# CONFIG_DEBUG_RODATA is not set
1303# CONFIG_IOMMU_DEBUG is not set 1327# CONFIG_IOMMU_DEBUG is not set
1304 1328
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index ada4535d0161..00dee176c08e 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -677,7 +677,7 @@ ia32_sys_call_table:
677 .quad sys_mknodat 677 .quad sys_mknodat
678 .quad sys_fchownat 678 .quad sys_fchownat
679 .quad compat_sys_futimesat 679 .quad compat_sys_futimesat
680 .quad compat_sys_newfstatat /* 300 */ 680 .quad sys32_fstatat /* 300 */
681 .quad sys_unlinkat 681 .quad sys_unlinkat
682 .quad sys_renameat 682 .quad sys_renameat
683 .quad sys_linkat 683 .quad sys_linkat
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
index 54481af5344a..2bc55af95419 100644
--- a/arch/x86_64/ia32/sys_ia32.c
+++ b/arch/x86_64/ia32/sys_ia32.c
@@ -180,6 +180,28 @@ sys32_fstat64(unsigned int fd, struct stat64 __user *statbuf)
180 return ret; 180 return ret;
181} 181}
182 182
183asmlinkage long
184sys32_fstatat(unsigned int dfd, char __user *filename,
185 struct stat64 __user* statbuf, int flag)
186{
187 struct kstat stat;
188 int error = -EINVAL;
189
190 if ((flag & ~AT_SYMLINK_NOFOLLOW) != 0)
191 goto out;
192
193 if (flag & AT_SYMLINK_NOFOLLOW)
194 error = vfs_lstat_fd(dfd, filename, &stat);
195 else
196 error = vfs_stat_fd(dfd, filename, &stat);
197
198 if (!error)
199 error = cp_stat64(statbuf, &stat);
200
201out:
202 return error;
203}
204
183/* 205/*
184 * Linux/i386 didn't use to be able to handle more than 206 * Linux/i386 didn't use to be able to handle more than
185 * 4 system call parameters, so these system calls used a memory 207 * 4 system call parameters, so these system calls used a memory
diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile
index 72fe60c20d39..a098a11e7755 100644
--- a/arch/x86_64/kernel/Makefile
+++ b/arch/x86_64/kernel/Makefile
@@ -43,7 +43,7 @@ CFLAGS_vsyscall.o := $(PROFILING) -g0
43 43
44bootflag-y += ../../i386/kernel/bootflag.o 44bootflag-y += ../../i386/kernel/bootflag.o
45cpuid-$(subst m,y,$(CONFIG_X86_CPUID)) += ../../i386/kernel/cpuid.o 45cpuid-$(subst m,y,$(CONFIG_X86_CPUID)) += ../../i386/kernel/cpuid.o
46topology-y += ../../i386/mach-default/topology.o 46topology-y += ../../i386/kernel/topology.o
47microcode-$(subst m,y,$(CONFIG_MICROCODE)) += ../../i386/kernel/microcode.o 47microcode-$(subst m,y,$(CONFIG_MICROCODE)) += ../../i386/kernel/microcode.o
48intel_cacheinfo-y += ../../i386/kernel/cpu/intel_cacheinfo.o 48intel_cacheinfo-y += ../../i386/kernel/cpu/intel_cacheinfo.o
49quirks-y += ../../i386/kernel/quirks.o 49quirks-y += ../../i386/kernel/quirks.o
diff --git a/arch/x86_64/kernel/aperture.c b/arch/x86_64/kernel/aperture.c
index e4e2b7d01f89..a0f955b9995f 100644
--- a/arch/x86_64/kernel/aperture.c
+++ b/arch/x86_64/kernel/aperture.c
@@ -248,7 +248,7 @@ void __init iommu_hole_init(void)
248 /* Got the aperture from the AGP bridge */ 248 /* Got the aperture from the AGP bridge */
249 } else if (swiotlb && !valid_agp) { 249 } else if (swiotlb && !valid_agp) {
250 /* Do nothing */ 250 /* Do nothing */
251 } else if ((!no_iommu && end_pfn >= MAX_DMA32_PFN) || 251 } else if ((!no_iommu && end_pfn > MAX_DMA32_PFN) ||
252 force_iommu || 252 force_iommu ||
253 valid_agp || 253 valid_agp ||
254 fallback_aper_force) { 254 fallback_aper_force) {
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86_64/kernel/apic.c
index 6147770b4347..e5b14c57eaa0 100644
--- a/arch/x86_64/kernel/apic.c
+++ b/arch/x86_64/kernel/apic.c
@@ -708,7 +708,7 @@ static void setup_APIC_timer(unsigned int clocks)
708 local_irq_save(flags); 708 local_irq_save(flags);
709 709
710 /* wait for irq slice */ 710 /* wait for irq slice */
711 if (vxtime.hpet_address) { 711 if (vxtime.hpet_address && hpet_use_timer) {
712 int trigger = hpet_readl(HPET_T0_CMP); 712 int trigger = hpet_readl(HPET_T0_CMP);
713 while (hpet_readl(HPET_COUNTER) >= trigger) 713 while (hpet_readl(HPET_COUNTER) >= trigger)
714 /* do nothing */ ; 714 /* do nothing */ ;
@@ -1152,6 +1152,7 @@ __setup("noapicmaintimer", setup_noapicmaintimer);
1152static __init int setup_apicpmtimer(char *s) 1152static __init int setup_apicpmtimer(char *s)
1153{ 1153{
1154 apic_calibrate_pmtmr = 1; 1154 apic_calibrate_pmtmr = 1;
1155 notsc_setup(NULL);
1155 return setup_apicmaintimer(NULL); 1156 return setup_apicmaintimer(NULL);
1156} 1157}
1157__setup("apicpmtimer", setup_apicpmtimer); 1158__setup("apicpmtimer", setup_apicpmtimer);
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index b150c87a08c6..7c10e9009d61 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -554,6 +554,7 @@ iret_label:
554 /* running with kernel gs */ 554 /* running with kernel gs */
555bad_iret: 555bad_iret:
556 movq $-9999,%rdi /* better code? */ 556 movq $-9999,%rdi /* better code? */
557 sti
557 jmp do_exit 558 jmp do_exit
558 .previous 559 .previous
559 560
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S
index 692c737feddb..02fc7fa0ea28 100644
--- a/arch/x86_64/kernel/head.S
+++ b/arch/x86_64/kernel/head.S
@@ -213,6 +213,11 @@ ENTRY(early_idt_handler)
213 cmpl $2,early_recursion_flag(%rip) 213 cmpl $2,early_recursion_flag(%rip)
214 jz 1f 214 jz 1f
215 call dump_stack 215 call dump_stack
216#ifdef CONFIG_KALLSYMS
217 leaq early_idt_ripmsg(%rip),%rdi
218 movq 8(%rsp),%rsi # get rip again
219 call __print_symbol
220#endif
2161: hlt 2211: hlt
217 jmp 1b 222 jmp 1b
218early_recursion_flag: 223early_recursion_flag:
@@ -220,6 +225,8 @@ early_recursion_flag:
220 225
221early_idt_msg: 226early_idt_msg:
222 .asciz "PANIC: early exception rip %lx error %lx cr2 %lx\n" 227 .asciz "PANIC: early exception rip %lx error %lx cr2 %lx\n"
228early_idt_ripmsg:
229 .asciz "RIP %s\n"
223 230
224.code32 231.code32
225ENTRY(no_long_mode) 232ENTRY(no_long_mode)
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 4282d72b2a26..ffed464e6b12 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -30,6 +30,9 @@
30#include <linux/mc146818rtc.h> 30#include <linux/mc146818rtc.h>
31#include <linux/acpi.h> 31#include <linux/acpi.h>
32#include <linux/sysdev.h> 32#include <linux/sysdev.h>
33#ifdef CONFIG_ACPI
34#include <acpi/acpi_bus.h>
35#endif
33 36
34#include <asm/io.h> 37#include <asm/io.h>
35#include <asm/smp.h> 38#include <asm/smp.h>
@@ -47,6 +50,8 @@ static int no_timer_check;
47 50
48int disable_timer_pin_1 __initdata; 51int disable_timer_pin_1 __initdata;
49 52
53int timer_over_8254 __initdata = 1;
54
50/* Where if anywhere is the i8259 connect in external int mode */ 55/* Where if anywhere is the i8259 connect in external int mode */
51static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; 56static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
52 57
@@ -248,6 +253,20 @@ static int __init enable_ioapic_setup(char *str)
248__setup("noapic", disable_ioapic_setup); 253__setup("noapic", disable_ioapic_setup);
249__setup("apic", enable_ioapic_setup); 254__setup("apic", enable_ioapic_setup);
250 255
256static int __init setup_disable_8254_timer(char *s)
257{
258 timer_over_8254 = -1;
259 return 1;
260}
261static int __init setup_enable_8254_timer(char *s)
262{
263 timer_over_8254 = 2;
264 return 1;
265}
266
267__setup("disable_8254_timer", setup_disable_8254_timer);
268__setup("enable_8254_timer", setup_enable_8254_timer);
269
251#include <asm/pci-direct.h> 270#include <asm/pci-direct.h>
252#include <linux/pci_ids.h> 271#include <linux/pci_ids.h>
253#include <linux/pci.h> 272#include <linux/pci.h>
@@ -260,6 +279,8 @@ __setup("apic", enable_ioapic_setup);
260 279
261 And another hack to disable the IOMMU on VIA chipsets. 280 And another hack to disable the IOMMU on VIA chipsets.
262 281
282 ... and others. Really should move this somewhere else.
283
263 Kludge-O-Rama. */ 284 Kludge-O-Rama. */
264void __init check_ioapic(void) 285void __init check_ioapic(void)
265{ 286{
@@ -304,16 +325,20 @@ void __init check_ioapic(void)
304#endif 325#endif
305 /* RED-PEN skip them on mptables too? */ 326 /* RED-PEN skip them on mptables too? */
306 return; 327 return;
328
329 /* This should be actually default, but
330 for 2.6.16 let's do it for ATI only where
331 it's really needed. */
307 case PCI_VENDOR_ID_ATI: 332 case PCI_VENDOR_ID_ATI:
308 if (apic_runs_main_timer != 0) 333 if (timer_over_8254 == 1) {
309 break; 334 timer_over_8254 = 0;
310 printk(KERN_INFO 335 printk(KERN_INFO
311 "ATI board detected. Using APIC/PM timer.\n"); 336 "ATI board detected. Disabling timer routing over 8254.\n");
312 apic_runs_main_timer = 1; 337 }
313 nohpet = 1;
314 return; 338 return;
315 } 339 }
316 340
341
317 /* No multi-function device? */ 342 /* No multi-function device? */
318 type = read_pci_config_byte(num,slot,func, 343 type = read_pci_config_byte(num,slot,func,
319 PCI_HEADER_TYPE); 344 PCI_HEADER_TYPE);
@@ -1757,6 +1782,8 @@ static inline void unlock_ExtINT_logic(void)
1757 * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ 1782 * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ
1758 * is so screwy. Thanks to Brian Perkins for testing/hacking this beast 1783 * is so screwy. Thanks to Brian Perkins for testing/hacking this beast
1759 * fanatically on his truly buggy board. 1784 * fanatically on his truly buggy board.
1785 *
1786 * FIXME: really need to revamp this for modern platforms only.
1760 */ 1787 */
1761static inline void check_timer(void) 1788static inline void check_timer(void)
1762{ 1789{
@@ -1779,7 +1806,8 @@ static inline void check_timer(void)
1779 */ 1806 */
1780 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); 1807 apic_write(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
1781 init_8259A(1); 1808 init_8259A(1);
1782 enable_8259A_irq(0); 1809 if (timer_over_8254 > 0)
1810 enable_8259A_irq(0);
1783 1811
1784 pin1 = find_isa_irq_pin(0, mp_INT); 1812 pin1 = find_isa_irq_pin(0, mp_INT);
1785 apic1 = find_isa_irq_apic(0, mp_INT); 1813 apic1 = find_isa_irq_apic(0, mp_INT);
@@ -1834,7 +1862,7 @@ static inline void check_timer(void)
1834 } 1862 }
1835 printk(" failed.\n"); 1863 printk(" failed.\n");
1836 1864
1837 if (nmi_watchdog) { 1865 if (nmi_watchdog == NMI_IO_APIC) {
1838 printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n"); 1866 printk(KERN_WARNING "timer doesn't work through the IO-APIC - disabling NMI Watchdog!\n");
1839 nmi_watchdog = 0; 1867 nmi_watchdog = 0;
1840 } 1868 }
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index dc49bfb6db0a..9013a90b5c2e 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -288,9 +288,9 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
288 288
289 memcpy(str,mpc->mpc_productid,12); 289 memcpy(str,mpc->mpc_productid,12);
290 str[12]=0; 290 str[12]=0;
291 printk(KERN_INFO "Product ID: %s ",str); 291 printk("Product ID: %s ",str);
292 292
293 printk(KERN_INFO "APIC at: 0x%X\n",mpc->mpc_lapic); 293 printk("APIC at: 0x%X\n",mpc->mpc_lapic);
294 294
295 /* save the local APIC address, it might be non-default */ 295 /* save the local APIC address, it might be non-default */
296 if (!acpi_lapic) 296 if (!acpi_lapic)
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c
index 8be407a1f62d..5bf17e41cd2d 100644
--- a/arch/x86_64/kernel/nmi.c
+++ b/arch/x86_64/kernel/nmi.c
@@ -236,6 +236,7 @@ static void enable_lapic_nmi_watchdog(void)
236{ 236{
237 if (nmi_active < 0) { 237 if (nmi_active < 0) {
238 nmi_watchdog = NMI_LOCAL_APIC; 238 nmi_watchdog = NMI_LOCAL_APIC;
239 touch_nmi_watchdog();
239 setup_apic_nmi_watchdog(); 240 setup_apic_nmi_watchdog();
240 } 241 }
241} 242}
@@ -456,15 +457,17 @@ static DEFINE_PER_CPU(int, nmi_touch);
456 457
457void touch_nmi_watchdog (void) 458void touch_nmi_watchdog (void)
458{ 459{
459 int i; 460 if (nmi_watchdog > 0) {
461 unsigned cpu;
460 462
461 /* 463 /*
462 * Tell other CPUs to reset their alert counters. We cannot 464 * Tell other CPUs to reset their alert counters. We cannot
463 * do it ourselves because the alert count increase is not 465 * do it ourselves because the alert count increase is not
464 * atomic. 466 * atomic.
465 */ 467 */
466 for (i = 0; i < NR_CPUS; i++) 468 for_each_present_cpu (cpu)
467 per_cpu(nmi_touch, i) = 1; 469 per_cpu(nmi_touch, cpu) = 1;
470 }
468 471
469 touch_softlockup_watchdog(); 472 touch_softlockup_watchdog();
470} 473}
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c
index 2fe23a6c361b..0c3f052ba6ce 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86_64/kernel/pci-gart.c
@@ -228,11 +228,6 @@ static inline int need_iommu(struct device *dev, unsigned long addr, size_t size
228 int mmu = high; 228 int mmu = high;
229 if (force_iommu) 229 if (force_iommu)
230 mmu = 1; 230 mmu = 1;
231 if (no_iommu) {
232 if (high)
233 panic("PCI-DMA: high address but no IOMMU.\n");
234 mmu = 0;
235 }
236 return mmu; 231 return mmu;
237} 232}
238 233
@@ -241,11 +236,6 @@ static inline int nonforced_iommu(struct device *dev, unsigned long addr, size_t
241 u64 mask = *dev->dma_mask; 236 u64 mask = *dev->dma_mask;
242 int high = addr + size >= mask; 237 int high = addr + size >= mask;
243 int mmu = high; 238 int mmu = high;
244 if (no_iommu) {
245 if (high)
246 panic("PCI-DMA: high address but no IOMMU.\n");
247 mmu = 0;
248 }
249 return mmu; 239 return mmu;
250} 240}
251 241
@@ -379,7 +369,7 @@ static int __dma_map_cont(struct scatterlist *sg, int start, int stopat,
379 SET_LEAK(iommu_page); 369 SET_LEAK(iommu_page);
380 addr += PAGE_SIZE; 370 addr += PAGE_SIZE;
381 iommu_page++; 371 iommu_page++;
382 } 372 }
383 } 373 }
384 BUG_ON(iommu_page - iommu_start != pages); 374 BUG_ON(iommu_page - iommu_start != pages);
385 return 0; 375 return 0;
@@ -634,17 +624,13 @@ static int __init pci_iommu_init(void)
634 (agp_copy_info(agp_bridge, &info) < 0); 624 (agp_copy_info(agp_bridge, &info) < 0);
635#endif 625#endif
636 626
637 if (swiotlb) { 627 if (swiotlb)
638 no_iommu = 1;
639 return -1; 628 return -1;
640 } 629
641
642 if (no_iommu || 630 if (no_iommu ||
643 (!force_iommu && end_pfn <= MAX_DMA32_PFN) || 631 (!force_iommu && end_pfn <= MAX_DMA32_PFN) ||
644 !iommu_aperture || 632 !iommu_aperture ||
645 (no_agp && init_k8_gatt(&info) < 0)) { 633 (no_agp && init_k8_gatt(&info) < 0)) {
646 no_iommu = 1;
647 no_iommu_init();
648 printk(KERN_INFO "PCI-DMA: Disabling IOMMU.\n"); 634 printk(KERN_INFO "PCI-DMA: Disabling IOMMU.\n");
649 if (end_pfn > MAX_DMA32_PFN) { 635 if (end_pfn > MAX_DMA32_PFN) {
650 printk(KERN_ERR "WARNING more than 4GB of memory " 636 printk(KERN_ERR "WARNING more than 4GB of memory "
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 9435ab7d6fb8..aa55e3cec665 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -423,6 +423,12 @@ static __init void parse_cmdline_early (char ** cmdline_p)
423 else if(!memcmp(from, "elfcorehdr=", 11)) 423 else if(!memcmp(from, "elfcorehdr=", 11))
424 elfcorehdr_addr = memparse(from+11, &from); 424 elfcorehdr_addr = memparse(from+11, &from);
425#endif 425#endif
426
427#ifdef CONFIG_HOTPLUG_CPU
428 else if (!memcmp(from, "additional_cpus=", 16))
429 setup_additional_cpus(from+16);
430#endif
431
426 next_char: 432 next_char:
427 c = *(from++); 433 c = *(from++);
428 if (!c) 434 if (!c)
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index 67e4e28f4df8..66e98659d077 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -1152,8 +1152,6 @@ void __init smp_cpus_done(unsigned int max_cpus)
1152 setup_ioapic_dest(); 1152 setup_ioapic_dest();
1153#endif 1153#endif
1154 1154
1155 time_init_gtod();
1156
1157 check_nmi_watchdog(); 1155 check_nmi_watchdog();
1158} 1156}
1159 1157
@@ -1244,7 +1242,7 @@ void __cpu_die(unsigned int cpu)
1244 printk(KERN_ERR "CPU %u didn't die...\n", cpu); 1242 printk(KERN_ERR "CPU %u didn't die...\n", cpu);
1245} 1243}
1246 1244
1247static __init int setup_additional_cpus(char *s) 1245__init int setup_additional_cpus(char *s)
1248{ 1246{
1249 return get_option(&s, &additional_cpus); 1247 return get_option(&s, &additional_cpus);
1250} 1248}
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index dba7237be5c1..3080f84bf7b7 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -48,6 +48,8 @@ static void cpufreq_delayed_get(void);
48extern void i8254_timer_resume(void); 48extern void i8254_timer_resume(void);
49extern int using_apic_timer; 49extern int using_apic_timer;
50 50
51static char *time_init_gtod(void);
52
51DEFINE_SPINLOCK(rtc_lock); 53DEFINE_SPINLOCK(rtc_lock);
52DEFINE_SPINLOCK(i8253_lock); 54DEFINE_SPINLOCK(i8253_lock);
53 55
@@ -59,7 +61,7 @@ static int notsc __initdata = 0;
59unsigned int cpu_khz; /* TSC clocks / usec, not used here */ 61unsigned int cpu_khz; /* TSC clocks / usec, not used here */
60static unsigned long hpet_period; /* fsecs / HPET clock */ 62static unsigned long hpet_period; /* fsecs / HPET clock */
61unsigned long hpet_tick; /* HPET clocks / interrupt */ 63unsigned long hpet_tick; /* HPET clocks / interrupt */
62static int hpet_use_timer; /* Use counter of hpet for time keeping, otherwise PIT */ 64int hpet_use_timer; /* Use counter of hpet for time keeping, otherwise PIT */
63unsigned long vxtime_hz = PIT_TICK_RATE; 65unsigned long vxtime_hz = PIT_TICK_RATE;
64int report_lost_ticks; /* command line option */ 66int report_lost_ticks; /* command line option */
65unsigned long long monotonic_base; 67unsigned long long monotonic_base;
@@ -326,7 +328,10 @@ static noinline void handle_lost_ticks(int lost, struct pt_regs *regs)
326 print_symbol("rip %s\n", regs->rip); 328 print_symbol("rip %s\n", regs->rip);
327 if (vxtime.mode == VXTIME_TSC && vxtime.hpet_address) { 329 if (vxtime.mode == VXTIME_TSC && vxtime.hpet_address) {
328 printk(KERN_WARNING "Falling back to HPET\n"); 330 printk(KERN_WARNING "Falling back to HPET\n");
329 vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick; 331 if (hpet_use_timer)
332 vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
333 else
334 vxtime.last = hpet_readl(HPET_COUNTER);
330 vxtime.mode = VXTIME_HPET; 335 vxtime.mode = VXTIME_HPET;
331 do_gettimeoffset = do_gettimeoffset_hpet; 336 do_gettimeoffset = do_gettimeoffset_hpet;
332 } 337 }
@@ -898,6 +903,7 @@ static struct irqaction irq0 = {
898void __init time_init(void) 903void __init time_init(void)
899{ 904{
900 char *timename; 905 char *timename;
906 char *gtod;
901 907
902#ifdef HPET_HACK_ENABLE_DANGEROUS 908#ifdef HPET_HACK_ENABLE_DANGEROUS
903 if (!vxtime.hpet_address) { 909 if (!vxtime.hpet_address) {
@@ -942,21 +948,19 @@ void __init time_init(void)
942 timename = "PIT"; 948 timename = "PIT";
943 } 949 }
944 950
945 printk(KERN_INFO "time.c: Using %ld.%06ld MHz %s timer.\n", 951 vxtime.mode = VXTIME_TSC;
946 vxtime_hz / 1000000, vxtime_hz % 1000000, timename); 952 gtod = time_init_gtod();
953
954 printk(KERN_INFO "time.c: Using %ld.%06ld MHz WALL %s GTOD %s timer.\n",
955 vxtime_hz / 1000000, vxtime_hz % 1000000, timename, gtod);
947 printk(KERN_INFO "time.c: Detected %d.%03d MHz processor.\n", 956 printk(KERN_INFO "time.c: Detected %d.%03d MHz processor.\n",
948 cpu_khz / 1000, cpu_khz % 1000); 957 cpu_khz / 1000, cpu_khz % 1000);
949 vxtime.mode = VXTIME_TSC;
950 vxtime.quot = (1000000L << 32) / vxtime_hz; 958 vxtime.quot = (1000000L << 32) / vxtime_hz;
951 vxtime.tsc_quot = (1000L << 32) / cpu_khz; 959 vxtime.tsc_quot = (1000L << 32) / cpu_khz;
952 vxtime.last_tsc = get_cycles_sync(); 960 vxtime.last_tsc = get_cycles_sync();
953 setup_irq(0, &irq0); 961 setup_irq(0, &irq0);
954 962
955 set_cyc2ns_scale(cpu_khz); 963 set_cyc2ns_scale(cpu_khz);
956
957#ifndef CONFIG_SMP
958 time_init_gtod();
959#endif
960} 964}
961 965
962/* 966/*
@@ -978,9 +982,9 @@ __cpuinit int unsynchronized_tsc(void)
978} 982}
979 983
980/* 984/*
981 * Decide after all CPUs are booted what mode gettimeofday should use. 985 * Decide what mode gettimeofday should use.
982 */ 986 */
983void __init time_init_gtod(void) 987__init static char *time_init_gtod(void)
984{ 988{
985 char *timetype; 989 char *timetype;
986 990
@@ -988,7 +992,10 @@ void __init time_init_gtod(void)
988 notsc = 1; 992 notsc = 1;
989 if (vxtime.hpet_address && notsc) { 993 if (vxtime.hpet_address && notsc) {
990 timetype = hpet_use_timer ? "HPET" : "PIT/HPET"; 994 timetype = hpet_use_timer ? "HPET" : "PIT/HPET";
991 vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick; 995 if (hpet_use_timer)
996 vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick;
997 else
998 vxtime.last = hpet_readl(HPET_COUNTER);
992 vxtime.mode = VXTIME_HPET; 999 vxtime.mode = VXTIME_HPET;
993 do_gettimeoffset = do_gettimeoffset_hpet; 1000 do_gettimeoffset = do_gettimeoffset_hpet;
994#ifdef CONFIG_X86_PM_TIMER 1001#ifdef CONFIG_X86_PM_TIMER
@@ -1005,8 +1012,7 @@ void __init time_init_gtod(void)
1005 timetype = hpet_use_timer ? "HPET/TSC" : "PIT/TSC"; 1012 timetype = hpet_use_timer ? "HPET/TSC" : "PIT/TSC";
1006 vxtime.mode = VXTIME_TSC; 1013 vxtime.mode = VXTIME_TSC;
1007 } 1014 }
1008 1015 return timetype;
1009 printk(KERN_INFO "time.c: Using %s based timekeeping.\n", timetype);
1010} 1016}
1011 1017
1012__setup("report_lost_ticks", time_setup); 1018__setup("report_lost_ticks", time_setup);
@@ -1321,8 +1327,7 @@ static int __init nohpet_setup(char *s)
1321 1327
1322__setup("nohpet", nohpet_setup); 1328__setup("nohpet", nohpet_setup);
1323 1329
1324 1330int __init notsc_setup(char *s)
1325static int __init notsc_setup(char *s)
1326{ 1331{
1327 notsc = 1; 1332 notsc = 1;
1328 return 0; 1333 return 0;
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index ee1b2da9e5e7..28d50dc540e8 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -90,6 +90,20 @@ static inline void conditional_sti(struct pt_regs *regs)
90 local_irq_enable(); 90 local_irq_enable();
91} 91}
92 92
93static inline void preempt_conditional_sti(struct pt_regs *regs)
94{
95 preempt_disable();
96 if (regs->eflags & X86_EFLAGS_IF)
97 local_irq_enable();
98}
99
100static inline void preempt_conditional_cli(struct pt_regs *regs)
101{
102 if (regs->eflags & X86_EFLAGS_IF)
103 local_irq_disable();
104 preempt_enable_no_resched();
105}
106
93static int kstack_depth_to_print = 10; 107static int kstack_depth_to_print = 10;
94 108
95#ifdef CONFIG_KALLSYMS 109#ifdef CONFIG_KALLSYMS
@@ -693,7 +707,7 @@ asmlinkage void __kprobes do_debug(struct pt_regs * regs,
693 SIGTRAP) == NOTIFY_STOP) 707 SIGTRAP) == NOTIFY_STOP)
694 return; 708 return;
695 709
696 conditional_sti(regs); 710 preempt_conditional_sti(regs);
697 711
698 /* Mask out spurious debug traps due to lazy DR7 setting */ 712 /* Mask out spurious debug traps due to lazy DR7 setting */
699 if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) { 713 if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) {
@@ -738,11 +752,13 @@ asmlinkage void __kprobes do_debug(struct pt_regs * regs,
738 752
739clear_dr7: 753clear_dr7:
740 set_debugreg(0UL, 7); 754 set_debugreg(0UL, 7);
755 preempt_conditional_cli(regs);
741 return; 756 return;
742 757
743clear_TF_reenable: 758clear_TF_reenable:
744 set_tsk_thread_flag(tsk, TIF_SINGLESTEP); 759 set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
745 regs->eflags &= ~TF_MASK; 760 regs->eflags &= ~TF_MASK;
761 preempt_conditional_cli(regs);
746} 762}
747 763
748static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr) 764static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr)
diff --git a/arch/x86_64/mm/k8topology.c b/arch/x86_64/mm/k8topology.c
index a5663e0bb01c..dd60e71fdba6 100644
--- a/arch/x86_64/mm/k8topology.c
+++ b/arch/x86_64/mm/k8topology.c
@@ -155,7 +155,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
155 if (!found) 155 if (!found)
156 return -1; 156 return -1;
157 157
158 memnode_shift = compute_hash_shift(nodes, numnodes); 158 memnode_shift = compute_hash_shift(nodes, 8);
159 if (memnode_shift < 0) { 159 if (memnode_shift < 0) {
160 printk(KERN_ERR "No NUMA node hash function found. Contact maintainer\n"); 160 printk(KERN_ERR "No NUMA node hash function found. Contact maintainer\n");
161 return -1; 161 return -1;
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c
index 6ef9f9a76235..22e51beee8d3 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86_64/mm/numa.c
@@ -351,7 +351,7 @@ void __init init_cpu_to_node(void)
351 continue; 351 continue;
352 if (apicid_to_node[apicid] == NUMA_NO_NODE) 352 if (apicid_to_node[apicid] == NUMA_NO_NODE)
353 continue; 353 continue;
354 cpu_to_node[i] = apicid_to_node[apicid]; 354 numa_set_node(i,apicid_to_node[apicid]);
355 } 355 }
356} 356}
357 357
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index cd25300726fc..482c25767369 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -228,7 +228,8 @@ static int nodes_cover_memory(void)
228 } 228 }
229 229
230 e820ram = end_pfn - e820_hole_size(0, end_pfn); 230 e820ram = end_pfn - e820_hole_size(0, end_pfn);
231 if (pxmram < e820ram) { 231 /* We seem to lose 3 pages somewhere. Allow a bit of slack. */
232 if ((long)(e820ram - pxmram) >= 1*1024*1024) {
232 printk(KERN_ERR 233 printk(KERN_ERR
233 "SRAT: PXMs only cover %luMB of your %luMB e820 RAM. Not used.\n", 234 "SRAT: PXMs only cover %luMB of your %luMB e820 RAM. Not used.\n",
234 (pxmram << PAGE_SHIFT) >> 20, 235 (pxmram << PAGE_SHIFT) >> 20,
@@ -270,7 +271,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
270 return -1; 271 return -1;
271 } 272 }
272 273
273 memnode_shift = compute_hash_shift(nodes, nodes_weight(nodes_parsed)); 274 memnode_shift = compute_hash_shift(nodes, MAX_NUMNODES);
274 if (memnode_shift < 0) { 275 if (memnode_shift < 0) {
275 printk(KERN_ERR 276 printk(KERN_ERR
276 "SRAT: No NUMA node hash function found. Contact maintainer\n"); 277 "SRAT: No NUMA node hash function found. Contact maintainer\n");