Skip to content

Commit 31016e9

Browse files
committed
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()
2 parents 6741502 + bf23690 commit 31016e9

13 files changed

Lines changed: 184 additions & 37 deletions

File tree

‎arch/powerpc/Kconfig‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ config IRQ_ALL_CPUS
400400

401401
config SPARSE_IRQ
402402
bool "Support sparse irq numbering"
403-
default y
403+
default n
404404
help
405405
This enables support for sparse irqs. This is useful for distro
406406
kernels that want to define a high CONFIG_NR_CPUS value but still
@@ -409,7 +409,7 @@ config SPARSE_IRQ
409409
( Sparse IRQs can also be beneficial on NUMA boxes, as they spread
410410
out the irq_desc[] array in a more NUMA-friendly way. )
411411

412-
If you don't know what to do here, say Y.
412+
If you don't know what to do here, say N.
413413

414414
config NUMA
415415
bool "NUMA support"

‎arch/powerpc/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ endif
9292
else
9393
KBUILD_CFLAGS += $(call cc-option,-mtune=power4)
9494
endif
95-
else
96-
LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
9795
endif
9896

97+
LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
98+
9999
ifeq ($(CONFIG_TUNE_CELL),y)
100100
KBUILD_CFLAGS += $(call cc-option,-mtune=cell)
101101
endif

‎arch/powerpc/include/asm/ptrace.h‎

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@
2424
* 2 of the License, or (at your option) any later version.
2525
*/
2626

27-
#ifdef __KERNEL__
2827
#include <linux/types.h>
29-
#else
30-
#include <stdint.h>
31-
#endif
3228

3329
#ifndef __ASSEMBLY__
3430

@@ -364,13 +360,13 @@ static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
364360
#ifndef __ASSEMBLY__
365361

366362
struct ppc_debug_info {
367-
uint32_t version; /* Only version 1 exists to date */
368-
uint32_t num_instruction_bps;
369-
uint32_t num_data_bps;
370-
uint32_t num_condition_regs;
371-
uint32_t data_bp_alignment;
372-
uint32_t sizeof_condition; /* size of the DVC register */
373-
uint64_t features;
363+
__u32 version; /* Only version 1 exists to date */
364+
__u32 num_instruction_bps;
365+
__u32 num_data_bps;
366+
__u32 num_condition_regs;
367+
__u32 data_bp_alignment;
368+
__u32 sizeof_condition; /* size of the DVC register */
369+
__u64 features;
374370
};
375371

376372
#endif /* __ASSEMBLY__ */
@@ -386,13 +382,13 @@ struct ppc_debug_info {
386382
#ifndef __ASSEMBLY__
387383

388384
struct ppc_hw_breakpoint {
389-
uint32_t version; /* currently, version must be 1 */
390-
uint32_t trigger_type; /* only some combinations allowed */
391-
uint32_t addr_mode; /* address match mode */
392-
uint32_t condition_mode; /* break/watchpoint condition flags */
393-
uint64_t addr; /* break/watchpoint address */
394-
uint64_t addr2; /* range end or mask */
395-
uint64_t condition_value; /* contents of the DVC register */
385+
__u32 version; /* currently, version must be 1 */
386+
__u32 trigger_type; /* only some combinations allowed */
387+
__u32 addr_mode; /* address match mode */
388+
__u32 condition_mode; /* break/watchpoint condition flags */
389+
__u64 addr; /* break/watchpoint address */
390+
__u64 addr2; /* range end or mask */
391+
__u64 condition_value; /* contents of the DVC register */
396392
};
397393

398394
#endif /* __ASSEMBLY__ */

‎arch/powerpc/kernel/crash.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
447447
crash_kexec_prepare_cpus(crashing_cpu);
448448
cpu_set(crashing_cpu, cpus_in_crash);
449449
crash_kexec_stop_spus();
450-
#ifdef CONFIG_PPC_STD_MMU_64
450+
#if defined(CONFIG_PPC_STD_MMU_64) && defined(CONFIG_SMP)
451451
crash_kexec_wait_realmode(crashing_cpu);
452452
#endif
453453
if (ppc_md.kexec_cpu_down)

‎arch/powerpc/kernel/irq.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,10 @@ void fixup_irqs(const struct cpumask *map)
295295

296296
for_each_irq(irq) {
297297
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)
299302
continue;
300303

301304
cpumask_and(mask, desc->affinity, map);

‎arch/powerpc/kernel/perf_event.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,8 +791,11 @@ static void power_pmu_disable(struct perf_event *event)
791791
cpuhw = &__get_cpu_var(cpu_hw_events);
792792
for (i = 0; i < cpuhw->n_events; ++i) {
793793
if (event == cpuhw->event[i]) {
794-
while (++i < cpuhw->n_events)
794+
while (++i < cpuhw->n_events) {
795795
cpuhw->event[i-1] = cpuhw->event[i];
796+
cpuhw->events[i-1] = cpuhw->events[i];
797+
cpuhw->flags[i-1] = cpuhw->flags[i];
798+
}
796799
--cpuhw->n_events;
797800
ppmu->disable_pmc(event->hw.idx - 1, cpuhw->mmcr);
798801
if (event->hw.idx) {

‎arch/powerpc/kernel/prom_init.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ static void __init prom_send_capabilities(void)
872872
"ibm_architecture_vec structure inconsistent: 0x%x !\n",
873873
*cores);
874874
} else {
875-
*cores = NR_CPUS / prom_count_smt_threads();
875+
*cores = DIV_ROUND_UP(NR_CPUS, prom_count_smt_threads());
876876
prom_printf("Max number of cores passed to firmware: 0x%x\n",
877877
(unsigned long)*cores);
878878
}

‎arch/powerpc/kernel/prom_init_check.sh‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,18 @@ do
5252
if [ "${UNDEF:0:9}" = "_restgpr_" ]; then
5353
OK=1
5454
fi
55+
if [ "${UNDEF:0:10}" = "_restgpr0_" ]; then
56+
OK=1
57+
fi
5558
if [ "${UNDEF:0:11}" = "_rest32gpr_" ]; then
5659
OK=1
5760
fi
5861
if [ "${UNDEF:0:9}" = "_savegpr_" ]; then
5962
OK=1
6063
fi
64+
if [ "${UNDEF:0:10}" = "_savegpr0_" ]; then
65+
OK=1
66+
fi
6167
if [ "${UNDEF:0:11}" = "_save32gpr_" ]; then
6268
OK=1
6369
fi

‎arch/powerpc/lib/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ CFLAGS_REMOVE_code-patching.o = -pg
1212
CFLAGS_REMOVE_feature-fixups.o = -pg
1313

1414
obj-y := string.o alloc.o \
15-
checksum_$(CONFIG_WORD_SIZE).o
16-
obj-$(CONFIG_PPC32) += div64.o copy_32.o crtsavres.o
15+
checksum_$(CONFIG_WORD_SIZE).o crtsavres.o
16+
obj-$(CONFIG_PPC32) += div64.o copy_32.o
1717
obj-$(CONFIG_HAS_IOMEM) += devres.o
1818

1919
obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \

‎arch/powerpc/lib/crtsavres.S‎

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Written By Michael Meissner
77
*
88
* Based on gcc/config/rs6000/crtsavres.asm from gcc
9+
* 64 bit additions from reading the PPC elf64abi document.
910
*
1011
* This file is free software; you can redistribute it and/or modify it
1112
* under the terms of the GNU General Public License as published by the
@@ -44,6 +45,8 @@
4445

4546
#ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
4647

48+
#ifndef CONFIG_PPC64
49+
4750
/* Routines for saving integer registers, called by the compiler. */
4851
/* Called with r11 pointing to the stack header word of the caller of the */
4952
/* function, just beyond the end of the integer save area. */
@@ -226,4 +229,130 @@ _GLOBAL(_rest32gpr_31_x)
226229
mtlr 0
227230
mr 1,11
228231
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+
229358
#endif

0 commit comments

Comments
 (0)