Re: [PATCH 9/9] zsmalloc: remove the zsmalloc file system

2021-03-09 Thread Minchan Kim
On Tue, Mar 09, 2021 at 04:53:48PM +0100, Christoph Hellwig wrote: > Just use the generic anon_inode file system. > > Signed-off-by: Christoph Hellwig Acked-by: Minchan Kim

[PATCH] powerpc: fix warning comparing pointer to 0

2021-03-09 Thread Jiapeng Chong
Fix the following coccicheck warning: ./arch/powerpc/platforms/powermac/pfunc_core.c:688:40-41: WARNING comparing pointer to 0. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- arch/powerpc/platforms/powermac/pfunc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

Re: [PATCH 1/9] fs: rename alloc_anon_inode to alloc_anon_inode_sb

2021-03-09 Thread Minchan Kim
On Tue, Mar 09, 2021 at 04:53:40PM +0100, Christoph Hellwig wrote: > Rename alloc_inode to free the name for a new variant that does not > need boilerplate to create a super_block first. > > Signed-off-by: Christoph Hellwig > --- > arch/powerpc/platforms/pseries/cmm.c | 2 +- > drivers/dma-buf/d

Re: [PATCH V2] mm/memtest: Add ARCH_USE_MEMTEST

2021-03-09 Thread Anshuman Khandual
On 3/1/21 10:02 AM, Anshuman Khandual wrote: > early_memtest() does not get called from all architectures. Hence enabling > CONFIG_MEMTEST and providing a valid memtest=[1..N] kernel command line > option might not trigger the memory pattern tests as would be expected in > normal circumstances.

Re: [PATCH 2/6] mm: Generalize SYS_SUPPORTS_HUGETLBFS (rename as ARCH_SUPPORTS_HUGETLBFS)

2021-03-09 Thread Michael Ellerman
Anshuman Khandual writes: > SYS_SUPPORTS_HUGETLBFS config has duplicate definitions on platforms that > subscribe it. Instead, just make it a generic option which can be selected > on applicable platforms. Also rename it as ARCH_SUPPORTS_HUGETLBFS instead. > This reduces code duplication and makes

Re: [PATCH v4] powerpc/uprobes: Validation for prefixed instruction

2021-03-09 Thread Michael Ellerman
Ravi Bangoria writes: > On 3/9/21 4:51 PM, Naveen N. Rao wrote: >> On 2021/03/09 08:54PM, Michael Ellerman wrote: >>> Ravi Bangoria writes: As per ISA 3.1, prefixed instruction should not cross 64-byte boundary. So don't allow Uprobe on such prefixed instruction. There are two

Re: PowerPC64 future proof kernel toc, revised for lld

2021-03-09 Thread Alan Modra
On Wed, Mar 10, 2021 at 03:44:44PM +1100, Alexey Kardashevskiy wrote: > For my own education, is .got for prom_init.o still generated by ld or gcc? .got is generated by ld. > In other words, should "objdump -D -s -j .got" ever dump .got for any .o > file, like below? No. "objdump -r prom_init.o

Re: Errant readings on LM81 with T2080 SoC

2021-03-09 Thread Guenter Roeck
On 3/9/21 6:19 PM, Chris Packham wrote: > On 9/03/21 9:27 am, Chris Packham wrote: >> On 8/03/21 5:59 pm, Guenter Roeck wrote: >>> Other than that, the only other real idea I have would be to monitor >>> the i2c bus. >> I am in the fortunate position of being able to go into the office and >> even

Re: [PATCH v2] powerpc/kexec_file: Restore FDT size estimation for kdump kernel

2021-03-09 Thread Michael Ellerman
Rob Herring writes: > On Fri, Feb 19, 2021 at 6:52 PM Thiago Jung Bauermann > wrote: >> >> Commit 2377c92e37fe ("powerpc/kexec_file: fix FDT size estimation for kdump >> kernel") fixed how elf64_load() estimates the FDT size needed by the >> crashdump kernel. >> >> At the same time, commit 130b2d

Re: [PATCH 2/6] mm: Generalize SYS_SUPPORTS_HUGETLBFS (rename as ARCH_SUPPORTS_HUGETLBFS)

2021-03-09 Thread Palmer Dabbelt
On Tue, 09 Mar 2021 00:33:06 PST (-0800), anshuman.khand...@arm.com wrote: SYS_SUPPORTS_HUGETLBFS config has duplicate definitions on platforms that subscribe it. Instead, just make it a generic option which can be selected on applicable platforms. Also rename it as ARCH_SUPPORTS_HUGETLBFS instea

Re: make alloc_anon_inode more useful

2021-03-09 Thread Matthew Wilcox
On Tue, Mar 09, 2021 at 04:53:39PM +0100, Christoph Hellwig wrote: > this series first renames the existing alloc_anon_inode to > alloc_anon_inode_sb to clearly mark it as requiring a superblock. > > It then adds a new alloc_anon_inode that works on the anon_inode > file system super block, thus r

Re: PowerPC64 future proof kernel toc, revised for lld

2021-03-09 Thread Alan Modra
This patch future-proofs the kernel against linker changes that might put the toc pointer at some location other than .got+0x8000, by replacing __toc_start+0x8000 with .TOC. throughout. If the kernel's idea of the toc pointer doesn't agree with the linker, bad things happen. prom_init.c code relo

Re: Errant readings on LM81 with T2080 SoC

2021-03-09 Thread Guenter Roeck
On 3/9/21 3:35 PM, Chris Packham wrote: > > On 8/03/21 1:31 pm, Guenter Roeck wrote: >> On 3/7/21 2:52 PM, Chris Packham wrote: >>> Fundamentally I think this is a problem with the fact that the LM81 is >>> an SMBus device but the T2080 (and other Freescale SoCs) uses i2c and we >>> emulate SMBus.

Re: [PATCH v2] powerpc/kexec_file: Restore FDT size estimation for kdump kernel

2021-03-09 Thread Rob Herring
On Tue, Mar 9, 2021 at 7:31 PM Lakshmi Ramasubramanian wrote: > > On 3/9/21 6:08 PM, Rob Herring wrote: > > Hi Rob, > > > On Fri, Feb 19, 2021 at 6:52 PM Thiago Jung Bauermann > > wrote: > >> > >> Commit 2377c92e37fe ("powerpc/kexec_file: fix FDT size estimation for kdump > >> kernel") fixed how

Re: [PATCH v4 3/6] ASoC: dt-bindings: fsl_rpmsg: Add binding doc for rpmsg cpu dai driver

2021-03-09 Thread Rob Herring
On Mon, Mar 08, 2021 at 09:22:27PM +0800, Shengjiu Wang wrote: > fsl_rpmsg cpu dai driver is driver for rpmsg audio, which is mainly used Bindings describe h/w blocks, not drivers. > for getting the user's configuration from device tree and configure the > clocks which is used by Cortex-M core. S

Re: [PATCH v2] powerpc/kexec_file: Restore FDT size estimation for kdump kernel

2021-03-09 Thread Lakshmi Ramasubramanian
On 3/9/21 6:08 PM, Rob Herring wrote: Hi Rob, On Fri, Feb 19, 2021 at 6:52 PM Thiago Jung Bauermann wrote: Commit 2377c92e37fe ("powerpc/kexec_file: fix FDT size estimation for kdump kernel") fixed how elf64_load() estimates the FDT size needed by the crashdump kernel. At the same time, com

Re: Errant readings on LM81 with T2080 SoC

2021-03-09 Thread Chris Packham
On 9/03/21 9:27 am, Chris Packham wrote: > On 8/03/21 5:59 pm, Guenter Roeck wrote: >> Other than that, the only other real idea I have would be to monitor >> the i2c bus. > I am in the fortunate position of being able to go into the office and > even happen to have the expensive scope at the mome

Re: [PATCH v2] powerpc/kexec_file: Restore FDT size estimation for kdump kernel

2021-03-09 Thread Rob Herring
On Fri, Feb 19, 2021 at 6:52 PM Thiago Jung Bauermann wrote: > > Commit 2377c92e37fe ("powerpc/kexec_file: fix FDT size estimation for kdump > kernel") fixed how elf64_load() estimates the FDT size needed by the > crashdump kernel. > > At the same time, commit 130b2d59cec0 ("powerpc: Use common >

Re: [PATCH v2 40/43] powerpc/64s: Make kuap_check_amr() and kuap_get_and_check_amr() generic

2021-03-09 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of March 9, 2021 10:10 pm: > In preparation of porting powerpc32 to C syscall entry/exit, > rename kuap_check_amr() and kuap_get_and_check_amr() as kuap_check() > and kuap_get_and_check(), and move in the generic asm/kup.h the stub > for when CONFIG_PPC_KUAP

Re: [PATCH v2 36/43] powerpc/32: Set current->thread.regs in C interrupt entry

2021-03-09 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of March 9, 2021 10:10 pm: > No need to do that is assembly, do it in C. Hmm. No issues with the patch as such, but why does ppc32 need this but not 64? AFAIKS 64 sets this when a thread is created. Thanks, Nick > > Signed-off-by: Christophe Leroy > --

Re: [PATCH v2 28/43] powerpc/64e: Call bad_page_fault() from do_page_fault()

2021-03-09 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of March 9, 2021 10:09 pm: > book3e/64 is the last one calling __bad_page_fault() > from assembly. > > Save non volatile registers before calling do_page_fault() > and modify do_page_fault() to call __bad_page_fault() > for all platforms. > > Then it can b

Re: [PATCH v2 02/43] powerpc/traps: Declare unrecoverable_exception() as __noreturn

2021-03-09 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of March 9, 2021 10:09 pm: > unrecoverable_exception() is never expected to return, most callers > have an infiniteloop in case it returns. > > Ensure it really never returns by terminating it with a BUG(), and > declare it __no_return. > > It always GCC t

Re: [PATCH v2 01/43] powerpc/traps: unrecoverable_exception() is not an interrupt handler

2021-03-09 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of March 9, 2021 10:09 pm: > unrecoverable_exception() is called from interrupt handlers or > after an interrupt handler has failed. > > Make it a standard function to avoid doubling the actions > performed on interrupt entry (e.g.: user time accounting). >

Re: Errant readings on LM81 with T2080 SoC

2021-03-09 Thread Chris Packham
On 8/03/21 1:31 pm, Guenter Roeck wrote: > On 3/7/21 2:52 PM, Chris Packham wrote: >> Fundamentally I think this is a problem with the fact that the LM81 is >> an SMBus device but the T2080 (and other Freescale SoCs) uses i2c and we >> emulate SMBus. I suspect the errant readings are when we don't

Re: [PATCH v1] powerpc: Include running function as first entry in save_stack_trace() and friends

2021-03-09 Thread Segher Boessenkool
Hi! On Tue, Mar 09, 2021 at 04:05:23PM +, Mark Rutland wrote: > On Thu, Mar 04, 2021 at 03:54:48PM -0600, Segher Boessenkool wrote: > > On Thu, Mar 04, 2021 at 02:57:30PM +, Mark Rutland wrote: > > > It looks like GCC is happy to give us the function-entry-time FP if we use > > > __builtin

Re: [PATCH 1/9] fs: rename alloc_anon_inode to alloc_anon_inode_sb

2021-03-09 Thread Gao Xiang
On Tue, Mar 09, 2021 at 04:53:40PM +0100, Christoph Hellwig wrote: > Rename alloc_inode to free the name for a new variant that does not > need boilerplate to create a super_block first. > > Signed-off-by: Christoph Hellwig > --- That is a nice idea as well to avoid sb by introducing an unique f

Re: [PATCH 2/9] fs: add an argument-less alloc_anon_inode

2021-03-09 Thread Gao Xiang
On Tue, Mar 09, 2021 at 04:53:41PM +0100, Christoph Hellwig wrote: > Add a new alloc_anon_inode helper that allocates an inode on > the anon_inode file system. > > Signed-off-by: Christoph Hellwig Reviewed-by: Gao Xiang Thanks, Gao Xiang

Re: [PATCH v2 1/8] powerpc/xive: Use cpu_to_node() instead of ibm,chip-id property

2021-03-09 Thread Daniel Henrique Barboza
On 3/9/21 12:33 PM, Cédric Le Goater wrote: On 3/8/21 6:13 PM, Greg Kurz wrote: On Wed, 3 Mar 2021 18:48:50 +0100 Cédric Le Goater wrote: The 'chip_id' field of the XIVE CPU structure is used to choose a target for a source located on the same chip when possible. This field is assigned on

Re: [PATCH] ethernet: ucc_geth: Use kmemdup instead of kmalloc and memcpy

2021-03-09 Thread Rasmus Villemoes
On 05/03/2021 15.27, angkery wrote: > From: Junlin Yang > > Fixes coccicheck warnings: > ./drivers/net/ethernet/freescale/ucc_geth.c:3594:11-18: > WARNING opportunity for kmemdup > > Signed-off-by: Junlin Yang > --- > drivers/net/ethernet/freescale/ucc_geth.c | 3 +-- > 1 file changed, 1 inser

Re: [PATCH v2 4/7] CMDLINE: powerpc: convert to generic builtin command line

2021-03-09 Thread Daniel Walker
On Tue, Mar 09, 2021 at 08:56:47AM +0100, Christophe Leroy wrote: > > > Le 09/03/2021 à 01:02, Daniel Walker a écrit : > > This updates the powerpc code to use the CONFIG_GENERIC_CMDLINE > > option. > > > > Cc: xe-linux-exter...@cisco.com > > Signed-off-by: Ruslan Ruslichenko > > Signed-off-by:

Re: [PATCH v2 3/7] powerpc: convert config files to generic cmdline

2021-03-09 Thread Daniel Walker
On Tue, Mar 09, 2021 at 08:47:09AM +0100, Christophe Leroy wrote: > > > Le 09/03/2021 à 01:02, Daniel Walker a écrit : > > This is a scripted mass convert of the config files to use > > the new generic cmdline. There is a bit of a trim effect here. > > It would seems that some of the config haven

Re: [PATCH v2 1/8] powerpc/xive: Use cpu_to_node() instead of ibm,chip-id property

2021-03-09 Thread Cédric Le Goater
On 3/9/21 6:08 PM, Daniel Henrique Barboza wrote: > > > On 3/9/21 12:33 PM, Cédric Le Goater wrote: >> On 3/8/21 6:13 PM, Greg Kurz wrote: >>> On Wed, 3 Mar 2021 18:48:50 +0100 >>> Cédric Le Goater wrote: >>> The 'chip_id' field of the XIVE CPU structure is used to choose a target for

[PATCH] powerpc/xmon: Check cpu id in commands "c#", "dp#" and "dx#"

2021-03-09 Thread Greg Kurz
All these commands end up peeking into the PACA using the user originated cpu id as an index. Check the cpu id is valid in order to prevent xmon to crash. Instead of printing an error, this follows the same behavior as the "lp s #" command : ignore the buggy cpu id parameter and fall back to the #-

Re: [PATCH 3/3] powerpc/qspinlock: Use generic smp_cond_load_relaxed

2021-03-09 Thread Michal Suchánek
On Tue, Mar 09, 2021 at 07:46:11AM -0800, Davidlohr Bueso wrote: > On Tue, 09 Mar 2021, Michal Such�nek wrote: > > > On Mon, Mar 08, 2021 at 05:59:50PM -0800, Davidlohr Bueso wrote: > > > 49a7d46a06c3 (powerpc: Implement smp_cond_load_relaxed()) added > > > busy-waiting pausing with a preferred

Re: [PATCH v2 8/8] powerpc/xive: Map one IPI interrupt per node

2021-03-09 Thread Cédric Le Goater
On 3/9/21 2:23 PM, Greg Kurz wrote: > On Wed, 3 Mar 2021 18:48:57 +0100 > Cédric Le Goater wrote: > >> ipistorm [*] can be used to benchmark the raw interrupt rate of an >> interrupt controller by measuring the number of IPIs a system can >> sustain. When applied to the XIVE interrupt controller

Re: make alloc_anon_inode more useful

2021-03-09 Thread Jason Gunthorpe
On Tue, Mar 09, 2021 at 04:53:39PM +0100, Christoph Hellwig wrote: > Hi all, > > this series first renames the existing alloc_anon_inode to > alloc_anon_inode_sb to clearly mark it as requiring a superblock. > > It then adds a new alloc_anon_inode that works on the anon_inode > file system super

Re: [PATCH 3/9] powerpc/pseries: remove the ppc-cmm file system

2021-03-09 Thread Jason Gunthorpe
On Tue, Mar 09, 2021 at 04:53:42PM +0100, Christoph Hellwig wrote: > Just use the generic anon_inode file system. > > Signed-off-by: Christoph Hellwig > arch/powerpc/platforms/pseries/cmm.c | 27 ++- > 1 file changed, 2 insertions(+), 25 deletions(-) > > diff --git a/arc

Re: [PATCH 5/9] vmw_balloon: remove the balloon-vmware file system

2021-03-09 Thread David Hildenbrand
On 09.03.21 16:53, Christoph Hellwig wrote: Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- drivers/misc/vmw_balloon.c | 24 ++-- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw

Re: [PATCH 6/9] virtio_balloon: remove the balloon-kvm file system

2021-03-09 Thread David Hildenbrand
On 09.03.21 16:53, Christoph Hellwig wrote: Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- drivers/virtio/virtio_balloon.c | 30 +++--- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/

Re: [PATCH 2/9] fs: add an argument-less alloc_anon_inode

2021-03-09 Thread David Hildenbrand
On 09.03.21 16:53, Christoph Hellwig wrote: Add a new alloc_anon_inode helper that allocates an inode on the anon_inode file system. Signed-off-by: Christoph Hellwig --- fs/anon_inodes.c| 15 +-- include/linux/anon_inodes.h | 1 + 2 files changed, 14 insertions(+),

Re: [PATCH 1/9] fs: rename alloc_anon_inode to alloc_anon_inode_sb

2021-03-09 Thread David Hildenbrand
On 09.03.21 16:53, Christoph Hellwig wrote: Rename alloc_inode to free the name for a new variant that does not need boilerplate to create a super_block first. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/pseries/cmm.c | 2 +- drivers/dma-buf/dma-buf.c| 2 +- driv

Re: [PATCH 3/9] powerpc/pseries: remove the ppc-cmm file system

2021-03-09 Thread David Hildenbrand
On 09.03.21 16:53, Christoph Hellwig wrote: Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/pseries/cmm.c | 27 ++- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/arch/powerpc/platforms/pseries/c

Re: [PATCH v1] powerpc: Include running function as first entry in save_stack_trace() and friends

2021-03-09 Thread Mark Rutland
On Thu, Mar 04, 2021 at 03:54:48PM -0600, Segher Boessenkool wrote: > Hi! Hi Segher, > On Thu, Mar 04, 2021 at 02:57:30PM +, Mark Rutland wrote: > > It looks like GCC is happy to give us the function-entry-time FP if we use > > __builtin_frame_address(1), > > From the GCC manual: > Call

Re: [PATCH v3] powerpc/32: remove bogus ppc_select syscall

2021-03-09 Thread Christophe Leroy
Le 05/03/2021 à 13:03, Arnd Bergmann a écrit : On Fri, Mar 5, 2021 at 11:15 AM Christophe Leroy wrote: Le 05/03/2021 à 11:06, Arnd Bergmann a écrit : On Fri, Mar 5, 2021 at 9:40 AM Christophe Leroy wrote: - glibc support for ppc32 gets merged during the linux-2.5 days, supporting only

[PATCH 9/9] zsmalloc: remove the zsmalloc file system

2021-03-09 Thread Christoph Hellwig
Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- mm/zsmalloc.c | 48 +++- 1 file changed, 3 insertions(+), 45 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index a6449a2ad861de..a7d2f471935447 100644 --- a/mm

[PATCH 8/9] z3fold: remove the z3fold file system

2021-03-09 Thread Christoph Hellwig
Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- mm/z3fold.c | 38 ++ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/mm/z3fold.c b/mm/z3fold.c index e7cd9298b221f5..e0749a3d8987de 100644 --- a/mm/z3fold.c +++ b/

[PATCH 7/9] iomem: remove the iomem file system

2021-03-09 Thread Christoph Hellwig
Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- kernel/resource.c | 30 -- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/kernel/resource.c b/kernel/resource.c index 0fd091a3f2fc66..12560553c26796 100644 --- a/kernel/r

[PATCH 6/9] virtio_balloon: remove the balloon-kvm file system

2021-03-09 Thread Christoph Hellwig
Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- drivers/virtio/virtio_balloon.c | 30 +++--- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index cae76ee5bd

[PATCH 5/9] vmw_balloon: remove the balloon-vmware file system

2021-03-09 Thread Christoph Hellwig
Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- drivers/misc/vmw_balloon.c | 24 ++-- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index 5d057a05ddbee8..be4be32f858253

[PATCH 4/9] drm: remove the drm file system

2021-03-09 Thread Christoph Hellwig
Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/drm_drv.c | 64 ++- 1 file changed, 3 insertions(+), 61 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 87e7214a8e3565..af2

[PATCH 3/9] powerpc/pseries: remove the ppc-cmm file system

2021-03-09 Thread Christoph Hellwig
Just use the generic anon_inode file system. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/pseries/cmm.c | 27 ++- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c ind

[PATCH 2/9] fs: add an argument-less alloc_anon_inode

2021-03-09 Thread Christoph Hellwig
Add a new alloc_anon_inode helper that allocates an inode on the anon_inode file system. Signed-off-by: Christoph Hellwig --- fs/anon_inodes.c| 15 +-- include/linux/anon_inodes.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/fs/anon_inodes.c b/f

make alloc_anon_inode more useful

2021-03-09 Thread Christoph Hellwig
Hi all, this series first renames the existing alloc_anon_inode to alloc_anon_inode_sb to clearly mark it as requiring a superblock. It then adds a new alloc_anon_inode that works on the anon_inode file system super block, thus removing tons of boilerplate code. The few remainig callers of alloc

[PATCH 1/9] fs: rename alloc_anon_inode to alloc_anon_inode_sb

2021-03-09 Thread Christoph Hellwig
Rename alloc_inode to free the name for a new variant that does not need boilerplate to create a super_block first. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/pseries/cmm.c | 2 +- drivers/dma-buf/dma-buf.c| 2 +- drivers/gpu/drm/drm_drv.c| 2 +- drivers/

Re: [PATCH v2 7/8] powerpc/xive: Fix xmon command "dxi"

2021-03-09 Thread Cédric Le Goater
On 3/9/21 11:23 AM, Greg Kurz wrote: > On Wed, 3 Mar 2021 18:48:56 +0100 > Cédric Le Goater wrote: > >> When under xmon, the "dxi" command dumps the state of the XIVE >> interrupts. If an interrupt number is specified, only the state of >> the associated XIVE interrupt is dumped. This form of the

Re: [PATCH 3/3] powerpc/qspinlock: Use generic smp_cond_load_relaxed

2021-03-09 Thread Davidlohr Bueso
On Tue, 09 Mar 2021, Michal Such�nek wrote: On Mon, Mar 08, 2021 at 05:59:50PM -0800, Davidlohr Bueso wrote: 49a7d46a06c3 (powerpc: Implement smp_cond_load_relaxed()) added busy-waiting pausing with a preferred SMT priority pattern, lowering the priority (reducing decode cycles) during the wh

Re: [PATCH v2 4/8] powerpc/xive: Simplify xive_core_debug_show()

2021-03-09 Thread Cédric Le Goater
On 3/9/21 10:42 AM, Greg Kurz wrote: > On Tue, 9 Mar 2021 10:13:39 +0100 > Greg Kurz wrote: > >> On Mon, 8 Mar 2021 19:11:11 +0100 >> Cédric Le Goater wrote: >> >>> On 3/8/21 7:07 PM, Greg Kurz wrote: On Wed, 3 Mar 2021 18:48:53 +0100 Cédric Le Goater wrote: > Now that the IP

Re: [PATCH v2 1/8] powerpc/xive: Use cpu_to_node() instead of ibm,chip-id property

2021-03-09 Thread Cédric Le Goater
On 3/8/21 6:13 PM, Greg Kurz wrote: > On Wed, 3 Mar 2021 18:48:50 +0100 > Cédric Le Goater wrote: > >> The 'chip_id' field of the XIVE CPU structure is used to choose a >> target for a source located on the same chip when possible. This field >> is assigned on the PowerNV platform using the "ibm,

[PATCH 4/4] tools/perf: Support pipeline stage cycles for powerpc

2021-03-09 Thread Athira Rajeev
The pipeline stage cycles details can be recorded on powerpc from the contents of Performance Monitor Unit (PMU) registers. On ISA v3.1 platform, sampling registers exposes the cycles spent in different pipeline stages. Patch adds perf tools support to present two of the cycle counter information a

[PATCH 3/4] tools/perf: Add powerpc support for PERF_SAMPLE_WEIGHT_STRUCT

2021-03-09 Thread Athira Rajeev
Add arch specific arch_evsel__set_sample_weight() to set the new sample type for powerpc. Add arch specific arch_perf_parse_sample_weight() to store the sample->weight values depending on the sample type applied. if the new sample type (PERF_SAMPLE_WEIGHT_STRUCT) is applied, store only the lower 3

[PATCH 2/4] tools/perf: Add dynamic headers for perf report columns

2021-03-09 Thread Athira Rajeev
Currently the header string for different columns in perf report is fixed. Some fields of perf sample could have different meaning for different architectures than the meaning conveyed by the header string. An example is the new field 'var2_w' of perf_sample_weight structure. This is presently capt

[PATCH 1/4] powerpc/perf: Expose processor pipeline stage cycles using PERF_SAMPLE_WEIGHT_STRUCT

2021-03-09 Thread Athira Rajeev
Performance Monitoring Unit (PMU) registers in powerpc provides information on cycles elapsed between different stages in the pipeline. This can be used for application tuning. On ISA v3.1 platform, this information is exposed by sampling registers. Patch adds kernel support to capture two of the c

[PATCH 0/4] powerpc/perf: Export processor pipeline stage cycles information

2021-03-09 Thread Athira Rajeev
Performance Monitoring Unit (PMU) registers in powerpc exports number of cycles elapsed between different stages in the pipeline. Example, sampling registers in ISA v3.1. This patchset implements kernel and perf tools support to expose these pipeline stage cycles using the sample type PERF_SAMPLE_

Re: [PATCH v2 8/8] powerpc/xive: Map one IPI interrupt per node

2021-03-09 Thread Greg Kurz
On Wed, 3 Mar 2021 18:48:57 +0100 Cédric Le Goater wrote: > ipistorm [*] can be used to benchmark the raw interrupt rate of an > interrupt controller by measuring the number of IPIs a system can > sustain. When applied to the XIVE interrupt controller of POWER9 and > POWER10 systems, a significan

Re: [PATCH v4] powerpc/uprobes: Validation for prefixed instruction

2021-03-09 Thread Ravi Bangoria
On 3/9/21 4:51 PM, Naveen N. Rao wrote: On 2021/03/09 08:54PM, Michael Ellerman wrote: Ravi Bangoria writes: As per ISA 3.1, prefixed instruction should not cross 64-byte boundary. So don't allow Uprobe on such prefixed instruction. There are two ways probed instruction is changed in mappe

[PATCH v2 43/43] powerpc/32: Manage KUAP in C

2021-03-09 Thread Christophe Leroy
Move all KUAP management in C. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/kup.h | 50 +--- arch/powerpc/include/asm/interrupt.h | 2 + arch/powerpc/include/asm/kup.h | 9 arch/powerpc/include/asm/nohash/32/kup-8xx.h | 2

[PATCH v2 41/43] powerpc/32s: Create C version of kuap save/restore/check helpers

2021-03-09 Thread Christophe Leroy
In preparation of porting PPC32 to C syscall entry/exit, create C version of kuap_save_and_lock() and kuap_user_restore() and kuap_kernel_restore() and kuap_check() and kuap_get_and_check() on book3s/32. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/kup.h | 45 ++

[PATCH v2 42/43] powerpc/8xx: Create C version of kuap save/restore/check helpers

2021-03-09 Thread Christophe Leroy
In preparation of porting PPC32 to C syscall entry/exit, create C version of kuap_save_and_lock() and kuap_user_restore() and kuap_kernel_restore() and kuap_check() and kuap_get_and_check() on 8xx. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/kup-8xx.h | 31

[PATCH v2 40/43] powerpc/64s: Make kuap_check_amr() and kuap_get_and_check_amr() generic

2021-03-09 Thread Christophe Leroy
In preparation of porting powerpc32 to C syscall entry/exit, rename kuap_check_amr() and kuap_get_and_check_amr() as kuap_check() and kuap_get_and_check(), and move in the generic asm/kup.h the stub for when CONFIG_PPC_KUAP is not selected. Signed-off-by: Christophe Leroy --- arch/powerpc/includ

[PATCH v2 39/43] powerpc/32s: Move KUEP locking/unlocking in C

2021-03-09 Thread Christophe Leroy
This can be done in C, do it. Unrolling the loop gains approx. 15% performance. >From now on, prepare_transfer_to_handler() is only for interrupts from kernel. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/kup.h | 31 --- arch/powerpc/include/asm/interr

[PATCH v2 38/43] powerpc/32: Only use prepare_transfer_to_handler function on book3s/32 and e500

2021-03-09 Thread Christophe Leroy
Only book3s/32 and e500 have significative work to do in prepare_transfer_to_handler. Other 32 bit have nothing to do at all. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 6 ++ arch/powerpc/kernel/head_32.h| 2 ++ arch/powerpc/kernel/head_booke.h | 2 ++ 3 file

[PATCH v2 37/43] powerpc/32: Return directly from power_save_ppc32_restore()

2021-03-09 Thread Christophe Leroy
transfer_to_handler_cont: is now just a blr. Directly perform blr in power_save_ppc32_restore(). Also remove useless setting of r11 in e500 version of power_save_ppc32_restore(). Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 3 --- arch/powerpc/kernel/idle_6xx.S | 2

[PATCH v2 36/43] powerpc/32: Set current->thread.regs in C interrupt entry

2021-03-09 Thread Christophe Leroy
No need to do that is assembly, do it in C. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/interrupt.h | 4 +++- arch/powerpc/kernel/entry_32.S | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include

[PATCH v2 35/43] powerpc/32: Save remaining registers in exception prolog

2021-03-09 Thread Christophe Leroy
Save non volatile registers, XER, CTR, MSR and NIP in exception prolog. Also assign proper value to r2 and r3 there. For now, recalculate thread pointer in prepare_transfer_to_handler. It will disappear once KUAP is ported to C. And remove the comment which is now completely wrong. Signed-off-b

[PATCH v2 34/43] powerpc/32: Refactor saving of volatile registers in exception prologs

2021-03-09 Thread Christophe Leroy
Exception prologs all do the same at the end: - Save trapno in stack - Mark stack with exception marker - Save r0 - Save r3 to r8 Refactor that into a COMMON_EXCEPTION_PROLOG_END macro. At the same time use r1 instead of r11. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.h

[PATCH v2 33/43] powerpc/32: Remove the xfer parameter in EXCEPTION() macro

2021-03-09 Thread Christophe Leroy
The xfer parameter is not used anymore, remove it. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.h| 2 +- arch/powerpc/kernel/head_40x.S | 42 arch/powerpc/kernel/head_44x.S | 10 ++-- arch/powerpc/kernel/head_8xx.S | 14 +++--- arch/

[PATCH v2 32/43] powerpc/32: Dismantle EXC_XFER_STD/LITE/TEMPLATE

2021-03-09 Thread Christophe Leroy
In order to get more control in exception prolog, dismantle all non standard exception macros, finishing with EXC_XFER_STD and EXC_XFER_LITE and EXC_XFER_TEMPLATE. Also remove transfer_to_handler_full and ret_from_except and ret_from_except_full as they are not used anymore. Last parameter of EXC

[PATCH v2 31/43] powerpc/32: Only restore non volatile registers when required

2021-03-09 Thread Christophe Leroy
Until now, non volatile registers were restored everytime they were saved, ie using EXC_XFER_STD meant saving and restoring them while EXC_XFER_LITE meant neither saving not restoring them. Now that they are always saved, EXC_XFER_STD means to restore them and EXC_XFER_LITE means to not restore th

[PATCH v2 30/43] powerpc/32: Add a prepare_transfer_to_handler macro for exception prologs

2021-03-09 Thread Christophe Leroy
In order to increase flexibility, add a macro that will for now call transfer_to_handler. As transfer_to_handler doesn't do the actual transfer anymore, also name it prepare_transfer_to_handler. The following patches will progressively remove the use of transfer_to_handler label. Signed-off-by: C

[PATCH v2 29/43] powerpc/32: Save trap number on stack in exception prolog

2021-03-09 Thread Christophe Leroy
Saving the trap number into the stack goes into the exception prolog, as EXC_XFER_xxx will soon disappear. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.h| 14 - arch/powerpc/kernel/head_40x.S | 22 +++--- arch/powerpc/kernel/head_8xx.S | 14

[PATCH v2 27/43] powerpc/32: Call bad_page_fault() from do_page_fault()

2021-03-09 Thread Christophe Leroy
Now that non volatile registers are saved at all time, no need to split bad_page_fault() out of do_page_fault(). Remove handle_page_fault() and use do_page_fault() directly. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 16 arch/powerpc/kernel/head_

[PATCH v2 28/43] powerpc/64e: Call bad_page_fault() from do_page_fault()

2021-03-09 Thread Christophe Leroy
book3e/64 is the last one calling __bad_page_fault() from assembly. Save non volatile registers before calling do_page_fault() and modify do_page_fault() to call __bad_page_fault() for all platforms. Then it can be refactored by the call of bad_page_fault() which avoids the duplication of the exc

[PATCH v2 26/43] powerpc/32: Set regs parameter in r3 in transfer_to_handler

2021-03-09 Thread Christophe Leroy
All exception handlers take regs as first parameter. Instead of setting r3 just before each call to a handler, set it in transfer_to_handler. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 5 ++--- arch/powerpc/kernel/head_32.h| 2 -- arch/powerpc/kernel/he

[PATCH v2 25/43] powerpc/32: Replace ASM exception exit by C exception exit from ppc64

2021-03-09 Thread Christophe Leroy
This patch replaces the PPC32 ASM exception exit by C exception exit. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 481 +--- arch/powerpc/kernel/interrupt.c | 4 + 2 files changed, 132 insertions(+), 353 deletions(-) diff --git a/arch/power

[PATCH v2 24/43] powerpc/32: Always save non volatile registers on exception entry

2021-03-09 Thread Christophe Leroy
In preparation of handling exception entry and exit in C, in order to simplify the handling, always save non volatile registers when entering an exception. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ptrace.h | 6 ++ arch/powerpc/kernel/entry_32.S| 13 + arc

[PATCH v2 23/43] powerpc/32: Perform normal function call in exception entry

2021-03-09 Thread Christophe Leroy
Now that the MMU is re-enabled before calling the transfer function, we don't need anymore that hack with the address of the handler and the return function sitting just after the 'bl' to the transfer fonction, that function is retrieving via a read relative to 'lr'. Do a regular call to the trans

[PATCH v2 22/43] powerpc/32: Refactor booke critical registers saving

2021-03-09 Thread Christophe Leroy
Refactor booke critical registers saving into a few macros and move it into the exception prolog directly. Keep the dedicated transfert_to_handler entry point for the moment allthough they are empty. They will be removed in a later patch to reduce churn. Signed-off-by: Christophe Leroy --- arch

[PATCH v2 21/43] powerpc/32: Provide a name to exception prolog continuation in virtual mode

2021-03-09 Thread Christophe Leroy
Now that the prolog continuation is separated in .text, give it a name and mark it _ASM_NOKPROBE_SYMBOL. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.h| 12 +++- arch/powerpc/kernel/head_40x.S | 22 -- arch/powerpc/kernel/head_8xx.S

[PATCH v2 20/43] powerpc/32: Move exception prolog code into .text once MMU is back on

2021-03-09 Thread Christophe Leroy
The space in the head section is rather constrained by the fact that exception vectors are spread every 0x100 bytes and sometimes we need to have "out of line" code because it doesn't fit. Now that we are enabling MMU early in the prolog, take that opportunity to jump somewhere else in the .text s

[PATCH v2 19/43] powerpc/32: Use START_EXCEPTION() as much as possible

2021-03-09 Thread Christophe Leroy
Everywhere where it is possible, use START_EXCEPTION(). This will help for proper exception init in future patches. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_40x.S | 12 +-- arch/powerpc/kernel/head_8xx.S | 27 + arch/powerpc/kernel

[PATCH v2 18/43] powerpc/32: Add vmap_stack_overflow label inside the macro

2021-03-09 Thread Christophe Leroy
For consistency, add in the macro the label used by exception prolog to branch to stack overflow processing. While at it, enclose the macro in #ifdef CONFIG_VMAP_STACK on the 8xx as already done on book3s/32. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.h| 3 ++- arch

[PATCH v2 17/43] powerpc/32: Statically initialise first emergency context

2021-03-09 Thread Christophe Leroy
The check of the emergency context initialisation in vmap_stack_overflow is buggy for the SMP case, as it compares r1 with 0 while in the SMP case r1 is offseted by the CPU id. Instead of fixing it, just perform static initialisation of the first emergency context. Signed-off-by: Christophe Leroy

[PATCH v2 16/43] powerpc/32: Enable instruction translation at the same time as data translation

2021-03-09 Thread Christophe Leroy
On 40x and 8xx, kernel text is pinned. On book3s/32, kernel text is mapped by BATs. Enable instruction translation at the same time as data translation, it makes things simpler. In syscall handler, MSR_RI can also be set at the same time because srr0/srr1 are already saved and r1 is set properly.

[PATCH v2 15/43] powerpc/32: Tag DAR in EXCEPTION_PROLOG_2 for the 8xx

2021-03-09 Thread Christophe Leroy
8xx requires to tag the DAR with a magic value in order to fixup DAR on faults generated by 'dcbX', as the 8xx forgets to update the DAR for those faults. Do the tagging as early as possible, that is before enabling MMU. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.h | 6 ++

[PATCH v2 14/43] powerpc/32: Always enable data translation in exception prolog

2021-03-09 Thread Christophe Leroy
If the code can use a stack in vm area, it can also use a stack in linear space. Simplify code by removing old non VMAP stack code on PPC32. That means the data translation is now re-enabled early in exception prolog in all cases, not only when using VMAP stacks. While we are touching EXCEPTION_

[PATCH v2 13/43] powerpc/32: Remove ksp_limit

2021-03-09 Thread Christophe Leroy
ksp_limit is there to help detect stack overflows. That is specific to ppc32 as it was removed from ppc64 in commit cbc9565ee826 ("powerpc: Remove ksp_limit on ppc64"). There are other means for detecting stack overflows. As ppc64 has proven to not need it, ppc32 should be able to do without it t

[PATCH v2 12/43] powerpc/32: Use fast instruction to set MSR RI in exception prolog on 8xx

2021-03-09 Thread Christophe Leroy
8xx has registers SPRN_NRI, SPRN_EID and SPRN_EIE for changing MSR EE and RI. Use SPRN_EID in exception prolog to set RI. On an 8xx, it reduces the null_syscall test by 3 cycles. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.h | 2 ++ 1 file changed, 2 insertions(+) diff --g

[PATCH v2 11/43] powerpc/32: Handle bookE debugging in C in exception entry

2021-03-09 Thread Christophe Leroy
The handling of SPRN_DBCR0 and other registers can easily be done in C instead of ASM. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/interrupt.h | 2 ++ arch/powerpc/kernel/entry_32.S | 23 --- 2 files changed, 2 insertions(+), 23 deletions(-) diff --gi

[PATCH v2 09/43] powerpc/32: Reconcile interrupts in C

2021-03-09 Thread Christophe Leroy
There is no need for this to be in asm anymore, use the new interrupt entry wrapper. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/interrupt.h | 4 ++ arch/powerpc/kernel/entry_32.S | 58 2 files changed, 4 insertions(+), 58 deletions(-) diff -

[PATCH v2 10/43] powerpc/32: Entry cpu time accounting in C

2021-03-09 Thread Christophe Leroy
There is no need for this to be in asm, use the new interrupt entry wrapper. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/interrupt.h | 3 +++ arch/powerpc/include/asm/ppc_asm.h | 10 -- arch/powerpc/kernel/entry_32.S | 1 - 3 files changed, 3 insertions(+), 11

  1   2   >