[RFC PATCH v1 11/11] powerpc/machdep: Convert ppc_md to static calls

2021-09-03 Thread Christophe Leroy
Static calls are global structures declared with DECLARE_STATIC_CALL() and defined with DEFINE_STATIC_CALL(). All fonction prototypes are moved out of struct machdep_calls into struct machdep_calls_ops. That new struct won't be instanciated, it is only used as a support for carriing fonction

[PATCH v3 1/2] powerpc/64s: system call scv tabort fix for corrupt irq soft-mask state

2021-09-03 Thread Nicholas Piggin
If a system call is made with a transaction active, the kernel immediately aborts it and returns. scv system calls disable irqs even earlier in their interrupt handler, and tabort_syscall does not fix this up. This can result in irq soft-mask state being messed up on the next kernel entry, and

[RFC PATCH v1 09/11] powerpc/platforms: Use ppc_md. helpers

2021-09-03 Thread Christophe Leroy
Instead of playing directly with ppc_md. structure fields, use the newly defined helpers. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/archrandom.h | 4 +- arch/powerpc/include/asm/iommu.h | 3 +- arch/powerpc/include/asm/machdep.h| 3 +-

[RFC PATCH v1 08/11] powerpc/corenet: Change criteria to set MPIC_ENABLE_COREINT

2021-09-03 Thread Christophe Leroy
Don't use ppc_md function comparison. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/85xx/corenet_generic.c | 2 +- arch/powerpc/sysdev/mpic.c| 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c

Re: [RESEND PATCH v4 2/4] drivers/nvdimm: Add perf interface to expose nvdimm performance stats

2021-09-03 Thread kernel test robot
Hi Kajol, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linux-nvdimm/libnvdimm-for-next] [also build test WARNING on powerpc/next linus/master v5.14 next-20210903] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting

[RFC PATCH v1 00/11] powerpc/machdep: Remove dust and convert to static calls

2021-09-03 Thread Christophe Leroy
The purpose of this series is to convert machine dependent functions in structure ppc_md into static calls. First part of the series remove some dust in and around machdep.h Then some helpers are defined to abstract the access to ppc_md. structure. Then all plateforms are converted to using

[RFC PATCH v1 02/11] powerpc/machdep: Remove stale functions from ppc_md structure

2021-09-03 Thread Christophe Leroy
ppc_md.iommu_save() is not set anymore by any platform after commit c40785ad305b ("powerpc/dart: Use a cachable DART"). So iommu_save() has become a nop and can be removed. ppc_md.show_percpuinfo() is not set anymore by any platform after commit 4350147a816b ("[PATCH] ppc64: SMU based macs

[RFC PATCH] drivers/nvdimm: nvdimm_pmu_free_hotplug_memory() can be static

2021-09-03 Thread kernel test robot
drivers/nvdimm/nd_perf.c:159:6: warning: symbol 'nvdimm_pmu_free_hotplug_memory' was not declared. Should it be static? Reported-by: kernel test robot Signed-off-by: kernel test robot --- nd_perf.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvdimm/nd_perf.c

[RFC PATCH v1 03/11] powerpc/machdep: Remove CONFIG_PPC_HAS_FEATURE_CALLS

2021-09-03 Thread Christophe Leroy
Last user was removed by commit 7bbd827750e6 ("[PATCH] ppc64: very basic desktop g5 sound support"). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/machdep.h | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/powerpc/include/asm/machdep.h

[RFC PATCH v1 05/11] powerpc/machdep: Move sys_ctrler_t definition into pmac.h

2021-09-03 Thread Christophe Leroy
sys_ctrler_t definitions are tied to pmac. Move it in pmac.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/machdep.h | 15 --- arch/powerpc/platforms/powermac/pmac.h | 12 2 files changed, 12 insertions(+), 15 deletions(-) diff --git

[RFC PATCH v1 04/11] powerpc/machdep: Make probe_machine() static

2021-09-03 Thread Christophe Leroy
Since commit b1923caa6e64 ("powerpc: Merge 32-bit and 64-bit setup_arch()") probe_machine has only been called from the file in which it is defined. So it can be static. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/machdep.h | 2 -- arch/powerpc/kernel/setup-common.c | 2 +- 2

[RFC PATCH v1 06/11] powerpc/machdep: Add helpers to use ppc_md. functions

2021-09-03 Thread Christophe Leroy
As a preparation to converting ppc_md functions to static calls, add helpers to play with ppc_md. functions. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/machdep.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/include/asm/machdep.h

[RFC PATCH v1 07/11] powerpc/mpc86xx_hpcn: Remove obsolete statement

2021-09-03 Thread Christophe Leroy
Comment says "Delete this in 2.6.27". Do so now. Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c index

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.15-1 tag

2021-09-03 Thread Marc Zyngier
Hi Michael, On Fri, 03 Sep 2021 14:36:57 +0100, Michael Ellerman wrote: > > Hi Linus, > > Please pull powerpc updates for 5.15. > > A bit of a small batch this time. > > There was one conflict against my own fixes branch, and the resolution was a > little bit > messy, so I just did a merge

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.15-1 tag

2021-09-03 Thread pr-tracker-bot
The pull request you sent on Fri, 03 Sep 2021 23:36:57 +1000: > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > tags/powerpc-5.15-1 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/7cca308cfdc0725363ac5943dca9dcd49cc1d2d5 Thank you! --

Re: [PATCH v2] powerpc/bug: Cast to unsigned long before passing to inline asm

2021-09-03 Thread Michael Ellerman
On Wed, 1 Sep 2021 21:25:22 +1000, Michael Ellerman wrote: > In commit 1e688dd2a3d6 ("powerpc/bug: Provide better flexibility to > WARN_ON/__WARN_FLAGS() with asm goto") we changed WARN_ON(). Previously > it would take the warning condition, x, and double negate it before > converting the result

Re: [PATCH] powerpc/ptdump: Fix generic ptdump for 64-bit

2021-09-03 Thread Michael Ellerman
On Tue, 31 Aug 2021 23:51:51 +1000, Michael Ellerman wrote: > Since the conversion to generic ptdump we see crashes on 64-bit: > > BUG: Unable to handle kernel data access on read at 0xc0eeff7f > Faulting instruction address: 0xc045e5fc > Oops: Kernel access of bad area,

Re: [PATCH kernel] KVM: PPC: Fix clearing never mapped TCEs in realmode

2021-09-03 Thread Michael Ellerman
On Fri, 27 Aug 2021 14:07:06 +1000, Alexey Kardashevskiy wrote: > Since e1a1ef84cd07, pages for TCE tables for KVM guests are allocated > only when needed. This allows skipping any update when clearing TCEs. > This works mostly fine as TCE updates are handled when MMU is enabled. > The realmode

[powerpc:next] BUILD SUCCESS a3314262eede9c909a0c797f16f25f941d12c78d

2021-09-03 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next branch HEAD: a3314262eede9c909a0c797f16f25f941d12c78d Merge branch 'fixes' into next elapsed time: 721m configs tested: 155 configs skipped: 4 The following configs have been built successfully. More configs

[PATCH] powerpc/code-patching: Return error on patch_branch() out-of-range failure

2021-09-03 Thread Christophe Leroy
Do not silentely ignore a failure of create_branch() in patch_branch(). Return -ERANGE. Signed-off-by: Christophe Leroy --- arch/powerpc/lib/code-patching.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c

[PATCH] powerpc/powermac: Remove stale declaration of pmac_md

2021-09-03 Thread Christophe Leroy
pmac_md doesn't exist anymore, remove stall declaration. Fixes: e8222502ee61 ("[PATCH] powerpc: Kill _machine and hard-coded platform numbers") Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/powermac/setup.c | 2 -- 1 file changed, 2 deletions(-) diff --git

Re: [PATCH] ftrace: Cleanup ftrace_dyn_arch_init()

2021-09-03 Thread Heiko Carstens
On Fri, Sep 03, 2021 at 03:18:17PM +0800, Weizhao Ouyang wrote: > Most ARCHs use empty ftrace_dyn_arch_init(), introduce a weak common > ftrace_dyn_arch_init() to cleanup them. > > Signed-off-by: Weizhao Ouyang > --- > arch/arm/kernel/ftrace.c | 5 - > arch/arm64/kernel/ftrace.c

Re: [PATCH v2 5/5] powerpc/signal: Use unsafe_copy_siginfo_to_user()

2021-09-03 Thread Christophe Leroy
Le 02/09/2021 à 20:38, Eric W. Biederman a écrit : Christophe Leroy writes: Use unsafe_copy_siginfo_to_user() in order to do the copy within the user access block. On an mpc 8321 (book3s/32) the improvment is about 5% on a process sending a signal to itself. Nacked-by: "Eric W.

Re: [PATCH v2 3/5] signal: Add unsafe_copy_siginfo_to_user()

2021-09-03 Thread Christophe Leroy
Le 02/09/2021 à 20:43, Eric W. Biederman a écrit : Christophe Leroy writes: In the same spirit as commit fb05121fd6a2 ("signal: Add unsafe_get_compat_sigset()"), implement an 'unsafe' version of copy_siginfo_to_user() in order to use it within user access blocks. For that, also add an

Re: [PATCH -next] powerpc/mm: check base flags in ioremap_prot

2021-09-03 Thread Christophe Leroy
Le 03/09/2021 à 11:03, Nanyong Sun a écrit : Some drivers who call ioremap_prot without setting base flags like ioremap_prot(addr, len, 0) may work well before commit 56f3c1413f5c ("powerpc/mm: properly set PAGE_KERNEL flags in ioremap()"), but now they will get a virtual address

[PATCH] powerpc: Remove unused prototype for of_show_percpuinfo

2021-09-03 Thread Daniel Axtens
commit 6d7f58b04d82 ("[PATCH] powerpc: Some minor cleanups to setup_32.c") removed of_show_percpuinfo but didn't remove the prototype. Remove it. Fixes: 6d7f58b04d82 ("[PATCH] powerpc: Some minor cleanups to setup_32.c") Signed-off-by: Daniel Axtens --- arch/powerpc/platforms/powermac/pmac.h |

Re: [PATCH] powerpc: Remove unused prototype for of_show_percpuinfo

2021-09-03 Thread Andrew Donnellan
On 3/9/21 4:32 pm, Daniel Axtens wrote: commit 6d7f58b04d82 ("[PATCH] powerpc: Some minor cleanups to setup_32.c") removed of_show_percpuinfo but didn't remove the prototype. Remove it. Fixes: 6d7f58b04d82 ("[PATCH] powerpc: Some minor cleanups to setup_32.c") Signed-off-by: Daniel Axtens I

Re: [PATCH] powerpc/machdep: Remove stale functions from ppc_md structure

2021-09-03 Thread Daniel Axtens
Hi Christophe, > ppc_md.iommu_save() is not set anymore by any platform after > commit c40785ad305b ("powerpc/dart: Use a cachable DART"). > So iommu_save() has become a nop and can be removed. I wonder if it makes sense to have an iommu_restore() without an iommu_save. Only dart_iommu.c defines

Re: [PATCH] powerpc/time: Remove generic_suspend_{dis/en}able_irqs()

2021-09-03 Thread Daniel Axtens
Christophe Leroy writes: > Commit d75d68cfef49 ("powerpc: Clean up obsolete code relating to > decrementer and timebase") made generic_suspend_enable_irqs() and > generic_suspend_disable_irqs() static. > > Fold them into their only caller. This does what it says, and simplifies the code.

[PATCH -next] powerpc/mm: check base flags in ioremap_prot

2021-09-03 Thread Nanyong Sun
Some drivers who call ioremap_prot without setting base flags like ioremap_prot(addr, len, 0) may work well before commit 56f3c1413f5c ("powerpc/mm: properly set PAGE_KERNEL flags in ioremap()"), but now they will get a virtual address "successfully" from ioremap_prot and badly fault on memory

[PATCH] ftrace: Cleanup ftrace_dyn_arch_init()

2021-09-03 Thread Weizhao Ouyang
Most ARCHs use empty ftrace_dyn_arch_init(), introduce a weak common ftrace_dyn_arch_init() to cleanup them. Signed-off-by: Weizhao Ouyang --- arch/arm/kernel/ftrace.c | 5 - arch/arm64/kernel/ftrace.c| 5 - arch/csky/kernel/ftrace.c | 5 -