diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-18 12:55:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-18 12:55:42 -0500 |
commit | c5b709804ed7d36c45b5efa170d9e3ea8c29b865 (patch) | |
tree | 417d230c7b71058d0140e476005a92bee437cc8c | |
parent | e6ec2fda2d464938989ecd770be92e492ace3ae1 (diff) | |
parent | 7bea7ac0ca0121798f3618d16201ca4dc4e67a00 (diff) |
Merge tag 'powerpc-5.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman:
"A couple of weeks of fixes.
There's one fix for an oops on Power9 machines with Open CAPI
adapters.
And a fix for probable memory corruption in some of the new NPU code,
caught by smatch though and not seen in the wild.
Plus a few other minor fixes.
There's one non-fix which is the perf_regs change. That was sent
during the merge window but I accidentally only merged the first of
two patches in the series. It's been in linux-next so hopefully
doesn't conflict with anything in acme's tree.
Thanks to: Alexey Kardashevskiy, Andrew Donnellan, Breno Leitao,
Christian Lamparter, Christophe Leroy, Dan Carpenter, Frederic Barrat,
Greg Kurz, Jason A. Donenfeld, Madhavan Srinivasan"
* tag 'powerpc-5.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/syscalls: Fix syscall tracing
powerpc/pseries: Fix build break due to pnv_npu2_init()
powerpc/4xx/ocm: Fix fix for phys_addr_t printf warnings
powerpc/powernv/npu: Fix oops in pnv_try_setup_npu_table_group()
powerpc/tm: Limit TM code inside PPC_TRANSACTIONAL_MEM
powerpc/8xx: fix setting of pagetable for Abatron BDI debug tool.
powerpc/powernv/npu: Allocate enough memory in pnv_try_setup_npu_table_group()
powerpc/perf: Update perf_regs structure to include MMCRA
-rw-r--r-- | arch/powerpc/include/uapi/asm/perf_regs.h | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/head_8xx.S | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal_64.c | 7 | ||||
-rw-r--r-- | arch/powerpc/kernel/trace/ftrace.c | 7 | ||||
-rw-r--r-- | arch/powerpc/perf/perf_regs.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/4xx/ocm.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/npu-dma.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/pci-ioda.c | 3 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/pci.c | 2 | ||||
-rw-r--r-- | tools/arch/powerpc/include/uapi/asm/perf_regs.h | 1 | ||||
-rw-r--r-- | tools/perf/arch/powerpc/include/perf_regs.h | 3 | ||||
-rw-r--r-- | tools/perf/arch/powerpc/util/perf_regs.c | 1 |
12 files changed, 25 insertions, 17 deletions
diff --git a/arch/powerpc/include/uapi/asm/perf_regs.h b/arch/powerpc/include/uapi/asm/perf_regs.h index ff91192407d1..f599064dd8dc 100644 --- a/arch/powerpc/include/uapi/asm/perf_regs.h +++ b/arch/powerpc/include/uapi/asm/perf_regs.h | |||
@@ -47,6 +47,7 @@ enum perf_event_powerpc_regs { | |||
47 | PERF_REG_POWERPC_DAR, | 47 | PERF_REG_POWERPC_DAR, |
48 | PERF_REG_POWERPC_DSISR, | 48 | PERF_REG_POWERPC_DSISR, |
49 | PERF_REG_POWERPC_SIER, | 49 | PERF_REG_POWERPC_SIER, |
50 | PERF_REG_POWERPC_MMCRA, | ||
50 | PERF_REG_POWERPC_MAX, | 51 | PERF_REG_POWERPC_MAX, |
51 | }; | 52 | }; |
52 | #endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */ | 53 | #endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */ |
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index 57deb1e9ffea..20cc816b3508 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S | |||
@@ -852,11 +852,12 @@ start_here: | |||
852 | 852 | ||
853 | /* set up the PTE pointers for the Abatron bdiGDB. | 853 | /* set up the PTE pointers for the Abatron bdiGDB. |
854 | */ | 854 | */ |
855 | tovirt(r6,r6) | ||
856 | lis r5, abatron_pteptrs@h | 855 | lis r5, abatron_pteptrs@h |
857 | ori r5, r5, abatron_pteptrs@l | 856 | ori r5, r5, abatron_pteptrs@l |
858 | stw r5, 0xf0(0) /* Must match your Abatron config file */ | 857 | stw r5, 0xf0(0) /* Must match your Abatron config file */ |
859 | tophys(r5,r5) | 858 | tophys(r5,r5) |
859 | lis r6, swapper_pg_dir@h | ||
860 | ori r6, r6, swapper_pg_dir@l | ||
860 | stw r6, 0(r5) | 861 | stw r6, 0(r5) |
861 | 862 | ||
862 | /* Now turn on the MMU for real! */ | 863 | /* Now turn on the MMU for real! */ |
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index bd5e6834ca69..6794466f6420 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
@@ -755,11 +755,12 @@ SYSCALL_DEFINE0(rt_sigreturn) | |||
755 | if (restore_tm_sigcontexts(current, &uc->uc_mcontext, | 755 | if (restore_tm_sigcontexts(current, &uc->uc_mcontext, |
756 | &uc_transact->uc_mcontext)) | 756 | &uc_transact->uc_mcontext)) |
757 | goto badframe; | 757 | goto badframe; |
758 | } | 758 | } else |
759 | #endif | 759 | #endif |
760 | /* Fall through, for non-TM restore */ | 760 | { |
761 | if (!MSR_TM_ACTIVE(msr)) { | ||
762 | /* | 761 | /* |
762 | * Fall through, for non-TM restore | ||
763 | * | ||
763 | * Unset MSR[TS] on the thread regs since MSR from user | 764 | * Unset MSR[TS] on the thread regs since MSR from user |
764 | * context does not have MSR active, and recheckpoint was | 765 | * context does not have MSR active, and recheckpoint was |
765 | * not called since restore_tm_sigcontexts() was not called | 766 | * not called since restore_tm_sigcontexts() was not called |
diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c index 29746dc28df5..517662a56bdc 100644 --- a/arch/powerpc/kernel/trace/ftrace.c +++ b/arch/powerpc/kernel/trace/ftrace.c | |||
@@ -967,13 +967,6 @@ out: | |||
967 | } | 967 | } |
968 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 968 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
969 | 969 | ||
970 | #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_PPC64) | ||
971 | unsigned long __init arch_syscall_addr(int nr) | ||
972 | { | ||
973 | return sys_call_table[nr*2]; | ||
974 | } | ||
975 | #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_PPC64 */ | ||
976 | |||
977 | #ifdef PPC64_ELF_ABI_v1 | 970 | #ifdef PPC64_ELF_ABI_v1 |
978 | char *arch_ftrace_match_adjust(char *str, const char *search) | 971 | char *arch_ftrace_match_adjust(char *str, const char *search) |
979 | { | 972 | { |
diff --git a/arch/powerpc/perf/perf_regs.c b/arch/powerpc/perf/perf_regs.c index 5c36b3a8d47a..3349f3f8fe84 100644 --- a/arch/powerpc/perf/perf_regs.c +++ b/arch/powerpc/perf/perf_regs.c | |||
@@ -70,6 +70,7 @@ static unsigned int pt_regs_offset[PERF_REG_POWERPC_MAX] = { | |||
70 | PT_REGS_OFFSET(PERF_REG_POWERPC_DAR, dar), | 70 | PT_REGS_OFFSET(PERF_REG_POWERPC_DAR, dar), |
71 | PT_REGS_OFFSET(PERF_REG_POWERPC_DSISR, dsisr), | 71 | PT_REGS_OFFSET(PERF_REG_POWERPC_DSISR, dsisr), |
72 | PT_REGS_OFFSET(PERF_REG_POWERPC_SIER, dar), | 72 | PT_REGS_OFFSET(PERF_REG_POWERPC_SIER, dar), |
73 | PT_REGS_OFFSET(PERF_REG_POWERPC_MMCRA, dsisr), | ||
73 | }; | 74 | }; |
74 | 75 | ||
75 | u64 perf_reg_value(struct pt_regs *regs, int idx) | 76 | u64 perf_reg_value(struct pt_regs *regs, int idx) |
@@ -83,6 +84,11 @@ u64 perf_reg_value(struct pt_regs *regs, int idx) | |||
83 | !is_sier_available())) | 84 | !is_sier_available())) |
84 | return 0; | 85 | return 0; |
85 | 86 | ||
87 | if (idx == PERF_REG_POWERPC_MMCRA && | ||
88 | (IS_ENABLED(CONFIG_FSL_EMB_PERF_EVENT) || | ||
89 | IS_ENABLED(CONFIG_PPC32))) | ||
90 | return 0; | ||
91 | |||
86 | return regs_get_register(regs, pt_regs_offset[idx]); | 92 | return regs_get_register(regs, pt_regs_offset[idx]); |
87 | } | 93 | } |
88 | 94 | ||
diff --git a/arch/powerpc/platforms/4xx/ocm.c b/arch/powerpc/platforms/4xx/ocm.c index a1aaa1569d7c..f0e488d97567 100644 --- a/arch/powerpc/platforms/4xx/ocm.c +++ b/arch/powerpc/platforms/4xx/ocm.c | |||
@@ -237,12 +237,12 @@ static int ocm_debugfs_show(struct seq_file *m, void *v) | |||
237 | continue; | 237 | continue; |
238 | 238 | ||
239 | seq_printf(m, "PPC4XX OCM : %d\n", ocm->index); | 239 | seq_printf(m, "PPC4XX OCM : %d\n", ocm->index); |
240 | seq_printf(m, "PhysAddr : %pa[p]\n", &(ocm->phys)); | 240 | seq_printf(m, "PhysAddr : %pa\n", &(ocm->phys)); |
241 | seq_printf(m, "MemTotal : %d Bytes\n", ocm->memtotal); | 241 | seq_printf(m, "MemTotal : %d Bytes\n", ocm->memtotal); |
242 | seq_printf(m, "MemTotal(NC) : %d Bytes\n", ocm->nc.memtotal); | 242 | seq_printf(m, "MemTotal(NC) : %d Bytes\n", ocm->nc.memtotal); |
243 | seq_printf(m, "MemTotal(C) : %d Bytes\n\n", ocm->c.memtotal); | 243 | seq_printf(m, "MemTotal(C) : %d Bytes\n\n", ocm->c.memtotal); |
244 | 244 | ||
245 | seq_printf(m, "NC.PhysAddr : %pa[p]\n", &(ocm->nc.phys)); | 245 | seq_printf(m, "NC.PhysAddr : %pa\n", &(ocm->nc.phys)); |
246 | seq_printf(m, "NC.VirtAddr : 0x%p\n", ocm->nc.virt); | 246 | seq_printf(m, "NC.VirtAddr : 0x%p\n", ocm->nc.virt); |
247 | seq_printf(m, "NC.MemTotal : %d Bytes\n", ocm->nc.memtotal); | 247 | seq_printf(m, "NC.MemTotal : %d Bytes\n", ocm->nc.memtotal); |
248 | seq_printf(m, "NC.MemFree : %d Bytes\n", ocm->nc.memfree); | 248 | seq_printf(m, "NC.MemFree : %d Bytes\n", ocm->nc.memfree); |
@@ -252,7 +252,7 @@ static int ocm_debugfs_show(struct seq_file *m, void *v) | |||
252 | blk->size, blk->owner); | 252 | blk->size, blk->owner); |
253 | } | 253 | } |
254 | 254 | ||
255 | seq_printf(m, "\nC.PhysAddr : %pa[p]\n", &(ocm->c.phys)); | 255 | seq_printf(m, "\nC.PhysAddr : %pa\n", &(ocm->c.phys)); |
256 | seq_printf(m, "C.VirtAddr : 0x%p\n", ocm->c.virt); | 256 | seq_printf(m, "C.VirtAddr : 0x%p\n", ocm->c.virt); |
257 | seq_printf(m, "C.MemTotal : %d Bytes\n", ocm->c.memtotal); | 257 | seq_printf(m, "C.MemTotal : %d Bytes\n", ocm->c.memtotal); |
258 | seq_printf(m, "C.MemFree : %d Bytes\n", ocm->c.memfree); | 258 | seq_printf(m, "C.MemFree : %d Bytes\n", ocm->c.memfree); |
diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c index d7f742ed48ba..3f58c7dbd581 100644 --- a/arch/powerpc/platforms/powernv/npu-dma.c +++ b/arch/powerpc/platforms/powernv/npu-dma.c | |||
@@ -564,7 +564,7 @@ struct iommu_table_group *pnv_try_setup_npu_table_group(struct pnv_ioda_pe *pe) | |||
564 | } | 564 | } |
565 | } else { | 565 | } else { |
566 | /* Create a group for 1 GPU and attached NPUs for POWER8 */ | 566 | /* Create a group for 1 GPU and attached NPUs for POWER8 */ |
567 | pe->npucomp = kzalloc(sizeof(pe->npucomp), GFP_KERNEL); | 567 | pe->npucomp = kzalloc(sizeof(*pe->npucomp), GFP_KERNEL); |
568 | table_group = &pe->npucomp->table_group; | 568 | table_group = &pe->npucomp->table_group; |
569 | table_group->ops = &pnv_npu_peers_ops; | 569 | table_group->ops = &pnv_npu_peers_ops; |
570 | iommu_register_group(table_group, hose->global_number, | 570 | iommu_register_group(table_group, hose->global_number, |
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 1d6406a051f1..7db3119f8a5b 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -2681,7 +2681,8 @@ static void pnv_pci_ioda_setup_iommu_api(void) | |||
2681 | list_for_each_entry(hose, &hose_list, list_node) { | 2681 | list_for_each_entry(hose, &hose_list, list_node) { |
2682 | phb = hose->private_data; | 2682 | phb = hose->private_data; |
2683 | 2683 | ||
2684 | if (phb->type == PNV_PHB_NPU_NVLINK) | 2684 | if (phb->type == PNV_PHB_NPU_NVLINK || |
2685 | phb->type == PNV_PHB_NPU_OCAPI) | ||
2685 | continue; | 2686 | continue; |
2686 | 2687 | ||
2687 | list_for_each_entry(pe, &phb->ioda.pe_list, list) { | 2688 | list_for_each_entry(pe, &phb->ioda.pe_list, list) { |
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index 7725825d887d..37a77e57893e 100644 --- a/arch/powerpc/platforms/pseries/pci.c +++ b/arch/powerpc/platforms/pseries/pci.c | |||
@@ -264,7 +264,9 @@ void __init pSeries_final_fixup(void) | |||
264 | if (!of_device_is_compatible(nvdn->parent, | 264 | if (!of_device_is_compatible(nvdn->parent, |
265 | "ibm,power9-npu")) | 265 | "ibm,power9-npu")) |
266 | continue; | 266 | continue; |
267 | #ifdef CONFIG_PPC_POWERNV | ||
267 | WARN_ON_ONCE(pnv_npu2_init(hose)); | 268 | WARN_ON_ONCE(pnv_npu2_init(hose)); |
269 | #endif | ||
268 | break; | 270 | break; |
269 | } | 271 | } |
270 | } | 272 | } |
diff --git a/tools/arch/powerpc/include/uapi/asm/perf_regs.h b/tools/arch/powerpc/include/uapi/asm/perf_regs.h index ff91192407d1..f599064dd8dc 100644 --- a/tools/arch/powerpc/include/uapi/asm/perf_regs.h +++ b/tools/arch/powerpc/include/uapi/asm/perf_regs.h | |||
@@ -47,6 +47,7 @@ enum perf_event_powerpc_regs { | |||
47 | PERF_REG_POWERPC_DAR, | 47 | PERF_REG_POWERPC_DAR, |
48 | PERF_REG_POWERPC_DSISR, | 48 | PERF_REG_POWERPC_DSISR, |
49 | PERF_REG_POWERPC_SIER, | 49 | PERF_REG_POWERPC_SIER, |
50 | PERF_REG_POWERPC_MMCRA, | ||
50 | PERF_REG_POWERPC_MAX, | 51 | PERF_REG_POWERPC_MAX, |
51 | }; | 52 | }; |
52 | #endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */ | 53 | #endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */ |
diff --git a/tools/perf/arch/powerpc/include/perf_regs.h b/tools/perf/arch/powerpc/include/perf_regs.h index 1076393e6f43..e18a3556f5e3 100644 --- a/tools/perf/arch/powerpc/include/perf_regs.h +++ b/tools/perf/arch/powerpc/include/perf_regs.h | |||
@@ -63,7 +63,8 @@ static const char *reg_names[] = { | |||
63 | [PERF_REG_POWERPC_TRAP] = "trap", | 63 | [PERF_REG_POWERPC_TRAP] = "trap", |
64 | [PERF_REG_POWERPC_DAR] = "dar", | 64 | [PERF_REG_POWERPC_DAR] = "dar", |
65 | [PERF_REG_POWERPC_DSISR] = "dsisr", | 65 | [PERF_REG_POWERPC_DSISR] = "dsisr", |
66 | [PERF_REG_POWERPC_SIER] = "sier" | 66 | [PERF_REG_POWERPC_SIER] = "sier", |
67 | [PERF_REG_POWERPC_MMCRA] = "mmcra" | ||
67 | }; | 68 | }; |
68 | 69 | ||
69 | static inline const char *perf_reg_name(int id) | 70 | static inline const char *perf_reg_name(int id) |
diff --git a/tools/perf/arch/powerpc/util/perf_regs.c b/tools/perf/arch/powerpc/util/perf_regs.c index 07fcd977d93e..34d5134681d9 100644 --- a/tools/perf/arch/powerpc/util/perf_regs.c +++ b/tools/perf/arch/powerpc/util/perf_regs.c | |||
@@ -53,6 +53,7 @@ const struct sample_reg sample_reg_masks[] = { | |||
53 | SMPL_REG(dar, PERF_REG_POWERPC_DAR), | 53 | SMPL_REG(dar, PERF_REG_POWERPC_DAR), |
54 | SMPL_REG(dsisr, PERF_REG_POWERPC_DSISR), | 54 | SMPL_REG(dsisr, PERF_REG_POWERPC_DSISR), |
55 | SMPL_REG(sier, PERF_REG_POWERPC_SIER), | 55 | SMPL_REG(sier, PERF_REG_POWERPC_SIER), |
56 | SMPL_REG(mmcra, PERF_REG_POWERPC_MMCRA), | ||
56 | SMPL_REG_END | 57 | SMPL_REG_END |
57 | }; | 58 | }; |
58 | 59 | ||