[PATCH v10 07/13] powerpc/mm: Remove CONFIG_PPC_MM_SLICES

2022-04-09 Thread Christophe Leroy
CONFIG_PPC_MM_SLICES is always selected by hash book3s/64. CONFIG_PPC_MM_SLICES is never selected by other platforms. Remove it. Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin --- arch/powerpc/include/asm/hugetlb.h | 2 +- arch/powerpc/include/asm/paca.h| 7 ---

[PATCH v10 13/13] powerpc: Simplify and move arch_randomize_brk()

2022-04-09 Thread Christophe Leroy
arch_randomize_brk() is only needed for hash on book3s/64, for other platforms the one provided by the default mmap layout is good enough. Move it to hash_utils.c and use randomize_page() like the generic one. And properly opt out the radix case instead of making an assumption on mmu_highuser_ssi

[PATCH v10 03/13] mm, hugetlbfs: Allow an arch to always use generic versions of get_unmapped_area functions

2022-04-09 Thread Christophe Leroy
Unlike most architectures, powerpc can only define at runtime if it is going to use the generic arch_get_unmapped_area() or not. Today, powerpc has a copy of the generic arch_get_unmapped_area() because when selection HAVE_ARCH_UNMAPPED_AREA the generic arch_get_unmapped_area() is not available.

[PATCH v10 01/13] mm, hugetlbfs: Allow for "high" userspace addresses

2022-04-09 Thread Christophe Leroy
This is a complement of f6795053dac8 ("mm: mmap: Allow for "high" userspace addresses") for hugetlb. This patch adds support for "high" userspace addresses that are optionally supported on the system and have to be requested via a hint mechanism ("high" addr parameter to mmap). Architectures such

[PATCH v10 00/13] Convert powerpc to default topdown mmap layout (v10)

2022-04-09 Thread Christophe Leroy
Rebased on top of v5.18-rc1 This series converts powerpc to default topdown mmap layout. First patch is a mm fix that should go into v5.18 and stable. Andrew, can you take it ? It is a complement/fix of f6795053dac8 ("mm: mmap: Allow for "high" userspace addresses") for hugetlb. It adds support

[PATCH v10 02/13] mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT

2022-04-09 Thread Christophe Leroy
Commit e7142bf5d231 ("arm64, mm: make randomization selected by generic topdown mmap layout") introduced a default version of arch_randomize_brk() provided when CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT is selected. powerpc could select CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT but needs to

[PATCH v10 12/13] powerpc/mm: Convert to default topdown mmap layout

2022-04-09 Thread Christophe Leroy
Select CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT and remove arch/powerpc/mm/mmap.c This change reuses the generic framework added by commit 67f3977f805b ("arm64, mm: move generic mmap layout functions to mm") without any functional change. Comparison between powerpc implementation and the gene

[PATCH v10 09/13] powerpc/mm: Use generic_hugetlb_get_unmapped_area()

2022-04-09 Thread Christophe Leroy
Use the generic version of arch_hugetlb_get_unmapped_area() which is now available at all time. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/hugetlb.h | 4 -- arch/powerpc/mm/book3s64/radix_hugetlbpage.c | 55 arch/powerpc/mm/hugetlbpage.c

[PATCH v10 11/13] powerpc/mm: Enable full randomisation of memory mappings

2022-04-09 Thread Christophe Leroy
Do like most other architectures and provide randomisation also to "legacy" memory mappings, by adding the random factor to mm->mmap_base in arch_pick_mmap_layout(). See commit 8b8addf891de ("x86/mm/32: Enable full randomization on i386 and X86_32") for all explanations and benefits of that mmap r

[PATCH v10 04/13] mm: Add len and flags parameters to arch_get_mmap_end()

2022-04-09 Thread Christophe Leroy
Powerpc needs flags and len to make decision on arch_get_mmap_end(). So add them as parameters to arch_get_mmap_end(). Signed-off-by: Christophe Leroy Cc: Steve Capper Cc: Catalin Marinas Cc: Will Deacon Acked-by: Catalin Marinas Acked-by: Andrew Morton --- arch/arm64/include/asm/processor

[PATCH v10 05/13] powerpc/mm: Move vma_mmu_pagesize()

2022-04-09 Thread Christophe Leroy
vma_mmu_pagesize() is only required for slices, otherwise there is a generic weak version doing the exact same thing. Move it to slice.c Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin --- arch/powerpc/mm/hugetlbpage.c | 11 --- arch/powerpc/mm/slice.c | 9 +

[PATCH v10 08/13] powerpc/mm: Use generic_get_unmapped_area() and call it from arch_get_unmapped_area()

2022-04-09 Thread Christophe Leroy
Use the generic version of arch_get_unmapped_area() which is now available at all time instead of its copy radix__arch_get_unmapped_area() To allow that for PPC64, add arch_get_mmap_base() and arch_get_mmap_end() macros. Instead of setting mm->get_unmapped_area() to either arch_get_unmapped_area(

[PATCH v10 10/13] powerpc/mm: Move get_unmapped_area functions to slice.c

2022-04-09 Thread Christophe Leroy
hugetlb_get_unmapped_area() is now identical to the generic version if only RADIX is enabled, so move it to slice.c and let it fallback on the generic one when HASH MMU is not compiled in. Do the same with arch_get_unmapped_area() and arch_get_unmapped_area_topdown(). Signed-off-by: Christophe Le

Re: [PATCH v2 0/4] Fix perf bench numa, futex and epoll to work with machines having #CPUs > 1K

2022-04-09 Thread Arnaldo Carvalho de Melo
Em Sat, Apr 09, 2022 at 12:28:01PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Wed, Apr 06, 2022 at 11:21:09PM +0530, Athira Rajeev escreveu: > > The perf benchmark for collections: numa, futex and epoll > > hits failure in system configuration with CPU's more than 1024. > > These benchmarks use

[PATCH v10 06/13] powerpc/mm: Make slice specific to book3s/64

2022-04-09 Thread Christophe Leroy
Since commit 555904d07eef ("powerpc/8xx: MM_SLICE is not needed anymore") only book3s/64 selects CONFIG_PPC_MM_SLICES. Move slice.c into mm/book3s64/ Move necessary stuff in asm/book3s/64/slice.h and remove asm/slice.h Signed-off-by: Christophe Leroy Reviewed-by: Nicholas Piggin --- arch/powe

Re: [PATCH v2 0/4] Fix perf bench numa, futex and epoll to work with machines having #CPUs > 1K

2022-04-09 Thread Arnaldo Carvalho de Melo
Em Wed, Apr 06, 2022 at 11:21:09PM +0530, Athira Rajeev escreveu: > The perf benchmark for collections: numa, futex and epoll > hits failure in system configuration with CPU's more than 1024. > These benchmarks uses "sched_getaffinity" and "sched_setaffinity" > in the code to work with affinity. A

Re: [PATCH v2 4/4] tools/perf: Fix perf bench numa testcase to check if CPU used to bind task is online

2022-04-09 Thread Arnaldo Carvalho de Melo
Em Wed, Apr 06, 2022 at 11:21:13PM +0530, Athira Rajeev escreveu: > Perf numa bench test fails with error: > > Testcase: > ./perf bench numa mem -p 2 -t 1 -P 1024 -C 0,8 -M 1,0 -s 20 -zZq > --thp 1 --no-data_rand_walk > > Failure snippet: > <<>> > Running 'numa/mem' benchmark: > > # Running m

Re: False positive kmemleak report for dtb properties names on powerpc

2022-04-09 Thread Ariel Marcovitch
Hi Christophe, did you get the chance to look at this? On 23/03/2022 21:06, Mike Rapoport wrote: Hi Catalin, On Wed, Mar 23, 2022 at 05:22:38PM +, Catalin Marinas wrote: Hi Ariel, On Fri, Feb 18, 2022 at 09:45:51PM +0200, Ariel Marcovitch wrote: I was running a powerpc 32bit kernel (buil

Re: [PATCH] powerpc: Mark arch_get_ima_policy() and is_ppc_trustedboot_enabled() as __init

2022-04-09 Thread Michael Ellerman
Mimi Zohar writes: > On Fri, 2022-04-08 at 13:31 -0400, Mimi Zohar wrote: >> On Fri, 2022-04-08 at 12:05 -0400, Mimi Zohar wrote: >> > On Fri, 2022-04-08 at 00:15 +1000, Michael Ellerman wrote: >> > > We can mark arch_get_ima_policy() as __init because it's only caller >> > > ima_init_arch_policy(

Re: [PATCH] powerpc: Mark arch_get_ima_policy() and is_ppc_trustedboot_enabled() as __init

2022-04-09 Thread Michael Ellerman
Mimi Zohar writes: > On Fri, 2022-04-08 at 00:15 +1000, Michael Ellerman wrote: >> We can mark arch_get_ima_policy() as __init because it's only caller >> ima_init_arch_policy() is __init. We can then mark >> is_ppc_trustedboot_enabled() __init because its only caller is >> arch_get_ima_policy().

Re: [PATCH v9 0/4] mm: Enable conversion of powerpc to default topdown mmap layout

2022-04-09 Thread Michael Ellerman
Christophe Leroy writes: > Le 09/04/2022 à 05:25, Andrew Morton a écrit : >> On Fri, 8 Apr 2022 09:24:58 +0200 Christophe Leroy >> wrote: >> >>> Rebased on top of Linux 5.18-rc1 >>> >>> This is the mm part of the series that converts powerpc to default >>> topdown mmap layout, for merge into v

Re: [PATCH V4 2/7] powerpc/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-04-09 Thread Christophe Leroy
Le 08/04/2022 à 14:53, Christophe Leroy a écrit : Le 07/04/2022 à 12:32, Anshuman Khandual a écrit : This defines and exports a platform specific custom vm_get_page_prot() via subscribing ARCH_HAS_VM_GET_PAGE_PROT. While here, this also localizes arch_vm_get_page_prot() as powerpc_vm_get_p

Re: [PATCH v9 0/4] mm: Enable conversion of powerpc to default topdown mmap layout

2022-04-09 Thread Christophe Leroy
Le 09/04/2022 à 05:25, Andrew Morton a écrit : > On Fri, 8 Apr 2022 09:24:58 +0200 Christophe Leroy > wrote: > >> Rebased on top of Linux 5.18-rc1 >> >> This is the mm part of the series that converts powerpc to default >> topdown mmap layout, for merge into v5.18 > > We're at 5.18-rc1. The

[PATCH] powerpc/pseries/vas: sysfs comments with the correct entries

2022-04-09 Thread Haren Myneni
VAS entry is created as a misc device and the sysfs comments should list the proper entries Reported-by: Matheus Castanho Signed-off-by: Haren Myneni --- arch/powerpc/platforms/pseries/vas-sysfs.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/

[PATCH] powerpc/powernv/vas: Assign real address to rx_fifo in vas_rx_win_attr

2022-04-09 Thread Haren Myneni
In init_winctx_regs(), __pa() is called on winctx->rx_fifo and this function is called to initialize registers for receive and fault windows. But the real address is passed in winctx->rx_fifo for receive windows and the virtual address for fault windows which causes errors with DEBUG_VIRTUAL enable