Skip to content

Commit 6f68a6a

Browse files
committed
Merge tag 'powerpc-4.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "Fix running SPU programs on Cell, and a few other minor fixes. Thanks to Alistair Popple, Jeremy Kerr, Michael Neuling, Nicholas Piggin" * tag 'powerpc-4.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc: Add PPC_FEATURE userspace bits for SCV and DARN instructions powerpc/spufs: Fix hash faults for kernel regions powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N powerpc/powernv/npu-dma.c: Fix opal_npu_destroy_context() call selftests/powerpc: Fix TM resched DSCR test with some compilers
2 parents 38e6bf2 + a4700a2 commit 6f68a6a

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

arch/powerpc/include/uapi/asm/cputable.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
#define PPC_FEATURE2_HTM_NOSC 0x01000000
4747
#define PPC_FEATURE2_ARCH_3_00 0x00800000 /* ISA 3.00 */
4848
#define PPC_FEATURE2_HAS_IEEE128 0x00400000 /* VSX IEEE Binary Float 128-bit */
49+
#define PPC_FEATURE2_DARN 0x00200000 /* darn random number insn */
50+
#define PPC_FEATURE2_SCV 0x00100000 /* scv syscall */
4951

5052
/*
5153
* IMPORTANT!

arch/powerpc/kernel/cputable.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ extern void __restore_cpu_e6500(void);
124124
#define COMMON_USER_POWER9 COMMON_USER_POWER8
125125
#define COMMON_USER2_POWER9 (COMMON_USER2_POWER8 | \
126126
PPC_FEATURE2_ARCH_3_00 | \
127-
PPC_FEATURE2_HAS_IEEE128)
127+
PPC_FEATURE2_HAS_IEEE128 | \
128+
PPC_FEATURE2_DARN )
128129

129130
#ifdef CONFIG_PPC_BOOK3E_64
130131
#define COMMON_USER_BOOKE (COMMON_USER_PPC64 | PPC_FEATURE_BOOKE)

arch/powerpc/kernel/prom.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ static struct ibm_pa_feature {
161161
{ .pabyte = 0, .pabit = 3, .cpu_features = CPU_FTR_CTRL },
162162
{ .pabyte = 0, .pabit = 6, .cpu_features = CPU_FTR_NOEXECUTE },
163163
{ .pabyte = 1, .pabit = 2, .mmu_features = MMU_FTR_CI_LARGE_PAGE },
164+
#ifdef CONFIG_PPC_RADIX_MMU
164165
{ .pabyte = 40, .pabit = 0, .mmu_features = MMU_FTR_TYPE_RADIX },
166+
#endif
165167
{ .pabyte = 1, .pabit = 1, .invert = 1, .cpu_features = CPU_FTR_NODSISRALIGN },
166168
{ .pabyte = 5, .pabit = 0, .cpu_features = CPU_FTR_REAL_LE,
167169
.cpu_user_ftrs = PPC_FEATURE_TRUE_LE },

arch/powerpc/platforms/cell/spu_base.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
197197
(REGION_ID(ea) != USER_REGION_ID)) {
198198

199199
spin_unlock(&spu->register_lock);
200-
ret = hash_page(ea, _PAGE_PRESENT | _PAGE_READ, 0x300, dsisr);
200+
ret = hash_page(ea,
201+
_PAGE_PRESENT | _PAGE_READ | _PAGE_PRIVILEGED,
202+
0x300, dsisr);
201203
spin_lock(&spu->register_lock);
202204

203205
if (!ret) {

arch/powerpc/platforms/powernv/npu-dma.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ static void pnv_npu2_release_context(struct kref *kref)
714714
void pnv_npu2_destroy_context(struct npu_context *npu_context,
715715
struct pci_dev *gpdev)
716716
{
717-
struct pnv_phb *nphb, *phb;
717+
struct pnv_phb *nphb;
718718
struct npu *npu;
719719
struct pci_dev *npdev = pnv_pci_get_npu_dev(gpdev, 0);
720720
struct device_node *nvlink_dn;
@@ -728,13 +728,12 @@ void pnv_npu2_destroy_context(struct npu_context *npu_context,
728728

729729
nphb = pci_bus_to_host(npdev->bus)->private_data;
730730
npu = &nphb->npu;
731-
phb = pci_bus_to_host(gpdev->bus)->private_data;
732731
nvlink_dn = of_parse_phandle(npdev->dev.of_node, "ibm,nvlink", 0);
733732
if (WARN_ON(of_property_read_u32(nvlink_dn, "ibm,npu-link-index",
734733
&nvlink_index)))
735734
return;
736735
npu_context->npdev[npu->index][nvlink_index] = NULL;
737-
opal_npu_destroy_context(phb->opal_id, npu_context->mm->context.id,
736+
opal_npu_destroy_context(nphb->opal_id, npu_context->mm->context.id,
738737
PCI_DEVID(gpdev->bus->number, gpdev->devfn));
739738
kref_put(&npu_context->kref, pnv_npu2_release_context);
740739
}

tools/testing/selftests/powerpc/tm/tm-resched-dscr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ int test_body(void)
4242
printf("Check DSCR TM context switch: ");
4343
fflush(stdout);
4444
for (;;) {
45-
rv = 1;
4645
asm __volatile__ (
4746
/* set a known value into the DSCR */
4847
"ld 3, %[dscr1];"
4948
"mtspr %[sprn_dscr], 3;"
5049

50+
"li %[rv], 1;"
5151
/* start and suspend a transaction */
5252
"tbegin.;"
5353
"beq 1f;"

0 commit comments

Comments
 (0)