Re: [PATCH 16/20] selftest/powerpc/pmu/: Add selftest for mmcr1 pmcxsel/unit/cache fields

2022-03-09 Thread Christophe Leroy
Le 27/01/2022 à 08:20, Kajol Jain a écrit : > From: Athira Rajeev > > The testcase uses event code "0x134001c040" to verify > the settings for different fields in Monitor Mode Control > Register 1 (MMCR1). The fields include PMCxSEL, PMCXCOMB > PMCxUNIT, cache. Checks if these fields are

Re: [PATCH v8 00/14] Convert powerpc to default topdown mmap layout (v8)

2022-03-09 Thread Christophe Leroy
Hi Michael, hi Andrew Le 09/03/2022 à 18:44, Christophe Leroy a écrit : > Rebased on top of powerpc/next branch > > This series converts powerpc to default topdown mmap layout. > > powerpc requires its own arch_get_unmapped_area() only when > slices are needed, which is only for book3s/64.

Re: [PATCH v7 0/4] Add perf interface to expose nvdimm

2022-03-09 Thread Dan Williams
On Mon, Mar 7, 2022 at 9:27 PM kajoljain wrote: > > Hi Dan, > Can you take this patch-set if it looks fine to you. > Pushed out to my libnvdimm-pending branch for a 0day confirmation before heading over to linux-next.

[powerpc:next] BUILD SUCCESS d799769188529abc6cbf035a10087a51f7832b6b

2022-03-09 Thread kernel test robot
se7705_defconfig sh se7722_defconfig armkeystone_defconfig powerpc mpc837x_rdb_defconfig mips xway_defconfig arm randconfig-c002-20220309 ia64

Re: rcutorture’s init segfaults in ppc64le VM

2022-03-09 Thread Paul E. McKenney
On Thu, Mar 10, 2022 at 10:37:12AM +0800, Zhouyi Zhou wrote: > Dear Paul > > I try to reproduce the bug in ppc64 VM in Oregon State University > using the vmlinux extracted from > https://owww.molgen.mpg.de/~pmenzel/rcutorture-2022.02.01-21.52.37-torture-locktorture-kasan-lock01.tar.xz > > the

Re: rcutorture’s init segfaults in ppc64le VM

2022-03-09 Thread Zhouyi Zhou
Dear Paul I try to reproduce the bug in ppc64 VM in Oregon State University using the vmlinux extracted from https://owww.molgen.mpg.de/~pmenzel/rcutorture-2022.02.01-21.52.37-torture-locktorture-kasan-lock01.tar.xz the ppc64 VM in which I run the qemu without hardware acceleration is: Linux

Re: [PATCH] powerpc: 8xx: fix a return value error in mpc8xx_pic_init

2022-03-09 Thread Michael Ellerman
Christophe Leroy writes: > Le 09/03/2022 à 11:46, Michael Ellerman a écrit : >> Christophe Leroy writes: >>> Le 09/03/2022 à 04:24, Michael Ellerman a écrit : Hangyu Hua writes: > mpc8xx_pic_init() should return -ENOMEM instead of 0 when > irq_domain_add_linear() return NULL. This

Re: [PATCH 6/6] KVM: PPC: Book3S HV Nested: L2 LPCR should inherit L1 LPES setting

2022-03-09 Thread Fabiano Rosas
Nicholas Piggin writes: > The L1 should not be able to adjust LPES mode for the L2. Setting LPES > if the L0 needs it clear would cause external interrupts to be sent to > L2 and missed by the L0. > > Clearing LPES when it may be set, as typically happens with XIVE enabled > could cause a

Re: [PATCH] powerpc/32: Stop printing the virtual memory layout

2022-03-09 Thread Christophe Leroy
Le 05/03/2020 à 16:08, Arvind Sankar a écrit : For security, don't display the kernel's virtual memory layout. Kees Cook points out: "These have been entirely removed on other architectures, so let's just do the same for ia32 and remove it unconditionally." 071929dbdd86 ("arm64: Stop

Re: [RFC PATCH 6/7] serial: General support for multipoint addresses

2022-03-09 Thread Lukas Wunner
On Mon, Mar 07, 2022 at 11:48:01AM +0200, Ilpo Järvinen wrote: > On Sun, 6 Mar 2022, Lukas Wunner wrote: > > On Wed, Mar 02, 2022 at 11:56:05AM +0200, Ilpo Järvinen wrote: > > > This change is necessary for supporting devices with RS485 > > > multipoint addressing [*]. > > > > If this is only

Re: [PATCH] powerpc: Replace ppc64 DT_RELACOUNT usage with DT_RELASZ/24

2022-03-09 Thread Nathan Chancellor
On Tue, Mar 08, 2022 at 09:51:18PM -0800, Fangrui Song wrote: > DT_RELACOUNT is an ELF dynamic tag inherited from SunOS indicating the > number of R_*_RELATIVE relocations. It is optional but {ld.lld,ld.lld} ^ ld.{bfd,lld} ? > -z combreloc

Re: [PATCH 1/3] powerpc/kprobes: Use appropriate format specifier for printing kernel address

2022-03-09 Thread Christophe Leroy
Le 23/04/2020 à 17:17, Naveen N. Rao a écrit : From: Balamuruhan S Change use of %p to %pK when printing address of the instruction slot so that the actual kernel address is visible for privileged users. Signed-off-by: Balamuruhan S Signed-off-by: Naveen N. Rao This series doesn't

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

2022-03-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 v8 08/14] powerpc/mm: Remove CONFIG_PPC_MM_SLICES

2022-03-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 v8 14/14] powerpc: Simplify and move arch_randomize_brk()

2022-03-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

[PATCH v8 09/14] powerpc/mm: Use generic_get_unmapped_area() and call it from arch_get_unmapped_area()

2022-03-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

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

2022-03-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 --- arch/arm64/include/asm/processor.h | 4 ++-- mm/mmap.c

[PATCH v8 11/14] powerpc/mm: Move get_unmapped_area functions to slice.c

2022-03-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

[PATCH v8 02/14] mm: Allow arch specific arch_randomize_brk() with CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT

2022-03-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 v8 07/14] powerpc/mm: Make slice specific to book3s/64

2022-03-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 ---

[PATCH v8 13/14] powerpc/mm: Convert to default topdown mmap layout

2022-03-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

[PATCH v8 06/14] powerpc/mm: Move vma_mmu_pagesize()

2022-03-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 v8 05/14] mm, hugetlbfs: Allow for "high" userspace addresses

2022-03-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

[PATCH v8 01/14] sizes.h: Add SZ_1T macro

2022-03-09 Thread Christophe Leroy
Today drivers/pci/controller/pci-xgene.c defines SZ_1T Move it into linux/sizes.h so that it can be re-used elsewhere. Link: https://lore.kernel.org/r/575cb7164cf124c75df7cb9242ea7374733942bf.1642752946.git.christophe.le...@csgroup.eu Signed-off-by: Christophe Leroy Signed-off-by: Lorenzo

[PATCH v8 00/14] Convert powerpc to default topdown mmap layout (v8)

2022-03-09 Thread Christophe Leroy
Rebased on top of powerpc/next branch This series converts powerpc to default topdown mmap layout. powerpc requires its own arch_get_unmapped_area() only when slices are needed, which is only for book3s/64. First part of the series moves slices into book3s/64 specific directories and cleans up

[PATCH v8 12/14] powerpc/mm: Enable full randomisation of memory mappings

2022-03-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

[PATCH v8 10/14] powerpc/mm: Use generic_hugetlb_get_unmapped_area()

2022-03-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

Re: [PATCH v2 1/4] powerpc/instruction_dump: Fix kernel crash with show_instructions

2022-03-09 Thread Christophe Leroy
Le 24/05/2020 à 11:38, Aneesh Kumar K.V a écrit : With Hard Lockup watchdog, we can hit a BUG() if we take a watchdog interrupt when in OPAL mode. This happens in show_instructions() where the kernel takes the watchdog NMI IPI with MSR_IR == 0. With that show_instructions() updates the

Re: [PATCH 4/6] KVM: PPC: Book3S HV P9: Split !nested case out from guest entry

2022-03-09 Thread Fabiano Rosas
Nicholas Piggin writes: > The differences between nested and !nested will become larger in > later changes so split them out for readability. > > Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas

[PATCH v5] PCI hotplug: rpaphp: Error out on busy status from get-sensor-state

2022-03-09 Thread Mahesh Salgaonkar
When certain PHB HW failure causes phyp to recover PHB, it marks the PE state as temporarily unavailable until recovery is complete. This also triggers an EEH handler in Linux which needs to notify drivers, and perform recovery. But before notifying the driver about the pci error it uses

[PATCH 07/29] rtc: opal: switch to RTC_FEATURE_UPDATE_INTERRUPT

2022-03-09 Thread Alexandre Belloni
Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-opal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-opal.c b/drivers/rtc/rtc-opal.c index f8f49a969c23..ad41aaf8a17f 100644 ---

Re: [PATCH v4 00/13] Fix LKDTM for PPC64/IA64/PARISC v4

2022-03-09 Thread Kees Cook
On Wed, Mar 09, 2022 at 12:37:14PM +1100, Michael Ellerman wrote: > Michael Ellerman writes: > > On Tue, 15 Feb 2022 13:40:55 +0100, Christophe Leroy wrote: > >> PPC64/IA64/PARISC have function descriptors. LKDTM doesn't work > >> on those three architectures because LKDTM messes up function > >>

Re: [v4,2/2] powerpc: Fix virt_addr_valid() check

2022-03-09 Thread Christophe Leroy
Reviewed-by: Christophe Leroy

Re: [v4,1/2] Revert "powerpc: Set max_mapnr correctly"

2022-03-09 Thread Christophe Leroy
Reviewed-by: Christophe Leroy

Re: [PATCH] powerpc/vdso: Fix VDSO unmap check

2022-03-09 Thread Christophe Leroy
Le 03/11/2020 à 18:13, Laurent Dufour a écrit : The check introduced by the commit 83d3f0e90c6c ("powerpc/mm: tracking vDSO remap") is wrong and is missing some partial unmaps of the VDSO. To be complete the check needs the base and end address of the VDSO. Currently only the base is

Re: [PATCH 11/12] swiotlb: merge swiotlb-xen initialization into swiotlb

2022-03-09 Thread Boris Ostrovsky
On 3/9/22 1:18 AM, Christoph Hellwig wrote: On Tue, Mar 08, 2022 at 04:38:21PM -0500, Boris Ostrovsky wrote: On 3/1/22 5:53 AM, Christoph Hellwig wrote: Allow to pass a remap argument to the swiotlb initialization functions to handle the Xen/x86 remap case. ARM/ARM64 never did any remapping

Re: [PATCH 3/6] KVM: PPC: Book3S HV P9: Move cede logic out of XIVE escalation rearming

2022-03-09 Thread Cédric Le Goater
On 3/3/22 06:33, Nicholas Piggin wrote: Move the cede abort logic out of xive escalation rearming and into the caller to prepare for handling a similar case with nested guest entry. Signed-off-by: Nicholas Piggin Reviewed-by: Cédric Le Goater In xive_esc_irq() : if

Re: [PATCH 3/6] KVM: PPC: Book3S HV P9: Move cede logic out of XIVE escalation rearming

2022-03-09 Thread Fabiano Rosas
Nicholas Piggin writes: > Move the cede abort logic out of xive escalation rearming and into > the caller to prepare for handling a similar case with nested guest > entry. > > Signed-off-by: Nicholas Piggin > --- > arch/powerpc/include/asm/kvm_ppc.h | 4 ++-- > arch/powerpc/kvm/book3s_hv.c

Re: [PATCH 1/6] KVM: PPC: Book3S HV P9: Fix "lost kick" race

2022-03-09 Thread Fabiano Rosas
Nicholas Piggin writes: > When new work is created that requires attention from the hypervisor > (e.g., to inject an interrupt into the guest), fast_vcpu_kick is used to > pull the target vcpu out of the guest if it may have been running. > > Therefore the work creation side looks like this: > >

[PATCH] soc: fsl: rcpm: Fix refcount leak in copy_ippdexpcr1_setting

2022-03-09 Thread Miaoqian Lin
The of_find_compatible_node() function returns a node pointer with refcount incremented, We should use of_node_put() on it when done Add the missing of_node_put() to release the refcount. Fixes: e95f287deed2 ("soc: fsl: handle RCPM errata A-008646 on SoC LS1021A") Signed-off-by: Miaoqian Lin ---

Re: [PATCH v1 2/4] powerpc/ftrace: Refactor ftrace_{regs_}caller

2022-03-09 Thread Naveen N. Rao
Christophe Leroy wrote: Le 03/03/2022 à 17:59, Naveen N. Rao a écrit : Christophe Leroy wrote: The ability to disable ftrace in certain code paths through paca_struct->ftrace_enabled will also be relevant on ppc32 - it will be nice if it can be introduced there. Ah ? I understood from

Re: [PATCH V3 09/30] arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-03-09 Thread Anshuman Khandual
On 3/2/22 16:44, Geert Uytterhoeven wrote: > Hi Anshuman, > > On Wed, Mar 2, 2022 at 12:07 PM Anshuman Khandual > wrote: >> On 3/2/22 3:35 PM, Geert Uytterhoeven wrote: >>> On Wed, Mar 2, 2022 at 10:51 AM Anshuman Khandual >>> wrote: On 3/2/22 12:35 PM, Christophe Leroy wrote: > Le

Re: [PATCH V3 05/30] arm64/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

2022-03-09 Thread Anshuman Khandual
On 3/3/22 20:58, Catalin Marinas wrote: > Hi Anshuman, > > On Mon, Feb 28, 2022 at 04:17:28PM +0530, Anshuman Khandual wrote: >> +static inline pgprot_t __vm_get_page_prot(unsigned long vm_flags) >> +{ >> +switch (vm_flags & (VM_READ | VM_WRITE | VM_EXEC | VM_SHARED)) { >> +case

Re: [PATCH] powerpc: 8xx: fix a return value error in mpc8xx_pic_init

2022-03-09 Thread Christophe Leroy
Le 09/03/2022 à 11:46, Michael Ellerman a écrit : > Christophe Leroy writes: >> Le 09/03/2022 à 04:24, Michael Ellerman a écrit : >>> Hangyu Hua writes: mpc8xx_pic_init() should return -ENOMEM instead of 0 when irq_domain_add_linear() return NULL. This cause mpc8xx_pics_init to

Re: [PATCH] powerpc: 8xx: fix a return value error in mpc8xx_pic_init

2022-03-09 Thread Michael Ellerman
Christophe Leroy writes: > Le 09/03/2022 à 04:24, Michael Ellerman a écrit : >> Hangyu Hua writes: >>> mpc8xx_pic_init() should return -ENOMEM instead of 0 when >>> irq_domain_add_linear() return NULL. This cause mpc8xx_pics_init to continue >>> executing even if mpc8xx_pic_host is NULL. >>> >>>

Re: [PATCH v3 4/7] powerpc/dt_cpu_ftrs: Set current thread fscr bits

2022-03-09 Thread Michael Ellerman
Christophe Leroy writes: > Le 21/05/2020 à 03:43, Alistair Popple a écrit : >> Setting the FSCR bit directly in the SPR only sets it during the initial >> boot and early init of the kernel but not for the init process or any >> subsequent kthreads. This is because the thread_struct for those is

RE: [PATCH] powerpc: Use rol32() instead of opencoding in csum_fold()

2022-03-09 Thread David Laight
From: Christophe Leroy > Sent: 09 March 2022 07:56 ... > diff --git a/arch/powerpc/include/asm/checksum.h > b/arch/powerpc/include/asm/checksum.h > index 8321f6053a67..4b573a3b7e17 100644 > --- a/arch/powerpc/include/asm/checksum.h > +++ b/arch/powerpc/include/asm/checksum.h > @@ -38,14 +38,15 @@

[PATCH] powerpc: Remove find_current_mm_pte()

2022-03-09 Thread Christophe Leroy
Last usage of find_current_mm_pte() was removed by commit 15759cb054ef ("powerpc/perf/callchain: Use __get_user_pages_fast in read_user_stack_slow") Remove it. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/pte-walk.h | 25 -

Re: [PATCH v2 1/3] powerpc/mce: Bug fixes for MCE handling in kernel space

2022-03-09 Thread Christophe Leroy
Le 05/04/2018 à 09:14, Balbir Singh a écrit : The code currently assumes PAGE_SHIFT as the shift value of the pfn, this works correctly (mostly) for user space pages, but the correct thing to do is 1. Extract the shift value returned via the pte-walk API's 2. Use the shift value to access

Re: [PATCH] powerpc/configs: Turn CONFIG_RELOCATABLE on by default

2022-03-09 Thread Christophe Leroy
Le 12/05/2017 à 07:36, Balbir Singh a écrit : On powernv/pseries and ppc64 defconfigs Most distros will want it on by default and I've missed turning it on during developer testing. Having it on ensures we are testing our patches with the config enabled. Signed-off-by: Balbir Singh Today

Re: [PATCH] powerpc/mm: Fix printing of process table address

2022-03-09 Thread Christophe Leroy
Le 28/03/2018 à 05:09, Balbir Singh a écrit : New changes to %p cause the information printed at boot about radix-mmu partition and process table opaque, if we really want to protect those values, we should make dmesg more secure using CONFIG_SECURITY_DMESG_RESTRICT Before the patches:

Re: [RFC PATCH] KVM: PPC: Book3S HV: Add KVM_CAP_PPC_GTSE

2022-03-09 Thread Paul Mackerras
On Tue, Mar 08, 2022 at 10:23:38PM -0300, Fabiano Rosas wrote: > This patch adds a new KVM capability to address a crash we're > currently having inside the nested guest kernel when running with > GTSE disabled in the nested hypervisor. I think the patch needs to add a description of

Re: [PATCH] powerpc/64/interrupt: Fix return to masked context after hard-mask irq becomes pending

2022-03-09 Thread Sachin Sant
> On 07-Mar-2022, at 8:21 PM, Nicholas Piggin wrote: > > When a synchronous interrupt[1] is taken in a local_irq_disable() region > which has MSR[EE]=1, the interrupt handler will enable MSR[EE] as part > of enabling MSR[RI], for peformance and profiling reasons. > > [1] Typically a hash

Re: [PATCH v3 4/7] powerpc/dt_cpu_ftrs: Set current thread fscr bits

2022-03-09 Thread Christophe Leroy
Hi, Le 21/05/2020 à 03:43, Alistair Popple a écrit : Setting the FSCR bit directly in the SPR only sets it during the initial boot and early init of the kernel but not for the init process or any subsequent kthreads. This is because the thread_struct for those is copied from the current