Re: [PATCH 1/6] powerpc/code-patching: Implement generic text patching function

2022-09-18 Thread Benjamin Gray
On Mon, 2022-09-19 at 06:04 +, Christophe Leroy wrote: > With CONFIG_STRICT_KERNEL_RWX, this patches causes a 15% time > increase > for activation/deactivation of ftrace. It's possible that new alignment check is the cause. I'll see > Without CONFIG_STRICT_KERNEL_RWX, it doesn't build. Yup

Re: [PATCH 1/6] powerpc/code-patching: Implement generic text patching function

2022-09-18 Thread Christophe Leroy
Le 16/09/2022 à 08:23, Benjamin Gray a écrit : > > -static int do_patch_instruction(u32 *addr, ppc_inst_t instr) > +static int patch_text(void *dest, const void *src, size_t size, bool is_exec) > { > int err; > unsigned long flags; > > - /* > - * During early early bo

Re: [PATCH 4/4] powerpc/64s: Enable KFENCE on book3s64

2022-09-18 Thread Christophe Leroy
Le 19/09/2022 à 03:44, Nicholas Miehlbradt a écrit : > KFENCE support was added for ppc32 in commit 90cbac0e995d > ("powerpc: Enable KFENCE for PPC32"). > Enable KFENCE on ppc64 architecture with hash and radix MMUs. > It uses the same mechanism as debug pagealloc to > protect/unprotect pages. Al

Re: [PATCH 1/4] powerpc/64s: Add DEBUG_PAGEALLOC for radix

2022-09-18 Thread Christophe Leroy
Le 19/09/2022 à 03:44, Nicholas Miehlbradt a écrit : > [Vous ne recevez pas souvent de courriers de nicho...@linux.ibm.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > There is support for DEBUG_PAGEALLOC on hash but not on radix. > Add suppo

Re: [PATCH 3/6] powerpc/module: Optimise nearby branches in ELF V2 ABI stub

2022-09-18 Thread Christophe Leroy
Le 16/09/2022 à 08:23, Benjamin Gray a écrit : > Inserts a direct branch to the stub target when possible, replacing the > mtctr/btctr sequence. > > The load into r12 could potentially be skipped too, but that change > would need to refactor the arguments to indicate that the address > does not

Re: [PATCH 2/6] powerpc/module: Handle caller-saved TOC in module linker

2022-09-18 Thread Christophe Leroy
Le 16/09/2022 à 08:23, Benjamin Gray a écrit : > The callee may set a field in `st_other` to 1 to indicate r2 should be > treated as caller-saved. This means a trampoline must be used to save > the current TOC before calling it and restore it afterwards, much like > external calls. > > This is n

Re: [PATCH 1/6] powerpc/code-patching: Implement generic text patching function

2022-09-18 Thread Christophe Leroy
Le 16/09/2022 à 08:23, Benjamin Gray a écrit : > Adds a generic text patching mechanism for patches of 1, 2, 4, or 8 > bytes. The patcher conditionally syncs the icache depending on if > the content will be executed (as opposed to, e.g., read-only data). > > The `patch_instruction` function is r

Re: [PATCH v2 3/7] powerpc/build: move got, toc, plt, branch_lt sections to read-only

2022-09-18 Thread Michael Ellerman
se: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next > config: powerpc-microwatt_defconfig > (https://download.01.org/0day-ci/archive/20220918/202209180437.4u3soljk-...@intel.com/config) > compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project > 791

Re: [PATCH] powerpc/microwatt: Remove unused early debug code

2022-09-18 Thread Andrew Donnellan
On Mon, 2022-09-19 at 15:27 +1000, Michael Ellerman wrote: > The original microwatt submission[1] included some early debug code > for > using the Microwatt "potato" UART. > > The series that was eventually merged switched to using a standard > UART, > and so doesn't need any special early debug h

[PATCH] powerpc/microwatt: Remove unused early debug code

2022-09-18 Thread Michael Ellerman
The original microwatt submission[1] included some early debug code for using the Microwatt "potato" UART. The series that was eventually merged switched to using a standard UART, and so doesn't need any special early debug handling. But some of the original code was merged accidentally under the

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-18 Thread Barry Song
On Mon, Sep 19, 2022 at 4:53 PM Barry Song <21cn...@gmail.com> wrote: > > On Mon, Sep 19, 2022 at 4:24 PM Anshuman Khandual > wrote: > > > > > > > > On 9/15/22 12:12, Barry Song wrote: > > > On Thu, Sep 15, 2022 at 6:07 PM Anshuman Khandual > > > wrote: > > >> > > >> > > >> > > >> On 9/9/22 11:05

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-18 Thread Barry Song
On Mon, Sep 19, 2022 at 4:24 PM Anshuman Khandual wrote: > > > > On 9/15/22 12:12, Barry Song wrote: > > On Thu, Sep 15, 2022 at 6:07 PM Anshuman Khandual > > wrote: > >> > >> > >> > >> On 9/9/22 11:05, Barry Song wrote: > >>> On Fri, Sep 9, 2022 at 5:24 PM Anshuman Khandual > >>> wrote: >

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-18 Thread Anshuman Khandual
On 9/15/22 12:12, Barry Song wrote: > On Thu, Sep 15, 2022 at 6:07 PM Anshuman Khandual > wrote: >> >> >> >> On 9/9/22 11:05, Barry Song wrote: >>> On Fri, Sep 9, 2022 at 5:24 PM Anshuman Khandual >>> wrote: On 8/22/22 13:51, Yicong Yang wrote: > From: Barry Song >

Re: [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation

2022-09-18 Thread Anshuman Khandual
On 9/15/22 20:01, Nadav Amit wrote: > > >> On Sep 14, 2022, at 11:42 PM, Barry Song <21cn...@gmail.com> wrote: >> >>> >>> The very idea behind TLB deferral is the opportunity it (might) provide >>> to accumulate address ranges and cpu masks so that individual TLB flush >>> can be replaced with

[PATCH v3] hugetlb: simplify hugetlb handling in follow_page_mask

2022-09-18 Thread Mike Kravetz
During discussions of this series [1], it was suggested that hugetlb handling code in follow_page_mask could be simplified. At the beginning of follow_page_mask, there currently is a call to follow_huge_addr which 'may' handle hugetlb pages. ia64 is the only architecture which provides a follow_h

[PATCH 3/4] powerpc/64s: Allow double call of kernel_[un]map_linear_page()

2022-09-18 Thread Nicholas Miehlbradt
From: Christophe Leroy If the page is already mapped resp. already unmapped, bail out. Signed-off-by: Christophe Leroy Signed-off-by: Nicholas Miehlbradt --- arch/powerpc/mm/book3s64/hash_utils.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s

[PATCH 2/4] powerpc/64s: Remove unneeded #ifdef CONFIG_DEBUG_PAGEALLOC in hash_utils

2022-09-18 Thread Nicholas Miehlbradt
From: Christophe Leroy debug_pagealloc_enabled() is always defined and constant folds to 'false' when CONFIG_DEBUG_PAGEALLOC is not enabled. Remove the #ifdefs, the code and associated static variables will be optimised out by the compiler when CONFIG_DEBUG_PAGEALLOC is not defined. Signed-off-

[PATCH 4/4] powerpc/64s: Enable KFENCE on book3s64

2022-09-18 Thread Nicholas Miehlbradt
KFENCE support was added for ppc32 in commit 90cbac0e995d ("powerpc: Enable KFENCE for PPC32"). Enable KFENCE on ppc64 architecture with hash and radix MMUs. It uses the same mechanism as debug pagealloc to protect/unprotect pages. All KFENCE kunit tests pass on both MMUs. KFENCE memory is initial

[PATCH 1/4] powerpc/64s: Add DEBUG_PAGEALLOC for radix

2022-09-18 Thread Nicholas Miehlbradt
There is support for DEBUG_PAGEALLOC on hash but not on radix. Add support on radix. Signed-off-by: Nicholas Miehlbradt --- arch/powerpc/mm/book3s64/radix_pgtable.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/ar

Re: [PATCH] cxl: fix repeated words in comments

2022-09-18 Thread Andrew Donnellan
On Sun, 2022-09-18 at 18:03 +0800, Jilin Yuan wrote: > Delete the redundant word 'dont'. > > Signed-off-by: Jilin Yuan --- >  drivers/misc/cxl/native.c | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c > index 50b0c44bb

Re: [PATCH] EDAC/ppc_4xx: Reorder symbols to get rid of a few forward declarations

2022-09-18 Thread Borislav Petkov
On Sun, Sep 18, 2022 at 01:20:13AM +0200, Uwe Kleine-König wrote: > When moving the definition of ppc4xx_edac_driver further down, the > forward declarations can just be dropped. > > Do this to reduce line needless repetition. > > Signed-off-by: Uwe Kleine-König > --- > drivers/edac/ppc4xx_edac

Re: [PATCH linux-next] macintosh/windfarm: fix comparing pointer to 0

2022-09-18 Thread Arnd Bergmann
On Sun, Sep 18, 2022, at 5:50 PM, cgel@gmail.com wrote: > @@ -970,7 +970,7 @@ static int pm121_init_pm(void) > const struct smu_sdbp_header *hdr; > > hdr = smu_get_sdb_partition(SMU_SDB_SENSORTREE_ID, NULL); > - if (hdr != 0) { > + if (hdr != NULL) { >

[PATCH linux-next] macintosh/windfarm: fix comparing pointer to 0

2022-09-18 Thread cgel . zte
From: Xu Panda Comparing pointer whith NULL instead of comparing pointer to 0. Reported-by: Zeal Robot Signed-off-by: Xu Panda --- drivers/macintosh/windfarm_pm121.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/macintosh/windfarm_pm121.c b/drivers/macintosh

[PATCH] cxl: fix repeated words in comments

2022-09-18 Thread Jilin Yuan
Delete the redundant word 'dont'. Signed-off-by: Jilin Yuan --- drivers/misc/cxl/native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c index 50b0c44bb8d7..6957946a6463 100644 --- a/drivers/misc/cxl/native.c +++ b/driver

Re: [PATCH] powerpc: Save AMR/IAMR when switching tasks

2022-09-18 Thread Christophe Leroy
Le 17/09/2022 à 20:38, Samuel Holland a écrit : > On 9/17/22 03:16, Christophe Leroy wrote: >> Le 16/09/2022 à 07:05, Samuel Holland a écrit : >>> With CONFIG_PREEMPT=y (involuntary preemption enabled), it is possible >>> to switch away from a task inside copy_{from,to}_user. This left the CPU >>