aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/kernel')
-rw-r--r--arch/x86_64/kernel/Makefile2
-rw-r--r--arch/x86_64/kernel/acpi/Makefile4
-rw-r--r--arch/x86_64/kernel/acpi/sleep.c17
-rw-r--r--arch/x86_64/kernel/e820.c2
-rw-r--r--arch/x86_64/kernel/entry.S12
-rw-r--r--arch/x86_64/kernel/genapic.c6
-rw-r--r--arch/x86_64/kernel/genapic_cluster.c6
-rw-r--r--arch/x86_64/kernel/io_apic.c116
-rw-r--r--arch/x86_64/kernel/kprobes.c41
-rw-r--r--arch/x86_64/kernel/mpparse.c14
-rw-r--r--arch/x86_64/kernel/nmi.c6
-rw-r--r--arch/x86_64/kernel/process.c1
-rw-r--r--arch/x86_64/kernel/setup.c10
-rw-r--r--arch/x86_64/kernel/setup64.c2
-rw-r--r--arch/x86_64/kernel/smpboot.c10
-rw-r--r--arch/x86_64/kernel/time.c8
-rw-r--r--arch/x86_64/kernel/traps.c14
-rw-r--r--arch/x86_64/kernel/vmlinux.lds.S1
18 files changed, 157 insertions, 115 deletions
diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile
index c32e198d7b2b..1579bdd0adcd 100644
--- a/arch/x86_64/kernel/Makefile
+++ b/arch/x86_64/kernel/Makefile
@@ -12,7 +12,7 @@ obj-y := process.o signal.o entry.o traps.o irq.o \
12obj-$(CONFIG_X86_MCE) += mce.o 12obj-$(CONFIG_X86_MCE) += mce.o
13obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o 13obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o
14obj-$(CONFIG_MTRR) += ../../i386/kernel/cpu/mtrr/ 14obj-$(CONFIG_MTRR) += ../../i386/kernel/cpu/mtrr/
15obj-$(CONFIG_ACPI_BOOT) += acpi/ 15obj-$(CONFIG_ACPI) += acpi/
16obj-$(CONFIG_X86_MSR) += msr.o 16obj-$(CONFIG_X86_MSR) += msr.o
17obj-$(CONFIG_MICROCODE) += microcode.o 17obj-$(CONFIG_MICROCODE) += microcode.o
18obj-$(CONFIG_X86_CPUID) += cpuid.o 18obj-$(CONFIG_X86_CPUID) += cpuid.o
diff --git a/arch/x86_64/kernel/acpi/Makefile b/arch/x86_64/kernel/acpi/Makefile
index d2c2ee5f9a88..7da9ace890bd 100644
--- a/arch/x86_64/kernel/acpi/Makefile
+++ b/arch/x86_64/kernel/acpi/Makefile
@@ -1,3 +1,3 @@
1obj-$(CONFIG_ACPI_BOOT) := boot.o 1obj-y := boot.o
2boot-$(CONFIG_ACPI_BOOT) := ../../../i386/kernel/acpi/boot.o 2boot-y := ../../../i386/kernel/acpi/boot.o
3obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o 3obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o
diff --git a/arch/x86_64/kernel/acpi/sleep.c b/arch/x86_64/kernel/acpi/sleep.c
index 7a275de6df22..148f6f7ea315 100644
--- a/arch/x86_64/kernel/acpi/sleep.c
+++ b/arch/x86_64/kernel/acpi/sleep.c
@@ -47,7 +47,6 @@
47#include <asm/proto.h> 47#include <asm/proto.h>
48#include <asm/tlbflush.h> 48#include <asm/tlbflush.h>
49 49
50
51/* -------------------------------------------------------------------------- 50/* --------------------------------------------------------------------------
52 Low-Level Sleep Support 51 Low-Level Sleep Support
53 -------------------------------------------------------------------------- */ 52 -------------------------------------------------------------------------- */
@@ -77,11 +76,12 @@ static void init_low_mapping(void)
77 * Create an identity mapped page table and copy the wakeup routine to 76 * Create an identity mapped page table and copy the wakeup routine to
78 * low memory. 77 * low memory.
79 */ 78 */
80int acpi_save_state_mem (void) 79int acpi_save_state_mem(void)
81{ 80{
82 init_low_mapping(); 81 init_low_mapping();
83 82
84 memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start); 83 memcpy((void *)acpi_wakeup_address, &wakeup_start,
84 &wakeup_end - &wakeup_start);
85 acpi_copy_wakeup_routine(acpi_wakeup_address); 85 acpi_copy_wakeup_routine(acpi_wakeup_address);
86 86
87 return 0; 87 return 0;
@@ -90,7 +90,7 @@ int acpi_save_state_mem (void)
90/* 90/*
91 * acpi_restore_state 91 * acpi_restore_state
92 */ 92 */
93void acpi_restore_state_mem (void) 93void acpi_restore_state_mem(void)
94{ 94{
95 set_pgd(pgd_offset(current->mm, 0UL), low_ptr); 95 set_pgd(pgd_offset(current->mm, 0UL), low_ptr);
96 flush_tlb_all(); 96 flush_tlb_all();
@@ -108,7 +108,8 @@ void __init acpi_reserve_bootmem(void)
108{ 108{
109 acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE); 109 acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE);
110 if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) 110 if ((&wakeup_end - &wakeup_start) > PAGE_SIZE)
111 printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n"); 111 printk(KERN_CRIT
112 "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
112} 113}
113 114
114static int __init acpi_sleep_setup(char *str) 115static int __init acpi_sleep_setup(char *str)
@@ -127,6 +128,8 @@ static int __init acpi_sleep_setup(char *str)
127 128
128__setup("acpi_sleep=", acpi_sleep_setup); 129__setup("acpi_sleep=", acpi_sleep_setup);
129 130
130#endif /*CONFIG_ACPI_SLEEP*/ 131#endif /*CONFIG_ACPI_SLEEP */
131 132
132void acpi_pci_link_exit(void) {} 133void acpi_pci_link_exit(void)
134{
135}
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
index b548dea4e5b9..116ac5f53dce 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86_64/kernel/e820.c
@@ -85,7 +85,7 @@ int __init e820_mapped(unsigned long start, unsigned long end, unsigned type)
85 struct e820entry *ei = &e820.map[i]; 85 struct e820entry *ei = &e820.map[i];
86 if (type && ei->type != type) 86 if (type && ei->type != type)
87 continue; 87 continue;
88 if (ei->addr >= end || ei->addr + ei->size < start) 88 if (ei->addr >= end || ei->addr + ei->size <= start)
89 continue; 89 continue;
90 return 1; 90 return 1;
91 } 91 }
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index 096d470e280f..be51dbe1f75e 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -784,8 +784,9 @@ ENTRY(execve)
784 ret 784 ret
785 CFI_ENDPROC 785 CFI_ENDPROC
786 786
787ENTRY(page_fault) 787KPROBE_ENTRY(page_fault)
788 errorentry do_page_fault 788 errorentry do_page_fault
789 .previous .text
789 790
790ENTRY(coprocessor_error) 791ENTRY(coprocessor_error)
791 zeroentry do_coprocessor_error 792 zeroentry do_coprocessor_error
@@ -797,13 +798,14 @@ ENTRY(device_not_available)
797 zeroentry math_state_restore 798 zeroentry math_state_restore
798 799
799 /* runs on exception stack */ 800 /* runs on exception stack */
800ENTRY(debug) 801KPROBE_ENTRY(debug)
801 CFI_STARTPROC 802 CFI_STARTPROC
802 pushq $0 803 pushq $0
803 CFI_ADJUST_CFA_OFFSET 8 804 CFI_ADJUST_CFA_OFFSET 8
804 paranoidentry do_debug 805 paranoidentry do_debug
805 jmp paranoid_exit 806 jmp paranoid_exit
806 CFI_ENDPROC 807 CFI_ENDPROC
808 .previous .text
807 809
808 /* runs on exception stack */ 810 /* runs on exception stack */
809ENTRY(nmi) 811ENTRY(nmi)
@@ -854,8 +856,9 @@ paranoid_schedule:
854 jmp paranoid_userspace 856 jmp paranoid_userspace
855 CFI_ENDPROC 857 CFI_ENDPROC
856 858
857ENTRY(int3) 859KPROBE_ENTRY(int3)
858 zeroentry do_int3 860 zeroentry do_int3
861 .previous .text
859 862
860ENTRY(overflow) 863ENTRY(overflow)
861 zeroentry do_overflow 864 zeroentry do_overflow
@@ -892,8 +895,9 @@ ENTRY(stack_segment)
892 jmp paranoid_exit 895 jmp paranoid_exit
893 CFI_ENDPROC 896 CFI_ENDPROC
894 897
895ENTRY(general_protection) 898KPROBE_ENTRY(general_protection)
896 errorentry do_general_protection 899 errorentry do_general_protection
900 .previous .text
897 901
898ENTRY(alignment_check) 902ENTRY(alignment_check)
899 errorentry do_alignment_check 903 errorentry do_alignment_check
diff --git a/arch/x86_64/kernel/genapic.c b/arch/x86_64/kernel/genapic.c
index 30c843a5efdd..b1c144f73149 100644
--- a/arch/x86_64/kernel/genapic.c
+++ b/arch/x86_64/kernel/genapic.c
@@ -20,12 +20,12 @@
20#include <asm/smp.h> 20#include <asm/smp.h>
21#include <asm/ipi.h> 21#include <asm/ipi.h>
22 22
23#if defined(CONFIG_ACPI_BUS) 23#if defined(CONFIG_ACPI)
24#include <acpi/acpi_bus.h> 24#include <acpi/acpi_bus.h>
25#endif 25#endif
26 26
27/* which logical CPU number maps to which CPU (physical APIC ID) */ 27/* which logical CPU number maps to which CPU (physical APIC ID) */
28u8 x86_cpu_to_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; 28u8 x86_cpu_to_apicid[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID };
29EXPORT_SYMBOL(x86_cpu_to_apicid); 29EXPORT_SYMBOL(x86_cpu_to_apicid);
30u8 x86_cpu_to_log_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; 30u8 x86_cpu_to_log_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
31 31
@@ -47,7 +47,7 @@ void __init clustered_apic_check(void)
47 u8 cluster_cnt[NUM_APIC_CLUSTERS]; 47 u8 cluster_cnt[NUM_APIC_CLUSTERS];
48 int num_cpus = 0; 48 int num_cpus = 0;
49 49
50#if defined(CONFIG_ACPI_BUS) 50#if defined(CONFIG_ACPI)
51 /* 51 /*
52 * Some x86_64 machines use physical APIC mode regardless of how many 52 * Some x86_64 machines use physical APIC mode regardless of how many
53 * procs/clusters are present (x86_64 ES7000 is an example). 53 * procs/clusters are present (x86_64 ES7000 is an example).
diff --git a/arch/x86_64/kernel/genapic_cluster.c b/arch/x86_64/kernel/genapic_cluster.c
index 9703da7202e3..f6523dd1bc09 100644
--- a/arch/x86_64/kernel/genapic_cluster.c
+++ b/arch/x86_64/kernel/genapic_cluster.c
@@ -72,10 +72,14 @@ static void cluster_send_IPI_mask(cpumask_t mask, int vector)
72static void cluster_send_IPI_allbutself(int vector) 72static void cluster_send_IPI_allbutself(int vector)
73{ 73{
74 cpumask_t mask = cpu_online_map; 74 cpumask_t mask = cpu_online_map;
75 cpu_clear(smp_processor_id(), mask); 75 int me = get_cpu(); /* Ensure we are not preempted when we clear */
76
77 cpu_clear(me, mask);
76 78
77 if (!cpus_empty(mask)) 79 if (!cpus_empty(mask))
78 cluster_send_IPI_mask(mask, vector); 80 cluster_send_IPI_mask(mask, vector);
81
82 put_cpu();
79} 83}
80 84
81static void cluster_send_IPI_all(int vector) 85static void cluster_send_IPI_all(int vector)
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index d206d7e49cf5..40e0aca088fb 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -70,7 +70,7 @@ static struct irq_pin_list {
70 short apic, pin, next; 70 short apic, pin, next;
71} irq_2_pin[PIN_MAP_SIZE]; 71} irq_2_pin[PIN_MAP_SIZE];
72 72
73int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1}; 73int vector_irq[NR_VECTORS] __read_mostly = { [0 ... NR_VECTORS - 1] = -1};
74#ifdef CONFIG_PCI_MSI 74#ifdef CONFIG_PCI_MSI
75#define vector_to_irq(vector) \ 75#define vector_to_irq(vector) \
76 (platform_legacy_irq(vector) ? vector : vector_irq[vector]) 76 (platform_legacy_irq(vector) ? vector : vector_irq[vector])
@@ -78,6 +78,54 @@ int vector_irq[NR_VECTORS] = { [0 ... NR_VECTORS - 1] = -1};
78#define vector_to_irq(vector) (vector) 78#define vector_to_irq(vector) (vector)
79#endif 79#endif
80 80
81#define __DO_ACTION(R, ACTION, FINAL) \
82 \
83{ \
84 int pin; \
85 struct irq_pin_list *entry = irq_2_pin + irq; \
86 \
87 for (;;) { \
88 unsigned int reg; \
89 pin = entry->pin; \
90 if (pin == -1) \
91 break; \
92 reg = io_apic_read(entry->apic, 0x10 + R + pin*2); \
93 reg ACTION; \
94 io_apic_modify(entry->apic, reg); \
95 if (!entry->next) \
96 break; \
97 entry = irq_2_pin + entry->next; \
98 } \
99 FINAL; \
100}
101
102#ifdef CONFIG_SMP
103static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask)
104{
105 unsigned long flags;
106 unsigned int dest;
107 cpumask_t tmp;
108
109 cpus_and(tmp, mask, cpu_online_map);
110 if (cpus_empty(tmp))
111 tmp = TARGET_CPUS;
112
113 cpus_and(mask, tmp, CPU_MASK_ALL);
114
115 dest = cpu_mask_to_apicid(mask);
116
117 /*
118 * Only the high 8 bits are valid.
119 */
120 dest = SET_APIC_LOGICAL_ID(dest);
121
122 spin_lock_irqsave(&ioapic_lock, flags);
123 __DO_ACTION(1, = dest, )
124 set_irq_info(irq, mask);
125 spin_unlock_irqrestore(&ioapic_lock, flags);
126}
127#endif
128
81/* 129/*
82 * The common case is 1:1 IRQ<->pin mappings. Sometimes there are 130 * The common case is 1:1 IRQ<->pin mappings. Sometimes there are
83 * shared ISA-space IRQs, so we have to support them. We are super 131 * shared ISA-space IRQs, so we have to support them. We are super
@@ -101,26 +149,6 @@ static void add_pin_to_irq(unsigned int irq, int apic, int pin)
101 entry->pin = pin; 149 entry->pin = pin;
102} 150}
103 151
104#define __DO_ACTION(R, ACTION, FINAL) \
105 \
106{ \
107 int pin; \
108 struct irq_pin_list *entry = irq_2_pin + irq; \
109 \
110 for (;;) { \
111 unsigned int reg; \
112 pin = entry->pin; \
113 if (pin == -1) \
114 break; \
115 reg = io_apic_read(entry->apic, 0x10 + R + pin*2); \
116 reg ACTION; \
117 io_apic_modify(entry->apic, reg); \
118 if (!entry->next) \
119 break; \
120 entry = irq_2_pin + entry->next; \
121 } \
122 FINAL; \
123}
124 152
125#define DO_ACTION(name,R,ACTION, FINAL) \ 153#define DO_ACTION(name,R,ACTION, FINAL) \
126 \ 154 \
@@ -655,7 +683,7 @@ static inline int IO_APIC_irq_trigger(int irq)
655} 683}
656 684
657/* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */ 685/* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */
658u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 }; 686u8 irq_vector[NR_IRQ_VECTORS] __read_mostly = { FIRST_DEVICE_VECTOR , 0 };
659 687
660int assign_irq_vector(int irq) 688int assign_irq_vector(int irq)
661{ 689{
@@ -767,6 +795,7 @@ static void __init setup_IO_APIC_irqs(void)
767 spin_lock_irqsave(&ioapic_lock, flags); 795 spin_lock_irqsave(&ioapic_lock, flags);
768 io_apic_write(apic, 0x11+2*pin, *(((int *)&entry)+1)); 796 io_apic_write(apic, 0x11+2*pin, *(((int *)&entry)+1));
769 io_apic_write(apic, 0x10+2*pin, *(((int *)&entry)+0)); 797 io_apic_write(apic, 0x10+2*pin, *(((int *)&entry)+0));
798 set_native_irq_info(irq, TARGET_CPUS);
770 spin_unlock_irqrestore(&ioapic_lock, flags); 799 spin_unlock_irqrestore(&ioapic_lock, flags);
771 } 800 }
772 } 801 }
@@ -1314,6 +1343,7 @@ static unsigned int startup_edge_ioapic_irq(unsigned int irq)
1314 */ 1343 */
1315static void ack_edge_ioapic_irq(unsigned int irq) 1344static void ack_edge_ioapic_irq(unsigned int irq)
1316{ 1345{
1346 move_irq(irq);
1317 if ((irq_desc[irq].status & (IRQ_PENDING | IRQ_DISABLED)) 1347 if ((irq_desc[irq].status & (IRQ_PENDING | IRQ_DISABLED))
1318 == (IRQ_PENDING | IRQ_DISABLED)) 1348 == (IRQ_PENDING | IRQ_DISABLED))
1319 mask_IO_APIC_irq(irq); 1349 mask_IO_APIC_irq(irq);
@@ -1343,26 +1373,10 @@ static unsigned int startup_level_ioapic_irq (unsigned int irq)
1343 1373
1344static void end_level_ioapic_irq (unsigned int irq) 1374static void end_level_ioapic_irq (unsigned int irq)
1345{ 1375{
1376 move_irq(irq);
1346 ack_APIC_irq(); 1377 ack_APIC_irq();
1347} 1378}
1348 1379
1349static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask)
1350{
1351 unsigned long flags;
1352 unsigned int dest;
1353
1354 dest = cpu_mask_to_apicid(mask);
1355
1356 /*
1357 * Only the high 8 bits are valid.
1358 */
1359 dest = SET_APIC_LOGICAL_ID(dest);
1360
1361 spin_lock_irqsave(&ioapic_lock, flags);
1362 __DO_ACTION(1, = dest, )
1363 spin_unlock_irqrestore(&ioapic_lock, flags);
1364}
1365
1366#ifdef CONFIG_PCI_MSI 1380#ifdef CONFIG_PCI_MSI
1367static unsigned int startup_edge_ioapic_vector(unsigned int vector) 1381static unsigned int startup_edge_ioapic_vector(unsigned int vector)
1368{ 1382{
@@ -1375,6 +1389,7 @@ static void ack_edge_ioapic_vector(unsigned int vector)
1375{ 1389{
1376 int irq = vector_to_irq(vector); 1390 int irq = vector_to_irq(vector);
1377 1391
1392 move_native_irq(vector);
1378 ack_edge_ioapic_irq(irq); 1393 ack_edge_ioapic_irq(irq);
1379} 1394}
1380 1395
@@ -1389,6 +1404,7 @@ static void end_level_ioapic_vector (unsigned int vector)
1389{ 1404{
1390 int irq = vector_to_irq(vector); 1405 int irq = vector_to_irq(vector);
1391 1406
1407 move_native_irq(vector);
1392 end_level_ioapic_irq(irq); 1408 end_level_ioapic_irq(irq);
1393} 1409}
1394 1410
@@ -1406,14 +1422,17 @@ static void unmask_IO_APIC_vector (unsigned int vector)
1406 unmask_IO_APIC_irq(irq); 1422 unmask_IO_APIC_irq(irq);
1407} 1423}
1408 1424
1425#ifdef CONFIG_SMP
1409static void set_ioapic_affinity_vector (unsigned int vector, 1426static void set_ioapic_affinity_vector (unsigned int vector,
1410 cpumask_t cpu_mask) 1427 cpumask_t cpu_mask)
1411{ 1428{
1412 int irq = vector_to_irq(vector); 1429 int irq = vector_to_irq(vector);
1413 1430
1431 set_native_irq_info(vector, cpu_mask);
1414 set_ioapic_affinity_irq(irq, cpu_mask); 1432 set_ioapic_affinity_irq(irq, cpu_mask);
1415} 1433}
1416#endif 1434#endif // CONFIG_SMP
1435#endif // CONFIG_PCI_MSI
1417 1436
1418/* 1437/*
1419 * Level and edge triggered IO-APIC interrupts need different handling, 1438 * Level and edge triggered IO-APIC interrupts need different handling,
@@ -1424,7 +1443,7 @@ static void set_ioapic_affinity_vector (unsigned int vector,
1424 * races. 1443 * races.
1425 */ 1444 */
1426 1445
1427static struct hw_interrupt_type ioapic_edge_type = { 1446static struct hw_interrupt_type ioapic_edge_type __read_mostly = {
1428 .typename = "IO-APIC-edge", 1447 .typename = "IO-APIC-edge",
1429 .startup = startup_edge_ioapic, 1448 .startup = startup_edge_ioapic,
1430 .shutdown = shutdown_edge_ioapic, 1449 .shutdown = shutdown_edge_ioapic,
@@ -1432,10 +1451,12 @@ static struct hw_interrupt_type ioapic_edge_type = {
1432 .disable = disable_edge_ioapic, 1451 .disable = disable_edge_ioapic,
1433 .ack = ack_edge_ioapic, 1452 .ack = ack_edge_ioapic,
1434 .end = end_edge_ioapic, 1453 .end = end_edge_ioapic,
1454#ifdef CONFIG_SMP
1435 .set_affinity = set_ioapic_affinity, 1455 .set_affinity = set_ioapic_affinity,
1456#endif
1436}; 1457};
1437 1458
1438static struct hw_interrupt_type ioapic_level_type = { 1459static struct hw_interrupt_type ioapic_level_type __read_mostly = {
1439 .typename = "IO-APIC-level", 1460 .typename = "IO-APIC-level",
1440 .startup = startup_level_ioapic, 1461 .startup = startup_level_ioapic,
1441 .shutdown = shutdown_level_ioapic, 1462 .shutdown = shutdown_level_ioapic,
@@ -1443,7 +1464,9 @@ static struct hw_interrupt_type ioapic_level_type = {
1443 .disable = disable_level_ioapic, 1464 .disable = disable_level_ioapic,
1444 .ack = mask_and_ack_level_ioapic, 1465 .ack = mask_and_ack_level_ioapic,
1445 .end = end_level_ioapic, 1466 .end = end_level_ioapic,
1467#ifdef CONFIG_SMP
1446 .set_affinity = set_ioapic_affinity, 1468 .set_affinity = set_ioapic_affinity,
1469#endif
1447}; 1470};
1448 1471
1449static inline void init_IO_APIC_traps(void) 1472static inline void init_IO_APIC_traps(void)
@@ -1506,7 +1529,7 @@ static void ack_lapic_irq (unsigned int irq)
1506 1529
1507static void end_lapic_irq (unsigned int i) { /* nothing */ } 1530static void end_lapic_irq (unsigned int i) { /* nothing */ }
1508 1531
1509static struct hw_interrupt_type lapic_irq_type = { 1532static struct hw_interrupt_type lapic_irq_type __read_mostly = {
1510 .typename = "local-APIC-edge", 1533 .typename = "local-APIC-edge",
1511 .startup = NULL, /* startup_irq() not used for IRQ0 */ 1534 .startup = NULL, /* startup_irq() not used for IRQ0 */
1512 .shutdown = NULL, /* shutdown_irq() not used for IRQ0 */ 1535 .shutdown = NULL, /* shutdown_irq() not used for IRQ0 */
@@ -1841,7 +1864,7 @@ device_initcall(ioapic_init_sysfs);
1841 ACPI-based IOAPIC Configuration 1864 ACPI-based IOAPIC Configuration
1842 -------------------------------------------------------------------------- */ 1865 -------------------------------------------------------------------------- */
1843 1866
1844#ifdef CONFIG_ACPI_BOOT 1867#ifdef CONFIG_ACPI
1845 1868
1846#define IO_APIC_MAX_ID 0xFE 1869#define IO_APIC_MAX_ID 0xFE
1847 1870
@@ -1918,12 +1941,13 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
1918 spin_lock_irqsave(&ioapic_lock, flags); 1941 spin_lock_irqsave(&ioapic_lock, flags);
1919 io_apic_write(ioapic, 0x11+2*pin, *(((int *)&entry)+1)); 1942 io_apic_write(ioapic, 0x11+2*pin, *(((int *)&entry)+1));
1920 io_apic_write(ioapic, 0x10+2*pin, *(((int *)&entry)+0)); 1943 io_apic_write(ioapic, 0x10+2*pin, *(((int *)&entry)+0));
1944 set_native_irq_info(use_pci_vector() ? entry.vector : irq, TARGET_CPUS);
1921 spin_unlock_irqrestore(&ioapic_lock, flags); 1945 spin_unlock_irqrestore(&ioapic_lock, flags);
1922 1946
1923 return 0; 1947 return 0;
1924} 1948}
1925 1949
1926#endif /*CONFIG_ACPI_BOOT*/ 1950#endif /* CONFIG_ACPI */
1927 1951
1928 1952
1929/* 1953/*
@@ -1931,6 +1955,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int a
1931 * we need to reprogram the ioredtbls to cater for the cpus which have come online 1955 * we need to reprogram the ioredtbls to cater for the cpus which have come online
1932 * so mask in all cases should simply be TARGET_CPUS 1956 * so mask in all cases should simply be TARGET_CPUS
1933 */ 1957 */
1958#ifdef CONFIG_SMP
1934void __init setup_ioapic_dest(void) 1959void __init setup_ioapic_dest(void)
1935{ 1960{
1936 int pin, ioapic, irq, irq_entry; 1961 int pin, ioapic, irq, irq_entry;
@@ -1949,3 +1974,4 @@ void __init setup_ioapic_dest(void)
1949 1974
1950 } 1975 }
1951} 1976}
1977#endif
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c
index 5c6dc7051482..df08c43276a0 100644
--- a/arch/x86_64/kernel/kprobes.c
+++ b/arch/x86_64/kernel/kprobes.c
@@ -74,7 +74,7 @@ static inline int is_IF_modifier(kprobe_opcode_t *insn)
74 return 0; 74 return 0;
75} 75}
76 76
77int arch_prepare_kprobe(struct kprobe *p) 77int __kprobes arch_prepare_kprobe(struct kprobe *p)
78{ 78{
79 /* insn: must be on special executable page on x86_64. */ 79 /* insn: must be on special executable page on x86_64. */
80 up(&kprobe_mutex); 80 up(&kprobe_mutex);
@@ -189,7 +189,7 @@ static inline s32 *is_riprel(u8 *insn)
189 return NULL; 189 return NULL;
190} 190}
191 191
192void arch_copy_kprobe(struct kprobe *p) 192void __kprobes arch_copy_kprobe(struct kprobe *p)
193{ 193{
194 s32 *ripdisp; 194 s32 *ripdisp;
195 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE); 195 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE);
@@ -215,21 +215,21 @@ void arch_copy_kprobe(struct kprobe *p)
215 p->opcode = *p->addr; 215 p->opcode = *p->addr;
216} 216}
217 217
218void arch_arm_kprobe(struct kprobe *p) 218void __kprobes arch_arm_kprobe(struct kprobe *p)
219{ 219{
220 *p->addr = BREAKPOINT_INSTRUCTION; 220 *p->addr = BREAKPOINT_INSTRUCTION;
221 flush_icache_range((unsigned long) p->addr, 221 flush_icache_range((unsigned long) p->addr,
222 (unsigned long) p->addr + sizeof(kprobe_opcode_t)); 222 (unsigned long) p->addr + sizeof(kprobe_opcode_t));
223} 223}
224 224
225void arch_disarm_kprobe(struct kprobe *p) 225void __kprobes arch_disarm_kprobe(struct kprobe *p)
226{ 226{
227 *p->addr = p->opcode; 227 *p->addr = p->opcode;
228 flush_icache_range((unsigned long) p->addr, 228 flush_icache_range((unsigned long) p->addr,
229 (unsigned long) p->addr + sizeof(kprobe_opcode_t)); 229 (unsigned long) p->addr + sizeof(kprobe_opcode_t));
230} 230}
231 231
232void arch_remove_kprobe(struct kprobe *p) 232void __kprobes arch_remove_kprobe(struct kprobe *p)
233{ 233{
234 up(&kprobe_mutex); 234 up(&kprobe_mutex);
235 free_insn_slot(p->ainsn.insn); 235 free_insn_slot(p->ainsn.insn);
@@ -261,7 +261,7 @@ static inline void set_current_kprobe(struct kprobe *p, struct pt_regs *regs)
261 kprobe_saved_rflags &= ~IF_MASK; 261 kprobe_saved_rflags &= ~IF_MASK;
262} 262}
263 263
264static void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 264static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
265{ 265{
266 regs->eflags |= TF_MASK; 266 regs->eflags |= TF_MASK;
267 regs->eflags &= ~IF_MASK; 267 regs->eflags &= ~IF_MASK;
@@ -272,7 +272,8 @@ static void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
272 regs->rip = (unsigned long)p->ainsn.insn; 272 regs->rip = (unsigned long)p->ainsn.insn;
273} 273}
274 274
275void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs) 275void __kprobes arch_prepare_kretprobe(struct kretprobe *rp,
276 struct pt_regs *regs)
276{ 277{
277 unsigned long *sara = (unsigned long *)regs->rsp; 278 unsigned long *sara = (unsigned long *)regs->rsp;
278 struct kretprobe_instance *ri; 279 struct kretprobe_instance *ri;
@@ -295,7 +296,7 @@ void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs)
295 * Interrupts are disabled on entry as trap3 is an interrupt gate and they 296 * Interrupts are disabled on entry as trap3 is an interrupt gate and they
296 * remain disabled thorough out this function. 297 * remain disabled thorough out this function.
297 */ 298 */
298int kprobe_handler(struct pt_regs *regs) 299int __kprobes kprobe_handler(struct pt_regs *regs)
299{ 300{
300 struct kprobe *p; 301 struct kprobe *p;
301 int ret = 0; 302 int ret = 0;
@@ -310,7 +311,8 @@ int kprobe_handler(struct pt_regs *regs)
310 Disarm the probe we just hit, and ignore it. */ 311 Disarm the probe we just hit, and ignore it. */
311 p = get_kprobe(addr); 312 p = get_kprobe(addr);
312 if (p) { 313 if (p) {
313 if (kprobe_status == KPROBE_HIT_SS) { 314 if (kprobe_status == KPROBE_HIT_SS &&
315 *p->ainsn.insn == BREAKPOINT_INSTRUCTION) {
314 regs->eflags &= ~TF_MASK; 316 regs->eflags &= ~TF_MASK;
315 regs->eflags |= kprobe_saved_rflags; 317 regs->eflags |= kprobe_saved_rflags;
316 unlock_kprobes(); 318 unlock_kprobes();
@@ -360,7 +362,10 @@ int kprobe_handler(struct pt_regs *regs)
360 * either a probepoint or a debugger breakpoint 362 * either a probepoint or a debugger breakpoint
361 * at this address. In either case, no further 363 * at this address. In either case, no further
362 * handling of this interrupt is appropriate. 364 * handling of this interrupt is appropriate.
365 * Back up over the (now missing) int3 and run
366 * the original instruction.
363 */ 367 */
368 regs->rip = (unsigned long)addr;
364 ret = 1; 369 ret = 1;
365 } 370 }
366 /* Not one of ours: let kernel handle it */ 371 /* Not one of ours: let kernel handle it */
@@ -399,7 +404,7 @@ no_kprobe:
399/* 404/*
400 * Called when we hit the probe point at kretprobe_trampoline 405 * Called when we hit the probe point at kretprobe_trampoline
401 */ 406 */
402int trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) 407int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
403{ 408{
404 struct kretprobe_instance *ri = NULL; 409 struct kretprobe_instance *ri = NULL;
405 struct hlist_head *head; 410 struct hlist_head *head;
@@ -478,7 +483,7 @@ int trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
478 * that is atop the stack is the address following the copied instruction. 483 * that is atop the stack is the address following the copied instruction.
479 * We need to make it the address following the original instruction. 484 * We need to make it the address following the original instruction.
480 */ 485 */
481static void resume_execution(struct kprobe *p, struct pt_regs *regs) 486static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs)
482{ 487{
483 unsigned long *tos = (unsigned long *)regs->rsp; 488 unsigned long *tos = (unsigned long *)regs->rsp;
484 unsigned long next_rip = 0; 489 unsigned long next_rip = 0;
@@ -536,7 +541,7 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs)
536 * Interrupts are disabled on entry as trap1 is an interrupt gate and they 541 * Interrupts are disabled on entry as trap1 is an interrupt gate and they
537 * remain disabled thoroughout this function. And we hold kprobe lock. 542 * remain disabled thoroughout this function. And we hold kprobe lock.
538 */ 543 */
539int post_kprobe_handler(struct pt_regs *regs) 544int __kprobes post_kprobe_handler(struct pt_regs *regs)
540{ 545{
541 if (!kprobe_running()) 546 if (!kprobe_running())
542 return 0; 547 return 0;
@@ -571,7 +576,7 @@ out:
571} 576}
572 577
573/* Interrupts disabled, kprobe_lock held. */ 578/* Interrupts disabled, kprobe_lock held. */
574int kprobe_fault_handler(struct pt_regs *regs, int trapnr) 579int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
575{ 580{
576 if (current_kprobe->fault_handler 581 if (current_kprobe->fault_handler
577 && current_kprobe->fault_handler(current_kprobe, regs, trapnr)) 582 && current_kprobe->fault_handler(current_kprobe, regs, trapnr))
@@ -590,8 +595,8 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
590/* 595/*
591 * Wrapper routine for handling exceptions. 596 * Wrapper routine for handling exceptions.
592 */ 597 */
593int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, 598int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
594 void *data) 599 unsigned long val, void *data)
595{ 600{
596 struct die_args *args = (struct die_args *)data; 601 struct die_args *args = (struct die_args *)data;
597 switch (val) { 602 switch (val) {
@@ -619,7 +624,7 @@ int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val,
619 return NOTIFY_DONE; 624 return NOTIFY_DONE;
620} 625}
621 626
622int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) 627int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
623{ 628{
624 struct jprobe *jp = container_of(p, struct jprobe, kp); 629 struct jprobe *jp = container_of(p, struct jprobe, kp);
625 unsigned long addr; 630 unsigned long addr;
@@ -640,7 +645,7 @@ int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
640 return 1; 645 return 1;
641} 646}
642 647
643void jprobe_return(void) 648void __kprobes jprobe_return(void)
644{ 649{
645 preempt_enable_no_resched(); 650 preempt_enable_no_resched();
646 asm volatile (" xchg %%rbx,%%rsp \n" 651 asm volatile (" xchg %%rbx,%%rsp \n"
@@ -651,7 +656,7 @@ void jprobe_return(void)
651 (jprobe_saved_rsp):"memory"); 656 (jprobe_saved_rsp):"memory");
652} 657}
653 658
654int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) 659int __kprobes longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
655{ 660{
656 u8 *addr = (u8 *) (regs->rip - 1); 661 u8 *addr = (u8 *) (regs->rip - 1);
657 unsigned long stack_addr = (unsigned long)jprobe_saved_rsp; 662 unsigned long stack_addr = (unsigned long)jprobe_saved_rsp;
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c
index 79c362d03e2e..8d8ed6ae1d0c 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86_64/kernel/mpparse.c
@@ -74,7 +74,7 @@ static unsigned int num_processors = 0;
74physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE; 74physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE;
75 75
76/* ACPI MADT entry parsing functions */ 76/* ACPI MADT entry parsing functions */
77#ifdef CONFIG_ACPI_BOOT 77#ifdef CONFIG_ACPI
78extern struct acpi_boot_flags acpi_boot; 78extern struct acpi_boot_flags acpi_boot;
79#ifdef CONFIG_X86_LOCAL_APIC 79#ifdef CONFIG_X86_LOCAL_APIC
80extern int acpi_parse_lapic (acpi_table_entry_header *header); 80extern int acpi_parse_lapic (acpi_table_entry_header *header);
@@ -84,7 +84,7 @@ extern int acpi_parse_lapic_nmi (acpi_table_entry_header *header);
84#ifdef CONFIG_X86_IO_APIC 84#ifdef CONFIG_X86_IO_APIC
85extern int acpi_parse_ioapic (acpi_table_entry_header *header); 85extern int acpi_parse_ioapic (acpi_table_entry_header *header);
86#endif /*CONFIG_X86_IO_APIC*/ 86#endif /*CONFIG_X86_IO_APIC*/
87#endif /*CONFIG_ACPI_BOOT*/ 87#endif /*CONFIG_ACPI*/
88 88
89u8 bios_cpu_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; 89u8 bios_cpu_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID };
90 90
@@ -519,8 +519,6 @@ void __init get_smp_config (void)
519 struct intel_mp_floating *mpf = mpf_found; 519 struct intel_mp_floating *mpf = mpf_found;
520 520
521 /* 521 /*
522 * ACPI may be used to obtain the entire SMP configuration or just to
523 * enumerate/configure processors (CONFIG_ACPI_BOOT). Note that
524 * ACPI supports both logical (e.g. Hyper-Threading) and physical 522 * ACPI supports both logical (e.g. Hyper-Threading) and physical
525 * processors, where MPS only supports physical. 523 * processors, where MPS only supports physical.
526 */ 524 */
@@ -673,7 +671,7 @@ void __init find_smp_config (void)
673 ACPI-based MP Configuration 671 ACPI-based MP Configuration
674 -------------------------------------------------------------------------- */ 672 -------------------------------------------------------------------------- */
675 673
676#ifdef CONFIG_ACPI_BOOT 674#ifdef CONFIG_ACPI
677 675
678void __init mp_register_lapic_address ( 676void __init mp_register_lapic_address (
679 u64 address) 677 u64 address)
@@ -929,11 +927,9 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low)
929 if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC) 927 if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC)
930 return gsi; 928 return gsi;
931 929
932#ifdef CONFIG_ACPI_BUS
933 /* Don't set up the ACPI SCI because it's already set up */ 930 /* Don't set up the ACPI SCI because it's already set up */
934 if (acpi_fadt.sci_int == gsi) 931 if (acpi_fadt.sci_int == gsi)
935 return gsi; 932 return gsi;
936#endif
937 933
938 ioapic = mp_find_ioapic(gsi); 934 ioapic = mp_find_ioapic(gsi);
939 if (ioapic < 0) { 935 if (ioapic < 0) {
@@ -973,13 +969,11 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low)
973 if (gsi < MAX_GSI_NUM) { 969 if (gsi < MAX_GSI_NUM) {
974 if (gsi > 15) 970 if (gsi > 15)
975 gsi = pci_irq++; 971 gsi = pci_irq++;
976#ifdef CONFIG_ACPI_BUS
977 /* 972 /*
978 * Don't assign IRQ used by ACPI SCI 973 * Don't assign IRQ used by ACPI SCI
979 */ 974 */
980 if (gsi == acpi_fadt.sci_int) 975 if (gsi == acpi_fadt.sci_int)
981 gsi = pci_irq++; 976 gsi = pci_irq++;
982#endif
983 gsi_to_irq[irq] = gsi; 977 gsi_to_irq[irq] = gsi;
984 } else { 978 } else {
985 printk(KERN_ERR "GSI %u is too high\n", gsi); 979 printk(KERN_ERR "GSI %u is too high\n", gsi);
@@ -994,4 +988,4 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low)
994} 988}
995 989
996#endif /*CONFIG_X86_IO_APIC*/ 990#endif /*CONFIG_X86_IO_APIC*/
997#endif /*CONFIG_ACPI_BOOT*/ 991#endif /*CONFIG_ACPI*/
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c
index 64a8e05d5811..caf164959e19 100644
--- a/arch/x86_64/kernel/nmi.c
+++ b/arch/x86_64/kernel/nmi.c
@@ -463,6 +463,8 @@ void touch_nmi_watchdog (void)
463 */ 463 */
464 for (i = 0; i < NR_CPUS; i++) 464 for (i = 0; i < NR_CPUS; i++)
465 per_cpu(nmi_touch, i) = 1; 465 per_cpu(nmi_touch, i) = 1;
466
467 touch_softlockup_watchdog();
466} 468}
467 469
468void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason) 470void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason)
@@ -522,14 +524,14 @@ asmlinkage void do_nmi(struct pt_regs * regs, long error_code)
522 524
523 nmi_enter(); 525 nmi_enter();
524 add_pda(__nmi_count,1); 526 add_pda(__nmi_count,1);
525 if (!nmi_callback(regs, cpu)) 527 if (!rcu_dereference(nmi_callback)(regs, cpu))
526 default_do_nmi(regs); 528 default_do_nmi(regs);
527 nmi_exit(); 529 nmi_exit();
528} 530}
529 531
530void set_nmi_callback(nmi_callback_t callback) 532void set_nmi_callback(nmi_callback_t callback)
531{ 533{
532 nmi_callback = callback; 534 rcu_assign_pointer(nmi_callback, callback);
533} 535}
534 536
535void unset_nmi_callback(void) 537void unset_nmi_callback(void)
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index 7577f9d7a75d..8661f82ac70b 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -310,6 +310,7 @@ void __show_regs(struct pt_regs * regs)
310 310
311void show_regs(struct pt_regs *regs) 311void show_regs(struct pt_regs *regs)
312{ 312{
313 printk("CPU %d:", smp_processor_id());
313 __show_regs(regs); 314 __show_regs(regs);
314 show_trace(&regs->rsp); 315 show_trace(&regs->rsp);
315} 316}
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c
index 116a491e2961..0511d8087910 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@ -65,13 +65,13 @@
65 * Machine setup.. 65 * Machine setup..
66 */ 66 */
67 67
68struct cpuinfo_x86 boot_cpu_data; 68struct cpuinfo_x86 boot_cpu_data __read_mostly;
69 69
70unsigned long mmu_cr4_features; 70unsigned long mmu_cr4_features;
71 71
72int acpi_disabled; 72int acpi_disabled;
73EXPORT_SYMBOL(acpi_disabled); 73EXPORT_SYMBOL(acpi_disabled);
74#ifdef CONFIG_ACPI_BOOT 74#ifdef CONFIG_ACPI
75extern int __initdata acpi_ht; 75extern int __initdata acpi_ht;
76extern acpi_interrupt_flags acpi_sci_flags; 76extern acpi_interrupt_flags acpi_sci_flags;
77int __initdata acpi_force = 0; 77int __initdata acpi_force = 0;
@@ -294,7 +294,7 @@ static __init void parse_cmdline_early (char ** cmdline_p)
294 maxcpus = simple_strtoul(from + 8, NULL, 0); 294 maxcpus = simple_strtoul(from + 8, NULL, 0);
295 } 295 }
296#endif 296#endif
297#ifdef CONFIG_ACPI_BOOT 297#ifdef CONFIG_ACPI
298 /* "acpi=off" disables both ACPI table parsing and interpreter init */ 298 /* "acpi=off" disables both ACPI table parsing and interpreter init */
299 if (!memcmp(from, "acpi=off", 8)) 299 if (!memcmp(from, "acpi=off", 8))
300 disable_acpi(); 300 disable_acpi();
@@ -566,7 +566,7 @@ void __init setup_arch(char **cmdline_p)
566 566
567 init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT)); 567 init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT));
568 568
569#ifdef CONFIG_ACPI_BOOT 569#ifdef CONFIG_ACPI
570 /* 570 /*
571 * Initialize the ACPI boot-time table parser (gets the RSDP and SDT). 571 * Initialize the ACPI boot-time table parser (gets the RSDP and SDT).
572 * Call this early for SRAT node setup. 572 * Call this early for SRAT node setup.
@@ -658,7 +658,7 @@ void __init setup_arch(char **cmdline_p)
658 658
659 check_ioapic(); 659 check_ioapic();
660 660
661#ifdef CONFIG_ACPI_BOOT 661#ifdef CONFIG_ACPI
662 /* 662 /*
663 * Read APIC and some other early information from ACPI tables. 663 * Read APIC and some other early information from ACPI tables.
664 */ 664 */
diff --git a/arch/x86_64/kernel/setup64.c b/arch/x86_64/kernel/setup64.c
index 34082c1cc41e..e3ffcacc8c90 100644
--- a/arch/x86_64/kernel/setup64.c
+++ b/arch/x86_64/kernel/setup64.c
@@ -36,7 +36,7 @@ struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table };
36 36
37char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned"))); 37char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned")));
38 38
39unsigned long __supported_pte_mask = ~0UL; 39unsigned long __supported_pte_mask __read_mostly = ~0UL;
40static int do_not_nx __initdata = 0; 40static int do_not_nx __initdata = 0;
41 41
42/* noexec=on|off 42/* noexec=on|off
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index fa25e39fe54d..90aeccd15190 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -62,13 +62,13 @@
62/* Number of siblings per CPU package */ 62/* Number of siblings per CPU package */
63int smp_num_siblings = 1; 63int smp_num_siblings = 1;
64/* Package ID of each logical CPU */ 64/* Package ID of each logical CPU */
65u8 phys_proc_id[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; 65u8 phys_proc_id[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID };
66u8 cpu_core_id[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; 66u8 cpu_core_id[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID };
67EXPORT_SYMBOL(phys_proc_id); 67EXPORT_SYMBOL(phys_proc_id);
68EXPORT_SYMBOL(cpu_core_id); 68EXPORT_SYMBOL(cpu_core_id);
69 69
70/* Bitmask of currently online CPUs */ 70/* Bitmask of currently online CPUs */
71cpumask_t cpu_online_map; 71cpumask_t cpu_online_map __read_mostly;
72 72
73EXPORT_SYMBOL(cpu_online_map); 73EXPORT_SYMBOL(cpu_online_map);
74 74
@@ -88,8 +88,8 @@ struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned;
88/* Set when the idlers are all forked */ 88/* Set when the idlers are all forked */
89int smp_threads_ready; 89int smp_threads_ready;
90 90
91cpumask_t cpu_sibling_map[NR_CPUS] __cacheline_aligned; 91cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly;
92cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned; 92cpumask_t cpu_core_map[NR_CPUS] __read_mostly;
93EXPORT_SYMBOL(cpu_core_map); 93EXPORT_SYMBOL(cpu_core_map);
94 94
95/* 95/*
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 66bf6ddeb0c3..7b6abe058253 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -176,10 +176,7 @@ int do_settimeofday(struct timespec *tv)
176 set_normalized_timespec(&xtime, sec, nsec); 176 set_normalized_timespec(&xtime, sec, nsec);
177 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec); 177 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
178 178
179 time_adjust = 0; /* stop active adjtime() */ 179 ntp_clear();
180 time_status |= STA_UNSYNC;
181 time_maxerror = NTP_PHASE_LIMIT;
182 time_esterror = NTP_PHASE_LIMIT;
183 180
184 write_sequnlock_irq(&xtime_lock); 181 write_sequnlock_irq(&xtime_lock);
185 clock_was_set(); 182 clock_was_set();
@@ -471,7 +468,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
471 * off) isn't likely to go away much sooner anyway. 468 * off) isn't likely to go away much sooner anyway.
472 */ 469 */
473 470
474 if ((~time_status & STA_UNSYNC) && xtime.tv_sec > rtc_update && 471 if (ntp_synced() && xtime.tv_sec > rtc_update &&
475 abs(xtime.tv_nsec - 500000000) <= tick_nsec / 2) { 472 abs(xtime.tv_nsec - 500000000) <= tick_nsec / 2) {
476 set_rtc_mmss(xtime.tv_sec); 473 set_rtc_mmss(xtime.tv_sec);
477 rtc_update = xtime.tv_sec + 660; 474 rtc_update = xtime.tv_sec + 660;
@@ -1041,6 +1038,7 @@ static int timer_resume(struct sys_device *dev)
1041 write_sequnlock_irqrestore(&xtime_lock,flags); 1038 write_sequnlock_irqrestore(&xtime_lock,flags);
1042 jiffies += sleep_length; 1039 jiffies += sleep_length;
1043 wall_jiffies += sleep_length; 1040 wall_jiffies += sleep_length;
1041 touch_softlockup_watchdog();
1044 return 0; 1042 return 0;
1045} 1043}
1046 1044
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c
index 6ead433a3885..f238d6078a5a 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86_64/kernel/traps.c
@@ -29,6 +29,7 @@
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/moduleparam.h> 30#include <linux/moduleparam.h>
31#include <linux/nmi.h> 31#include <linux/nmi.h>
32#include <linux/kprobes.h>
32 33
33#include <asm/system.h> 34#include <asm/system.h>
34#include <asm/uaccess.h> 35#include <asm/uaccess.h>
@@ -419,8 +420,9 @@ void die_nmi(char *str, struct pt_regs *regs)
419 do_exit(SIGSEGV); 420 do_exit(SIGSEGV);
420} 421}
421 422
422static void do_trap(int trapnr, int signr, char *str, 423static void __kprobes do_trap(int trapnr, int signr, char *str,
423 struct pt_regs * regs, long error_code, siginfo_t *info) 424 struct pt_regs * regs, long error_code,
425 siginfo_t *info)
424{ 426{
425 conditional_sti(regs); 427 conditional_sti(regs);
426 428
@@ -504,7 +506,8 @@ DO_ERROR(18, SIGSEGV, "reserved", reserved)
504DO_ERROR(12, SIGBUS, "stack segment", stack_segment) 506DO_ERROR(12, SIGBUS, "stack segment", stack_segment)
505DO_ERROR( 8, SIGSEGV, "double fault", double_fault) 507DO_ERROR( 8, SIGSEGV, "double fault", double_fault)
506 508
507asmlinkage void do_general_protection(struct pt_regs * regs, long error_code) 509asmlinkage void __kprobes do_general_protection(struct pt_regs * regs,
510 long error_code)
508{ 511{
509 conditional_sti(regs); 512 conditional_sti(regs);
510 513
@@ -622,7 +625,7 @@ asmlinkage void default_do_nmi(struct pt_regs *regs)
622 io_check_error(reason, regs); 625 io_check_error(reason, regs);
623} 626}
624 627
625asmlinkage void do_int3(struct pt_regs * regs, long error_code) 628asmlinkage void __kprobes do_int3(struct pt_regs * regs, long error_code)
626{ 629{
627 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) { 630 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) {
628 return; 631 return;
@@ -653,7 +656,8 @@ asmlinkage struct pt_regs *sync_regs(struct pt_regs *eregs)
653} 656}
654 657
655/* runs on IST stack. */ 658/* runs on IST stack. */
656asmlinkage void do_debug(struct pt_regs * regs, unsigned long error_code) 659asmlinkage void __kprobes do_debug(struct pt_regs * regs,
660 unsigned long error_code)
657{ 661{
658 unsigned long condition; 662 unsigned long condition;
659 struct task_struct *tsk = current; 663 struct task_struct *tsk = current;
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S
index 2a94f9b60b2d..d4abb07af52d 100644
--- a/arch/x86_64/kernel/vmlinux.lds.S
+++ b/arch/x86_64/kernel/vmlinux.lds.S
@@ -21,6 +21,7 @@ SECTIONS
21 *(.text) 21 *(.text)
22 SCHED_TEXT 22 SCHED_TEXT
23 LOCK_TEXT 23 LOCK_TEXT
24 KPROBES_TEXT
24 *(.fixup) 25 *(.fixup)
25 *(.gnu.warning) 26 *(.gnu.warning)
26 } = 0x9090 27 } = 0x9090