aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-07-08 11:05:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-07-08 11:05:43 -0400
commit31016e9941be85e8c487b1f3c45d253eda356715 (patch)
treef2984c3b651a72d8b160b7d7df545c01af6bef40 /arch
parent67415020950046e32f520c1447e79ebebbf447ac (diff)
parentbf23690b89b731468478c21eb07bbb645cc66ead (diff)
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: powerpc: Fix userspace build of ptrace.h powerpc: Fix default_machine_crash_shutdown #ifdef botch powerpc: Fix logic error in fixup_irqs powerpc/iseries: Fix possible null pointer dereference in iSeries_pcibios_fixup_resources powerpc: Linux cannot run with 0 cores powerpc: Fix feature-fixup tests for gcc 4.5 powerpc: Disable SPARSE_IRQ by default powerpc: Fix compile errors in prom_init_check for gcc 4.5 powerpc: Fix module building for gcc 4.5 and 64 bit powerpc/perf_event: Fix for power_pmu_disable()
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/Kconfig4
-rw-r--r--arch/powerpc/Makefile4
-rw-r--r--arch/powerpc/include/asm/ptrace.h32
-rw-r--r--arch/powerpc/kernel/crash.c2
-rw-r--r--arch/powerpc/kernel/irq.c5
-rw-r--r--arch/powerpc/kernel/perf_event.c5
-rw-r--r--arch/powerpc/kernel/prom_init.c2
-rw-r--r--arch/powerpc/kernel/prom_init_check.sh6
-rw-r--r--arch/powerpc/lib/Makefile4
-rw-r--r--arch/powerpc/lib/crtsavres.S129
-rw-r--r--arch/powerpc/lib/feature-fixups.c17
-rw-r--r--arch/powerpc/platforms/iseries/pci.c6
12 files changed, 179 insertions, 37 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 328774bd41ee..6506bf4fbff1 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -400,7 +400,7 @@ config IRQ_ALL_CPUS
400 400
401config SPARSE_IRQ 401config SPARSE_IRQ
402 bool "Support sparse irq numbering" 402 bool "Support sparse irq numbering"
403 default y 403 default n
404 help 404 help
405 This enables support for sparse irqs. This is useful for distro 405 This enables support for sparse irqs. This is useful for distro
406 kernels that want to define a high CONFIG_NR_CPUS value but still 406 kernels that want to define a high CONFIG_NR_CPUS value but still
@@ -409,7 +409,7 @@ config SPARSE_IRQ
409 ( Sparse IRQs can also be beneficial on NUMA boxes, as they spread 409 ( Sparse IRQs can also be beneficial on NUMA boxes, as they spread
410 out the irq_desc[] array in a more NUMA-friendly way. ) 410 out the irq_desc[] array in a more NUMA-friendly way. )
411 411
412 If you don't know what to do here, say Y. 412 If you don't know what to do here, say N.
413 413
414config NUMA 414config NUMA
415 bool "NUMA support" 415 bool "NUMA support"
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 42dcd3f4ad7b..77cfe7a29e25 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -92,10 +92,10 @@ endif
92else 92else
93 KBUILD_CFLAGS += $(call cc-option,-mtune=power4) 93 KBUILD_CFLAGS += $(call cc-option,-mtune=power4)
94endif 94endif
95else
96LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
97endif 95endif
98 96
97LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
98
99ifeq ($(CONFIG_TUNE_CELL),y) 99ifeq ($(CONFIG_TUNE_CELL),y)
100 KBUILD_CFLAGS += $(call cc-option,-mtune=cell) 100 KBUILD_CFLAGS += $(call cc-option,-mtune=cell)
101endif 101endif
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h
index 5d8be0416227..0175a676b34b 100644
--- a/arch/powerpc/include/asm/ptrace.h
+++ b/arch/powerpc/include/asm/ptrace.h
@@ -24,11 +24,7 @@
24 * 2 of the License, or (at your option) any later version. 24 * 2 of the License, or (at your option) any later version.
25 */ 25 */
26 26
27#ifdef __KERNEL__
28#include <linux/types.h> 27#include <linux/types.h>
29#else
30#include <stdint.h>
31#endif
32 28
33#ifndef __ASSEMBLY__ 29#ifndef __ASSEMBLY__
34 30
@@ -364,13 +360,13 @@ static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
364#ifndef __ASSEMBLY__ 360#ifndef __ASSEMBLY__
365 361
366struct ppc_debug_info { 362struct ppc_debug_info {
367 uint32_t version; /* Only version 1 exists to date */ 363 __u32 version; /* Only version 1 exists to date */
368 uint32_t num_instruction_bps; 364 __u32 num_instruction_bps;
369 uint32_t num_data_bps; 365 __u32 num_data_bps;
370 uint32_t num_condition_regs; 366 __u32 num_condition_regs;
371 uint32_t data_bp_alignment; 367 __u32 data_bp_alignment;
372 uint32_t sizeof_condition; /* size of the DVC register */ 368 __u32 sizeof_condition; /* size of the DVC register */
373 uint64_t features; 369 __u64 features;
374}; 370};
375 371
376#endif /* __ASSEMBLY__ */ 372#endif /* __ASSEMBLY__ */
@@ -386,13 +382,13 @@ struct ppc_debug_info {
386#ifndef __ASSEMBLY__ 382#ifndef __ASSEMBLY__
387 383
388struct ppc_hw_breakpoint { 384struct ppc_hw_breakpoint {
389 uint32_t version; /* currently, version must be 1 */ 385 __u32 version; /* currently, version must be 1 */
390 uint32_t trigger_type; /* only some combinations allowed */ 386 __u32 trigger_type; /* only some combinations allowed */
391 uint32_t addr_mode; /* address match mode */ 387 __u32 addr_mode; /* address match mode */
392 uint32_t condition_mode; /* break/watchpoint condition flags */ 388 __u32 condition_mode; /* break/watchpoint condition flags */
393 uint64_t addr; /* break/watchpoint address */ 389 __u64 addr; /* break/watchpoint address */
394 uint64_t addr2; /* range end or mask */ 390 __u64 addr2; /* range end or mask */
395 uint64_t condition_value; /* contents of the DVC register */ 391 __u64 condition_value; /* contents of the DVC register */
396}; 392};
397 393
398#endif /* __ASSEMBLY__ */ 394#endif /* __ASSEMBLY__ */
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
index b46f2e09bd81..29df48f2b61a 100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -447,7 +447,7 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
447 crash_kexec_prepare_cpus(crashing_cpu); 447 crash_kexec_prepare_cpus(crashing_cpu);
448 cpu_set(crashing_cpu, cpus_in_crash); 448 cpu_set(crashing_cpu, cpus_in_crash);
449 crash_kexec_stop_spus(); 449 crash_kexec_stop_spus();
450#ifdef CONFIG_PPC_STD_MMU_64 450#if defined(CONFIG_PPC_STD_MMU_64) && defined(CONFIG_SMP)
451 crash_kexec_wait_realmode(crashing_cpu); 451 crash_kexec_wait_realmode(crashing_cpu);
452#endif 452#endif
453 if (ppc_md.kexec_cpu_down) 453 if (ppc_md.kexec_cpu_down)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 3333bbdd23ef..77be3d058a65 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -295,7 +295,10 @@ void fixup_irqs(const struct cpumask *map)
295 295
296 for_each_irq(irq) { 296 for_each_irq(irq) {
297 desc = irq_to_desc(irq); 297 desc = irq_to_desc(irq);
298 if (desc && desc->status & IRQ_PER_CPU) 298 if (!desc)
299 continue;
300
301 if (desc->status & IRQ_PER_CPU)
299 continue; 302 continue;
300 303
301 cpumask_and(mask, desc->affinity, map); 304 cpumask_and(mask, desc->affinity, map);
diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c
index 43b83c35cf54..5c14ffe51258 100644
--- a/arch/powerpc/kernel/perf_event.c
+++ b/arch/powerpc/kernel/perf_event.c
@@ -791,8 +791,11 @@ static void power_pmu_disable(struct perf_event *event)
791 cpuhw = &__get_cpu_var(cpu_hw_events); 791 cpuhw = &__get_cpu_var(cpu_hw_events);
792 for (i = 0; i < cpuhw->n_events; ++i) { 792 for (i = 0; i < cpuhw->n_events; ++i) {
793 if (event == cpuhw->event[i]) { 793 if (event == cpuhw->event[i]) {
794 while (++i < cpuhw->n_events) 794 while (++i < cpuhw->n_events) {
795 cpuhw->event[i-1] = cpuhw->event[i]; 795 cpuhw->event[i-1] = cpuhw->event[i];
796 cpuhw->events[i-1] = cpuhw->events[i];
797 cpuhw->flags[i-1] = cpuhw->flags[i];
798 }
796 --cpuhw->n_events; 799 --cpuhw->n_events;
797 ppmu->disable_pmc(event->hw.idx - 1, cpuhw->mmcr); 800 ppmu->disable_pmc(event->hw.idx - 1, cpuhw->mmcr);
798 if (event->hw.idx) { 801 if (event->hw.idx) {
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 97d4bd9442d3..3b6f8ae9b8cc 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -872,7 +872,7 @@ static void __init prom_send_capabilities(void)
872 "ibm_architecture_vec structure inconsistent: 0x%x !\n", 872 "ibm_architecture_vec structure inconsistent: 0x%x !\n",
873 *cores); 873 *cores);
874 } else { 874 } else {
875 *cores = NR_CPUS / prom_count_smt_threads(); 875 *cores = DIV_ROUND_UP(NR_CPUS, prom_count_smt_threads());
876 prom_printf("Max number of cores passed to firmware: 0x%x\n", 876 prom_printf("Max number of cores passed to firmware: 0x%x\n",
877 (unsigned long)*cores); 877 (unsigned long)*cores);
878 } 878 }
diff --git a/arch/powerpc/kernel/prom_init_check.sh b/arch/powerpc/kernel/prom_init_check.sh
index 1ac136b128f0..9f82f4937892 100644
--- a/arch/powerpc/kernel/prom_init_check.sh
+++ b/arch/powerpc/kernel/prom_init_check.sh
@@ -52,12 +52,18 @@ do
52 if [ "${UNDEF:0:9}" = "_restgpr_" ]; then 52 if [ "${UNDEF:0:9}" = "_restgpr_" ]; then
53 OK=1 53 OK=1
54 fi 54 fi
55 if [ "${UNDEF:0:10}" = "_restgpr0_" ]; then
56 OK=1
57 fi
55 if [ "${UNDEF:0:11}" = "_rest32gpr_" ]; then 58 if [ "${UNDEF:0:11}" = "_rest32gpr_" ]; then
56 OK=1 59 OK=1
57 fi 60 fi
58 if [ "${UNDEF:0:9}" = "_savegpr_" ]; then 61 if [ "${UNDEF:0:9}" = "_savegpr_" ]; then
59 OK=1 62 OK=1
60 fi 63 fi
64 if [ "${UNDEF:0:10}" = "_savegpr0_" ]; then
65 OK=1
66 fi
61 if [ "${UNDEF:0:11}" = "_save32gpr_" ]; then 67 if [ "${UNDEF:0:11}" = "_save32gpr_" ]; then
62 OK=1 68 OK=1
63 fi 69 fi
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 3040dac18a37..111da1c03a11 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -12,8 +12,8 @@ CFLAGS_REMOVE_code-patching.o = -pg
12CFLAGS_REMOVE_feature-fixups.o = -pg 12CFLAGS_REMOVE_feature-fixups.o = -pg
13 13
14obj-y := string.o alloc.o \ 14obj-y := string.o alloc.o \
15 checksum_$(CONFIG_WORD_SIZE).o 15 checksum_$(CONFIG_WORD_SIZE).o crtsavres.o
16obj-$(CONFIG_PPC32) += div64.o copy_32.o crtsavres.o 16obj-$(CONFIG_PPC32) += div64.o copy_32.o
17obj-$(CONFIG_HAS_IOMEM) += devres.o 17obj-$(CONFIG_HAS_IOMEM) += devres.o
18 18
19obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \ 19obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \
diff --git a/arch/powerpc/lib/crtsavres.S b/arch/powerpc/lib/crtsavres.S
index 70a9cd8a3008..1c893f05d224 100644
--- a/arch/powerpc/lib/crtsavres.S
+++ b/arch/powerpc/lib/crtsavres.S
@@ -6,6 +6,7 @@
6 * Written By Michael Meissner 6 * Written By Michael Meissner
7 * 7 *
8 * Based on gcc/config/rs6000/crtsavres.asm from gcc 8 * Based on gcc/config/rs6000/crtsavres.asm from gcc
9 * 64 bit additions from reading the PPC elf64abi document.
9 * 10 *
10 * This file is free software; you can redistribute it and/or modify it 11 * This file is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the 12 * under the terms of the GNU General Public License as published by the
@@ -44,6 +45,8 @@
44 45
45#ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE 46#ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
46 47
48#ifndef CONFIG_PPC64
49
47/* Routines for saving integer registers, called by the compiler. */ 50/* Routines for saving integer registers, called by the compiler. */
48/* Called with r11 pointing to the stack header word of the caller of the */ 51/* Called with r11 pointing to the stack header word of the caller of the */
49/* function, just beyond the end of the integer save area. */ 52/* function, just beyond the end of the integer save area. */
@@ -226,4 +229,130 @@ _GLOBAL(_rest32gpr_31_x)
226 mtlr 0 229 mtlr 0
227 mr 1,11 230 mr 1,11
228 blr 231 blr
232
233#else /* CONFIG_PPC64 */
234
235.globl _savegpr0_14
236_savegpr0_14:
237 std r14,-144(r1)
238.globl _savegpr0_15
239_savegpr0_15:
240 std r15,-136(r1)
241.globl _savegpr0_16
242_savegpr0_16:
243 std r16,-128(r1)
244.globl _savegpr0_17
245_savegpr0_17:
246 std r17,-120(r1)
247.globl _savegpr0_18
248_savegpr0_18:
249 std r18,-112(r1)
250.globl _savegpr0_19
251_savegpr0_19:
252 std r19,-104(r1)
253.globl _savegpr0_20
254_savegpr0_20:
255 std r20,-96(r1)
256.globl _savegpr0_21
257_savegpr0_21:
258 std r21,-88(r1)
259.globl _savegpr0_22
260_savegpr0_22:
261 std r22,-80(r1)
262.globl _savegpr0_23
263_savegpr0_23:
264 std r23,-72(r1)
265.globl _savegpr0_24
266_savegpr0_24:
267 std r24,-64(r1)
268.globl _savegpr0_25
269_savegpr0_25:
270 std r25,-56(r1)
271.globl _savegpr0_26
272_savegpr0_26:
273 std r26,-48(r1)
274.globl _savegpr0_27
275_savegpr0_27:
276 std r27,-40(r1)
277.globl _savegpr0_28
278_savegpr0_28:
279 std r28,-32(r1)
280.globl _savegpr0_29
281_savegpr0_29:
282 std r29,-24(r1)
283.globl _savegpr0_30
284_savegpr0_30:
285 std r30,-16(r1)
286.globl _savegpr0_31
287_savegpr0_31:
288 std r31,-8(r1)
289 std r0,16(r1)
290 blr
291
292.globl _restgpr0_14
293_restgpr0_14:
294 ld r14,-144(r1)
295.globl _restgpr0_15
296_restgpr0_15:
297 ld r15,-136(r1)
298.globl _restgpr0_16
299_restgpr0_16:
300 ld r16,-128(r1)
301.globl _restgpr0_17
302_restgpr0_17:
303 ld r17,-120(r1)
304.globl _restgpr0_18
305_restgpr0_18:
306 ld r18,-112(r1)
307.globl _restgpr0_19
308_restgpr0_19:
309 ld r19,-104(r1)
310.globl _restgpr0_20
311_restgpr0_20:
312 ld r20,-96(r1)
313.globl _restgpr0_21
314_restgpr0_21:
315 ld r21,-88(r1)
316.globl _restgpr0_22
317_restgpr0_22:
318 ld r22,-80(r1)
319.globl _restgpr0_23
320_restgpr0_23:
321 ld r23,-72(r1)
322.globl _restgpr0_24
323_restgpr0_24:
324 ld r24,-64(r1)
325.globl _restgpr0_25
326_restgpr0_25:
327 ld r25,-56(r1)
328.globl _restgpr0_26
329_restgpr0_26:
330 ld r26,-48(r1)
331.globl _restgpr0_27
332_restgpr0_27:
333 ld r27,-40(r1)
334.globl _restgpr0_28
335_restgpr0_28:
336 ld r28,-32(r1)
337.globl _restgpr0_29
338_restgpr0_29:
339 ld r0,16(r1)
340 ld r29,-24(r1)
341 mtlr r0
342 ld r30,-16(r1)
343 ld r31,-8(r1)
344 blr
345
346.globl _restgpr0_30
347_restgpr0_30:
348 ld r30,-16(r1)
349.globl _restgpr0_31
350_restgpr0_31:
351 ld r0,16(r1)
352 ld r31,-8(r1)
353 mtlr r0
354 blr
355
356#endif /* CONFIG_PPC64 */
357
229#endif 358#endif
diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
index e640175b65ae..0d08d0171392 100644
--- a/arch/powerpc/lib/feature-fixups.c
+++ b/arch/powerpc/lib/feature-fixups.c
@@ -12,6 +12,7 @@
12 * 2 of the License, or (at your option) any later version. 12 * 2 of the License, or (at your option) any later version.
13 */ 13 */
14 14
15#include <linux/types.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/string.h> 17#include <linux/string.h>
17#include <linux/init.h> 18#include <linux/init.h>
@@ -288,8 +289,8 @@ static void test_alternative_case_with_external_branch(void)
288 289
289static void test_cpu_macros(void) 290static void test_cpu_macros(void)
290{ 291{
291 extern void ftr_fixup_test_FTR_macros; 292 extern u8 ftr_fixup_test_FTR_macros;
292 extern void ftr_fixup_test_FTR_macros_expected; 293 extern u8 ftr_fixup_test_FTR_macros_expected;
293 unsigned long size = &ftr_fixup_test_FTR_macros_expected - 294 unsigned long size = &ftr_fixup_test_FTR_macros_expected -
294 &ftr_fixup_test_FTR_macros; 295 &ftr_fixup_test_FTR_macros;
295 296
@@ -301,8 +302,8 @@ static void test_cpu_macros(void)
301static void test_fw_macros(void) 302static void test_fw_macros(void)
302{ 303{
303#ifdef CONFIG_PPC64 304#ifdef CONFIG_PPC64
304 extern void ftr_fixup_test_FW_FTR_macros; 305 extern u8 ftr_fixup_test_FW_FTR_macros;
305 extern void ftr_fixup_test_FW_FTR_macros_expected; 306 extern u8 ftr_fixup_test_FW_FTR_macros_expected;
306 unsigned long size = &ftr_fixup_test_FW_FTR_macros_expected - 307 unsigned long size = &ftr_fixup_test_FW_FTR_macros_expected -
307 &ftr_fixup_test_FW_FTR_macros; 308 &ftr_fixup_test_FW_FTR_macros;
308 309
@@ -314,10 +315,10 @@ static void test_fw_macros(void)
314 315
315static void test_lwsync_macros(void) 316static void test_lwsync_macros(void)
316{ 317{
317 extern void lwsync_fixup_test; 318 extern u8 lwsync_fixup_test;
318 extern void end_lwsync_fixup_test; 319 extern u8 end_lwsync_fixup_test;
319 extern void lwsync_fixup_test_expected_LWSYNC; 320 extern u8 lwsync_fixup_test_expected_LWSYNC;
320 extern void lwsync_fixup_test_expected_SYNC; 321 extern u8 lwsync_fixup_test_expected_SYNC;
321 unsigned long size = &end_lwsync_fixup_test - 322 unsigned long size = &end_lwsync_fixup_test -
322 &lwsync_fixup_test; 323 &lwsync_fixup_test;
323 324
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 3fc2e6494b8b..ab3962b0d246 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -445,7 +445,11 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
445 } 445 }
446 446
447 allocate_device_bars(pdev); 447 allocate_device_bars(pdev);
448 iseries_device_information(pdev, bus, *sub_bus); 448 if (likely(sub_bus))
449 iseries_device_information(pdev, bus, *sub_bus);
450 else
451 printk(KERN_ERR "PCI: Device node %s has missing or invalid "
452 "linux,subbus property\n", node->full_name);
449} 453}
450 454
451/* 455/*