Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 8 Jul 2010 15:05:43 +0000 (08:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 8 Jul 2010 15:05:43 +0000 (08:05 -0700)
* '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()

13 files changed:
arch/powerpc/Kconfig
arch/powerpc/Makefile
arch/powerpc/include/asm/ptrace.h
arch/powerpc/kernel/crash.c
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/perf_event.c
arch/powerpc/kernel/prom_init.c
arch/powerpc/kernel/prom_init_check.sh
arch/powerpc/lib/Makefile
arch/powerpc/lib/crtsavres.S
arch/powerpc/lib/feature-fixups.c
arch/powerpc/platforms/iseries/pci.c
scripts/mod/modpost.c

index 328774bd41ee171706de902d5640721bfc49b0d2..6506bf4fbff13d82d1c66b629638efe435882b3d 100644 (file)
@@ -400,7 +400,7 @@ config IRQ_ALL_CPUS
 
 config SPARSE_IRQ
        bool "Support sparse irq numbering"
-       default y
+       default n
        help
          This enables support for sparse irqs. This is useful for distro
          kernels that want to define a high CONFIG_NR_CPUS value but still
@@ -409,7 +409,7 @@ config SPARSE_IRQ
          ( Sparse IRQs can also be beneficial on NUMA boxes, as they spread
            out the irq_desc[] array in a more NUMA-friendly way. )
 
-         If you don't know what to do here, say Y.
+         If you don't know what to do here, say N.
 
 config NUMA
        bool "NUMA support"
index 42dcd3f4ad7b5d45241e7057804a100cb6df9375..77cfe7a29e2574a3601c0db1c9a58b96bedfd101 100644 (file)
@@ -92,10 +92,10 @@ endif
 else
        KBUILD_CFLAGS += $(call cc-option,-mtune=power4)
 endif
-else
-LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
 endif
 
+LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
+
 ifeq ($(CONFIG_TUNE_CELL),y)
        KBUILD_CFLAGS += $(call cc-option,-mtune=cell)
 endif
index 5d8be0416227590021287ef01eeee6982c4267c6..0175a676b34b5e577c4e52107bfd1f3e99c6e8d2 100644 (file)
  * 2 of the License, or (at your option) any later version.
  */
 
-#ifdef __KERNEL__
 #include <linux/types.h>
-#else
-#include <stdint.h>
-#endif
 
 #ifndef __ASSEMBLY__
 
@@ -364,13 +360,13 @@ static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
 #ifndef __ASSEMBLY__
 
 struct ppc_debug_info {
-       uint32_t version;               /* Only version 1 exists to date */
-       uint32_t num_instruction_bps;
-       uint32_t num_data_bps;
-       uint32_t num_condition_regs;
-       uint32_t data_bp_alignment;
-       uint32_t sizeof_condition;      /* size of the DVC register */
-       uint64_t features;
+       __u32 version;                  /* Only version 1 exists to date */
+       __u32 num_instruction_bps;
+       __u32 num_data_bps;
+       __u32 num_condition_regs;
+       __u32 data_bp_alignment;
+       __u32 sizeof_condition;         /* size of the DVC register */
+       __u64 features;
 };
 
 #endif /* __ASSEMBLY__ */
@@ -386,13 +382,13 @@ struct ppc_debug_info {
 #ifndef __ASSEMBLY__
 
 struct ppc_hw_breakpoint {
-       uint32_t version;               /* currently, version must be 1 */
-       uint32_t trigger_type;          /* only some combinations allowed */
-       uint32_t addr_mode;             /* address match mode */
-       uint32_t condition_mode;        /* break/watchpoint condition flags */
-       uint64_t addr;                  /* break/watchpoint address */
-       uint64_t addr2;                 /* range end or mask */
-       uint64_t condition_value;       /* contents of the DVC register */
+       __u32 version;          /* currently, version must be 1 */
+       __u32 trigger_type;     /* only some combinations allowed */
+       __u32 addr_mode;        /* address match mode */
+       __u32 condition_mode;   /* break/watchpoint condition flags */
+       __u64 addr;             /* break/watchpoint address */
+       __u64 addr2;            /* range end or mask */
+       __u64 condition_value;  /* contents of the DVC register */
 };
 
 #endif /* __ASSEMBLY__ */
index b46f2e09bd81df4bea175401fe4f70fbf45bfb35..29df48f2b61a45d27f33301fe350439a94e384f4 100644 (file)
@@ -447,7 +447,7 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
        crash_kexec_prepare_cpus(crashing_cpu);
        cpu_set(crashing_cpu, cpus_in_crash);
        crash_kexec_stop_spus();
-#ifdef CONFIG_PPC_STD_MMU_64
+#if defined(CONFIG_PPC_STD_MMU_64) && defined(CONFIG_SMP)
        crash_kexec_wait_realmode(crashing_cpu);
 #endif
        if (ppc_md.kexec_cpu_down)
index 3333bbdd23efaffce914c4b64c24ac766aba1fc3..77be3d058a658fa447a2235a8441d320be245d20 100644 (file)
@@ -295,7 +295,10 @@ void fixup_irqs(const struct cpumask *map)
 
        for_each_irq(irq) {
                desc = irq_to_desc(irq);
-               if (desc && desc->status & IRQ_PER_CPU)
+               if (!desc)
+                       continue;
+
+               if (desc->status & IRQ_PER_CPU)
                        continue;
 
                cpumask_and(mask, desc->affinity, map);
index 43b83c35cf54b0dfb07bc5abef8ee558d5f3cd9c..5c14ffe5125813d19e6793ebf69e132fa19dbffe 100644 (file)
@@ -791,8 +791,11 @@ static void power_pmu_disable(struct perf_event *event)
        cpuhw = &__get_cpu_var(cpu_hw_events);
        for (i = 0; i < cpuhw->n_events; ++i) {
                if (event == cpuhw->event[i]) {
-                       while (++i < cpuhw->n_events)
+                       while (++i < cpuhw->n_events) {
                                cpuhw->event[i-1] = cpuhw->event[i];
+                               cpuhw->events[i-1] = cpuhw->events[i];
+                               cpuhw->flags[i-1] = cpuhw->flags[i];
+                       }
                        --cpuhw->n_events;
                        ppmu->disable_pmc(event->hw.idx - 1, cpuhw->mmcr);
                        if (event->hw.idx) {
index 97d4bd9442d380ca8f65d66f28c6fe85892cc9f2..3b6f8ae9b8cc236eeed53511e9320a60919d843c 100644 (file)
@@ -872,7 +872,7 @@ static void __init prom_send_capabilities(void)
                                    "ibm_architecture_vec structure inconsistent: 0x%x !\n",
                                    *cores);
                } else {
-                       *cores = NR_CPUS / prom_count_smt_threads();
+                       *cores = DIV_ROUND_UP(NR_CPUS, prom_count_smt_threads());
                        prom_printf("Max number of cores passed to firmware: 0x%x\n",
                                    (unsigned long)*cores);
                }
index 1ac136b128f01fb700e86bcb609863376458336f..9f82f4937892201029232de04009d415f46cd80b 100644 (file)
@@ -52,12 +52,18 @@ do
        if [ "${UNDEF:0:9}" = "_restgpr_" ]; then
                OK=1
        fi
+       if [ "${UNDEF:0:10}" = "_restgpr0_" ]; then
+               OK=1
+       fi
        if [ "${UNDEF:0:11}" = "_rest32gpr_" ]; then
                OK=1
        fi
        if [ "${UNDEF:0:9}" = "_savegpr_" ]; then
                OK=1
        fi
+       if [ "${UNDEF:0:10}" = "_savegpr0_" ]; then
+               OK=1
+       fi
        if [ "${UNDEF:0:11}" = "_save32gpr_" ]; then
                OK=1
        fi
index 3040dac18a37e2b09287823c96acca5ec5f94863..111da1c03a113ae41eff40cfe7b5ccdd6b3fded5 100644 (file)
@@ -12,8 +12,8 @@ CFLAGS_REMOVE_code-patching.o = -pg
 CFLAGS_REMOVE_feature-fixups.o = -pg
 
 obj-y                  := string.o alloc.o \
-                          checksum_$(CONFIG_WORD_SIZE).o
-obj-$(CONFIG_PPC32)    += div64.o copy_32.o crtsavres.o
+                          checksum_$(CONFIG_WORD_SIZE).o crtsavres.o
+obj-$(CONFIG_PPC32)    += div64.o copy_32.o
 obj-$(CONFIG_HAS_IOMEM)        += devres.o
 
 obj-$(CONFIG_PPC64)    += copypage_64.o copyuser_64.o \
index 70a9cd8a30083cafdcf54d2d60c2d02d9dd07d16..1c893f05d224cab5ae36cff82e3eeb30cd46171c 100644 (file)
@@ -6,6 +6,7 @@
  *   Written By Michael Meissner
  *
  * Based on gcc/config/rs6000/crtsavres.asm from gcc
+ * 64 bit additions from reading the PPC elf64abi document.
  *
  * This file is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -44,6 +45,8 @@
 
 #ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
 
+#ifndef CONFIG_PPC64
+
 /* Routines for saving integer registers, called by the compiler.  */
 /* Called with r11 pointing to the stack header word of the caller of the */
 /* function, just beyond the end of the integer save area.  */
@@ -226,4 +229,130 @@ _GLOBAL(_rest32gpr_31_x)
        mtlr    0
        mr      1,11
        blr
+
+#else /* CONFIG_PPC64 */
+
+.globl _savegpr0_14
+_savegpr0_14:
+       std     r14,-144(r1)
+.globl _savegpr0_15
+_savegpr0_15:
+       std     r15,-136(r1)
+.globl _savegpr0_16
+_savegpr0_16:
+       std     r16,-128(r1)
+.globl _savegpr0_17
+_savegpr0_17:
+       std     r17,-120(r1)
+.globl _savegpr0_18
+_savegpr0_18:
+       std     r18,-112(r1)
+.globl _savegpr0_19
+_savegpr0_19:
+       std     r19,-104(r1)
+.globl _savegpr0_20
+_savegpr0_20:
+       std     r20,-96(r1)
+.globl _savegpr0_21
+_savegpr0_21:
+       std     r21,-88(r1)
+.globl _savegpr0_22
+_savegpr0_22:
+       std     r22,-80(r1)
+.globl _savegpr0_23
+_savegpr0_23:
+       std     r23,-72(r1)
+.globl _savegpr0_24
+_savegpr0_24:
+       std     r24,-64(r1)
+.globl _savegpr0_25
+_savegpr0_25:
+       std     r25,-56(r1)
+.globl _savegpr0_26
+_savegpr0_26:
+       std     r26,-48(r1)
+.globl _savegpr0_27
+_savegpr0_27:
+       std     r27,-40(r1)
+.globl _savegpr0_28
+_savegpr0_28:
+       std     r28,-32(r1)
+.globl _savegpr0_29
+_savegpr0_29:
+       std     r29,-24(r1)
+.globl _savegpr0_30
+_savegpr0_30:
+       std     r30,-16(r1)
+.globl _savegpr0_31
+_savegpr0_31:
+       std     r31,-8(r1)
+       std     r0,16(r1)
+       blr
+
+.globl _restgpr0_14
+_restgpr0_14:
+       ld      r14,-144(r1)
+.globl _restgpr0_15
+_restgpr0_15:
+       ld      r15,-136(r1)
+.globl _restgpr0_16
+_restgpr0_16:
+       ld      r16,-128(r1)
+.globl _restgpr0_17
+_restgpr0_17:
+       ld      r17,-120(r1)
+.globl _restgpr0_18
+_restgpr0_18:
+       ld      r18,-112(r1)
+.globl _restgpr0_19
+_restgpr0_19:
+       ld      r19,-104(r1)
+.globl _restgpr0_20
+_restgpr0_20:
+       ld      r20,-96(r1)
+.globl _restgpr0_21
+_restgpr0_21:
+       ld      r21,-88(r1)
+.globl _restgpr0_22
+_restgpr0_22:
+       ld      r22,-80(r1)
+.globl _restgpr0_23
+_restgpr0_23:
+       ld      r23,-72(r1)
+.globl _restgpr0_24
+_restgpr0_24:
+       ld      r24,-64(r1)
+.globl _restgpr0_25
+_restgpr0_25:
+       ld      r25,-56(r1)
+.globl _restgpr0_26
+_restgpr0_26:
+       ld      r26,-48(r1)
+.globl _restgpr0_27
+_restgpr0_27:
+       ld      r27,-40(r1)
+.globl _restgpr0_28
+_restgpr0_28:
+       ld      r28,-32(r1)
+.globl _restgpr0_29
+_restgpr0_29:
+       ld      r0,16(r1)
+       ld      r29,-24(r1)
+       mtlr    r0
+       ld      r30,-16(r1)
+       ld      r31,-8(r1)
+       blr
+
+.globl _restgpr0_30
+_restgpr0_30:
+       ld      r30,-16(r1)
+.globl _restgpr0_31
+_restgpr0_31:
+       ld      r0,16(r1)
+       ld      r31,-8(r1)
+       mtlr    r0
+       blr
+
+#endif /* CONFIG_PPC64 */
+
 #endif
index e640175b65ae0fd53836f78df004a46a168bf27e..0d08d0171392a4e7ec72e21226737cc458e3a98f 100644 (file)
@@ -12,6 +12,7 @@
  *  2 of the License, or (at your option) any later version.
  */
 
+#include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/init.h>
@@ -288,8 +289,8 @@ static void test_alternative_case_with_external_branch(void)
 
 static void test_cpu_macros(void)
 {
-       extern void ftr_fixup_test_FTR_macros;
-       extern void ftr_fixup_test_FTR_macros_expected;
+       extern u8 ftr_fixup_test_FTR_macros;
+       extern u8 ftr_fixup_test_FTR_macros_expected;
        unsigned long size = &ftr_fixup_test_FTR_macros_expected -
                             &ftr_fixup_test_FTR_macros;
 
@@ -301,8 +302,8 @@ static void test_cpu_macros(void)
 static void test_fw_macros(void)
 {
 #ifdef CONFIG_PPC64
-       extern void ftr_fixup_test_FW_FTR_macros;
-       extern void ftr_fixup_test_FW_FTR_macros_expected;
+       extern u8 ftr_fixup_test_FW_FTR_macros;
+       extern u8 ftr_fixup_test_FW_FTR_macros_expected;
        unsigned long size = &ftr_fixup_test_FW_FTR_macros_expected -
                             &ftr_fixup_test_FW_FTR_macros;
 
@@ -314,10 +315,10 @@ static void test_fw_macros(void)
 
 static void test_lwsync_macros(void)
 {
-       extern void lwsync_fixup_test;
-       extern void end_lwsync_fixup_test;
-       extern void lwsync_fixup_test_expected_LWSYNC;
-       extern void lwsync_fixup_test_expected_SYNC;
+       extern u8 lwsync_fixup_test;
+       extern u8 end_lwsync_fixup_test;
+       extern u8 lwsync_fixup_test_expected_LWSYNC;
+       extern u8 lwsync_fixup_test_expected_SYNC;
        unsigned long size = &end_lwsync_fixup_test -
                             &lwsync_fixup_test;
 
index 3fc2e6494b8b277cf01eb0d03c76e69bc1f11664..ab3962b0d246b586f9b406769acd9e39cd712482 100644 (file)
@@ -445,7 +445,11 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
        }
 
        allocate_device_bars(pdev);
-       iseries_device_information(pdev, bus, *sub_bus);
+       if (likely(sub_bus))
+               iseries_device_information(pdev, bus, *sub_bus);
+       else
+               printk(KERN_ERR "PCI: Device node %s has missing or invalid "
+                               "linux,subbus property\n", node->full_name);
 }
 
 /*
index f8779006986d16a2e39341a7aa66ebf7b8825162..f6127b9f5acac16c10842fee3c53445fddfacd2a 100644 (file)
@@ -503,6 +503,11 @@ static int ignore_undef_symbol(struct elf_info *info, const char *symname)
                    strncmp(symname, "_rest32gpr_", sizeof("_rest32gpr_") - 1) == 0 ||
                    strncmp(symname, "_save32gpr_", sizeof("_save32gpr_") - 1) == 0)
                        return 1;
+       if (info->hdr->e_machine == EM_PPC64)
+               /* Special register function linked on all modules during final link of .ko */
+               if (strncmp(symname, "_restgpr0_", sizeof("_restgpr0_") - 1) == 0 ||
+                   strncmp(symname, "_savegpr0_", sizeof("_savegpr0_") - 1) == 0)
+                       return 1;
        /* Do not ignore this symbol */
        return 0;
 }