Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-28 Thread Andrew Donnellan
On Mon, 2022-11-28 at 18:08 -0600, Nathan Lynch wrote: > Andrew Donnellan writes: > > On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: > > > Convert rtas_token() to use a lockless binary search on the > > > function > > > table. Fall back to the old behavior for lookups against names > > >

Re: [PATCH 13/13] powerpc/rtas: place tracepoints in do_enter_rtas()

2022-11-28 Thread Nicholas Piggin
On Tue Nov 29, 2022 at 9:44 AM AEST, Nathan Lynch wrote: > "Nicholas Piggin" writes: > > > On Sat Nov 19, 2022 at 1:07 AM AEST, Nathan Lynch wrote: > >> Call the just-added rtas tracepoints in do_enter_rtas(), taking care > >> to avoid function name lookups in the CPU offline path. > >> > >>

Re: [PATCH 03/13] powerpc/rtas: avoid device tree lookups in rtas_os_term()

2022-11-28 Thread Nicholas Piggin
On Tue Nov 29, 2022 at 4:26 AM AEST, Nathan Lynch wrote: > "Nicholas Piggin" writes: > > On Sat Nov 19, 2022 at 1:07 AM AEST, Nathan Lynch wrote: > >> rtas_os_term() is called during panic. Its behavior depends on a > >> couple of conditions in the /rtas node of the device tree, the > >>

Re: [PATCH] driver core: fix up some missing class.devnode() conversions.

2022-11-28 Thread Christophe Leroy
Le 28/11/2022 à 18:35, Greg Kroah-Hartman a écrit : > In commit ff62b8e6588f ("driver core: make struct class.devnode() take a > const *") the ->devnode callback changed the pointer to be const, but a > few instances of PowerPC drivers were not caught for some reason. > > Fix this up by

[PATCH v4 7/7] powerpc/64: Sanitise user registers on interrupt in pseries, POWERNV

2022-11-28 Thread Rohan McLure
Cause pseries and POWERNV platforms to default to zeroising all potentially user-defined registers when entering the kernel by means of any interrupt source, reducing user-influence of the kernel and the likelihood or producing speculation gadgets. Signed-off-by: Rohan McLure --- Resubmitting

[PATCH v4 6/7] powerpc/64e: Clear gprs on interrupt routine entry on Book3E

2022-11-28 Thread Rohan McLure
Zero GPRS r14-r31 on entry into the kernel for interrupt sources to limit influence of user-space values in potential speculation gadgets. Prior to this commit, all other GPRS are reassigned during the common prologue to interrupt handlers and so need not be zeroised explicitly. This may be done

[PATCH v4 5/7] powerpc/64s: Zeroise gprs on interrupt routine entry on Book3S

2022-11-28 Thread Rohan McLure
Zeroise user state in gprs (assign to zero) to reduce the influence of user registers on speculation within kernel syscall handlers. Clears occur at the very beginning of the sc and scv 0 interrupt handlers, with restores occurring following the execution of the syscall handler. Zeroise GPRS r0,

[PATCH v4 4/7] powerpc/64s: IOption for MSR stored in r12

2022-11-28 Thread Rohan McLure
Interrupt handlers in asm/exceptions-64s.S contain a great deal of common code produced by the GEN_COMMON macros. Currently, at the exit point of the macro, r12 will contain the contents of the MSR. A future patch will cause these macros to zeroise architected registers to avoid potential

[PATCH v4 3/7] powerpc/64: Sanitise common exit code for interrupts

2022-11-28 Thread Rohan McLure
Interrupt code is shared between Book3E/S 64-bit systems for interrupt handlers. Ensure that exit code correctly restores non-volatile gprs on each system when CONFIG_INTERRUPT_SANITIZE_REGISTERS is enabled. Also introduce macros for clearing/restoring registers on interrupt entry for when this

[PATCH v4 1/7] powerpc/64: Add INTERRUPT_SANITIZE_REGISTERS Kconfig

2022-11-28 Thread Rohan McLure
Add Kconfig option for enabling clearing of registers on arrival in an interrupt handler. This reduces the speculation influence of registers on kernel internals. The option will be consumed by 64-bit systems that feature speculation and wish to implement this mitigation. This patch only

[PATCH v4 2/7] powerpc/64: Add interrupt register sanitisation macros

2022-11-28 Thread Rohan McLure
Include in asm/ppc_asm.h macros to be used in multiple successive patches to implement zeroising architected registers in interrupt handlers. Registers will be sanitised in this fashion in future patches to reduce the speculation influence of user-controlled register values. These mitigations will

Re: [PATCH 1/3] firmware_loader: remove #include

2022-11-28 Thread Russ Weight
On 11/25/22 21:09, Thomas Weißschuh wrote: > utsrelease.h is potentially generated on each build. > By removing this unused include we can get rid of some spurious > recompilations. Reviewed-by: Russ Weight > Signed-off-by: Thomas Weißschuh > --- > drivers/base/firmware_loader/firmware.h | 2

Re: [PATCH v6 0/4] Option to build big-endian with ELFv2 ABI

2022-11-28 Thread Joel Stanley
On Mon, 28 Nov 2022 at 04:16, Nicholas Piggin wrote: > > This is hopefully the final attempt. Luis was happy for the module > patch to go via the powerpc tree, so I've put the the ELFv2 for big > endian build patches into the series. Hopefully we can deprecate > the ELFv1 ABI > > Since v5, I

Re: [PATCH v6] livepatch: Clear relocation targets on a module removal

2022-11-28 Thread Song Liu
On Fri, Nov 18, 2022 at 8:24 AM Petr Mladek wrote: > [...] > > > > +#ifdef CONFIG_LIVEPATCH > > +void clear_relocate_add(Elf64_Shdr *sechdrs, > > +const char *strtab, > > +unsigned int symindex, > > +unsigned int relsec, > > +

[PATCH] soc: fsl: qe: Fix refcount leak in par_io_of_config

2022-11-28 Thread Zheng Yongjun
of_parse_phandle() returns a node pointer with refcount incremented, we should use of_node_put() on error path. Add missing of_node_put() to avoid refcount leak. Fixes: 986585385131 ("[POWERPC] Add QUICC Engine (QE) infrastructure") Signed-off-by: Zheng Yongjun --- drivers/soc/fsl/qe/qe_io.c |

Re: [PATCH] powerpc: dts: turris1x.dts: Add channel labels for temperature sensor

2022-11-28 Thread Michael Ellerman
Pali Rohár writes: > Michael, could you take this patch? Yep. With these dts patches it always helps if you tell me that it passes the DT schema checks, so that I don't get yelled at by the DT people :) cheers > On Sunday 09 October 2022 14:05:06 Pali Rohár wrote: >> On Friday 30 September

Re: [PATCH 13/13] powerpc/rtas: place tracepoints in do_enter_rtas()

2022-11-28 Thread Michael Ellerman
Nathan Lynch writes: > "Nicholas Piggin" writes: >> On Sat Nov 19, 2022 at 1:07 AM AEST, Nathan Lynch wrote: >>> Call the just-added rtas tracepoints in do_enter_rtas(), taking care >>> to avoid function name lookups in the CPU offline path. >>> >>> Signed-off-by: Nathan Lynch >>> --- >>>

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-28 Thread Nathan Lynch
Andrew Donnellan writes: > On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: >> Convert rtas_token() to use a lockless binary search on the function >> table. Fall back to the old behavior for lookups against names that >> are not known to be RTAS functions, but issue a warning. rtas_token()

Re: [PATCH 13/13] powerpc/rtas: place tracepoints in do_enter_rtas()

2022-11-28 Thread Nathan Lynch
"Nicholas Piggin" writes: > On Sat Nov 19, 2022 at 1:07 AM AEST, Nathan Lynch wrote: >> Call the just-added rtas tracepoints in do_enter_rtas(), taking care >> to avoid function name lookups in the CPU offline path. >> >> Signed-off-by: Nathan Lynch >> --- >> arch/powerpc/kernel/rtas.c | 23

Re: [PATCH mm-unstable v1 16/20] mm/frame-vector: remove FOLL_FORCE usage

2022-11-28 Thread Andrew Morton
On Mon, 28 Nov 2022 09:18:47 +0100 David Hildenbrand wrote: > > Less chances of things going wrong that way. > > > > Just mention in the v2 cover letter that the first patch was added to > > make it easy to backport that fix without being hampered by merge > > conflicts if it was added after

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-28 Thread Nathan Lynch
Nick Child writes: > On 11/18/22 09:07, Nathan Lynch wrote: >> +static int __init rtas_token_to_function_xarray_init(void) >> +{ >> +int err = 0; >> + >> +for (size_t i = 0; i < ARRAY_SIZE(rtas_function_table); ++i) { >> +const struct rtas_function *func = _function_table[i];

Re: [PATCH 10/13] powerpc/rtas: improve function information lookups

2022-11-28 Thread Nathan Lynch
Andrew Donnellan writes: > On Wed, 2022-11-23 at 13:32 -0600, Nick Child wrote: >> On 11/22/22 20:51, Andrew Donnellan wrote: >> > On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: >> > > +enum rtas_function_flags { >> > > +   RTAS_FN_FLAG_BANNED_FOR_SYSCALL_ON_LE = (1 << 0), >> > > +};

Re: [PATCH 05/13] powerpc/pseries/eeh: use correct API for error log size

2022-11-28 Thread Nathan Lynch
Andrew Donnellan writes: > On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: >> rtas-error-log-max is not the name of an RTAS function, so >> rtas_token() is not the appropriate API for retrieving its value. We >> already have rtas_get_error_log_max() which returns a sensible value >> if the

Re: [PATCH 03/13] powerpc/rtas: avoid device tree lookups in rtas_os_term()

2022-11-28 Thread Nathan Lynch
"Nicholas Piggin" writes: > On Sat Nov 19, 2022 at 1:07 AM AEST, Nathan Lynch wrote: >> rtas_os_term() is called during panic. Its behavior depends on a >> couple of conditions in the /rtas node of the device tree, the >> traversal of which entails locking and local IRQ state changes. If the >>

Re: [PATCH 03/13] powerpc/rtas: avoid device tree lookups in rtas_os_term()

2022-11-28 Thread Nathan Lynch
Andrew Donnellan writes: >> diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c >> index c12dd5ed5e00..81e4996012b7 100644 >> --- a/arch/powerpc/kernel/rtas.c >> +++ b/arch/powerpc/kernel/rtas.c >> @@ -947,6 +947,8 @@ void __noreturn rtas_halt(void) >>   >>  /* Must be in the RMO

[PATCH] driver core: fix up some missing class.devnode() conversions.

2022-11-28 Thread Greg Kroah-Hartman
In commit ff62b8e6588f ("driver core: make struct class.devnode() take a const *") the ->devnode callback changed the pointer to be const, but a few instances of PowerPC drivers were not caught for some reason. Fix this up by changing the pointers to be const. Reported-by: Stephen Rothwell Cc:

[linux-next:master] BUILD REGRESSION 15f2f20ccbf2d04cb14e3e7635aa0447208c71e7

2022-11-28 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master branch HEAD: 15f2f20ccbf2d04cb14e3e7635aa0447208c71e7 Add linux-next specific files for 20221128 Error/Warning reports: https://lore.kernel.org/oe-kbuild-all/202211041320.coq8eelj-...@intel.com https

Re: [PATCH linux-next][RFC]torture: avoid offline tick_do_timer_cpu

2022-11-28 Thread Paul E. McKenney
On Mon, Nov 28, 2022 at 09:12:28AM +0100, Thomas Gleixner wrote: > On Sun, Nov 27 2022 at 09:53, Paul E. McKenney wrote: > > On Sun, Nov 27, 2022 at 01:40:28PM +0100, Thomas Gleixner wrote: > >> There are quite some reasons why a CPU-hotplug or a hot-unplug operation > >> can fail, which is not a

Re: [PATCH mm-unstable v1 16/20] mm/frame-vector: remove FOLL_FORCE usage

2022-11-28 Thread Tomasz Figa
On Mon, Nov 28, 2022 at 5:19 PM David Hildenbrand wrote: > > On 28.11.22 09:17, Hans Verkuil wrote: > > Hi David, > > > > On 27/11/2022 11:35, David Hildenbrand wrote: > >> On 16.11.22 11:26, David Hildenbrand wrote: > >>> FOLL_FORCE is really only for ptrace access. According to commit > >>>

Re: [PATCH mm-unstable v1 16/20] mm/frame-vector: remove FOLL_FORCE usage

2022-11-28 Thread Hans Verkuil
On 28/11/2022 09:18, David Hildenbrand wrote: > On 28.11.22 09:17, Hans Verkuil wrote: >> Hi David, >> >> On 27/11/2022 11:35, David Hildenbrand wrote: >>> On 16.11.22 11:26, David Hildenbrand wrote: FOLL_FORCE is really only for ptrace access. According to commit 707947247e95 ("media:

Re: [PATCH mm-unstable v1 16/20] mm/frame-vector: remove FOLL_FORCE usage

2022-11-28 Thread David Hildenbrand
On 28.11.22 09:17, Hans Verkuil wrote: Hi David, On 27/11/2022 11:35, David Hildenbrand wrote: On 16.11.22 11:26, David Hildenbrand wrote: FOLL_FORCE is really only for ptrace access. According to commit 707947247e95 ("media: videobuf2-vmalloc: get_userptr: buffers are always writable"),

Re: [PATCH mm-unstable v1 16/20] mm/frame-vector: remove FOLL_FORCE usage

2022-11-28 Thread Hans Verkuil
Hi David, On 27/11/2022 11:35, David Hildenbrand wrote: > On 16.11.22 11:26, David Hildenbrand wrote: >> FOLL_FORCE is really only for ptrace access. According to commit >> 707947247e95 ("media: videobuf2-vmalloc: get_userptr: buffers are always >> writable"), get_vaddr_frames() currently pins

Re: [PATCH linux-next][RFC]torture: avoid offline tick_do_timer_cpu

2022-11-28 Thread Thomas Gleixner
On Sun, Nov 27 2022 at 09:53, Paul E. McKenney wrote: > On Sun, Nov 27, 2022 at 01:40:28PM +0100, Thomas Gleixner wrote: >> There are quite some reasons why a CPU-hotplug or a hot-unplug operation >> can fail, which is not a fatal problem, really. >> >> So if a CPU hotplug operation fails, then