[PATCH v3 00/12] kasan: unify kasan_arch_is_ready() and remove arch-specific implementations

2025-07-17 Thread Sabyrzhan Tasbolatov
This patch series addresses the fragmentation in KASAN initialization across architectures by introducing a unified approach that eliminates duplicate static keys and arch-specific kasan_arch_is_ready() implementations. The core issue is that different architectures have inconsistent approaches to

[PATCH v3 01/12] lib/kasan: introduce CONFIG_ARCH_DEFER_KASAN option

2025-07-17 Thread Sabyrzhan Tasbolatov
Introduce CONFIG_ARCH_DEFER_KASAN to identify architectures that need to defer KASAN initialization until shadow memory is properly set up. Some architectures (like PowerPC with radix MMU) need to set up their shadow memory mappings before KASAN can be safely enabled, while others (like s390, x86,

[PATCH v3 12/12] kasan: add shadow checks to wrappers and rename kasan_arch_is_ready

2025-07-17 Thread Sabyrzhan Tasbolatov
This patch completes: 1. Adding kasan_shadow_initialized() checks to existing wrapper functions 2. Replacing kasan_arch_is_ready() calls with kasan_shadow_initialized() 3. Creating wrapper functions for internal functions that need shadow readiness checks 4. Removing the kasan_arch_is_ready() fa

[PATCH v3 10/12] kasan/s390: call kasan_init_generic in kasan_init

2025-07-17 Thread Sabyrzhan Tasbolatov
Call kasan_init_generic() which handles Generic KASAN initialization and prints the banner. Since s390 doesn't select ARCH_DEFER_KASAN, kasan_enable() will be a no-op, and kasan_enabled() will return IS_ENABLED(CONFIG_KASAN) for optimal compile-time behavior. s390 sets up KASAN mappings in the dec

[PATCH v3 11/12] kasan/riscv: call kasan_init_generic in kasan_init

2025-07-17 Thread Sabyrzhan Tasbolatov
Call kasan_init_generic() which handles Generic KASAN initialization and prints the banner. Since riscv doesn't select ARCH_DEFER_KASAN, kasan_enable() will be a no-op, and kasan_enabled() will return IS_ENABLED(CONFIG_KASAN) for optimal compile-time behavior. Closes: https://bugzilla.kernel.org/s

[PATCH v3 08/12] kasan/um: select ARCH_DEFER_KASAN and call kasan_init_generic

2025-07-17 Thread Sabyrzhan Tasbolatov
UserMode Linux needs deferred KASAN initialization as it has a custom kasan_arch_is_ready() implementation that tracks shadow memory readiness via the kasan_um_is_ready flag. Select ARCH_DEFER_KASAN to enable the unified static key mechanism for runtime KASAN control. Call kasan_init_generic() whi

[PATCH v3 09/12] kasan/x86: call kasan_init_generic in kasan_init

2025-07-17 Thread Sabyrzhan Tasbolatov
Call kasan_init_generic() which handles Generic KASAN initialization and prints the banner. Since x86 doesn't select ARCH_DEFER_KASAN, kasan_enable() will be a no-op, and kasan_enabled() will return IS_ENABLED(CONFIG_KASAN) for optimal compile-time behavior. Closes: https://bugzilla.kernel.org/sho

[PATCH v3 03/12] kasan/powerpc: select ARCH_DEFER_KASAN and call kasan_init_generic

2025-07-17 Thread Sabyrzhan Tasbolatov
PowerPC with radix MMU is the primary architecture that needs deferred KASAN initialization, as it requires complex shadow memory setup before KASAN can be safely enabled. Select ARCH_DEFER_KASAN for PPC_RADIX_MMU to enable the static key mechanism for runtime KASAN control. Other PowerPC configur

[PATCH v3 07/12] kasan/loongarch: select ARCH_DEFER_KASAN and call kasan_init_generic

2025-07-17 Thread Sabyrzhan Tasbolatov
LoongArch needs deferred KASAN initialization as it has a custom kasan_arch_is_ready() implementation that tracks shadow memory readiness via the kasan_early_stage flag. Select ARCH_DEFER_KASAN to enable the unified static key mechanism for runtime KASAN control. Call kasan_init_generic() which ha

[PATCH v3 02/12] kasan: unify static kasan_flag_enabled across modes

2025-07-17 Thread Sabyrzhan Tasbolatov
Historically, the runtime static key kasan_flag_enabled existed only for CONFIG_KASAN_HW_TAGS mode. Generic and SW_TAGS modes either relied on architecture-specific kasan_arch_is_ready() implementations or evaluated KASAN checks unconditionally, leading to code duplication. This patch implements t

[PATCH v3 04/12] kasan/arm64: call kasan_init_generic in kasan_init

2025-07-17 Thread Sabyrzhan Tasbolatov
Call kasan_init_generic() which handles Generic KASAN initialization. Since arm64 doesn't select ARCH_DEFER_KASAN, this will be a no-op for the runtime flag but will print the initialization banner. For SW_TAGS and HW_TAGS modes, their respective init functions will handle the flag enabling. Clos

[PATCH v3 06/12] kasan/xtensa: call kasan_init_generic in kasan_init

2025-07-17 Thread Sabyrzhan Tasbolatov
Call kasan_init_generic() which handles Generic KASAN initialization and prints the banner. Since xtensa doesn't select ARCH_DEFER_KASAN, kasan_enable() will be a no-op. Note that arch/xtensa still uses "current" instead of "init_task" pointer in `current->kasan_depth = 0;` to enable error message

[PATCH v3 05/12] kasan/arm: call kasan_init_generic in kasan_init

2025-07-17 Thread Sabyrzhan Tasbolatov
Call kasan_init_generic() which handles Generic KASAN initialization and prints the banner. Since arm doesn't select ARCH_DEFER_KASAN, kasan_enable() will be a no-op, but kasan_enabled() will return IS_ENABLED(CONFIG_KASAN) for optimal compile-time behavior. Closes: https://bugzilla.kernel.org/sho

Re: [PATCH v2] integrity: Extract secure boot enquiry function out of IMA

2025-07-17 Thread GONG Ruiqi
On 7/8/2025 4:35 AM, Nayna Jain wrote: > > On 7/2/25 10:07 PM, GONG Ruiqi wrote: >> >> ... >> >> "We encountered a boot failure issue in an in-house testing, where the >> kernel refused to load its modules since it couldn't verify their >> signature. The root cause turned out to be the early re

Re: [PATCH v2 0/7] syscore: Pass context data to callbacks

2025-07-17 Thread Greg Kroah-Hartman
On Thu, Jul 17, 2025 at 12:32:34PM +0200, Thierry Reding wrote: > From: Thierry Reding > > Hi, > > Something that's been bugging me over the years is how some drivers have > had to adopt file-scoped variables to pass data into something like the > syscore operations. This is often harmless, but

Re: [PATCH v2] powerpc: Replace the obsolete address of the FSF

2025-07-17 Thread Zavras, Alexios
Thanks, Richard. I've opened an issue for the SPDX License List https://github.com/spdx/license-list-XML/issues/2785 and if no one else reacts faster, I plan to submit a PR to implement this next week. -- zvr -- From: Richard Fontana Sent: Sunday, July 13, 2025

[PATCH v2 1/7] syscore: Pass context data to callbacks

2025-07-17 Thread Thierry Reding
From: Thierry Reding Pass a pointer to the syscore_ops structure that was registered to the callbacks. This enables callbacks to act on instance data (syscore_ops can be embedded into other structures, and driver-specific data can be obtained using container_of()) rather than the current practice

[PATCH v2 0/7] syscore: Pass context data to callbacks

2025-07-17 Thread Thierry Reding
From: Thierry Reding Hi, Something that's been bugging me over the years is how some drivers have had to adopt file-scoped variables to pass data into something like the syscore operations. This is often harmless, but usually leads to drivers not being able to deal with multiple instances, or ad

[PATCH v2 2/7] MIPS: Embed syscore_ops in PCI context

2025-07-17 Thread Thierry Reding
From: Thierry Reding This enables the syscore callbacks to obtain the PCI context without relying on a separate global variable. Signed-off-by: Thierry Reding --- arch/mips/pci/pci-alchemy.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/mip

[PATCH v2 3/7] bus: mvebu-mbus: Embed syscore_ops in mbus context

2025-07-17 Thread Thierry Reding
From: Thierry Reding This enables the syscore callbacks to obtain the mbus context without relying on a separate global variable. Signed-off-by: Thierry Reding --- drivers/bus/mvebu-mbus.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/bus/mve

[PATCH v2 4/7] clk: ingenic: tcu: Embed syscore_ops in TCU context

2025-07-17 Thread Thierry Reding
From: Thierry Reding This enables the syscore callbacks to obtain the TCU context without relying on a separate global variable. Signed-off-by: Thierry Reding --- drivers/clk/ingenic/tcu.c | 54 ++- 1 file changed, 25 insertions(+), 29 deletions(-) diff --g

[PATCH v2 5/7] clk: mvebu: Embed syscore_ops in clock context

2025-07-17 Thread Thierry Reding
From: Thierry Reding This enables the syscore callbacks to obtain the clock context without relying on a separate global variable. Signed-off-by: Thierry Reding --- drivers/clk/mvebu/common.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/clk

[PATCH v2 6/7] irqchip/irq-imx-gpcv2: Embed syscore_ops in chip context

2025-07-17 Thread Thierry Reding
From: Thierry Reding This enables the syscore callbacks to obtain the IRQ chip context without relying on a separate global variable. Signed-off-by: Thierry Reding --- drivers/irqchip/irq-imx-gpcv2.c | 29 +++-- 1 file changed, 11 insertions(+), 18 deletions(-) diff --

[PATCH v2 7/7] soc/tegra: pmc: Derive PMC context from syscore ops

2025-07-17 Thread Thierry Reding
From: Thierry Reding Rather than relying on a global variable, make use of the fact that the syscore ops are embedded in the PMC context and can be obtained via container_of(). Signed-off-by: Thierry Reding --- drivers/soc/tegra/pmc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/driv

[PATCH bpf-next 1/1] powerpc64/bpf: Add jit support for load_acquire and store_release

2025-07-17 Thread Puranjay Mohan
Add JIT support for the load_acquire and store_release instructions. The implementation is similar to the kernel where: load_acquire => plain load -> lwsync store_release => lwsync -> plain store To test the correctness of the implementation, following selftests were run: [fed

Re: [PATCH v6 0/4] PCI: Add support for resetting the Root Ports in a platform specific way

2025-07-17 Thread Krishna Chaitanya Chundru
On 7/15/2025 7:51 PM, Manivannan Sadhasivam via B4 Relay wrote: Hi, Currently, in the event of AER/DPC, PCI core will try to reset the slot (Root Port) and its subordinate devices by invoking bridge control reset and FLR. But in some cases like AER Fatal error, it might be necessary to reset

Re: [PATCH v6 2/4] PCI: host-common: Add link down handling for Root Portsy

2025-07-17 Thread Frank Li
On Tue, Jul 15, 2025 at 07:51:05PM +0530, Manivannan Sadhasivam via B4 Relay wrote: > From: Manivannan Sadhasivam > > The PCI link, when down, needs to be recovered to bring it back. But on > some platforms, that cannot be done in a generic way as link recovery > procedure is platform specific. S

Re: [PATCH v3 5/6] PCI: pnv_php: Fix surprise plug detection and recovery

2025-07-17 Thread Timothy Pearson
- Original Message - > From: "Bjorn Helgaas" > To: "Timothy Pearson" > Cc: "linuxppc-dev" , "linux-kernel" > , "linux-pci" > , "Madhavan Srinivasan" , > "Michael Ellerman" , > "christophe leroy" , "Naveen N Rao" > , "Bjorn Helgaas" > , "Shawn Anastasio" > Sent: Thursday, July 17, 2

Re: [PATCH v6 1/4] PCI/ERR: Add support for resetting the Root Ports in a platform specific wayy

2025-07-17 Thread Frank Li
On Tue, Jul 15, 2025 at 07:51:04PM +0530, Manivannan Sadhasivam via B4 Relay wrote: > From: Manivannan Sadhasivam > > Some host bridge devices require resetting the Root Ports in a platform > specific way to recover them from error conditions such as Fatal AER > errors, Link Down etc... So introd

[PATCH RESEND bpf-next 1/1] powerpc64/bpf: Add jit support for load_acquire and store_release

2025-07-17 Thread Puranjay Mohan
Add JIT support for the load_acquire and store_release instructions. The implementation is similar to the kernel where: load_acquire => plain load -> lwsync store_release => lwsync -> plain store To test the correctness of the implementation, following selftests were run: [fed

Re: [PATCH RESEND bpf-next 1/1] powerpc64/bpf: Add jit support for load_acquire and store_release

2025-07-17 Thread puranjay
Puranjay Mohan writes: Somehow the cover letter for this patch was missed, adding it here: To test the functionality of these special instructions, a tool called blitmus[0] was used to convert the following baseline litmus test[1] to bpf programs: C MP+poonceonces (* * Result: Sometimes

Re: [PATCH v3 01/12] lib/kasan: introduce CONFIG_ARCH_DEFER_KASAN option

2025-07-17 Thread Andrew Morton
On Thu, 17 Jul 2025 19:27:21 +0500 Sabyrzhan Tasbolatov wrote: > Introduce CONFIG_ARCH_DEFER_KASAN to identify architectures that need > to defer KASAN initialization until shadow memory is properly set up. > > Some architectures (like PowerPC with radix MMU) need to set up their > shadow memor

[PATCH net-next] ibmveth: Add multi buffers rx replenishment hcall support

2025-07-17 Thread Mingming Cao
This patch enables batched RX buffer replenishment in ibmveth by using the new firmware-supported h_add_logical_lan_buffers() hcall to submit up to 8 RX buffers in a single call, instead of repeatedly calling the single-buffer h_add_logical_lan_buffer() hcall. During the probe, with the patch, th

Re: [PATCH v3 5/6] PCI: pnv_php: Fix surprise plug detection and recovery

2025-07-17 Thread Bjorn Helgaas
On Tue, Jul 15, 2025 at 04:39:06PM -0500, Timothy Pearson wrote: > The existing PowerNV hotplug code did not handle surprise plug events > correctly, leading to a complete failure of the hotplug system after > device removal and a required reboot to detect new devices. > +++ b/drivers/pci/hotplug/

Re: [PATCH v3 0/6] PowerNV PCIe Hotplug Driver Fixes

2025-07-17 Thread Bjorn Helgaas
On Tue, Jul 15, 2025 at 04:31:49PM -0500, Timothy Pearson wrote: > Hello all, > > This series includes several fixes for bugs in the PowerNV PCIe hotplug > driver that were discovered in testing with a Microsemi Switchtec PM8533 > PFX 48xG3 PCIe switch on a PowerNV system, as well as one workaroun