Re: [PATCH 1/6] powerpc/code-patching: Implement generic text patching function

2022-09-19 Thread Christophe Leroy
Le 20/09/2022 à 04:32, Benjamin Gray a écrit : > On Mon, 2022-09-19 at 07:16 +, Christophe Leroy wrote: >> Why would it be unpredictable ? Only one page is mapped. If it >> crosses >> the boundary, __put_kernel_nofault() will fail in a controled manner. >> I see no point in doing the check

Re: [PATCH 4/6] static_call: Move static call selftest to static_call_selftest.c

2022-09-19 Thread Andrew Donnellan
On Fri, 2022-09-16 at 16:23 +1000, Benjamin Gray wrote: > These tests are out-of-line only, so moving them to the > their own file allows them to be run when an arch does > not implement inline static calls. > > Signed-off-by: Benjamin Gray This looks very sensible. Reviewed-by: Andrew

Re: [PATCH] Revert "powerpc/rtas: Implement reentrant rtas call"

2022-09-19 Thread Nicholas Piggin
On Mon Sep 19, 2022 at 11:51 PM AEST, Nathan Lynch wrote: > Nathan Lynch writes: > > "Nicholas Piggin" writes: > >> On Wed Sep 14, 2022 at 3:39 AM AEST, Leonardo Brás wrote: > >>> On Mon, 2022-09-12 at 14:58 -0500, Nathan Lynch wrote: > >>> > Leonardo Brás writes: > >>> > > On Fri, 2022-09-09

Re: [PACTH v2] powerpc/pseries/mce: Avoid instrumentation in realmode

2022-09-19 Thread Nicholas Piggin
On Mon Sep 19, 2022 at 4:03 PM AEST, Ganesh wrote: > On 9/7/22 09:49, Nicholas Piggin wrote: > > > On Mon Sep 5, 2022 at 4:38 PM AEST, Ganesh Goudar wrote: > >> Part of machine check error handling is done in realmode, > >> As of now instrumentation is not possible for any code that > >> runs in

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

2022-09-19 Thread Barry Song
On Tue, Sep 20, 2022 at 3:00 PM Anshuman Khandual wrote: > > > On 8/22/22 13:51, Yicong Yang wrote: > > +static inline bool arch_tlbbatch_should_defer(struct mm_struct *mm) > > +{ > > + return true; > > +} > > This needs to be conditional on systems, where there will be performance >

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

2022-09-19 Thread Anshuman Khandual
On 8/22/22 13:51, Yicong Yang wrote: > +static inline bool arch_tlbbatch_should_defer(struct mm_struct *mm) > +{ > + return true; > +} This needs to be conditional on systems, where there will be performance improvements, and should not just be enabled all the time on all systems.

Re: [PATCH v2 25/44] printk: Remove trace_.*_rcuidle() usage

2022-09-19 Thread Sergey Senozhatsky
On (22/09/19 12:00), Peter Zijlstra wrote: > The problem, per commit fc98c3c8c9dc ("printk: use rcuidle console > tracepoint"), was printk usage from the cpuidle path where RCU was > already disabled. > > Per the patches earlier in this series, this is no longer the case. > > Signed-off-by:

Re: [PATCH 1/6] powerpc/code-patching: Implement generic text patching function

2022-09-19 Thread Benjamin Gray
On Mon, 2022-09-19 at 07:16 +, Christophe Leroy wrote: > Why would it be unpredictable ? Only one page is mapped. If it > crosses > the boundary, __put_kernel_nofault() will fail in a controled manner. > I see no point in doing the check before every write. Oh I didn't see that get_vm_area

Re: [PATCH 22/23] powerpc/64s: Clear gprs on interrupt routine entry in Book3S

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 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 remaining gprs are overwritten by > entry macros to interrupt

Re: [PATCH 21/23] powerpc/64: Add INTERRUPT_SANITIZE_REGISTERS Kconfig

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > 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

Re: [PATCH 20/23] powerpc/64s: Clear/restore caller gprs in syscall interrupt/return

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > Clear 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

Re: [PATCH 20/23] powerpc/64s: Clear/restore caller gprs in syscall interrupt/return

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > Clear 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

Re: [PATCH 19/23] powerpc: Provide syscall wrapper

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > Implement syscall wrapper as per s390, x86, arm64. When enabled > cause handlers to accept parameters from a stack frame rather than > from user scratch register state. This allows for user registers to be > safely cleared in order to

Re: [PATCH 1/6] powerpc/code-patching: Implement generic text patching function

2022-09-19 Thread Benjamin Gray
On Mon, 2022-09-19 at 06:38 +, Christophe Leroy wrote: > Le 16/09/2022 à 08:23, Benjamin Gray a écrit : > > [...] > > +   /* Make sure we aren't patching a freed init section */ > > +   if (static_branch_likely(_mem_is_free) && > > init_section_contains(dest, 4)) > > +   

Re: [PATCH 18/23] powerpc: Use common syscall handler type

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > Cause syscall handlers to be typed as follows when called indirectly > throughout the kernel. This is to allow for better type checking. > > typedef long (*syscall_fn)(unsigned long, unsigned long, unsigned long, >

Re: [PATCH 17/23] powerpc: Enable compile-time check for syscall handlers

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > The table of syscall handlers and registered compatibility syscall > handlers has in past been produced using assembly, with function > references resolved at link time. This moves link-time errors to > compile-time, by rewriting systbl.S

Re: [PATCH 16/23] powerpc: Include all arch-specific syscall prototypes

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > Forward declare all syscall handler prototypes where a generic prototype > is not provided in either linux/syscalls.h or linux/compat.h in > asm/syscalls.h. This is required for compile-time type-checking for > syscall handlers, which is

Re: [PATCH 15/23] powerpc: Adopt SYSCALL_DEFINE for arch-specific syscall handlers

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > Arch-specific implementations of syscall handlers are currently used > over generic implementations for the following reasons: > > 1. Semantics unique to powerpc > 2. Compatibility syscalls require 'argument padding' to comply with >

Re: [PATCH 09/23] asm-generic: compat: Support BE for long long args in 32-bit ABIs

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > 32-bit ABIs support passing 64-bit integers by registers via argument > translation. Commit 59c10c52f573 ("riscv: compat: syscall: Add > compat_sys_call_table implementation") implements the compat_arg_u64 > macro for efficiently defining

Re: [PATCH 08/23] powerpc: Fix fallocate and fadvise64_64 compat parameter combination

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > As reported[1] by Arnd, the arch-specific fadvise64_64 and fallocate > compatibility handlers assume parameters are passed with 32-bit > big-endian ABI. This affects the assignment of odd-even parameter pairs > to the high or low words of

Re: [PATCH 07/23] powerpc/64s: Fix comment on interrupt handler prologue

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > Interrupt handlers on 64s systems will often need to save register state > from the interrupted process to make space for loading special purpose > registers or for internal state. > > Fix a comment documenting a common code path macro in

Re: [PATCH 06/23] powerpc/64e: Clarify register saves and clears with {SAVE,ZEROIZE}_GPRS

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > The common interrupt handler prologue macro and the bad_stack > trampolines include consecutive sequences of register saves, and some > register clears. Neaten such instances by expanding use of the SAVE_GPRS > macro and employing the

Re: [PATCH 05/23] powerpc/32: Clarify interrupt restores with REST_GPR macro in entry_32.S

2022-09-19 Thread Nicholas Piggin
On Fri Sep 16, 2022 at 3:32 PM AEST, Rohan McLure wrote: > Restoring the register state of the interrupted thread involves issuing > a large number of predictable loads to the kernel stack frame. Issue the > REST_GPR{,S} macros to clearly signal when this is happening, and bunch > together

Re: [PATCH v2 0/2] Fix console probe delay when stdout-path isn't set

2022-09-19 Thread Olof Johansson
On Mon, Sep 19, 2022 at 1:44 AM Greg Kroah-Hartman wrote: > > On Sun, Sep 18, 2022 at 08:44:27PM -0700, Olof Johansson wrote: > > On Tue, Aug 23, 2022 at 8:37 AM Greg Kroah-Hartman > > wrote: > > > > > > On Thu, Jun 30, 2022 at 06:26:38PM -0700, Saravana Kannan wrote: > > > > These patches are

Re: [PATCH] Revert "powerpc/rtas: Implement reentrant rtas call"

2022-09-19 Thread Michael Ellerman
Nathan Lynch writes: > Nathan Lynch writes: >> "Nicholas Piggin" writes: >>> On Wed Sep 14, 2022 at 3:39 AM AEST, Leonardo Brás wrote: On Mon, 2022-09-12 at 14:58 -0500, Nathan Lynch wrote: > Leonardo Brás writes: > > On Fri, 2022-09-09 at 09:04 -0500, Nathan Lynch wrote: >

RE: [PATCH] powerpc/83xx: update kmeter1 defconfig and dts

2022-09-19 Thread Michael Ellerman
Holger Brunck writes: >> > Le 16/12/2019 à 10:50, Holger Brunck a écrit : >> >> From: Matteo Ghidoni >> >> >> >> The defconfig is synchronized and the missing MTD_PHYSMAP, >> DEVTMPFS >> >> and I2C MUX support are switched on. >> >> >> >> Additionally the I2C mux device is added to the DTS with

Re: [PATCH v2 00/44] cpuidle,rcu: Clean up the mess

2022-09-19 Thread Rafael J. Wysocki
On Mon, Sep 19, 2022 at 12:17 PM Peter Zijlstra wrote: > > Hi All! > > At long last, a respin of the cpuidle vs rcu cleanup patches. > > v1: https://lkml.kernel.org/r/20220608142723.103523...@infradead.org > > These here patches clean up the mess that is cpuidle vs rcuidle. > > At the end of the

Re: [PATCH v2 09/44] cpuidle,omap3: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
On Mon, Sep 19, 2022 at 04:31:42PM +0200, Frederic Weisbecker wrote: > On Mon, Sep 19, 2022 at 11:59:48AM +0200, Peter Zijlstra wrote: > > Doing RCU-idle outside the driver, only to then teporarily enable it > > again before going idle is daft. > > That doesn't tell where those calls are.

Re: [PATCH v2 08/44] cpuidle,imx6: Push RCU-idle into driver

2022-09-19 Thread Frederic Weisbecker
On Mon, Sep 19, 2022 at 05:03:04PM +0200, Peter Zijlstra wrote: > On Mon, Sep 19, 2022 at 04:49:41PM +0200, Frederic Weisbecker wrote: > > On Mon, Sep 19, 2022 at 11:59:47AM +0200, Peter Zijlstra wrote: > > > Doing RCU-idle outside the driver, only to then temporarily enable it > > > again, at

Re: [PATCH v2 08/44] cpuidle,imx6: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
On Mon, Sep 19, 2022 at 04:49:41PM +0200, Frederic Weisbecker wrote: > On Mon, Sep 19, 2022 at 11:59:47AM +0200, Peter Zijlstra wrote: > > Doing RCU-idle outside the driver, only to then temporarily enable it > > again, at least twice, before going idle is daft. > > > > Signed-off-by: Peter

Re: [PATCH v2 08/44] cpuidle,imx6: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
On Mon, Sep 19, 2022 at 04:49:41PM +0200, Frederic Weisbecker wrote: > On Mon, Sep 19, 2022 at 11:59:47AM +0200, Peter Zijlstra wrote: > > Doing RCU-idle outside the driver, only to then temporarily enable it > > again, at least twice, before going idle is daft. > > > > Signed-off-by: Peter

Re: [PATCH v2 08/44] cpuidle,imx6: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
On Mon, Sep 19, 2022 at 04:21:23PM +0200, Frederic Weisbecker wrote: > On Mon, Sep 19, 2022 at 11:59:47AM +0200, Peter Zijlstra wrote: > > Doing RCU-idle outside the driver, only to then temporarily enable it > > again, at least twice, before going idle is daft. > > Hmm, what ends up calling

Re: [PATCH v2 08/44] cpuidle,imx6: Push RCU-idle into driver

2022-09-19 Thread Frederic Weisbecker
On Mon, Sep 19, 2022 at 11:59:47AM +0200, Peter Zijlstra wrote: > Doing RCU-idle outside the driver, only to then temporarily enable it > again, at least twice, before going idle is daft. > > Signed-off-by: Peter Zijlstra (Intel) > --- > arch/arm/mach-imx/cpuidle-imx6sx.c |5 - > 1 file

Re: [PATCH v2 09/44] cpuidle,omap3: Push RCU-idle into driver

2022-09-19 Thread Frederic Weisbecker
On Mon, Sep 19, 2022 at 11:59:48AM +0200, Peter Zijlstra wrote: > Doing RCU-idle outside the driver, only to then teporarily enable it > again before going idle is daft. > > Signed-off-by: Peter Zijlstra (Intel) > Reviewed-by: Tony Lindgren > Tested-by: Tony Lindgren Ok now with the

Re: [PATCH v2 10/44] cpuidle,armada: Push RCU-idle into driver

2022-09-19 Thread Frederic Weisbecker
On Mon, Sep 19, 2022 at 11:59:49AM +0200, Peter Zijlstra wrote: > Doing RCU-idle outside the driver, only to then temporarily enable it > again before going idle is daft. Ah wait, now I see, that's cpu_pm_enter()/cpu_pm_exit() -> cpu_pm_notify*() the culprits. Might be worth adding a short note

Re: [PATCH v2 09/44] cpuidle,omap3: Push RCU-idle into driver

2022-09-19 Thread Frederic Weisbecker
On Mon, Sep 19, 2022 at 11:59:48AM +0200, Peter Zijlstra wrote: > Doing RCU-idle outside the driver, only to then teporarily enable it > again before going idle is daft. That doesn't tell where those calls are. Thanks.

RE: [PATCH] powerpc/83xx: update kmeter1 defconfig and dts

2022-09-19 Thread Holger Brunck
> > Le 16/12/2019 à 10:50, Holger Brunck a écrit : > >> From: Matteo Ghidoni > >> > >> The defconfig is synchronized and the missing MTD_PHYSMAP, > DEVTMPFS > >> and I2C MUX support are switched on. > >> > >> Additionally the I2C mux device is added to the DTS with its attached > >> temperature

Re: [PATCH v2 08/44] cpuidle,imx6: Push RCU-idle into driver

2022-09-19 Thread Frederic Weisbecker
On Mon, Sep 19, 2022 at 11:59:47AM +0200, Peter Zijlstra wrote: > Doing RCU-idle outside the driver, only to then temporarily enable it > again, at least twice, before going idle is daft. Hmm, what ends up calling RCU_IDLE() here? Also what about cpu_do_idle()? Thanks. > > Signed-off-by: Peter

Re: [PATCH v2 07/44] cpuidle,psci: Push RCU-idle into driver

2022-09-19 Thread Frederic Weisbecker
On Mon, Sep 19, 2022 at 11:59:46AM +0200, Peter Zijlstra wrote: > Doing RCU-idle outside the driver, only to then temporarily enable it > again, at least twice, before going idle is daft. > > Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Frederic Weisbecker

Re: [PATCH v2 06/44] cpuidle,tegra: Push RCU-idle into driver

2022-09-19 Thread Frederic Weisbecker
On Mon, Sep 19, 2022 at 11:59:45AM +0200, Peter Zijlstra wrote: > Doing RCU-idle outside the driver, only to then temporarily enable it > again, at least twice, before going idle is daft. > > Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Frederic Weisbecker

Re: [PATCH v2 05/44] cpuidle,riscv: Push RCU-idle into driver

2022-09-19 Thread Frederic Weisbecker
On Mon, Sep 19, 2022 at 11:59:44AM +0200, Peter Zijlstra wrote: > Doing RCU-idle outside the driver, only to then temporarily enable it > again, at least twice, before going idle is daft. > > Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Frederic Weisbecker

Re: [PATCH v2 03/44] cpuidle/poll: Ensure IRQ state is invariant

2022-09-19 Thread Frederic Weisbecker
On Mon, Sep 19, 2022 at 11:59:42AM +0200, Peter Zijlstra wrote: > cpuidle_state::enter() methods should be IRQ invariant Got a bit confused with the invariant thing since the first chunck I see in this patch is a conversion to an non-traceable local_irq_enable(). Maybe just add a short mention

Re: [PATCH v2 05/44] cpuidle,riscv: Push RCU-idle into driver

2022-09-19 Thread Anup Patel
On Mon, Sep 19, 2022 at 3:47 PM Peter Zijlstra wrote: > > Doing RCU-idle outside the driver, only to then temporarily enable it > again, at least twice, before going idle is daft. > > Signed-off-by: Peter Zijlstra (Intel) Looks good to me. For RISC-V cpuidle: Reviewed-by: Anup Patel Regards,

Re: [PATCH v2 30/44] cpuidle,xenpv: Make more PARAVIRT_XXL noinstr clean

2022-09-19 Thread Juergen Gross
On 19.09.22 12:00, Peter Zijlstra wrote: vmlinux.o: warning: objtool: acpi_idle_enter_s2idle+0xde: call to wbinvd() leaves .noinstr.text section vmlinux.o: warning: objtool: default_idle+0x4: call to arch_safe_halt() leaves .noinstr.text section vmlinux.o: warning: objtool: xen_safe_halt+0xa:

[PATCH v2 21/44] arch/idle: Change arch_cpu_idle() IRQ behaviour

2022-09-19 Thread Peter Zijlstra
Current arch_cpu_idle() is called with IRQs disabled, but will return with IRQs enabled. However, the very first thing the generic code does after calling arch_cpu_idle() is raw_local_irq_disable(). This means that architectures that can idle with IRQs disabled end up doing a pointless

[PATCH v2 04/44] cpuidle: Move IRQ state validation

2022-09-19 Thread Peter Zijlstra
Make cpuidle_enter_state() consistent with the s2idle variant and verify ->enter() always returns with interrupts disabled. Signed-off-by: Peter Zijlstra (Intel) --- drivers/cpuidle/cpuidle.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/cpuidle/cpuidle.c +++

[PATCH v2 41/44] intel_idle: Add force_irq_on module param

2022-09-19 Thread Peter Zijlstra
For testing purposes. Signed-off-by: Peter Zijlstra (Intel) --- drivers/idle/intel_idle.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c @@ -1787,6 +1787,9 @@ static bool __init intel_idle_verify_cst return

[PATCH v2 19/44] cpuidle,intel_idle: Fix CPUIDLE_FLAG_INIT_XSTATE

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: intel_idle_s2idle+0xd5: call to fpu_idle_fpregs() leaves .noinstr.text section vmlinux.o: warning: objtool: intel_idle_xstate+0x11: call to fpu_idle_fpregs() leaves .noinstr.text section vmlinux.o: warning: objtool: fpu_idle_fpregs+0x9: call to xfeatures_in_use()

[PATCH v2 40/44] ubsan: Fix objtool UACCESS warns

2022-09-19 Thread Peter Zijlstra
clang-14 allyesconfig gives: vmlinux.o: warning: objtool: emulator_cmpxchg_emulated+0x705: call to __ubsan_handle_load_invalid_value() with UACCESS enabled vmlinux.o: warning: objtool: paging64_update_accessed_dirty_bits+0x39e: call to __ubsan_handle_load_invalid_value() with UACCESS enabled

[PATCH v2 00/44] cpuidle,rcu: Clean up the mess

2022-09-19 Thread Peter Zijlstra
Hi All! At long last, a respin of the cpuidle vs rcu cleanup patches. v1: https://lkml.kernel.org/r/20220608142723.103523...@infradead.org These here patches clean up the mess that is cpuidle vs rcuidle. At the end of the ride there's only on RCU_NONIDLE user left:

[PATCH v2 26/44] time/tick-broadcast: Remove RCU_NONIDLE usage

2022-09-19 Thread Peter Zijlstra
No callers left that have already disabled RCU. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mark Rutland --- kernel/time/tick-broadcast-hrtimer.c | 29 - 1 file changed, 12 insertions(+), 17 deletions(-) --- a/kernel/time/tick-broadcast-hrtimer.c +++

[PATCH v2 18/44] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE *again*

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: intel_idle_irq+0x10c: call to trace_hardirqs_off() leaves .noinstr.text section As per commit 32d4fd5751ea ("cpuidle,intel_idle: Fix CPUIDLE_FLAG_IRQ_ENABLE"): "must not have tracing in idle functions" Clearly people can't read and tinker along until splat

[PATCH v2 24/44] arm64,smp: Remove trace_.*_rcuidle() usage

2022-09-19 Thread Peter Zijlstra
Ever since commit d3afc7f12987 ("arm64: Allow IPIs to be handled as normal interrupts") this function is called in regular IRQ context. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Mark Rutland Acked-by: Marc Zyngier --- arch/arm64/kernel/smp.c |4 ++-- 1 file changed, 2 insertions(+),

[PATCH v2 42/44] entry,kasan,x86: Disallow overriding mem*() functions

2022-09-19 Thread Peter Zijlstra
KASAN cannot just hijack the mem*() functions, it needs to emit __asan_mem*() variants if it wants instrumentation (other sanitizers already do this). vmlinux.o: warning: objtool: sync_regs+0x24: call to memcpy() leaves .noinstr.text section vmlinux.o: warning: objtool: vc_switch_off_ist+0xbe:

[PATCH v2 08/44] cpuidle,imx6: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again, at least twice, before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) --- arch/arm/mach-imx/cpuidle-imx6sx.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) ---

[PATCH v2 23/44] arm,smp: Remove trace_.*_rcuidle() usage

2022-09-19 Thread Peter Zijlstra
None of these functions should ever be ran with RCU disabled anymore. Specifically, do_handle_IPI() is only called from handle_IPI() which explicitly does irq_enter()/irq_exit() which ensures RCU is watching. The problem with smp_cross_call() was, per commit 7c64cc0531fa ("arm: Use _rcuidle for

[PATCH v2 01/44] x86/perf/amd: Remove tracing from perf_lopwr_cb()

2022-09-19 Thread Peter Zijlstra
The perf_lopwr_cb() is called from the idle routines; there is no RCU there, we must not enter tracing. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/events/amd/brs.c | 13 + arch/x86/include/asm/perf_event.h |2 +- 2 files changed, 6 insertions(+), 9 deletions(-)

[PATCH v2 44/44] arm64,riscv,perf: Remove RCU_NONIDLE() usage

2022-09-19 Thread Peter Zijlstra
The PM notifiers should no longer be ran with RCU disabled (per the previous patches), as such this hack is no longer required either. Signed-off-by: Peter Zijlstra (Intel) --- drivers/perf/arm_pmu.c | 11 +-- drivers/perf/riscv_pmu_sbi.c |8 +--- 2 files changed, 2

[PATCH v2 35/44] cpuidle,omap3: Push RCU-idle into omap_sram_idle()

2022-09-19 Thread Peter Zijlstra
OMAP3 uses full SoC suspend modes as idle states, as such it needs the whole power-domain and clock-domain code from the idle path. All that code is not suitable to run with RCU disabled, as such push RCU-idle deeper still. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Tony Lindgren

[PATCH v2 12/44] cpuidle,dt: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again before going idle is daft. Notably: this converts all dt_init_idle_driver() and __CPU_PM_CPU_IDLE_ENTER() users for they are inextrably intertwined. Signed-off-by: Peter Zijlstra (Intel) ---

[PATCH v2 34/44] cpuidle,omap3: Use WFI for omap3_pm_idle()

2022-09-19 Thread Peter Zijlstra
arch_cpu_idle() is a very simple idle interface and exposes only a single idle state and is expected to not require RCU and not do any tracing/instrumentation. As such, omap_sram_idle() is not a valid implementation. Replace it with the simple (shallow) omap3_do_wfi() call. Leaving the more

[PATCH v2 28/44] cpuidle,mwait: Make noinstr clean

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: intel_idle_s2idle+0x6e: call to __monitor.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: intel_idle_irq+0x8c: call to __monitor.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: intel_idle+0x73: call to

[PATCH v2 20/44] cpuidle,intel_idle: Fix CPUIDLE_FLAG_IBRS

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: intel_idle_ibrs+0x17: call to spec_ctrl_current() leaves .noinstr.text section vmlinux.o: warning: objtool: intel_idle_ibrs+0x27: call to wrmsrl.constprop.0() leaves .noinstr.text section Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/kernel/cpu/bugs.c |2

[PATCH v2 43/44] sched: Always inline __this_cpu_preempt_check()

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: in_entry_stack+0x9: call to __this_cpu_preempt_check() leaves .noinstr.text section vmlinux.o: warning: objtool: default_do_nmi+0x10: call to __this_cpu_preempt_check() leaves .noinstr.text section vmlinux.o: warning: objtool: fpu_idle_fpregs+0x41: call to

[PATCH v2 17/44] objtool/idle: Validate __cpuidle code as noinstr

2022-09-19 Thread Peter Zijlstra
Idle code is very like entry code in that RCU isn't available. As such, add a little validation. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Geert Uytterhoeven --- arch/alpha/kernel/vmlinux.lds.S |1 - arch/arc/kernel/vmlinux.lds.S|1 -

[PATCH v2 13/44] cpuidle: Fix ct_idle_*() usage

2022-09-19 Thread Peter Zijlstra
The whole disable-RCU, enable-IRQS dance is very intricate since changing IRQ state is traced, which depends on RCU. Add two helpers for the cpuidle case that mirror the entry code. Signed-off-by: Peter Zijlstra (Intel) --- arch/arm/mach-imx/cpuidle-imx6q.c|4 +--

[PATCH v2 38/44] cpuidle,powerdomain: Remove trace_.*_rcuidle()

2022-09-19 Thread Peter Zijlstra
OMAP was the one and only user. Signed-off-by: Peter Zijlstra (Intel) --- arch/arm/mach-omap2/powerdomain.c | 10 +- drivers/base/power/runtime.c | 24 2 files changed, 17 insertions(+), 17 deletions(-) --- a/arch/arm/mach-omap2/powerdomain.c +++

[PATCH v2 32/44] cpuidle,acpi: Make noinstr clean

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: io_idle+0xc: call to __inb.isra.0() leaves .noinstr.text section vmlinux.o: warning: objtool: acpi_idle_enter+0xfe: call to num_online_cpus() leaves .noinstr.text section vmlinux.o: warning: objtool: acpi_idle_enter+0x115: call to acpi_idle_fallback_to_c1.isra.0()

[PATCH v2 27/44] cpuidle,sched: Remove annotations from TIF_{POLLING_NRFLAG,NEED_RESCHED}

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: mwait_idle+0x5: call to current_set_polling_and_test() leaves .noinstr.text section vmlinux.o: warning: objtool: acpi_processor_ffh_cstate_enter+0xc5: call to current_set_polling_and_test() leaves .noinstr.text section vmlinux.o: warning: objtool:

[PATCH v2 39/44] cpuidle,clk: Remove trace_.*_rcuidle()

2022-09-19 Thread Peter Zijlstra
OMAP was the one and only user. Signed-off-by: Peter Zijlstra (Intel) --- drivers/clk/clk.c |8 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -978,12 +978,12 @@ static void clk_core_disable(struct clk_ if

[PATCH v2 36/44] cpuidle,omap4: Push RCU-idle into omap4_enter_lowpower()

2022-09-19 Thread Peter Zijlstra
From: Tony Lindgren OMAP4 uses full SoC suspend modes as idle states, as such it needs the whole power-domain and clock-domain code from the idle path. All that code is not suitable to run with RCU disabled, as such push RCU-idle deeper still. Signed-off-by: Tony Lindgren Signed-off-by: Peter

[PATCH v2 33/44] ftrace: WARN on rcuidle

2022-09-19 Thread Peter Zijlstra
CONFIG_GENERIC_ENTRY disallows any and all tracing when RCU isn't enabled. XXX if s390 (the only other GENERIC_ENTRY user as of this writing) isn't comfortable with this, we could switch to HAVE_NOINSTR_VALIDATION which is x86_64 only atm. Signed-off-by: Peter Zijlstra (Intel) ---

[PATCH v2 29/44] cpuidle,tdx: Make tdx noinstr clean

2022-09-19 Thread Peter Zijlstra
vmlinux.o: warning: objtool: __halt+0x2c: call to hcall_func.constprop.0() leaves .noinstr.text section vmlinux.o: warning: objtool: __halt+0x3f: call to __tdx_hypercall() leaves .noinstr.text section vmlinux.o: warning: objtool: __tdx_hypercall+0x66: call to __tdx_hypercall_failed() leaves

[PATCH v2 37/44] arm,omap2: Use WFI for omap2_pm_idle()

2022-09-19 Thread Peter Zijlstra
arch_cpu_idle() is a very simple idle interface and exposes only a single idle state and is expected to not require RCU and not do any tracing/instrumentation. As such, omap2_pm_idle() is not a valid implementation. Replace it with a simple (shallow) omap2_do_wfi() call. Omap2 doesn't have a

[PATCH v2 22/44] x86/tdx: Remove TDX_HCALL_ISSUE_STI

2022-09-19 Thread Peter Zijlstra
Now that arch_cpu_idle() is expected to return with IRQs disabled, avoid the useless STI/CLI dance. Per the specs this is supposed to work, but nobody has yet relied up this behaviour so broken implementations are possible. Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/coco/tdx/tdcall.S

[PATCH v2 25/44] printk: Remove trace_.*_rcuidle() usage

2022-09-19 Thread Peter Zijlstra
The problem, per commit fc98c3c8c9dc ("printk: use rcuidle console tracepoint"), was printk usage from the cpuidle path where RCU was already disabled. Per the patches earlier in this series, this is no longer the case. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Sergey Senozhatsky

[PATCH v2 15/44] acpi_idle: Remove tracing

2022-09-19 Thread Peter Zijlstra
All the idle routines are called with RCU disabled, as such there must not be any tracing inside. While there; clean-up the io-port idle thing. Signed-off-by: Peter Zijlstra (Intel) --- drivers/acpi/processor_idle.c | 24 +--- 1 file changed, 13 insertions(+), 11

[PATCH v2 16/44] cpuidle: Annotate poll_idle()

2022-09-19 Thread Peter Zijlstra
The __cpuidle functions will become a noinstr class, as such they need explicit annotations. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Rafael J. Wysocki --- drivers/cpuidle/poll_state.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/cpuidle/poll_state.c

[PATCH v2 11/44] cpuidle,omap4: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again, some *four* times, before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Tony Lindgren Tested-by: Tony Lindgren --- arch/arm/mach-omap2/cpuidle44xx.c | 29 ++--- 1

[PATCH v2 09/44] cpuidle,omap3: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then teporarily enable it again before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Tony Lindgren Tested-by: Tony Lindgren --- arch/arm/mach-omap2/cpuidle34xx.c | 16 1 file changed, 16 insertions(+) ---

[PATCH v2 02/44] x86/idle: Replace x86_idle with a static_call

2022-09-19 Thread Peter Zijlstra
Typical boot time setup; no need to suffer an indirect call for that. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Frederic Weisbecker Reviewed-by: Rafael J. Wysocki --- arch/x86/kernel/process.c | 50 +- 1 file changed, 28 insertions(+), 22

[PATCH v2 10/44] cpuidle,armada: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) --- drivers/cpuidle/cpuidle-mvebu-v7.c |7 +++ 1 file changed, 7 insertions(+) --- a/drivers/cpuidle/cpuidle-mvebu-v7.c +++

[PATCH v2 03/44] cpuidle/poll: Ensure IRQ state is invariant

2022-09-19 Thread Peter Zijlstra
cpuidle_state::enter() methods should be IRQ invariant Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Rafael J. Wysocki --- drivers/cpuidle/poll_state.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/cpuidle/poll_state.c +++ b/drivers/cpuidle/poll_state.c @@

[PATCH v2 06/44] cpuidle,tegra: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again, at least twice, before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) --- drivers/cpuidle/cpuidle-tegra.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) ---

[PATCH v2 07/44] cpuidle,psci: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again, at least twice, before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) --- drivers/cpuidle/cpuidle-psci.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) ---

[PATCH v2 05/44] cpuidle,riscv: Push RCU-idle into driver

2022-09-19 Thread Peter Zijlstra
Doing RCU-idle outside the driver, only to then temporarily enable it again, at least twice, before going idle is daft. Signed-off-by: Peter Zijlstra (Intel) --- drivers/cpuidle/cpuidle-riscv-sbi.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) ---

Re: [PATCH v2 0/2] Fix console probe delay when stdout-path isn't set

2022-09-19 Thread Greg Kroah-Hartman
On Sun, Sep 18, 2022 at 08:44:27PM -0700, Olof Johansson wrote: > On Tue, Aug 23, 2022 at 8:37 AM Greg Kroah-Hartman > wrote: > > > > On Thu, Jun 30, 2022 at 06:26:38PM -0700, Saravana Kannan wrote: > > > These patches are on top of driver-core-next. > > > > > > Even if stdout-path isn't set in

Re: [PATCH] net: ethernet: remove fs_mii_disconnect and fs_mii_connect declarations

2022-09-19 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (master) by Jakub Kicinski : On Fri, 9 Sep 2022 14:29:59 +0800 you wrote: > fs_mii_disconnect and fs_mii_connect have been removed since > commit 5b4b8454344a ("[PATCH] FS_ENET: use PAL for mii management"), > so remove them. > >

Re: [PATCH 2/2] Discard .note.gnu.property sections in generic NOTES

2022-09-19 Thread Mark Brown
On Mon, Sep 19, 2022 at 10:40:36AM -0700, Omar Sandoval wrote: > On Mon, Sep 19, 2022 at 06:33:40PM +0100, Mark Brown wrote: > > I don't understand the question, what file are you talking about > > here? arch/arm64/include/asm/assembler.h is itself a file and I > > couldn't find anything nearby

Re: [PATCH 2/2] Discard .note.gnu.property sections in generic NOTES

2022-09-19 Thread Omar Sandoval
On Mon, Sep 19, 2022 at 06:33:40PM +0100, Mark Brown wrote: > On Mon, Sep 19, 2022 at 10:26:17AM -0700, Omar Sandoval wrote: > > In general if you're going to CC someone into a thread please put > a note at the start of your mail explaining why, many of us get > copied on a lot of irrelevant

Re: [PATCH 2/2] Discard .note.gnu.property sections in generic NOTES

2022-09-19 Thread Mark Brown
On Mon, Sep 19, 2022 at 10:26:17AM -0700, Omar Sandoval wrote: In general if you're going to CC someone into a thread please put a note at the start of your mail explaining why, many of us get copied on a lot of irrelevant things for no apparently reason so if it's not immediately obvious why we

Re: [PATCH 2/2] Discard .note.gnu.property sections in generic NOTES

2022-09-19 Thread Omar Sandoval
On Sat, Sep 17, 2022 at 06:31:20AM +, Christophe Leroy wrote: > > > Le 16/09/2022 à 21:40, Omar Sandoval a écrit : > > [Vous ne recevez pas souvent de courriers de osan...@osandov.com. D?couvrez > > pourquoi ceci est important ? https://aka.ms/LearnAboutSenderIdentification > > ] > > > >

[PATCH v2 19/19] powerpc: Remove impossible mmu_psize_defs[] on nohash

2022-09-19 Thread Christophe Leroy
Today there is: if e500 or 8xx if e500 mmu_psize_defs[] = else if 8xx mmu_psize_defs[] = else mmu_psize_defs[] = endif endif The else leg is dead definition. Drop that else leg and rewrite as: if e500 mmu_psize_defs[] = endif if 8xx

[PATCH v2 13/19] watchdog: booke_wdt: Replace PPC_FSL_BOOK3E by PPC_E500

2022-09-19 Thread Christophe Leroy
CONFIG_PPC_FSL_BOOK3E is redundant with CONFIG_PPC_E500. Replace it so that CONFIG_PPC_FSL_BOOK3E can be removed later. Signed-off-by: Christophe Leroy Cc: Wim Van Sebroeck Acked-by: Guenter Roeck Cc: linux-watch...@vger.kernel.org --- drivers/watchdog/Kconfig | 8

[PATCH v2 05/19] powerpc/cputable: Move __cpu_setup() prototypes out of cputable.h

2022-09-19 Thread Christophe Leroy
Move all prototypes out of cputable.h For that rename cpu_setup_power.h to cpu_setup.h and move all prototypes in it. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/cpu_setup.h | 49 ++ arch/powerpc/include/asm/cpu_setup_power.h | 12 --

[PATCH v2 09/19] powerpc: Remove CONFIG_PPC_BOOK3E

2022-09-19 Thread Christophe Leroy
CONFIG_PPC_BOOK3E is redundant with CONFIG_PPC_BOOK3E_64. The later is more explicit about the fact that it's a 64 bits target. Remove CONFIG_PPC_BOOK3E. Signed-off-by: Christophe Leroy --- arch/powerpc/Kconfig | 2 +- arch/powerpc/include/asm/cputable.h | 4 +--

[PATCH v2 11/19] powerpc: Change CONFIG_E500 to CONFIG_PPC_E500

2022-09-19 Thread Christophe Leroy
It will be used outside arch/powerpc, make it clear its a powerpc configuration item. And we already have CONFIG_PPC_E500MC, so that will make it more consistant. Signed-off-by: Christophe Leroy --- arch/powerpc/Makefile | 2 +- arch/powerpc/include/asm/cputable.h |

[PATCH v2 18/19] powerpc: Cleanup idle for e500

2022-09-19 Thread Christophe Leroy
e500 idle setup is a bit messy. e500_idle() is used for PPC32 while book3e_idle() is used for PPC64. As they are mutually exclusive, call them all e500_idle(). Use CONFIG_MPC_85xx instead of PPC32 + E500 in Makefile and rename idle_e500.c to idle_85xx.c . Rename idle_book3e.c to idle_64e.c and

[PATCH v2 12/19] Documentation: Rename PPC_FSL_BOOK3E to PPC_E500

2022-09-19 Thread Christophe Leroy
CONFIG_PPC_FSL_BOOK3E is redundant with CONFIG_PPC_E500. Rename it so that CONFIG_PPC_FSL_BOOK3E can be removed later. Signed-off-by: Christophe Leroy Cc: Jonathan Corbet Cc: linux-...@vger.kernel.org --- Documentation/admin-guide/kernel-parameters.txt | 2 +- 1 file changed, 1 insertion(+),

[PATCH v2 10/19] powerpc: Remove redundant selection of E500 and E500MC

2022-09-19 Thread Christophe Leroy
PPC_85xx and PPC_BOOK3E_64 already select E500 so no need to select it again by PPC_QEMU_E500 and CORENET_GENERIC as they depend on PPC_85xx || PPC_BOOK3E_64. PPC_BOOK3E_64 already selects E500MC so no need to select it again by PPC_QEMU_E500 if PPC64, PPC_BOOK3E_64 is the only way into

  1   2   >