aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/Kconfig2
-rw-r--r--arch/alpha/kernel/smp.c6
-rw-r--r--arch/alpha/oprofile/common.c6
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/kernel/traps.c2
-rw-r--r--arch/arm/nwfpe/fpopcode.h6
-rw-r--r--arch/i386/kernel/nmi.c4
-rw-r--r--arch/i386/kernel/traps.c10
-rw-r--r--arch/ia64/hp/sim/boot/boot_head.S2
-rw-r--r--arch/ia64/sn/kernel/io_init.c18
-rw-r--r--arch/m32r/Kconfig3
-rw-r--r--arch/m32r/Kconfig.debug2
-rw-r--r--arch/m32r/kernel/setup_m32700ut.c4
-rw-r--r--arch/m32r/kernel/setup_opsput.c4
-rw-r--r--arch/m32r/kernel/smpboot.c1
-rw-r--r--arch/m32r/lib/csum_partial_copy.c1
-rw-r--r--arch/m32r/mm/discontig.c2
-rw-r--r--arch/ppc/Kconfig5
-rw-r--r--arch/ppc/platforms/4xx/Kconfig14
-rw-r--r--arch/s390/kernel/cpcmd.c8
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c5
-rw-r--r--arch/sparc64/kernel/Makefile2
-rw-r--r--arch/sparc64/kernel/traps.c3
-rw-r--r--arch/sparc64/kernel/una_asm.S153
-rw-r--r--arch/sparc64/kernel/unaligned.c261
-rw-r--r--arch/x86_64/kernel/smpboot.c15
-rw-r--r--arch/x86_64/mm/fault.c4
-rw-r--r--arch/x86_64/pci/k8-bus.c13
28 files changed, 301 insertions, 257 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 083c5df42d35..189d5eababa8 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -522,7 +522,7 @@ source "mm/Kconfig"
522 522
523config NUMA 523config NUMA
524 bool "NUMA Support (EXPERIMENTAL)" 524 bool "NUMA Support (EXPERIMENTAL)"
525 depends on DISCONTIGMEM 525 depends on DISCONTIGMEM && BROKEN
526 help 526 help
527 Say Y to compile the kernel to support NUMA (Non-Uniform Memory 527 Say Y to compile the kernel to support NUMA (Non-Uniform Memory
528 Access). This option is for configuring high-end multiprocessor 528 Access). This option is for configuring high-end multiprocessor
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 8f1e78551b1e..e211aa7404e6 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -1036,7 +1036,7 @@ debug_spin_lock(spinlock_t * lock, const char *base_file, int line_no)
1036 " br 1b\n" 1036 " br 1b\n"
1037 ".previous" 1037 ".previous"
1038 : "=r" (tmp), "=m" (lock->lock), "=r" (stuck) 1038 : "=r" (tmp), "=m" (lock->lock), "=r" (stuck)
1039 : "1" (lock->lock), "2" (stuck) : "memory"); 1039 : "m" (lock->lock), "2" (stuck) : "memory");
1040 1040
1041 if (stuck < 0) { 1041 if (stuck < 0) {
1042 printk(KERN_WARNING 1042 printk(KERN_WARNING
@@ -1115,7 +1115,7 @@ void _raw_write_lock(rwlock_t * lock)
1115 ".previous" 1115 ".previous"
1116 : "=m" (*(volatile int *)lock), "=&r" (regx), "=&r" (regy), 1116 : "=m" (*(volatile int *)lock), "=&r" (regx), "=&r" (regy),
1117 "=&r" (stuck_lock), "=&r" (stuck_reader) 1117 "=&r" (stuck_lock), "=&r" (stuck_reader)
1118 : "0" (*(volatile int *)lock), "3" (stuck_lock), "4" (stuck_reader) : "memory"); 1118 : "m" (*(volatile int *)lock), "3" (stuck_lock), "4" (stuck_reader) : "memory");
1119 1119
1120 if (stuck_lock < 0) { 1120 if (stuck_lock < 0) {
1121 printk(KERN_WARNING "write_lock stuck at %p\n", inline_pc); 1121 printk(KERN_WARNING "write_lock stuck at %p\n", inline_pc);
@@ -1153,7 +1153,7 @@ void _raw_read_lock(rwlock_t * lock)
1153 " br 1b\n" 1153 " br 1b\n"
1154 ".previous" 1154 ".previous"
1155 : "=m" (*(volatile int *)lock), "=&r" (regx), "=&r" (stuck_lock) 1155 : "=m" (*(volatile int *)lock), "=&r" (regx), "=&r" (stuck_lock)
1156 : "0" (*(volatile int *)lock), "2" (stuck_lock) : "memory"); 1156 : "m" (*(volatile int *)lock), "2" (stuck_lock) : "memory");
1157 1157
1158 if (stuck_lock < 0) { 1158 if (stuck_lock < 0) {
1159 printk(KERN_WARNING "read_lock stuck at %p\n", inline_pc); 1159 printk(KERN_WARNING "read_lock stuck at %p\n", inline_pc);
diff --git a/arch/alpha/oprofile/common.c b/arch/alpha/oprofile/common.c
index 908eb4af8dec..ba788cfdc3c6 100644
--- a/arch/alpha/oprofile/common.c
+++ b/arch/alpha/oprofile/common.c
@@ -65,7 +65,7 @@ op_axp_setup(void)
65 model->reg_setup(&reg, ctr, &sys); 65 model->reg_setup(&reg, ctr, &sys);
66 66
67 /* Configure the registers on all cpus. */ 67 /* Configure the registers on all cpus. */
68 smp_call_function(model->cpu_setup, &reg, 0, 1); 68 (void)smp_call_function(model->cpu_setup, &reg, 0, 1);
69 model->cpu_setup(&reg); 69 model->cpu_setup(&reg);
70 return 0; 70 return 0;
71} 71}
@@ -86,7 +86,7 @@ op_axp_cpu_start(void *dummy)
86static int 86static int
87op_axp_start(void) 87op_axp_start(void)
88{ 88{
89 smp_call_function(op_axp_cpu_start, NULL, 0, 1); 89 (void)smp_call_function(op_axp_cpu_start, NULL, 0, 1);
90 op_axp_cpu_start(NULL); 90 op_axp_cpu_start(NULL);
91 return 0; 91 return 0;
92} 92}
@@ -101,7 +101,7 @@ op_axp_cpu_stop(void *dummy)
101static void 101static void
102op_axp_stop(void) 102op_axp_stop(void)
103{ 103{
104 smp_call_function(op_axp_cpu_stop, NULL, 0, 1); 104 (void)smp_call_function(op_axp_cpu_stop, NULL, 0, 1);
105 op_axp_cpu_stop(NULL); 105 op_axp_cpu_stop(NULL);
106} 106}
107 107
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 7bc4a583f4e1..c65c6eb9810d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -310,7 +310,7 @@ menu "Kernel Features"
310 310
311config SMP 311config SMP
312 bool "Symmetric Multi-Processing (EXPERIMENTAL)" 312 bool "Symmetric Multi-Processing (EXPERIMENTAL)"
313 depends on EXPERIMENTAL #&& n 313 depends on EXPERIMENTAL && BROKEN #&& n
314 help 314 help
315 This enables support for systems with more than one CPU. If you have 315 This enables support for systems with more than one CPU. If you have
316 a system with only one CPU, like most personal computers, say N. If 316 a system with only one CPU, like most personal computers, say N. If
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index d571c37ac30c..4554c961251c 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -617,7 +617,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs)
617 notify_die("unknown data abort code", regs, &info, instr, 0); 617 notify_die("unknown data abort code", regs, &info, instr, 0);
618} 618}
619 619
620volatile void __bug(const char *file, int line, void *data) 620void __attribute__((noreturn)) __bug(const char *file, int line, void *data)
621{ 621{
622 printk(KERN_CRIT"kernel BUG at %s:%d!", file, line); 622 printk(KERN_CRIT"kernel BUG at %s:%d!", file, line);
623 if (data) 623 if (data)
diff --git a/arch/arm/nwfpe/fpopcode.h b/arch/arm/nwfpe/fpopcode.h
index 8035f4faafbf..1777e92a88e6 100644
--- a/arch/arm/nwfpe/fpopcode.h
+++ b/arch/arm/nwfpe/fpopcode.h
@@ -370,20 +370,20 @@ TABLE 5
370#define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5) 370#define getRoundingMode(opcode) ((opcode & MASK_ROUNDING_MODE) >> 5)
371 371
372#ifdef CONFIG_FPE_NWFPE_XP 372#ifdef CONFIG_FPE_NWFPE_XP
373static inline const floatx80 getExtendedConstant(const unsigned int nIndex) 373static inline __attribute_pure__ floatx80 getExtendedConstant(const unsigned int nIndex)
374{ 374{
375 extern const floatx80 floatx80Constant[]; 375 extern const floatx80 floatx80Constant[];
376 return floatx80Constant[nIndex]; 376 return floatx80Constant[nIndex];
377} 377}
378#endif 378#endif
379 379
380static inline const float64 getDoubleConstant(const unsigned int nIndex) 380static inline __attribute_pure__ float64 getDoubleConstant(const unsigned int nIndex)
381{ 381{
382 extern const float64 float64Constant[]; 382 extern const float64 float64Constant[];
383 return float64Constant[nIndex]; 383 return float64Constant[nIndex];
384} 384}
385 385
386static inline const float32 getSingleConstant(const unsigned int nIndex) 386static inline __attribute_pure__ float32 getSingleConstant(const unsigned int nIndex)
387{ 387{
388 extern const float32 float32Constant[]; 388 extern const float32 float32Constant[];
389 return float32Constant[nIndex]; 389 return float32Constant[nIndex];
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index da6c46d667cb..8c242bb1ef45 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -195,7 +195,7 @@ static void disable_lapic_nmi_watchdog(void)
195 wrmsr(MSR_P6_EVNTSEL0, 0, 0); 195 wrmsr(MSR_P6_EVNTSEL0, 0, 0);
196 break; 196 break;
197 case 15: 197 case 15:
198 if (boot_cpu_data.x86_model > 0x3) 198 if (boot_cpu_data.x86_model > 0x4)
199 break; 199 break;
200 200
201 wrmsr(MSR_P4_IQ_CCCR0, 0, 0); 201 wrmsr(MSR_P4_IQ_CCCR0, 0, 0);
@@ -432,7 +432,7 @@ void setup_apic_nmi_watchdog (void)
432 setup_p6_watchdog(); 432 setup_p6_watchdog();
433 break; 433 break;
434 case 15: 434 case 15:
435 if (boot_cpu_data.x86_model > 0x3) 435 if (boot_cpu_data.x86_model > 0x4)
436 return; 436 return;
437 437
438 if (!setup_p4_watchdog()) 438 if (!setup_p4_watchdog())
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index a61f33d06ea3..cd2d5d5514fe 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -803,15 +803,17 @@ void math_error(void __user *eip)
803 */ 803 */
804 cwd = get_fpu_cwd(task); 804 cwd = get_fpu_cwd(task);
805 swd = get_fpu_swd(task); 805 swd = get_fpu_swd(task);
806 switch (((~cwd) & swd & 0x3f) | (swd & 0x240)) { 806 switch (swd & ~cwd & 0x3f) {
807 case 0x000: 807 case 0x000:
808 default: 808 default:
809 break; 809 break;
810 case 0x001: /* Invalid Op */ 810 case 0x001: /* Invalid Op */
811 case 0x041: /* Stack Fault */ 811 /*
812 case 0x241: /* Stack Fault | Direction */ 812 * swd & 0x240 == 0x040: Stack Underflow
813 * swd & 0x240 == 0x240: Stack Overflow
814 * User must clear the SF bit (0x40) if set
815 */
813 info.si_code = FPE_FLTINV; 816 info.si_code = FPE_FLTINV;
814 /* Should we clear the SF or let user space do it ???? */
815 break; 817 break;
816 case 0x002: /* Denormalize */ 818 case 0x002: /* Denormalize */
817 case 0x010: /* Underflow */ 819 case 0x010: /* Underflow */
diff --git a/arch/ia64/hp/sim/boot/boot_head.S b/arch/ia64/hp/sim/boot/boot_head.S
index 9364199e5632..1c8c7e6a9a5e 100644
--- a/arch/ia64/hp/sim/boot/boot_head.S
+++ b/arch/ia64/hp/sim/boot/boot_head.S
@@ -22,7 +22,7 @@ GLOBAL_ENTRY(_start)
22 .save rp, r0 22 .save rp, r0
23 .body 23 .body
24 movl gp = __gp 24 movl gp = __gp
25 movl sp = stack_mem 25 movl sp = stack_mem+16384-16
26 bsw.1 26 bsw.1
27 br.call.sptk.many rp=start_bootloader 27 br.call.sptk.many rp=start_bootloader
28END(_start) 28END(_start)
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index 37e10e010a2f..414cdf2e3c96 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -323,7 +323,7 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
323 struct pci_controller *controller; 323 struct pci_controller *controller;
324 struct pcibus_bussoft *prom_bussoft_ptr; 324 struct pcibus_bussoft *prom_bussoft_ptr;
325 struct hubdev_info *hubdev_info; 325 struct hubdev_info *hubdev_info;
326 void *provider_soft; 326 void *provider_soft = NULL;
327 struct sn_pcibus_provider *provider; 327 struct sn_pcibus_provider *provider;
328 328
329 status = sal_get_pcibus_info((u64) segment, (u64) busnum, 329 status = sal_get_pcibus_info((u64) segment, (u64) busnum,
@@ -339,7 +339,7 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
339 if (bus == NULL) { 339 if (bus == NULL) {
340 bus = pci_scan_bus(busnum, &pci_root_ops, controller); 340 bus = pci_scan_bus(busnum, &pci_root_ops, controller);
341 if (bus == NULL) 341 if (bus == NULL)
342 return; /* error, or bus already scanned */ 342 goto error_return; /* error, or bus already scanned */
343 bus->sysdata = NULL; 343 bus->sysdata = NULL;
344 } 344 }
345 345
@@ -352,28 +352,30 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
352 */ 352 */
353 353
354 if (prom_bussoft_ptr->bs_asic_type >= PCIIO_ASIC_MAX_TYPES) 354 if (prom_bussoft_ptr->bs_asic_type >= PCIIO_ASIC_MAX_TYPES)
355 return; /* unsupported asic type */ 355 goto error_return; /* unsupported asic type */
356 356
357 if (prom_bussoft_ptr->bs_asic_type == PCIIO_ASIC_TYPE_PPB) 357 if (prom_bussoft_ptr->bs_asic_type == PCIIO_ASIC_TYPE_PPB)
358 goto error_return; /* no further fixup necessary */ 358 goto error_return; /* no further fixup necessary */
359 359
360 provider = sn_pci_provider[prom_bussoft_ptr->bs_asic_type]; 360 provider = sn_pci_provider[prom_bussoft_ptr->bs_asic_type];
361 if (provider == NULL) 361 if (provider == NULL)
362 return; /* no provider registerd for this asic */ 362 goto error_return; /* no provider registerd for this asic */
363 363
364 provider_soft = NULL; 364 bus->sysdata = controller;
365 if (provider->bus_fixup) 365 if (provider->bus_fixup)
366 provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr, controller); 366 provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr, controller);
367 367
368 if (provider_soft == NULL) 368 if (provider_soft == NULL) {
369 return; /* fixup failed or not applicable */ 369 /* fixup failed or not applicable */
370 bus->sysdata = NULL;
371 goto error_return;
372 }
370 373
371 /* 374 /*
372 * Generic bus fixup goes here. Don't reference prom_bussoft_ptr 375 * Generic bus fixup goes here. Don't reference prom_bussoft_ptr
373 * after this point. 376 * after this point.
374 */ 377 */
375 378
376 bus->sysdata = controller;
377 PCI_CONTROLLER(bus)->platform_data = provider_soft; 379 PCI_CONTROLLER(bus)->platform_data = provider_soft;
378 nasid = NASID_GET(SN_PCIBUS_BUSSOFT(bus)->bs_base); 380 nasid = NASID_GET(SN_PCIBUS_BUSSOFT(bus)->bs_base);
379 cnode = nasid_to_cnodeid(nasid); 381 cnode = nasid_to_cnodeid(nasid);
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index 7772951df313..7622d4ec5f08 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -269,7 +269,7 @@ config NR_CPUS
269# Common NUMA Features 269# Common NUMA Features
270config NUMA 270config NUMA
271 bool "Numa Memory Allocation Support" 271 bool "Numa Memory Allocation Support"
272 depends on SMP 272 depends on SMP && BROKEN
273 default n 273 default n
274 274
275# turning this on wastes a bunch of space. 275# turning this on wastes a bunch of space.
@@ -286,6 +286,7 @@ menu "Bus options (PCI, PCMCIA, EISA, MCA, ISA)"
286 286
287config PCI 287config PCI
288 bool "PCI support" 288 bool "PCI support"
289 depends on BROKEN
289 default n 290 default n
290 help 291 help
291 Find out whether you have a PCI motherboard. PCI is the name of a 292 Find out whether you have a PCI motherboard. PCI is the name of a
diff --git a/arch/m32r/Kconfig.debug b/arch/m32r/Kconfig.debug
index 31039723804f..bbf711bab69e 100644
--- a/arch/m32r/Kconfig.debug
+++ b/arch/m32r/Kconfig.debug
@@ -20,7 +20,7 @@ config DEBUG_STACK_USAGE
20 20
21config DEBUG_PAGEALLOC 21config DEBUG_PAGEALLOC
22 bool "Page alloc debugging" 22 bool "Page alloc debugging"
23 depends on DEBUG_KERNEL 23 depends on DEBUG_KERNEL && BROKEN
24 help 24 help
25 Unmap pages from the kernel linear mapping after free_pages(). 25 Unmap pages from the kernel linear mapping after free_pages().
26 This results in a large slowdown, but helps to find certain types 26 This results in a large slowdown, but helps to find certain types
diff --git a/arch/m32r/kernel/setup_m32700ut.c b/arch/m32r/kernel/setup_m32700ut.c
index a146b24a556b..708634b685e4 100644
--- a/arch/m32r/kernel/setup_m32700ut.c
+++ b/arch/m32r/kernel/setup_m32700ut.c
@@ -30,9 +30,11 @@
30typedef struct { 30typedef struct {
31 unsigned long icucr; /* ICU Control Register */ 31 unsigned long icucr; /* ICU Control Register */
32} icu_data_t; 32} icu_data_t;
33static icu_data_t icu_data[M32700UT_NUM_CPU_IRQ];
34#else
35icu_data_t icu_data[M32700UT_NUM_CPU_IRQ];
33#endif /* CONFIG_SMP */ 36#endif /* CONFIG_SMP */
34 37
35static icu_data_t icu_data[M32700UT_NUM_CPU_IRQ];
36 38
37static void disable_m32700ut_irq(unsigned int irq) 39static void disable_m32700ut_irq(unsigned int irq)
38{ 40{
diff --git a/arch/m32r/kernel/setup_opsput.c b/arch/m32r/kernel/setup_opsput.c
index f0301f58bcce..d7b7ec6d30f8 100644
--- a/arch/m32r/kernel/setup_opsput.c
+++ b/arch/m32r/kernel/setup_opsput.c
@@ -31,9 +31,11 @@
31typedef struct { 31typedef struct {
32 unsigned long icucr; /* ICU Control Register */ 32 unsigned long icucr; /* ICU Control Register */
33} icu_data_t; 33} icu_data_t;
34static icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ];
35#else
36icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ];
34#endif /* CONFIG_SMP */ 37#endif /* CONFIG_SMP */
35 38
36static icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ];
37 39
38static void disable_opsput_irq(unsigned int irq) 40static void disable_opsput_irq(unsigned int irq)
39{ 41{
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
index f9a0e723478d..640d592ea072 100644
--- a/arch/m32r/kernel/smpboot.c
+++ b/arch/m32r/kernel/smpboot.c
@@ -91,6 +91,7 @@ extern struct {
91 91
92/* which physical physical ID maps to which logical CPU number */ 92/* which physical physical ID maps to which logical CPU number */
93static volatile int physid_2_cpu[NR_CPUS]; 93static volatile int physid_2_cpu[NR_CPUS];
94#define physid_to_cpu(physid) physid_2_cpu[physid]
94 95
95/* which logical CPU number maps to which physical ID */ 96/* which logical CPU number maps to which physical ID */
96volatile int cpu_2_physid[NR_CPUS]; 97volatile int cpu_2_physid[NR_CPUS];
diff --git a/arch/m32r/lib/csum_partial_copy.c b/arch/m32r/lib/csum_partial_copy.c
index c871b4606b07..ddb16a83a8ce 100644
--- a/arch/m32r/lib/csum_partial_copy.c
+++ b/arch/m32r/lib/csum_partial_copy.c
@@ -58,3 +58,4 @@ csum_partial_copy_from_user (const unsigned char __user *src,
58 return csum_partial(dst, len-missing, sum); 58 return csum_partial(dst, len-missing, sum);
59} 59}
60EXPORT_SYMBOL(csum_partial_copy_from_user); 60EXPORT_SYMBOL(csum_partial_copy_from_user);
61EXPORT_SYMBOL(csum_partial);
diff --git a/arch/m32r/mm/discontig.c b/arch/m32r/mm/discontig.c
index 1d1a01e54b3f..08e727955555 100644
--- a/arch/m32r/mm/discontig.c
+++ b/arch/m32r/mm/discontig.c
@@ -12,12 +12,14 @@
12#include <linux/mmzone.h> 12#include <linux/mmzone.h>
13#include <linux/initrd.h> 13#include <linux/initrd.h>
14#include <linux/nodemask.h> 14#include <linux/nodemask.h>
15#include <linux/module.h>
15 16
16#include <asm/setup.h> 17#include <asm/setup.h>
17 18
18extern char _end[]; 19extern char _end[];
19 20
20struct pglist_data *node_data[MAX_NUMNODES]; 21struct pglist_data *node_data[MAX_NUMNODES];
22EXPORT_SYMBOL(node_data);
21static bootmem_data_t node_bdata[MAX_NUMNODES] __initdata; 23static bootmem_data_t node_bdata[MAX_NUMNODES] __initdata;
22 24
23pg_data_t m32r_node_data[MAX_NUMNODES]; 25pg_data_t m32r_node_data[MAX_NUMNODES];
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index f6db3b385fea..e6fa1d1cc03a 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -911,6 +911,7 @@ config PPCBUG_NVRAM
911 default y if PPC_PREP 911 default y if PPC_PREP
912 912
913config SMP 913config SMP
914 depends on PPC_STD_MMU
914 bool "Symmetric multi-processing support" 915 bool "Symmetric multi-processing support"
915 ---help--- 916 ---help---
916 This enables support for systems with more than one CPU. If you have 917 This enables support for systems with more than one CPU. If you have
@@ -930,7 +931,7 @@ config SMP
930 931
931config IRQ_ALL_CPUS 932config IRQ_ALL_CPUS
932 bool "Distribute interrupts on all CPUs by default" 933 bool "Distribute interrupts on all CPUs by default"
933 depends on SMP 934 depends on SMP && !MV64360
934 help 935 help
935 This option gives the kernel permission to distribute IRQs across 936 This option gives the kernel permission to distribute IRQs across
936 multiple CPUs. Saying N here will route all IRQs to the first 937 multiple CPUs. Saying N here will route all IRQs to the first
@@ -1121,7 +1122,9 @@ config PROC_HARDWARE
1121 1122
1122source "drivers/zorro/Kconfig" 1123source "drivers/zorro/Kconfig"
1123 1124
1125if !44x || BROKEN
1124source kernel/power/Kconfig 1126source kernel/power/Kconfig
1127endif
1125 1128
1126config SECCOMP 1129config SECCOMP
1127 bool "Enable seccomp to safely compute untrusted bytecode" 1130 bool "Enable seccomp to safely compute untrusted bytecode"
diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
index f7c045764e04..805dd98908a3 100644
--- a/arch/ppc/platforms/4xx/Kconfig
+++ b/arch/ppc/platforms/4xx/Kconfig
@@ -3,6 +3,11 @@ config 4xx
3 depends on 40x || 44x 3 depends on 40x || 44x
4 default y 4 default y
5 5
6config WANT_EARLY_SERIAL
7 bool
8 select SERIAL_8250
9 default n
10
6menu "IBM 4xx options" 11menu "IBM 4xx options"
7 depends on 4xx 12 depends on 4xx
8 13
@@ -18,6 +23,7 @@ config ASH
18 23
19config BUBINGA 24config BUBINGA
20 bool "Bubinga" 25 bool "Bubinga"
26 select WANT_EARLY_SERIAL
21 help 27 help
22 This option enables support for the IBM 405EP evaluation board. 28 This option enables support for the IBM 405EP evaluation board.
23 29
@@ -70,21 +76,25 @@ choice
70 76
71config BAMBOO 77config BAMBOO
72 bool "Bamboo" 78 bool "Bamboo"
79 select WANT_EARLY_SERIAL
73 help 80 help
74 This option enables support for the IBM PPC440EP evaluation board. 81 This option enables support for the IBM PPC440EP evaluation board.
75 82
76config EBONY 83config EBONY
77 bool "Ebony" 84 bool "Ebony"
85 select WANT_EARLY_SERIAL
78 help 86 help
79 This option enables support for the IBM PPC440GP evaluation board. 87 This option enables support for the IBM PPC440GP evaluation board.
80 88
81config LUAN 89config LUAN
82 bool "Luan" 90 bool "Luan"
91 select WANT_EARLY_SERIAL
83 help 92 help
84 This option enables support for the IBM PPC440SP evaluation board. 93 This option enables support for the IBM PPC440SP evaluation board.
85 94
86config OCOTEA 95config OCOTEA
87 bool "Ocotea" 96 bool "Ocotea"
97 select WANT_EARLY_SERIAL
88 help 98 help
89 This option enables support for the IBM PPC440GX evaluation board. 99 This option enables support for the IBM PPC440GX evaluation board.
90 100
@@ -230,10 +240,6 @@ config PPC_GEN550
230 depends on 4xx 240 depends on 4xx
231 default y 241 default y
232 242
233config PM
234 bool "Power Management support (EXPERIMENTAL)"
235 depends on 4xx && EXPERIMENTAL
236
237choice 243choice
238 prompt "TTYS0 device and default console" 244 prompt "TTYS0 device and default console"
239 depends on 40x 245 depends on 40x
diff --git a/arch/s390/kernel/cpcmd.c b/arch/s390/kernel/cpcmd.c
index 20062145e84e..d47fecb42cc5 100644
--- a/arch/s390/kernel/cpcmd.c
+++ b/arch/s390/kernel/cpcmd.c
@@ -46,9 +46,9 @@ int __cpcmd(const char *cmd, char *response, int rlen, int *response_code)
46 "lra 3,0(%4)\n" 46 "lra 3,0(%4)\n"
47 "lr 5,%5\n" 47 "lr 5,%5\n"
48 "diag 2,4,0x8\n" 48 "diag 2,4,0x8\n"
49 "brc 8, .Litfits\n" 49 "brc 8, 1f\n"
50 "ar 5, %5\n" 50 "ar 5, %5\n"
51 ".Litfits: \n" 51 "1: \n"
52 "lr %0,4\n" 52 "lr %0,4\n"
53 "lr %1,5\n" 53 "lr %1,5\n"
54 : "=d" (return_code), "=d" (return_len) 54 : "=d" (return_code), "=d" (return_len)
@@ -64,9 +64,9 @@ int __cpcmd(const char *cmd, char *response, int rlen, int *response_code)
64 "sam31\n" 64 "sam31\n"
65 "diag 2,4,0x8\n" 65 "diag 2,4,0x8\n"
66 "sam64\n" 66 "sam64\n"
67 "brc 8, .Litfits\n" 67 "brc 8, 1f\n"
68 "agr 5, %5\n" 68 "agr 5, %5\n"
69 ".Litfits: \n" 69 "1: \n"
70 "lgr %0,4\n" 70 "lgr %0,4\n"
71 "lgr %1,5\n" 71 "lgr %1,5\n"
72 : "=d" (return_code), "=d" (return_len) 72 : "=d" (return_code), "=d" (return_len)
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index 1bd430d0ca06..8faa8dc4de43 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -98,8 +98,9 @@ extern void ___rw_write_enter(void);
98 * The module references will be fixed up by module_frob_arch_sections. 98 * The module references will be fixed up by module_frob_arch_sections.
99 */ 99 */
100#define DOT_ALIAS2(__ret, __x, __arg1, __arg2) \ 100#define DOT_ALIAS2(__ret, __x, __arg1, __arg2) \
101 extern __ret __x(__arg1, __arg2) \ 101 extern __ret __x(__arg1, __arg2); \
102 __attribute__((weak, alias("." # __x))); 102 asm(".weak " #__x);\
103 asm(#__x "=." #__x);
103 104
104DOT_ALIAS2(int, div, int, int) 105DOT_ALIAS2(int, div, int, int)
105DOT_ALIAS2(int, mul, int, int) 106DOT_ALIAS2(int, mul, int, int)
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile
index 093281bdf85f..6f00ab8b9d23 100644
--- a/arch/sparc64/kernel/Makefile
+++ b/arch/sparc64/kernel/Makefile
@@ -8,7 +8,7 @@ EXTRA_CFLAGS := -Werror
8extra-y := head.o init_task.o vmlinux.lds 8extra-y := head.o init_task.o vmlinux.lds
9 9
10obj-y := process.o setup.o cpu.o idprom.o \ 10obj-y := process.o setup.o cpu.o idprom.o \
11 traps.o devices.o auxio.o \ 11 traps.o devices.o auxio.o una_asm.o \
12 irq.o ptrace.o time.o sys_sparc.o signal.o \ 12 irq.o ptrace.o time.o sys_sparc.o signal.o \
13 unaligned.o central.o pci.o starfire.o semaphore.o \ 13 unaligned.o central.o pci.o starfire.o semaphore.o \
14 power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o 14 power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index 100b0107c4be..0c9e54b2f0c8 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -2127,6 +2127,9 @@ void __init trap_init(void)
2127 TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || 2127 TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) ||
2128 TI_NEW_CHILD != offsetof(struct thread_info, new_child) || 2128 TI_NEW_CHILD != offsetof(struct thread_info, new_child) ||
2129 TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) || 2129 TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) ||
2130 TI_RESTART_BLOCK != offsetof(struct thread_info, restart_block) ||
2131 TI_KUNA_REGS != offsetof(struct thread_info, kern_una_regs) ||
2132 TI_KUNA_INSN != offsetof(struct thread_info, kern_una_insn) ||
2130 TI_FPREGS != offsetof(struct thread_info, fpregs) || 2133 TI_FPREGS != offsetof(struct thread_info, fpregs) ||
2131 (TI_FPREGS & (64 - 1))) 2134 (TI_FPREGS & (64 - 1)))
2132 thread_info_offsets_are_bolixed_dave(); 2135 thread_info_offsets_are_bolixed_dave();
diff --git a/arch/sparc64/kernel/una_asm.S b/arch/sparc64/kernel/una_asm.S
new file mode 100644
index 000000000000..cbb40585253c
--- /dev/null
+++ b/arch/sparc64/kernel/una_asm.S
@@ -0,0 +1,153 @@
1/* una_asm.S: Kernel unaligned trap assembler helpers.
2 *
3 * Copyright (C) 1996,2005 David S. Miller (davem@davemloft.net)
4 * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
5 */
6
7 .text
8
9kernel_unaligned_trap_fault:
10 call kernel_mna_trap_fault
11 nop
12 retl
13 nop
14 .size kern_unaligned_trap_fault, .-kern_unaligned_trap_fault
15
16 .globl __do_int_store
17__do_int_store:
18 rd %asi, %o4
19 wr %o3, 0, %asi
20 ldx [%o2], %g3
21 cmp %o1, 2
22 be,pn %icc, 2f
23 cmp %o1, 4
24 be,pt %icc, 1f
25 srlx %g3, 24, %g2
26 srlx %g3, 56, %g1
27 srlx %g3, 48, %g7
284: stba %g1, [%o0] %asi
29 srlx %g3, 40, %g1
305: stba %g7, [%o0 + 1] %asi
31 srlx %g3, 32, %g7
326: stba %g1, [%o0 + 2] %asi
337: stba %g7, [%o0 + 3] %asi
34 srlx %g3, 16, %g1
358: stba %g2, [%o0 + 4] %asi
36 srlx %g3, 8, %g7
379: stba %g1, [%o0 + 5] %asi
3810: stba %g7, [%o0 + 6] %asi
39 ba,pt %xcc, 0f
4011: stba %g3, [%o0 + 7] %asi
411: srl %g3, 16, %g7
4212: stba %g2, [%o0] %asi
43 srl %g3, 8, %g2
4413: stba %g7, [%o0 + 1] %asi
4514: stba %g2, [%o0 + 2] %asi
46 ba,pt %xcc, 0f
4715: stba %g3, [%o0 + 3] %asi
482: srl %g3, 8, %g2
4916: stba %g2, [%o0] %asi
5017: stba %g3, [%o0 + 1] %asi
510:
52 wr %o4, 0x0, %asi
53 retl
54 nop
55 .size __do_int_store, .-__do_int_store
56
57 .section __ex_table
58 .word 4b, kernel_unaligned_trap_fault
59 .word 5b, kernel_unaligned_trap_fault
60 .word 6b, kernel_unaligned_trap_fault
61 .word 7b, kernel_unaligned_trap_fault
62 .word 8b, kernel_unaligned_trap_fault
63 .word 9b, kernel_unaligned_trap_fault
64 .word 10b, kernel_unaligned_trap_fault
65 .word 11b, kernel_unaligned_trap_fault
66 .word 12b, kernel_unaligned_trap_fault
67 .word 13b, kernel_unaligned_trap_fault
68 .word 14b, kernel_unaligned_trap_fault
69 .word 15b, kernel_unaligned_trap_fault
70 .word 16b, kernel_unaligned_trap_fault
71 .word 17b, kernel_unaligned_trap_fault
72 .previous
73
74 .globl do_int_load
75do_int_load:
76 rd %asi, %o5
77 wr %o4, 0, %asi
78 cmp %o1, 8
79 bge,pn %icc, 9f
80 cmp %o1, 4
81 be,pt %icc, 6f
824: lduba [%o2] %asi, %g2
835: lduba [%o2 + 1] %asi, %g3
84 sll %g2, 8, %g2
85 brz,pt %o3, 3f
86 add %g2, %g3, %g2
87 sllx %g2, 48, %g2
88 srax %g2, 48, %g2
893: ba,pt %xcc, 0f
90 stx %g2, [%o0]
916: lduba [%o2 + 1] %asi, %g3
92 sll %g2, 24, %g2
937: lduba [%o2 + 2] %asi, %g7
94 sll %g3, 16, %g3
958: lduba [%o2 + 3] %asi, %g1
96 sll %g7, 8, %g7
97 or %g2, %g3, %g2
98 or %g7, %g1, %g7
99 or %g2, %g7, %g2
100 brnz,a,pt %o3, 3f
101 sra %g2, 0, %g2
1023: ba,pt %xcc, 0f
103 stx %g2, [%o0]
1049: lduba [%o2] %asi, %g2
10510: lduba [%o2 + 1] %asi, %g3
106 sllx %g2, 56, %g2
10711: lduba [%o2 + 2] %asi, %g7
108 sllx %g3, 48, %g3
10912: lduba [%o2 + 3] %asi, %g1
110 sllx %g7, 40, %g7
111 sllx %g1, 32, %g1
112 or %g2, %g3, %g2
113 or %g7, %g1, %g7
11413: lduba [%o2 + 4] %asi, %g3
115 or %g2, %g7, %g7
11614: lduba [%o2 + 5] %asi, %g1
117 sllx %g3, 24, %g3
11815: lduba [%o2 + 6] %asi, %g2
119 sllx %g1, 16, %g1
120 or %g7, %g3, %g7
12116: lduba [%o2 + 7] %asi, %g3
122 sllx %g2, 8, %g2
123 or %g7, %g1, %g7
124 or %g2, %g3, %g2
125 or %g7, %g2, %g7
126 cmp %o1, 8
127 be,a,pt %icc, 0f
128 stx %g7, [%o0]
129 srlx %g7, 32, %g2
130 sra %g7, 0, %g7
131 stx %g2, [%o0]
132 stx %g7, [%o0 + 8]
1330:
134 wr %o5, 0x0, %asi
135 retl
136 nop
137 .size __do_int_load, .-__do_int_load
138
139 .section __ex_table
140 .word 4b, kernel_unaligned_trap_fault
141 .word 5b, kernel_unaligned_trap_fault
142 .word 6b, kernel_unaligned_trap_fault
143 .word 7b, kernel_unaligned_trap_fault
144 .word 8b, kernel_unaligned_trap_fault
145 .word 9b, kernel_unaligned_trap_fault
146 .word 10b, kernel_unaligned_trap_fault
147 .word 11b, kernel_unaligned_trap_fault
148 .word 12b, kernel_unaligned_trap_fault
149 .word 13b, kernel_unaligned_trap_fault
150 .word 14b, kernel_unaligned_trap_fault
151 .word 15b, kernel_unaligned_trap_fault
152 .word 16b, kernel_unaligned_trap_fault
153 .previous
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c
index 4372bf32ecf6..11c3e88732e4 100644
--- a/arch/sparc64/kernel/unaligned.c
+++ b/arch/sparc64/kernel/unaligned.c
@@ -180,169 +180,28 @@ static void __attribute_used__ unaligned_panic(char *str, struct pt_regs *regs)
180 die_if_kernel(str, regs); 180 die_if_kernel(str, regs);
181} 181}
182 182
183#define do_integer_load(dest_reg, size, saddr, is_signed, asi, errh) ({ \ 183extern void do_int_load(unsigned long *dest_reg, int size,
184__asm__ __volatile__ ( \ 184 unsigned long *saddr, int is_signed, int asi);
185 "wr %4, 0, %%asi\n\t" \
186 "cmp %1, 8\n\t" \
187 "bge,pn %%icc, 9f\n\t" \
188 " cmp %1, 4\n\t" \
189 "be,pt %%icc, 6f\n" \
190"4:\t" " lduba [%2] %%asi, %%l1\n" \
191"5:\t" "lduba [%2 + 1] %%asi, %%l2\n\t" \
192 "sll %%l1, 8, %%l1\n\t" \
193 "brz,pt %3, 3f\n\t" \
194 " add %%l1, %%l2, %%l1\n\t" \
195 "sllx %%l1, 48, %%l1\n\t" \
196 "srax %%l1, 48, %%l1\n" \
197"3:\t" "ba,pt %%xcc, 0f\n\t" \
198 " stx %%l1, [%0]\n" \
199"6:\t" "lduba [%2 + 1] %%asi, %%l2\n\t" \
200 "sll %%l1, 24, %%l1\n" \
201"7:\t" "lduba [%2 + 2] %%asi, %%g7\n\t" \
202 "sll %%l2, 16, %%l2\n" \
203"8:\t" "lduba [%2 + 3] %%asi, %%g1\n\t" \
204 "sll %%g7, 8, %%g7\n\t" \
205 "or %%l1, %%l2, %%l1\n\t" \
206 "or %%g7, %%g1, %%g7\n\t" \
207 "or %%l1, %%g7, %%l1\n\t" \
208 "brnz,a,pt %3, 3f\n\t" \
209 " sra %%l1, 0, %%l1\n" \
210"3:\t" "ba,pt %%xcc, 0f\n\t" \
211 " stx %%l1, [%0]\n" \
212"9:\t" "lduba [%2] %%asi, %%l1\n" \
213"10:\t" "lduba [%2 + 1] %%asi, %%l2\n\t" \
214 "sllx %%l1, 56, %%l1\n" \
215"11:\t" "lduba [%2 + 2] %%asi, %%g7\n\t" \
216 "sllx %%l2, 48, %%l2\n" \
217"12:\t" "lduba [%2 + 3] %%asi, %%g1\n\t" \
218 "sllx %%g7, 40, %%g7\n\t" \
219 "sllx %%g1, 32, %%g1\n\t" \
220 "or %%l1, %%l2, %%l1\n\t" \
221 "or %%g7, %%g1, %%g7\n" \
222"13:\t" "lduba [%2 + 4] %%asi, %%l2\n\t" \
223 "or %%l1, %%g7, %%g7\n" \
224"14:\t" "lduba [%2 + 5] %%asi, %%g1\n\t" \
225 "sllx %%l2, 24, %%l2\n" \
226"15:\t" "lduba [%2 + 6] %%asi, %%l1\n\t" \
227 "sllx %%g1, 16, %%g1\n\t" \
228 "or %%g7, %%l2, %%g7\n" \
229"16:\t" "lduba [%2 + 7] %%asi, %%l2\n\t" \
230 "sllx %%l1, 8, %%l1\n\t" \
231 "or %%g7, %%g1, %%g7\n\t" \
232 "or %%l1, %%l2, %%l1\n\t" \
233 "or %%g7, %%l1, %%g7\n\t" \
234 "cmp %1, 8\n\t" \
235 "be,a,pt %%icc, 0f\n\t" \
236 " stx %%g7, [%0]\n\t" \
237 "srlx %%g7, 32, %%l1\n\t" \
238 "sra %%g7, 0, %%g7\n\t" \
239 "stx %%l1, [%0]\n\t" \
240 "stx %%g7, [%0 + 8]\n" \
241"0:\n\t" \
242 "wr %%g0, %5, %%asi\n\n\t" \
243 ".section __ex_table\n\t" \
244 ".word 4b, " #errh "\n\t" \
245 ".word 5b, " #errh "\n\t" \
246 ".word 6b, " #errh "\n\t" \
247 ".word 7b, " #errh "\n\t" \
248 ".word 8b, " #errh "\n\t" \
249 ".word 9b, " #errh "\n\t" \
250 ".word 10b, " #errh "\n\t" \
251 ".word 11b, " #errh "\n\t" \
252 ".word 12b, " #errh "\n\t" \
253 ".word 13b, " #errh "\n\t" \
254 ".word 14b, " #errh "\n\t" \
255 ".word 15b, " #errh "\n\t" \
256 ".word 16b, " #errh "\n\n\t" \
257 ".previous\n\t" \
258 : : "r" (dest_reg), "r" (size), "r" (saddr), "r" (is_signed), \
259 "r" (asi), "i" (ASI_AIUS) \
260 : "l1", "l2", "g7", "g1", "cc"); \
261})
262 185
263#define store_common(dst_addr, size, src_val, asi, errh) ({ \ 186extern void __do_int_store(unsigned long *dst_addr, int size,
264__asm__ __volatile__ ( \ 187 unsigned long *src_val, int asi);
265 "wr %3, 0, %%asi\n\t" \ 188
266 "ldx [%2], %%l1\n" \ 189static inline void do_int_store(int reg_num, int size, unsigned long *dst_addr,
267 "cmp %1, 2\n\t" \ 190 struct pt_regs *regs, int asi)
268 "be,pn %%icc, 2f\n\t" \ 191{
269 " cmp %1, 4\n\t" \ 192 unsigned long zero = 0;
270 "be,pt %%icc, 1f\n\t" \ 193 unsigned long *src_val = &zero;
271 " srlx %%l1, 24, %%l2\n\t" \ 194
272 "srlx %%l1, 56, %%g1\n\t" \ 195 if (size == 16) {
273 "srlx %%l1, 48, %%g7\n" \ 196 size = 8;
274"4:\t" "stba %%g1, [%0] %%asi\n\t" \ 197 zero = (((long)(reg_num ?
275 "srlx %%l1, 40, %%g1\n" \ 198 (unsigned)fetch_reg(reg_num, regs) : 0)) << 32) |
276"5:\t" "stba %%g7, [%0 + 1] %%asi\n\t" \ 199 (unsigned)fetch_reg(reg_num + 1, regs);
277 "srlx %%l1, 32, %%g7\n" \ 200 } else if (reg_num) {
278"6:\t" "stba %%g1, [%0 + 2] %%asi\n" \ 201 src_val = fetch_reg_addr(reg_num, regs);
279"7:\t" "stba %%g7, [%0 + 3] %%asi\n\t" \ 202 }
280 "srlx %%l1, 16, %%g1\n" \ 203 __do_int_store(dst_addr, size, src_val, asi);
281"8:\t" "stba %%l2, [%0 + 4] %%asi\n\t" \ 204}
282 "srlx %%l1, 8, %%g7\n" \
283"9:\t" "stba %%g1, [%0 + 5] %%asi\n" \
284"10:\t" "stba %%g7, [%0 + 6] %%asi\n\t" \
285 "ba,pt %%xcc, 0f\n" \
286"11:\t" " stba %%l1, [%0 + 7] %%asi\n" \
287"1:\t" "srl %%l1, 16, %%g7\n" \
288"12:\t" "stba %%l2, [%0] %%asi\n\t" \
289 "srl %%l1, 8, %%l2\n" \
290"13:\t" "stba %%g7, [%0 + 1] %%asi\n" \
291"14:\t" "stba %%l2, [%0 + 2] %%asi\n\t" \
292 "ba,pt %%xcc, 0f\n" \
293"15:\t" " stba %%l1, [%0 + 3] %%asi\n" \
294"2:\t" "srl %%l1, 8, %%l2\n" \
295"16:\t" "stba %%l2, [%0] %%asi\n" \
296"17:\t" "stba %%l1, [%0 + 1] %%asi\n" \
297"0:\n\t" \
298 "wr %%g0, %4, %%asi\n\n\t" \
299 ".section __ex_table\n\t" \
300 ".word 4b, " #errh "\n\t" \
301 ".word 5b, " #errh "\n\t" \
302 ".word 6b, " #errh "\n\t" \
303 ".word 7b, " #errh "\n\t" \
304 ".word 8b, " #errh "\n\t" \
305 ".word 9b, " #errh "\n\t" \
306 ".word 10b, " #errh "\n\t" \
307 ".word 11b, " #errh "\n\t" \
308 ".word 12b, " #errh "\n\t" \
309 ".word 13b, " #errh "\n\t" \
310 ".word 14b, " #errh "\n\t" \
311 ".word 15b, " #errh "\n\t" \
312 ".word 16b, " #errh "\n\t" \
313 ".word 17b, " #errh "\n\n\t" \
314 ".previous\n\t" \
315 : : "r" (dst_addr), "r" (size), "r" (src_val), "r" (asi), "i" (ASI_AIUS)\
316 : "l1", "l2", "g7", "g1", "cc"); \
317})
318
319#define do_integer_store(reg_num, size, dst_addr, regs, asi, errh) ({ \
320 unsigned long zero = 0; \
321 unsigned long *src_val = &zero; \
322 \
323 if (size == 16) { \
324 size = 8; \
325 zero = (((long)(reg_num ? \
326 (unsigned)fetch_reg(reg_num, regs) : 0)) << 32) | \
327 (unsigned)fetch_reg(reg_num + 1, regs); \
328 } else if (reg_num) src_val = fetch_reg_addr(reg_num, regs); \
329 store_common(dst_addr, size, src_val, asi, errh); \
330})
331
332extern void smp_capture(void);
333extern void smp_release(void);
334
335#define do_atomic(srcdest_reg, mem, errh) ({ \
336 unsigned long flags, tmp; \
337 \
338 smp_capture(); \
339 local_irq_save(flags); \
340 tmp = *srcdest_reg; \
341 do_integer_load(srcdest_reg, 4, mem, 0, errh); \
342 store_common(mem, 4, &tmp, errh); \
343 local_irq_restore(flags); \
344 smp_release(); \
345})
346 205
347static inline void advance(struct pt_regs *regs) 206static inline void advance(struct pt_regs *regs)
348{ 207{
@@ -364,24 +223,29 @@ static inline int ok_for_kernel(unsigned int insn)
364 return !floating_point_load_or_store_p(insn); 223 return !floating_point_load_or_store_p(insn);
365} 224}
366 225
367void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("kernel_mna_trap_fault"); 226void kernel_mna_trap_fault(void)
368
369void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
370{ 227{
371 unsigned long g2 = regs->u_regs [UREG_G2]; 228 struct pt_regs *regs = current_thread_info()->kern_una_regs;
229 unsigned int insn = current_thread_info()->kern_una_insn;
230 unsigned long g2 = regs->u_regs[UREG_G2];
372 unsigned long fixup = search_extables_range(regs->tpc, &g2); 231 unsigned long fixup = search_extables_range(regs->tpc, &g2);
373 232
374 if (!fixup) { 233 if (!fixup) {
375 unsigned long address = compute_effective_address(regs, insn, ((insn >> 25) & 0x1f)); 234 unsigned long address;
235
236 address = compute_effective_address(regs, insn,
237 ((insn >> 25) & 0x1f));
376 if (address < PAGE_SIZE) { 238 if (address < PAGE_SIZE) {
377 printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference in mna handler"); 239 printk(KERN_ALERT "Unable to handle kernel NULL "
240 "pointer dereference in mna handler");
378 } else 241 } else
379 printk(KERN_ALERT "Unable to handle kernel paging request in mna handler"); 242 printk(KERN_ALERT "Unable to handle kernel paging "
243 "request in mna handler");
380 printk(KERN_ALERT " at virtual address %016lx\n",address); 244 printk(KERN_ALERT " at virtual address %016lx\n",address);
381 printk(KERN_ALERT "current->{mm,active_mm}->context = %016lx\n", 245 printk(KERN_ALERT "current->{active_,}mm->context = %016lx\n",
382 (current->mm ? CTX_HWBITS(current->mm->context) : 246 (current->mm ? CTX_HWBITS(current->mm->context) :
383 CTX_HWBITS(current->active_mm->context))); 247 CTX_HWBITS(current->active_mm->context)));
384 printk(KERN_ALERT "current->{mm,active_mm}->pgd = %016lx\n", 248 printk(KERN_ALERT "current->{active_,}mm->pgd = %016lx\n",
385 (current->mm ? (unsigned long) current->mm->pgd : 249 (current->mm ? (unsigned long) current->mm->pgd :
386 (unsigned long) current->active_mm->pgd)); 250 (unsigned long) current->active_mm->pgd));
387 die_if_kernel("Oops", regs); 251 die_if_kernel("Oops", regs);
@@ -400,48 +264,41 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, u
400 enum direction dir = decode_direction(insn); 264 enum direction dir = decode_direction(insn);
401 int size = decode_access_size(insn); 265 int size = decode_access_size(insn);
402 266
267 current_thread_info()->kern_una_regs = regs;
268 current_thread_info()->kern_una_insn = insn;
269
403 if (!ok_for_kernel(insn) || dir == both) { 270 if (!ok_for_kernel(insn) || dir == both) {
404 printk("Unsupported unaligned load/store trap for kernel at <%016lx>.\n", 271 printk("Unsupported unaligned load/store trap for kernel "
405 regs->tpc); 272 "at <%016lx>.\n", regs->tpc);
406 unaligned_panic("Kernel does fpu/atomic unaligned load/store.", regs); 273 unaligned_panic("Kernel does fpu/atomic "
407 274 "unaligned load/store.", regs);
408 __asm__ __volatile__ ("\n" 275
409"kernel_unaligned_trap_fault:\n\t" 276 kernel_mna_trap_fault();
410 "mov %0, %%o0\n\t"
411 "call kernel_mna_trap_fault\n\t"
412 " mov %1, %%o1\n\t"
413 :
414 : "r" (regs), "r" (insn)
415 : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
416 "g1", "g2", "g3", "g4", "g7", "cc");
417 } else { 277 } else {
418 unsigned long addr = compute_effective_address(regs, insn, ((insn >> 25) & 0x1f)); 278 unsigned long addr;
419 279
280 addr = compute_effective_address(regs, insn,
281 ((insn >> 25) & 0x1f));
420#ifdef DEBUG_MNA 282#ifdef DEBUG_MNA
421 printk("KMNA: pc=%016lx [dir=%s addr=%016lx size=%d] retpc[%016lx]\n", 283 printk("KMNA: pc=%016lx [dir=%s addr=%016lx size=%d] "
422 regs->tpc, dirstrings[dir], addr, size, regs->u_regs[UREG_RETPC]); 284 "retpc[%016lx]\n",
285 regs->tpc, dirstrings[dir], addr, size,
286 regs->u_regs[UREG_RETPC]);
423#endif 287#endif
424 switch (dir) { 288 switch (dir) {
425 case load: 289 case load:
426 do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs), 290 do_int_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
427 size, (unsigned long *) addr, 291 size, (unsigned long *) addr,
428 decode_signedness(insn), decode_asi(insn, regs), 292 decode_signedness(insn),
429 kernel_unaligned_trap_fault); 293 decode_asi(insn, regs));
430 break; 294 break;
431 295
432 case store: 296 case store:
433 do_integer_store(((insn>>25)&0x1f), size, 297 do_int_store(((insn>>25)&0x1f), size,
434 (unsigned long *) addr, regs, 298 (unsigned long *) addr, regs,
435 decode_asi(insn, regs), 299 decode_asi(insn, regs));
436 kernel_unaligned_trap_fault);
437 break;
438#if 0 /* unsupported */
439 case both:
440 do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs),
441 (unsigned long *) addr,
442 kernel_unaligned_trap_fault);
443 break; 300 break;
444#endif 301
445 default: 302 default:
446 panic("Impossible kernel unaligned trap."); 303 panic("Impossible kernel unaligned trap.");
447 /* Not reached... */ 304 /* Not reached... */
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index b15761ff4101..fa25e39fe54d 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -492,6 +492,14 @@ void __cpuinit start_secondary(void)
492 */ 492 */
493 set_cpu_sibling_map(smp_processor_id()); 493 set_cpu_sibling_map(smp_processor_id());
494 494
495 /*
496 * Wait for TSC sync to not schedule things before.
497 * We still process interrupts, which could see an inconsistent
498 * time in that window unfortunately.
499 * Do this here because TSC sync has global unprotected state.
500 */
501 tsc_sync_wait();
502
495 /* 503 /*
496 * We need to hold call_lock, so there is no inconsistency 504 * We need to hold call_lock, so there is no inconsistency
497 * between the time smp_call_function() determines number of 505 * between the time smp_call_function() determines number of
@@ -509,13 +517,6 @@ void __cpuinit start_secondary(void)
509 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; 517 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
510 unlock_ipi_call_lock(); 518 unlock_ipi_call_lock();
511 519
512 mb();
513
514 /* Wait for TSC sync to not schedule things before.
515 We still process interrupts, which could see an inconsistent
516 time in that window unfortunately. */
517 tsc_sync_wait();
518
519 cpu_idle(); 520 cpu_idle();
520} 521}
521 522
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index 493819e543a5..ca914c3bd49c 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -211,9 +211,7 @@ int unhandled_signal(struct task_struct *tsk, int sig)
211{ 211{
212 if (tsk->pid == 1) 212 if (tsk->pid == 1)
213 return 1; 213 return 1;
214 /* Warn for strace, but not for gdb */ 214 if (tsk->ptrace & PT_PTRACED)
215 if (!test_ti_thread_flag(tsk->thread_info, TIF_SYSCALL_TRACE) &&
216 (tsk->ptrace & PT_PTRACED))
217 return 0; 215 return 0;
218 return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) || 216 return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) ||
219 (tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL); 217 (tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL);
diff --git a/arch/x86_64/pci/k8-bus.c b/arch/x86_64/pci/k8-bus.c
index c2c38b579939..d80c323669e0 100644
--- a/arch/x86_64/pci/k8-bus.c
+++ b/arch/x86_64/pci/k8-bus.c
@@ -47,13 +47,22 @@ fill_mp_bus_to_cpumask(void)
47 * if there are no busses hanging off of the current 47 * if there are no busses hanging off of the current
48 * ldt link then both the secondary and subordinate 48 * ldt link then both the secondary and subordinate
49 * bus number fields are set to 0. 49 * bus number fields are set to 0.
50 *
51 * RED-PEN
52 * This is slightly broken because it assumes
53 * HT node IDs == Linux node ids, which is not always
54 * true. However it is probably mostly true.
50 */ 55 */
51 if (!(SECONDARY_LDT_BUS_NUMBER(ldtbus) == 0 56 if (!(SECONDARY_LDT_BUS_NUMBER(ldtbus) == 0
52 && SUBORDINATE_LDT_BUS_NUMBER(ldtbus) == 0)) { 57 && SUBORDINATE_LDT_BUS_NUMBER(ldtbus) == 0)) {
53 for (j = SECONDARY_LDT_BUS_NUMBER(ldtbus); 58 for (j = SECONDARY_LDT_BUS_NUMBER(ldtbus);
54 j <= SUBORDINATE_LDT_BUS_NUMBER(ldtbus); 59 j <= SUBORDINATE_LDT_BUS_NUMBER(ldtbus);
55 j++) 60 j++) {
56 pci_bus_to_node[j] = NODE_ID(nid); 61 int node = NODE_ID(nid);
62 if (!node_online(node))
63 node = 0;
64 pci_bus_to_node[j] = node;
65 }
57 } 66 }
58 } 67 }
59 } 68 }