[PATCH] KVM: PPC: Book3S HV: Fix typo in a comment

2022-05-07 Thread Jason Wang
The double `the' in the comment in line 212 is repeated. Remove one of them from the comment. Signed-off-by: Jason Wang --- arch/powerpc/kvm/book3s_xive_native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_xive_native.c

Re: [RFC v2 01/39] Kconfig: introduce HAS_IOPORT option and select it as necessary

2022-05-07 Thread Finn Thain
On Sun, 8 May 2022, I wrote: > > That suggests to me that we need a "bool CONFIG_WARINGS_INTO_ERRORS" to > control -Werror, which could be disabled for .config files (like make > allmodconfig) where it is not helping. > I just noticed that we already have CONFIG_WERROR. So perhaps

Re: [RFC v2 01/39] Kconfig: introduce HAS_IOPORT option and select it as necessary

2022-05-07 Thread Finn Thain
Hi Arnd, On Sat, 7 May 2022, Arnd Bergmann wrote: > On Sat, May 7, 2022 at 2:01 AM Finn Thain wrote: > > On Fri, 6 May 2022, Niklas Schnelle wrote: > > > On Fri, 2022-05-06 at 19:12 +1000, Finn Thain wrote: > > > > On Thu, 5 May 2022, Bjorn Helgaas wrote: > > > > > > > > > > I mooted a s390

[PATCH] ASoC: fsl_sai: fix incorrect mclk number in error message

2022-05-07 Thread Pieterjan Camerlynck
In commit ("ASoC: fsl_sai: add sai master mode support") the loop was changed to start iterating from 1 instead of 0. The error message however was not updated, reporting the wrong clock to the user. Signed-off-by: Pieterjan Camerlynck --- sound/soc/fsl/fsl_sai.c | 2 +- 1 file changed, 1

Re: request_module DoS

2022-05-07 Thread Luis Chamberlain
On Sat, May 07, 2022 at 01:02:20AM -0700, Luis Chamberlain wrote: > You can try to reproduce by using adding a new test type for crypto-aegis256 > on lib/test_kmod.c. These tests however can try something similar but other > modules. > > /tools/testing/selftests/kmod/kmod.sh -t 0008 >

Re: [PATCH v6 00/23] Rust support

2022-05-07 Thread Miguel Ojeda
Hi David, On Sat, May 7, 2022 at 11:29 AM David Gow wrote: > > It's great to see some KUnit support here! Thanks! > It's also possible to run these tests using the KUnit wrapper tool with: > $ ./tools/testing/kunit/kunit.py run --kconfig_add CONFIG_RUST=y > --make_options LLVM=1 --arch x86_64

Re: [RFC v2 01/39] Kconfig: introduce HAS_IOPORT option and select it as necessary

2022-05-07 Thread Arnd Bergmann
On Sat, May 7, 2022 at 2:01 AM Finn Thain wrote: > On Fri, 6 May 2022, Niklas Schnelle wrote: > > On Fri, 2022-05-06 at 19:12 +1000, Finn Thain wrote: > > > On Thu, 5 May 2022, Bjorn Helgaas wrote: > > > > > > > > I mooted a s390 inb() implementation like "return ~0" because that's > > > > what

Re: [PATCH v2 21/25] powerpc/ftrace: Don't use copy_from_kernel_nofault() in module_trampoline_target()

2022-05-07 Thread kernel test robot
. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/intel-lab-lkp/linux/commits/Christophe-Leroy/powerpc-ftrace-optimisation-and-cleanup-and-more-v2/20220507-145034 base: https://git.kernel.org/pub/scm/linux

[PATCH v2 4/4] powerpc/52xx: Convert to use fwnode API

2022-05-07 Thread Andy Shevchenko
We may convert the GPT driver to use fwnode API for the sake of consistency of the used APIs inside the driver. Signed-off-by: Andy Shevchenko --- v2: no changes arch/powerpc/platforms/52xx/mpc52xx_gpt.c | 47 +++ 1 file changed, 22 insertions(+), 25 deletions(-) diff --git

[PATCH v2 1/4] powerpc/52xx: Remove dead code, i.e. mpc52xx_get_xtal_freq()

2022-05-07 Thread Andy Shevchenko
It seems mpc52xx_get_xtal_freq() is not used anywhere. Remove dead code. Signed-off-by: Andy Shevchenko Reviewed-by: Wolfram Sang --- v2: collected tags arch/powerpc/include/asm/mpc52xx.h | 1 - arch/powerpc/platforms/52xx/mpc52xx_common.c | 37 2 files changed,

[PATCH v2 3/4] powerpc/52xx: Get rid of of_node assignment

2022-05-07 Thread Andy Shevchenko
Let GPIO library assign of_node from the parent device. This allows to move GPIO library and drivers to use fwnode APIs instead of being stuck with OF-only interfaces. Signed-off-by: Andy Shevchenko --- v2: no changes arch/powerpc/platforms/52xx/mpc52xx_gpt.c | 18 -- 1 file

[PATCH v2 2/4] powerpc/mpc5xxx: Switch mpc5xxx_get_bus_frequency() to use fwnode

2022-05-07 Thread Andy Shevchenko
Switch mpc5xxx_get_bus_frequency() to use fwnode in order to help cleaning up other parts of the kernel from OF specific code. No functional change intended. Signed-off-by: Andy Shevchenko Acked-by: Chris Packham # for i2c-mpc Acked-by: Wolfram Sang # for the I2C part Acked-by: Mark Brown

Re: [PATCH 2/3] mm: rmap: Fix CONT-PTE/PMD size hugetlb issue when migration

2022-05-07 Thread Mike Kravetz
On 5/5/22 20:39, Baolin Wang wrote: > > On 5/6/2022 7:53 AM, Mike Kravetz wrote: >> On 4/29/22 01:14, Baolin Wang wrote: >>> On some architectures (like ARM64), it can support CONT-PTE/PMD size >>> hugetlb, which means it can support not only PMD/PUD size hugetlb: >>> 2M and 1G, but also

Re: [PATCH linux-next] power:pkeys: fix bugon.cocci warnings

2022-05-07 Thread Arnd Bergmann
On Sat, May 7, 2022 at 9:04 AM Christophe Leroy wrote: > Le 02/05/2022 à 15:24, Michael Ellerman a écrit : > > CGEL writes: > >> From: Jing Yangyang > >> > >> Use BUG_ON instead of a if condition followed by BUG. > >> > >> ./arch/powerpc/include/asm/book3s/64/pkeys.h:21:2-5:WARNING > >> Use

Re: [PATCH v6 00/23] Rust support

2022-05-07 Thread Kees Cook
On Sat, May 07, 2022 at 07:23:58AM +0200, Miguel Ojeda wrote: > ## Patch series status > > The Rust support is still to be considered experimental. However, > support is good enough that kernel developers can start working on the > Rust abstractions for subsystems and write drivers and other

Re: request_module DoS

2022-05-07 Thread Luis Chamberlain
On Sat, May 07, 2022 at 07:10:23AM +, Christophe Leroy wrote: > > There are some code paths in the kernel where you can reliably > > trigger a request_module of a non-existant module. For example, > > if you attempt to load a non-existent crypto algorithm, or create > > a socket of a

Re: request_module DoS

2022-05-07 Thread Christophe Leroy
+ linuxppc list Le 07/05/2022 à 05:08, Herbert Xu a écrit : > Hi: > > There are some code paths in the kernel where you can reliably > trigger a request_module of a non-existant module. For example, > if you attempt to load a non-existent crypto algorithm, or create > a socket of a non-existent

Re: [PATCH linux-next] power:pkeys: fix bugon.cocci warnings

2022-05-07 Thread Christophe Leroy
Le 02/05/2022 à 15:24, Michael Ellerman a écrit : > CGEL writes: >> From: Jing Yangyang >> >> Use BUG_ON instead of a if condition followed by BUG. >> >> ./arch/powerpc/include/asm/book3s/64/pkeys.h:21:2-5:WARNING >> Use BUG_ON instead of if condition followed by BUG. >>

[PATCH v2 21/25] powerpc/ftrace: Don't use copy_from_kernel_nofault() in module_trampoline_target()

2022-05-07 Thread Christophe Leroy
module_trampoline_target() is quite a hot path used when activating/deactivating function tracer. Avoid the heavy copy_from_kernel_nofault() by doing four calls to copy_inst_from_kernel_nofault(). Use __copy_inst_from_kernel_nofault() for the 3 last calls. First call is done to

[PATCH v2 09/25] powerpc: Replace PPC64_ELF_ABI_v{1/2} by CONFIG_PPC64_ELF_ABI_V{1/2}

2022-05-07 Thread Christophe Leroy
Replace all uses of PPC64_ELF_ABI_v1 and PPC64_ELF_ABI_v2 by resp CONFIG_PPC64_ELF_ABI_V1 and CONFIG_PPC64_ELF_ABI_V2. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/code-patching.h | 12 ++-- arch/powerpc/include/asm/ftrace.h| 4 ++--

[PATCH v2 23/25] powerpc/modules: Use PPC_LI macros instead of opencoding

2022-05-07 Thread Christophe Leroy
Use PPC_LI_MASK and PPC_LI() instead of opencoding. Signed-off-by: Christophe Leroy --- v2: Utilisation de PPC_LI() et PPC_LI_MASK --- arch/powerpc/kernel/module_32.c | 11 --- arch/powerpc/kernel/module_64.c | 3 +-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git

[PATCH v2 08/25] powerpc: Add CONFIG_PPC64_ELF_ABI_V1 and CONFIG_PPC64_ELF_ABI_V2

2022-05-07 Thread Christophe Leroy
At the time being, we use CONFIG_CPU_LITTLE_ENDIAN and CONFIG_CPU_BIG_ENDIAN to pass -mabi=elfv1 or elfv2 to compiler, then define a PPC64_ELF_ABI_v1 or PPC64_ELF_ABI_v2 macro in asm/types.h based on _CALL_ELF define set by the compiler. Make it more straight forward with a CONFIG option that is

[PATCH v2 25/25] powerpc/opcodes: Remove unused PPC_INST_XXX macros

2022-05-07 Thread Christophe Leroy
The following PPC_INST_XXX macros are not used anymore outside ppc-opcode.h: - PPC_INST_LD - PPC_INST_STD - PPC_INST_ADDIS - PPC_INST_ADD - PPC_INST_DIVD Remove them. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc-opcode.h | 13

[PATCH v2 01/25] powerpc/ftrace: Refactor prepare_ftrace_return()

2022-05-07 Thread Christophe Leroy
When we have CONFIG_DYNAMIC_FTRACE_WITH_ARGS, prepare_ftrace_return() is called by ftrace_graph_func() otherwise prepare_ftrace_return() is called from assembly. Refactor prepare_ftrace_return() into a static __prepare_ftrace_return() that will be called by both prepare_ftrace_return() and

[PATCH v2 19/25] powerpc/ftrace: Minimise number of #ifdefs

2022-05-07 Thread Christophe Leroy
A lot of #ifdefs can be replaced by IS_ENABLED() Do so. This requires to have kernel_toc_addr() defined at all time as well as PPC_INST_LD_TOC and PPC_INST_STD_LR. Signed-off-by: Christophe Leroy --- v2: Moved the setup of pop outside of the big if()/else() in __ftrace_make_nop() ---

[PATCH v2 11/25] powerpc/ftrace: Make __ftrace_make_{nop/call}() common to PPC32 and PPC64

2022-05-07 Thread Christophe Leroy
Since c93d4f6ecf4b ("powerpc/ftrace: Add module_trampoline_target() for PPC32"), __ftrace_make_nop() for PPC32 is very similar to the one for PPC64. Same for __ftrace_make_call(). Make them common. Signed-off-by: Christophe Leroy --- v2: - Fixed comment to -mprofile-kernel versus

[PATCH v2 18/25] powerpc/ftrace: Simplify expected_nop_sequence()

2022-05-07 Thread Christophe Leroy
Avoid ifdefs around expected_nop_sequence(). While at it make it a bool. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/trace/ftrace.c | 22 ++ 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/arch/powerpc/kernel/trace/ftrace.c

[PATCH v2 16/25] powerpc/ftrace: Use PPC_RAW_xxx() macros instead of opencoding.

2022-05-07 Thread Christophe Leroy
PPC_RAW_xxx() macros are self explanatory and less error prone than open coding. Use them in ftrace.c Signed-off-by: Christophe Leroy --- v2: - Replaced PPC_INST_OFFSET24_MASK by PPC_LI_MASK and added PPC_LI(). - Fix ADDI instead of ADDIS --- arch/powerpc/include/asm/ppc-opcode.h | 5 +

[PATCH v2 24/25] powerpc/inst: Remove PPC_INST_BL

2022-05-07 Thread Christophe Leroy
Convert last users of PPC_INST_BL to PPC_RAW_BL() And remove PPC_INST_BL. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc-opcode.h | 1 - arch/powerpc/net/bpf_jit.h| 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH v2 04/25] powerpc/ftrace: Use is_offset_in_branch_range()

2022-05-07 Thread Christophe Leroy
Use is_offset_in_branch_range() instead of create_branch() to check if a target is within branch range. This patch together with the previous one improves ftrace activation time by 7% Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/trace/ftrace.c | 8 ++-- 1 file changed, 2

[PATCH v2 15/25] powerpc/ftrace: Use BRANCH_SET_LINK instead of value 1

2022-05-07 Thread Christophe Leroy
To make it explicit, use BRANCH_SET_LINK instead of value 1 when calling create_branch(). Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/trace/ftrace.c

[PATCH v2 07/25] powerpc/ftrace: Use patch_instruction() return directly

2022-05-07 Thread Christophe Leroy
Instead of returning -EPERM when patch_instruction() fails, just return what patch_instruction returns. That simplifies ftrace_modify_code(): 0: 94 21 ff c0 stwur1,-64(r1) 4: 93 e1 00 3c stw r31,60(r1) 8: 7c 7f 1b 79 mr. r31,r3

[PATCH v2 06/25] powerpc/ftrace: Inline ftrace_modify_code()

2022-05-07 Thread Christophe Leroy
Inlining ftrace_modify_code(), it increases a bit the size of ftrace code but brings 5% improvment on ftrace activation. Usually in C files we let gcc decide what to do but here it really help to 'help' gcc to decide to inline, thought we don't want to force it with an __always_inline that would

[PATCH v2 22/25] powerpc/inst: Remove PPC_INST_BRANCH

2022-05-07 Thread Christophe Leroy
Convert last users of PPC_INST_BRANCH to PPC_RAW_BRANCH() And remove PPC_INST_BRANCH. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc-opcode.h | 3 +-- arch/powerpc/lib/feature-fixups.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git

[PATCH v2 12/25] powerpc/ftrace: Don't include ftrace.o for CONFIG_FTRACE_SYSCALLS

2022-05-07 Thread Christophe Leroy
Since commit 7bea7ac0ca01 ("powerpc/syscalls: Fix syscall tracing") ftrace.o is not needed anymore for CONFIG_FTRACE_SYSCALLS. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/trace/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/kernel/trace/Makefile

[PATCH v2 20/25] powerpc/inst: Add __copy_inst_from_kernel_nofault()

2022-05-07 Thread Christophe Leroy
On the same model as get_user() versus __get_user(), introduce __copy_inst_from_kernel_nofault() which doesn't check address. To be used by callers that have already checked that the adress is a kernel address. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/inst.h | 13

[PATCH v2 05/25] powerpc/code-patching: Inline create_branch()

2022-05-07 Thread Christophe Leroy
create_branch() is a good candidate for inlining because: - Flags can be folded in. - Range tests are likely to be already done. Hence reducing the create_branch() to only a set of instructions. So inline it. It improves ftrace activation by 10%. Signed-off-by: Christophe Leroy ---

[PATCH v2 13/25] powerpc/ftrace: Use CONFIG_FUNCTION_TRACER instead of CONFIG_DYNAMIC_FTRACE

2022-05-07 Thread Christophe Leroy
Since commit 0c0c52306f47 ("powerpc: Only support DYNAMIC_FTRACE not static"), CONFIG_DYNAMIC_FTRACE is always selected when CONFIG_FUNCTION_TRACER is selected. To avoid confusion and have the reader wonder what's happen when CONFIG_FUNCTION_TRACER is selected and CONFIG_DYNAMIC_FTRACE is not,

[PATCH v2 00/25] powerpc: ftrace optimisation and cleanup and more [v2]

2022-05-07 Thread Christophe Leroy
This series provides optimisation and cleanup of ftrace on powerpc. With this series ftrace activation is about 20% faster on an 8xx. At the end of the series come additional cleanups around ppc-opcode, that would likely conflict with this series if posted separately. Main changes since v1

[PATCH v2 10/25] powerpc: Finalise cleanup around ABI use

2022-05-07 Thread Christophe Leroy
Now that we have CONFIG_PPC64_ELF_ABI_V1 and CONFIG_PPC64_ELF_ABI_V2, get rid of all indirect detection of ABI version. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig| 2 +- arch/powerpc/Makefile | 2 +- arch/powerpc/include/asm/types.h| 8

[PATCH v2 02/25] powerpc/ftrace: Remove redundant create_branch() calls

2022-05-07 Thread Christophe Leroy
Since commit d5937db114e4 ("powerpc/code-patching: Fix patch_branch() return on out-of-range failure") patch_branch() fails with -ERANGE when trying to branch out of range. No need to perform the test twice. Remove redundant create_branch() calls. Signed-off-by: Christophe Leroy ---

[PATCH v2 03/25] powerpc/code-patching: Inline is_offset_in_{cond}_branch_range()

2022-05-07 Thread Christophe Leroy
Test in is_offset_in_branch_range() and is_offset_in_cond_branch_range() are simple tests that are worth inlining. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/code-patching.h | 29 ++-- arch/powerpc/lib/code-patching.c | 27 -- 2

[PATCH v2 14/25] powerpc/ftrace: Remove ftrace_plt_tramps[]

2022-05-07 Thread Christophe Leroy
ftrace_plt_tramps table is never filled so it is useless. Remove it. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/trace/ftrace.c | 8 1 file changed, 8 deletions(-) diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c index

[PATCH v2 17/25] powerpc/ftrace: Use size macro instead of opencoding

2022-05-07 Thread Christophe Leroy
0x8000 is SZ_2G. Use it. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/trace/ftrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c index ac3f97dd1729..346b5485e7ef 100644 ---