Re: [PATCH] powerpc/pseries: add lparctl driver for platform-specific functions

2022-09-14 Thread Michal Suchánek
On Tue, Sep 13, 2022 at 12:02:42PM -0500, Nathan Lynch wrote: > Michal Suchánek writes: > > On Tue, Sep 13, 2022 at 10:59:56AM -0500, Nathan Lynch wrote: > >> Michal Suchánek writes: > >> > >> > On Fri, Aug 12, 2022 at 02:14:21PM -0500, Nathan Lynch wrote: > >> >> Laurent Dufour writes: > >> >>

[PATCH v2] hmm-tests: Fix migrate_dirty_page test

2022-09-14 Thread Alistair Popple
As noted by John Hubbard the original test relied on side effects of the implementation of migrate_vma_setup() to detect if pages had been swapped to disk or not. This is subject to change in future so explicitly check for swap entries via pagemap instead. Fix a spelling mistake while we're at it.

Re: Fragmented physical memory on powerpc/32

2022-09-14 Thread Mike Rapoport
On Tue, Sep 13, 2022 at 02:36:13PM +0200, Christophe Leroy wrote: > > > Le 13/09/2022 à 08:11, Christophe Leroy a écrit : > > > > > > Le 12/09/2022 à 23:16, Pali Rohár a écrit : > > > > > > > > My guess would be that something went wrong in the linear map > > > > setup, but it > > > > won't hu

Re: Fragmented physical memory on powerpc/32

2022-09-14 Thread Christophe Leroy
Le 14/09/2022 à 11:32, Mike Rapoport a écrit : > On Tue, Sep 13, 2022 at 02:36:13PM +0200, Christophe Leroy wrote: >> >> >> Le 13/09/2022 à 08:11, Christophe Leroy a écrit : >>> >>> >>> Le 12/09/2022 à 23:16, Pali Rohár a écrit : > > My guess would be that something went wrong in the line

Re: [PATCH] hmm-tests: Fix migrate_dirty_page test

2022-09-14 Thread David Hildenbrand
On 13.09.22 10:20, Alistair Popple wrote: David Hildenbrand writes: On 13.09.22 07:22, Alistair Popple wrote: As noted by John Hubbard the original test relied on side effects of the implementation of migrate_vma_setup() to detect if pages had been swapped to disk or not. This is subject to

Re: [RFC] Objtool toolchain proposal: -fannotate-{jump-table,noreturn}

2022-09-14 Thread Josh Poimboeuf
On Mon, Sep 12, 2022 at 06:31:14AM -0500, Segher Boessenkool wrote: > Hi! > > On Fri, Sep 09, 2022 at 11:07:04AM -0700, Josh Poimboeuf wrote: > > 2) Noreturn functions: > > > >There's no reliable way to determine which functions are designated > >by the compiler to be noreturn (either

Re: [RFC] Objtool toolchain proposal: -fannotate-{jump-table,noreturn}

2022-09-14 Thread Michael Matz
Hello, On Wed, 14 Sep 2022, Josh Poimboeuf wrote: > > >This information is needed because the > > >code after the call to such a function is optimized out as > > >unreachable and objtool has no way of knowing that. > > > > Since June we (GCC) have -funreachable-traps. This creates a

Re: [PATCH linux-next][RFC] powerpc: protect cpu offlining by RCU offline lock

2022-09-14 Thread Paul E. McKenney
On Wed, Sep 14, 2022 at 10:15:28AM +0800, Zhouyi Zhou wrote: > During the cpu offlining, the sub functions of xive_teardown_cpu will > call __lock_acquire when CONFIG_LOCKDEP=y. The latter function will > travel RCU protected list, so "WARNING: suspicious RCU usage" will be > triggered. > > Try to

Re: [RFC] Objtool toolchain proposal: -fannotate-{jump-table,noreturn}

2022-09-14 Thread Segher Boessenkool
On Wed, Sep 14, 2022 at 11:21:00AM +0100, Josh Poimboeuf wrote: > On Mon, Sep 12, 2022 at 06:31:14AM -0500, Segher Boessenkool wrote: > > On Fri, Sep 09, 2022 at 11:07:04AM -0700, Josh Poimboeuf wrote: > > > 2) Noreturn functions: > > > > > >There's no reliable way to determine which functi

Re: [PATCH 0/4] Remove unused macros from asm-offset

2022-09-14 Thread Disha Goel
On 9/13/22 1:45 PM, Christophe Leroy wrote: Le 13/09/2022 à 09:40, Disha Goel a écrit : There were commits which did code refactoring and converting some of kvm assembly routines to C. When doing it, many of the asm-offset macro definitions were missed to remove. Patchset here removes those.

Re: [RFC] Objtool toolchain proposal: -fannotate-{jump-table,noreturn}

2022-09-14 Thread Peter Zijlstra
On Wed, Sep 14, 2022 at 01:04:16AM +0100, Josh Poimboeuf wrote: > > I will mention that objtool's existence is based on mistrust, of persons > > (not correctly annotating stuff) and of tools (not correctly heeding those > > annotations). The mistrust in persons is understandable and can be deal

Re: [PATCH linux-next][RFC] powerpc: protect cpu offlining by RCU offline lock

2022-09-14 Thread Zhouyi Zhou
On Wed, Sep 14, 2022 at 8:17 PM Paul E. McKenney wrote: > > On Wed, Sep 14, 2022 at 10:15:28AM +0800, Zhouyi Zhou wrote: > > During the cpu offlining, the sub functions of xive_teardown_cpu will > > call __lock_acquire when CONFIG_LOCKDEP=y. The latter function will > > travel RCU protected list,

Re: [RFC] Objtool toolchain proposal: -fannotate-{jump-table,noreturn}

2022-09-14 Thread Michael Matz
Hello, On Wed, 14 Sep 2022, Peter Zijlstra wrote: > > Maybe this is semantics, but I wouldn't characterize objtool's existence > > as being based on the mistrust of tools. It's main motivation is to > > fill in the toolchain's blind spots in asm and inline-asm, which exist > > by design. > > Th

Re: [RFC] Objtool toolchain proposal: -fannotate-{jump-table,noreturn}

2022-09-14 Thread Peter Zijlstra
On Wed, Sep 14, 2022 at 02:28:26PM +, Michael Matz wrote: > Hello, > > On Wed, 14 Sep 2022, Peter Zijlstra wrote: > > > > Maybe this is semantics, but I wouldn't characterize objtool's existence > > > as being based on the mistrust of tools. It's main motivation is to > > > fill in the toolc

[PATCH 0/7] powerpc: build / linker improvements

2022-09-14 Thread Nicholas Piggin
This series is mainly about moving more things out of writable and executable memory, and slightly moving the linker script in the direction of the binutils ld internal linker script as we do. Thanks, Nick Nicholas Piggin (7): powerpc/build: put sys_call_table in .data.rel.ro if RELOCATABLE p

[PATCH 1/7] powerpc/build: put sys_call_table in .data.rel.ro if RELOCATABLE

2022-09-14 Thread Nicholas Piggin
Const function pointers live in .data.rel.ro rather than .rodata because they must be relocated. This change prevents powerpc/32 from generating R_PPC_UADDR32 relocations (which are not handled). The sys_call_table is moved to writeable memory, but a later change will move it back. After this patc

[PATCH 2/7] powerpc: move __end_rodata to cover arch read-only sections

2022-09-14 Thread Nicholas Piggin
powerpc has a number of read-only sections and tables that are put after RO_DATA(). Move the __end_rodata symbol to cover these as well. Setting memory to read-only at boot is done using __init_begin, change that that to use __end_rodata. This also affects boot dmesg, is_kernel_rodata(), and some

[PATCH 3/7] powerpc/32/build: move got1/got2 sections out of text

2022-09-14 Thread Nicholas Piggin
Following the example from the binutils default linker script, move .got1 and .got2 out of .text, to just after RO_DATA where they are in read-only NX memory. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/vmlinux.lds.S | 21 +++-- 1 file changed, 11 insertions(+), 10 del

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

2022-09-14 Thread Nicholas Piggin
This moves linker related tables from .data to read-only area. Relocations are performed at early boot time before memory is protected, after which there should be no modifications required. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/vmlinux.lds.S | 42 ---

[PATCH 5/7] powerpc/build: move .data.rel.ro, .sdata2 to read-only

2022-09-14 Thread Nicholas Piggin
.sdata2 is a readonly small data section for ppc32, and .data.rel.ro is data that needs relocating but is read-only after that so these can both be moved to the read only memory region. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/vmlinux.lds.S | 20 1 file changed

[PATCH 6/7] powerpc/64/build: only include .opd with ELFv1

2022-09-14 Thread Nicholas Piggin
ELFv2 does not use function descriptors so .opd is not required. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/vmlinux.lds.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 44050863032e..404944263db8 1006

[PATCH 7/7] powerpc/64/build: merge .got and .toc input sections

2022-09-14 Thread Nicholas Piggin
Follow the binutils ld internal linker script and merge .got and .toc input sections in the .got output section. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/vmlinux.lds.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/po

Re: Fragmented physical memory on powerpc/32

2022-09-14 Thread Mike Rapoport
On September 14, 2022 10:43:52 AM GMT+01:00, Christophe Leroy wrote: > > >Le 14/09/2022 à 11:32, Mike Rapoport a écrit : >> On Tue, Sep 13, 2022 at 02:36:13PM +0200, Christophe Leroy wrote: >>> >>> >>> Le 13/09/2022 à 08:11, Christophe Leroy a écrit : Le 12/09/2022 à 23:16, Pali

Re: [PATCH 8/9] powerpc/ps3: remove orphan declarations from ps3av.h

2022-09-14 Thread Geoff Levand
Hi Gaosheng, On 9/13/22 00:50, Gaosheng Cui wrote: > Remove the following orphan declarations from ps3av.h: > 1. ps3av_dev_open() > 2. ps3av_dev_close() > > They have been removed since commit 13a5e30cf740 ("[POWERPC] PS3: > Rework AV settings driver"), so remove them. I did a test build with th

Re: [RFC] Objtool toolchain proposal: -fannotate-{jump-table,noreturn}

2022-09-14 Thread Segher Boessenkool
On Wed, Sep 14, 2022 at 04:55:27PM +0200, Peter Zijlstra wrote: > On Wed, Sep 14, 2022 at 02:28:26PM +, Michael Matz wrote: > > Don't mix DWARF debug info with DWARF-based unwinding info, the latter > > doesn't imply the former. Out of interest: how does ORC get around the > > need for CFI a

Re: Fragmented physical memory on powerpc/32

2022-09-14 Thread Pali Rohár
On Wednesday 14 September 2022 16:55:04 Mike Rapoport wrote: > On September 14, 2022 10:43:52 AM GMT+01:00, Christophe Leroy > wrote: > > > > > >Le 14/09/2022 à 11:32, Mike Rapoport a écrit : > >> On Tue, Sep 13, 2022 at 02:36:13PM +0200, Christophe Leroy wrote: > >>> > >>> > >>> Le 13/09/2022 à

Re: [PATCH v4 03/20] powerpc/32: Remove powerpc select specialisation

2022-09-14 Thread Rohan McLure
> On 12 Sep 2022, at 7:03 pm, Nicholas Piggin wrote: > > On Wed Aug 24, 2022 at 12:05 PM AEST, Rohan McLure wrote: >> Syscall #82 has been implemented for 32-bit platforms in a unique way on >> powerpc systems. This hack will in effect guess whether the caller is >> expecting new select semant

Re: [PATCH v4 06/20] powerpc: Remove direct call to mmap2 syscall handlers

2022-09-14 Thread Rohan McLure
> On 12 Sep 2022, at 7:47 pm, Nicholas Piggin wrote: > > On Wed Aug 24, 2022 at 12:05 PM AEST, Rohan McLure wrote: >> Syscall handlers should not be invoked internally by their symbol names, >> as these symbols defined by the architecture-defined SYSCALL_DEFINE >> macro. Move the compatibility

Re: [PATCH v4 10/20] powerpc: Use common syscall handler type

2022-09-14 Thread Rohan McLure
> On 12 Sep 2022, at 8:56 pm, Nicholas Piggin wrote: > > On Wed Aug 24, 2022 at 12:05 PM AEST, Rohan McLure wrote: >> Cause syscall handlers to be typed as follows when called indirectly >> throughout the kernel. >> >> typedef long (*syscall_fn)(unsigned long, unsigned long, unsigned long, >>

Re: [PATCH v4 11/20] powerpc: Add ZEROIZE_GPRS macros for register clears

2022-09-14 Thread Rohan McLure
> On 12 Sep 2022, at 9:09 pm, Nicholas Piggin wrote: > > On Wed Aug 24, 2022 at 12:05 PM AEST, Rohan McLure wrote: >> Macros for restoring and saving registers to and from the stack exist. >> Provide macros with the same interface for clearing a range of gprs by >> setting each register's valu

Re: [PATCH 2/7] powerpc: move __end_rodata to cover arch read-only sections

2022-09-14 Thread Christophe Leroy
Le 14/09/2022 à 17:47, Nicholas Piggin a écrit : > powerpc has a number of read-only sections and tables that are put > after RO_DATA(). Move the __end_rodata symbol to cover these as well. > > Setting memory to read-only at boot is done using __init_begin, > change that that to use __end_rodata

Re: [PATCH 1/7] powerpc/build: put sys_call_table in .data.rel.ro if RELOCATABLE

2022-09-14 Thread Christophe Leroy
Le 14/09/2022 à 17:47, Nicholas Piggin a écrit : > Const function pointers live in .data.rel.ro rather than .rodata because > they must be relocated. This change prevents powerpc/32 from generating > R_PPC_UADDR32 relocations (which are not handled). The sys_call_table is > moved to writeable mem

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

2022-09-14 Thread Anshuman Khandual
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 >>> >>> on x86, batched and deferred tlb shootdown has lead to 90% >>> performance increase on tlb shootdown. on arm64, HW can do

Re: [PATCH -next] net: fs_enet: Fix wrong check in do_pd_setup

2022-09-14 Thread Christophe Leroy
Le 08/09/2022 à 15:55, Zheng Yongjun a écrit : > [Vous ne recevez pas souvent de courriers de zhengyongj...@huawei.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > Should check of_iomap return value 'fep->fec.fecp' instead of 'fep->fcc.fccp'

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

2022-09-14 Thread Barry Song
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 > >>> > >>> on x86, batched and deferred tlb shootdo

Re: [PATCH v4 19/20] powerpc/64s: Clear gprs on interrupt routine entry in Book3S

2022-09-14 Thread Rohan McLure
> On 12 Sep 2022, at 10:15 pm, Nicholas Piggin wrote: > > On Wed Aug 24, 2022 at 12:05 PM AEST, Rohan McLure wrote: >> Zero GPRS r0, r2-r11, r14-r31, on entry into the kernel for all >> other interrupt sources to limit influence of user-space values >> in potential speculation gadgets. The rem

Re: [PATCH v3 11/16] objtool: Add --mnop as an option to --mcount

2022-09-14 Thread Naveen N. Rao
kernel test robot wrote: Hi Sathvika, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/topic/ppc-kvm] [also build test ERROR on linus/master v6.0-rc5] [cannot apply to powerpc/next masahiroy-kbuild/for-next next-20220912] [If your patch is applied to the wron