Skip to content

Commit 7442cf9

Browse files
committed
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull powerpc fixes from Ben Herrenschmidt: "Here is a handful of powerpc fixes for 3.16. They are all pretty simple and self contained and should still make this release" * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: powerpc: use _GLOBAL_TOC for memmove powerpc/pseries: dynamically added OF nodes need to call of_node_init powerpc: subpage_protect: Increase the array size to take care of 64TB powerpc: Fix bugs in emulate_step() powerpc: Disable doorbells on Power8 DD1.x
2 parents 355cb09 + 6f5405b commit 7442cf9

File tree

7 files changed

+31
-7
lines changed

7 files changed

+31
-7
lines changed

arch/powerpc/include/asm/cputable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ extern const char *powerpc_base_platform;
447447
CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_DAWR | \
448448
CPU_FTR_ARCH_207S | CPU_FTR_TM_COMP)
449449
#define CPU_FTRS_POWER8E (CPU_FTRS_POWER8 | CPU_FTR_PMAO_BUG)
450+
#define CPU_FTRS_POWER8_DD1 (CPU_FTRS_POWER8 & ~CPU_FTR_DBELL)
450451
#define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
451452
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
452453
CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \

arch/powerpc/include/asm/mmu-hash64.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*/
2323
#include <asm/pgtable-ppc64.h>
2424
#include <asm/bug.h>
25+
#include <asm/processor.h>
2526

2627
/*
2728
* Segment table
@@ -496,7 +497,7 @@ extern void slb_set_size(u16 size);
496497
*/
497498
struct subpage_prot_table {
498499
unsigned long maxaddr; /* only addresses < this are protected */
499-
unsigned int **protptrs[2];
500+
unsigned int **protptrs[(TASK_SIZE_USER64 >> 43)];
500501
unsigned int *low_prot[4];
501502
};
502503

arch/powerpc/kernel/cputable.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,26 @@ static struct cpu_spec __initdata cpu_specs[] = {
527527
.machine_check_early = __machine_check_early_realmode_p8,
528528
.platform = "power8",
529529
},
530+
{ /* Power8 DD1: Does not support doorbell IPIs */
531+
.pvr_mask = 0xffffff00,
532+
.pvr_value = 0x004d0100,
533+
.cpu_name = "POWER8 (raw)",
534+
.cpu_features = CPU_FTRS_POWER8_DD1,
535+
.cpu_user_features = COMMON_USER_POWER8,
536+
.cpu_user_features2 = COMMON_USER2_POWER8,
537+
.mmu_features = MMU_FTRS_POWER8,
538+
.icache_bsize = 128,
539+
.dcache_bsize = 128,
540+
.num_pmcs = 6,
541+
.pmc_type = PPC_PMC_IBM,
542+
.oprofile_cpu_type = "ppc64/power8",
543+
.oprofile_type = PPC_OPROFILE_INVALID,
544+
.cpu_setup = __setup_cpu_power8,
545+
.cpu_restore = __restore_cpu_power8,
546+
.flush_tlb = __flush_tlb_power8,
547+
.machine_check_early = __machine_check_early_realmode_p8,
548+
.platform = "power8",
549+
},
530550
{ /* Power8 */
531551
.pvr_mask = 0xffff0000,
532552
.pvr_value = 0x004d0000,

arch/powerpc/lib/mem_64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ _GLOBAL(memset)
7777
stb r4,0(r6)
7878
blr
7979

80-
_GLOBAL(memmove)
80+
_GLOBAL_TOC(memmove)
8181
cmplw 0,r3,r4
8282
bgt backwards_memcpy
8383
b memcpy

arch/powerpc/lib/sstep.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
11981198
sh = regs->gpr[rb] & 0x3f;
11991199
ival = (signed int) regs->gpr[rd];
12001200
regs->gpr[ra] = ival >> (sh < 32 ? sh : 31);
1201-
if (ival < 0 && (sh >= 32 || (ival & ((1 << sh) - 1)) != 0))
1201+
if (ival < 0 && (sh >= 32 || (ival & ((1ul << sh) - 1)) != 0))
12021202
regs->xer |= XER_CA;
12031203
else
12041204
regs->xer &= ~XER_CA;
@@ -1208,15 +1208,15 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
12081208
sh = rb;
12091209
ival = (signed int) regs->gpr[rd];
12101210
regs->gpr[ra] = ival >> sh;
1211-
if (ival < 0 && (ival & ((1 << sh) - 1)) != 0)
1211+
if (ival < 0 && (ival & ((1ul << sh) - 1)) != 0)
12121212
regs->xer |= XER_CA;
12131213
else
12141214
regs->xer &= ~XER_CA;
12151215
goto logical_done;
12161216

12171217
#ifdef __powerpc64__
12181218
case 27: /* sld */
1219-
sh = regs->gpr[rd] & 0x7f;
1219+
sh = regs->gpr[rb] & 0x7f;
12201220
if (sh < 64)
12211221
regs->gpr[ra] = regs->gpr[rd] << sh;
12221222
else
@@ -1235,7 +1235,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
12351235
sh = regs->gpr[rb] & 0x7f;
12361236
ival = (signed long int) regs->gpr[rd];
12371237
regs->gpr[ra] = ival >> (sh < 64 ? sh : 63);
1238-
if (ival < 0 && (sh >= 64 || (ival & ((1 << sh) - 1)) != 0))
1238+
if (ival < 0 && (sh >= 64 || (ival & ((1ul << sh) - 1)) != 0))
12391239
regs->xer |= XER_CA;
12401240
else
12411241
regs->xer &= ~XER_CA;
@@ -1246,7 +1246,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
12461246
sh = rb | ((instr & 2) << 4);
12471247
ival = (signed long int) regs->gpr[rd];
12481248
regs->gpr[ra] = ival >> sh;
1249-
if (ival < 0 && (ival & ((1 << sh) - 1)) != 0)
1249+
if (ival < 0 && (ival & ((1ul << sh) - 1)) != 0)
12501250
regs->xer |= XER_CA;
12511251
else
12521252
regs->xer &= ~XER_CA;

arch/powerpc/platforms/pseries/dlpar.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa,
8686
}
8787

8888
of_node_set_flag(dn, OF_DYNAMIC);
89+
of_node_init(dn);
8990

9091
return dn;
9192
}

arch/powerpc/platforms/pseries/reconfig.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist
6969

7070
np->properties = proplist;
7171
of_node_set_flag(np, OF_DYNAMIC);
72+
of_node_init(np);
7273

7374
np->parent = derive_parent(path);
7475
if (IS_ERR(np->parent)) {

0 commit comments

Comments
 (0)