[bpf-next 6/6] selftests/bpf: Fix arena_spin_lock selftest failure

2025-08-04 Thread Saket Kumar Bhaskar
For systems having CONFIG_NR_CPUS set to > 1024 in kernel config the selftest fails even though the current number of online cpus is less. For example, on powerpc the default value for CONFIG_NR_CPUS is set to 8192. get_nprocs() is used to get the number of available cpus in test driver code and t

[bpf-next 4/6] bpf,powerpc: Introduce bpf_jit_emit_atomic_ops() to emit atomic instructions

2025-08-04 Thread Saket Kumar Bhaskar
The existing code for emitting bpf atomic instruction sequences for atomic operations such as XCHG, CMPXCHG, ADD, AND, OR, and XOR has been refactored into a reusable function, bpf_jit_emit_ppc_atomic_op(). It also computes the jump offset and tracks the instruction index for jited LDARX/LWARX to b

[bpf-next 5/6] bpf,powerpc: Implement PROBE_ATOMIC instructions

2025-08-04 Thread Saket Kumar Bhaskar
powerpc supports BPF atomic operations using a loop around Load-And-Reserve(LDARX/LWARX) and Store-Conditional(STDCX/STWCX) instructions gated by sync instructions to enforce full ordering. To implement arena_atomics, arena vm start address is added to the dst_reg to be used for both the LDARX/LWA

[bpf-next 1/6] bpf,powerpc: Introduce bpf_jit_emit_probe_mem_store() to emit store instructions

2025-08-04 Thread Saket Kumar Bhaskar
bpf_jit_emit_probe_mem_store() is introduced to emit instructions for storing memory values depending on the size (byte, halfword, word, doubleword). Signed-off-by: Saket Kumar Bhaskar --- arch/powerpc/net/bpf_jit_comp64.c | 30 ++ 1 file changed, 30 insertions(+) di

[bpf-next 3/6] bpf,powerpc: Implement bpf_addr_space_cast instruction

2025-08-04 Thread Saket Kumar Bhaskar
LLVM generates bpf_addr_space_cast instruction while translating pointers between native (zero) address space and __attribute__((address_space(N))). The addr_space=0 is reserved as bpf_arena address space. rY = addr_space_cast(rX, 0, 1) is processed by the verifier and converted to normal 32-bit m

[bpf-next 2/6] bpf,powerpc: Implement PROBE_MEM32 pseudo instructions

2025-08-04 Thread Saket Kumar Bhaskar
Add support for [LDX | STX | ST], PROBE_MEM32, [B | H | W | DW] instructions. They are similar to PROBE_MEM instructions with the following differences: - PROBE_MEM32 supports store. - PROBE_MEM32 relies on the verifier to clear upper 32-bit of the src/dst register - PROBE_MEM32 adds 64-bit kern_v

Apply commit 5a821e2d69e2 ("powerpc/boot: Fix build with gcc 15") to stable kernels

2025-08-04 Thread Christophe Leroy
Hi, Could you please apply commit 5a821e2d69e2 ("powerpc/boot: Fix build with gcc 15") to stable kernels, just like you did with commit ee2ab467bddf ("x86/boot: Use '-std=gnu11' to fix build with GCC 15") Ref: https://bugzilla.kernel.org/show_bug.cgi?id=220407 Thanks Christophe

Re: [PATCH] pseries/lparcfg: Add resource group monitoring

2025-08-04 Thread Srikar Dronamraju
* Shrikanth Hegde [2025-08-01 19:27:22]: > > On 7/16/25 16:15, Srikar Dronamraju wrote: > > Systems can now be partitioned into resource groups. By default all > > systems will be part of default resource group. Once a resource group is > > created, and resources allocated to the resource group,

Re: Crypto use cases (was: Remove PowerPC optimized MD5 code)

2025-08-04 Thread Eric Biggers
On Tue, Aug 05, 2025 at 01:49:31PM +0900, Simon Richter wrote: > Hi, > > On 8/5/25 07:59, Eric Biggers wrote: > > > > md5sum uses the kernel's MD5 code: > > > What? That's crazy. Userspace MD5 code would be faster and more > > reliable. No need to make syscalls, transfer data to and from the

Crypto use cases (was: Remove PowerPC optimized MD5 code)

2025-08-04 Thread Simon Richter
Hi, On 8/5/25 07:59, Eric Biggers wrote: md5sum uses the kernel's MD5 code: What? That's crazy. Userspace MD5 code would be faster and more reliable. No need to make syscalls, transfer data to and from the kernel, have an external dependency, etc. Is this the coreutils md5sum? We need to

[PATCH v3 net-next] ibmvnic: Increase max subcrq indirect entries with fallback

2025-08-04 Thread Mingming Cao
POWER8 support a maximum of 16 subcrq indirect descriptor entries per H_SEND_SUB_CRQ_INDIRECT call, while POWER9 and newer hypervisors support up to 128 entries. Increasing the max number of indirect descriptor entries improves batching efficiency and reduces hcall overhead, which enhances throug

Re: [PATCH 3/7] crypto: powerpc/md5 - Remove PowerPC optimized MD5 code

2025-08-04 Thread Eric Biggers
On Mon, Aug 04, 2025 at 10:59:01PM +, Eric Biggers wrote: > On Mon, Aug 04, 2025 at 09:02:27PM +0200, Christophe Leroy wrote: > > > > > > Le 04/08/2025 à 20:09, Eric Biggers a écrit : > > > On Mon, Aug 04, 2025 at 07:42:15PM +0200, Christophe Leroy wrote: > > > > > > > > > > > > Le 03/08/20

Re: [PATCH 3/7] crypto: powerpc/md5 - Remove PowerPC optimized MD5 code

2025-08-04 Thread Eric Biggers
On Mon, Aug 04, 2025 at 09:02:27PM +0200, Christophe Leroy wrote: > > > Le 04/08/2025 à 20:09, Eric Biggers a écrit : > > On Mon, Aug 04, 2025 at 07:42:15PM +0200, Christophe Leroy wrote: > > > > > > > > > Le 03/08/2025 à 22:44, Eric Biggers a écrit : > > > > MD5 is insecure, is no longer commo

Re: [PATCH 3/7] crypto: powerpc/md5 - Remove PowerPC optimized MD5 code

2025-08-04 Thread Christophe Leroy
Le 04/08/2025 à 20:09, Eric Biggers a écrit : On Mon, Aug 04, 2025 at 07:42:15PM +0200, Christophe Leroy wrote: Le 03/08/2025 à 22:44, Eric Biggers a écrit : MD5 is insecure, is no longer commonly used, and has never been optimized for the most common architectures in the kernel. Only mip

[Bug 220407] arch/powerpc/boot/types.h:43:13: error: 'bool' cannot be defined via 'typedef' when building with GCC 15

2025-08-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=220407 --- Comment #2 from Avraham Hollander (anhollander...@gmail.com) --- (In reply to Christophe Leroy from comment #1) > This is fixed with commit > https://github.com/torvalds/linux/commit/ > 5a821e2d69e26b51b7f3740b6b0c3462b8cacaff Oh now I see th

[Bug 220407] arch/powerpc/boot/types.h:43:13: error: 'bool' cannot be defined via 'typedef' when building with GCC 15

2025-08-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=220407 Artem S. Tashkinov (a...@gmx.com) changed: What|Removed |Added Status|NEW |RESOLVED Reso

Re: [PATCH 3/7] crypto: powerpc/md5 - Remove PowerPC optimized MD5 code

2025-08-04 Thread Eric Biggers
On Mon, Aug 04, 2025 at 07:42:15PM +0200, Christophe Leroy wrote: > > > Le 03/08/2025 à 22:44, Eric Biggers a écrit : > > MD5 is insecure, is no longer commonly used, and has never been > > optimized for the most common architectures in the kernel. Only mips, > > powerpc, and sparc have optimize

Re: [PATCH 3/7] crypto: powerpc/md5 - Remove PowerPC optimized MD5 code

2025-08-04 Thread Christophe Leroy
Le 03/08/2025 à 22:44, Eric Biggers a écrit : MD5 is insecure, is no longer commonly used, and has never been optimized for the most common architectures in the kernel. Only mips, powerpc, and sparc have optimized MD5 code in the kernel. Of these, only the powerpc one is actually testable in

Re: [PATCH v4] vmcoreinfo: Track and log recoverable hardware errors

2025-08-04 Thread Dave Hansen
On 8/4/25 10:12, Breno Leitao wrote: ... > +- These errros are divided by are, which includes CPU, Memory, PCI, CXL and > + others. There's a double typo in there I think: errros => errors and are,=>area, > --- a/include/linux/vmcore_info.h > +++ b/include/linux/vmcore_info.h >

Re: [PATCH 10/17] openrisc: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Stafford Horne
On Mon, Aug 04, 2025 at 09:44:06AM -0700, Kees Cook wrote: > While tracking down a problem where constant expressions used by > BUILD_BUG_ON() suddenly stopped working[1], we found that an added static > initializer was convincing the compiler that it couldn't track the state > of the prior statica

Re: [PATCH v4] vmcoreinfo: Track and log recoverable hardware errors

2025-08-04 Thread Breno Leitao
On Fri, Aug 01, 2025 at 10:06:51AM -0700, Dave Hansen wrote: > On 8/1/25 10:00, Breno Leitao wrote: > > Would a solution like this look better? > > > > enum hwerr_error_type { > > HWERR_RECOV_CPU, > > HWERR_RECOV_MEMORY, > > HWERR_RECOV_PCI, > >

[PATCH 04/17] x86: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 14/17] s390: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

Re: [PATCH] PCI/AER: Check for NULL aer_info before ratelimiting in pci_print_aer()

2025-08-04 Thread Breno Leitao
Hello Sathyanarayanan On Mon, Aug 04, 2025 at 09:11:27AM -0700, Sathyanarayanan Kuppuswamy wrote: > > On 8/4/25 8:35 AM, Breno Leitao wrote: > > Hello Sathyanarayanan, > > > > On Mon, Aug 04, 2025 at 06:50:30AM -0700, Sathyanarayanan Kuppuswamy wrote: > > > On 8/4/25 2:17 AM, Breno Leitao wrote:

[PATCH 16/17] sparc: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 17/17] KUnit: ffs: Validate all the __attribute_const__ annotations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 13/17] parisc: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 01/17] KUnit: Introduce ffs()-family tests

2025-08-04 Thread Kees Cook
Add KUnit tests for ffs()-family bit scanning functions: ffs(), __ffs(), fls(), __fls(), fls64(), __ffs64(), and ffz(). The tests validate mathematical relationships (e.g. ffs(x) == __ffs(x) + 1), and test zero values, power-of-2 patterns, maximum values, and sparse bit patterns. Build and run tes

[PATCH 12/17] mips: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 09/17] riscv: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 10/17] openrisc: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 02/17] bitops: Add __attribute_const__ to generic ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 03/17] csky: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 06/17] sh: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 07/17] alpha: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 15/17] xtensa: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 08/17] hexagon: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 11/17] m68k: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

[PATCH 00/17] Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
Hi, While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was

[PATCH 05/17] powerpc: Add __attribute_const__ to ffs()-family implementations

2025-08-04 Thread Kees Cook
While tracking down a problem where constant expressions used by BUILD_BUG_ON() suddenly stopped working[1], we found that an added static initializer was convincing the compiler that it couldn't track the state of the prior statically initialized value. Tracing this down found that ffs() was used

Re: radeon_fbdev_river_fbdev: failed to initialize framebuffer and setup emulation

2025-08-04 Thread mad skateman
I am using the R580 chip which is the Radeon X1950 XT. The board i am using is a T1042 PowerPC based one with e5500 core. I also lost the ability to start Xorg and therefore just a blank screen. Dave Op ma 4 aug 2025, 18:04 schreef Christian Zigotzky : > > On 04 August 2025 at 04:42 pm, Al

Re: [PATCH] PCI/AER: Check for NULL aer_info before ratelimiting in pci_print_aer()

2025-08-04 Thread Sathyanarayanan Kuppuswamy
On 8/4/25 8:35 AM, Breno Leitao wrote: Hello Sathyanarayanan, On Mon, Aug 04, 2025 at 06:50:30AM -0700, Sathyanarayanan Kuppuswamy wrote: On 8/4/25 2:17 AM, Breno Leitao wrote: Similarly to pci_dev_aer_stats_incr(), pci_print_aer() may be called when dev->aer_info is NULL. Add a NULL check b

radeon_fbdev_river_fbdev: failed to initialize framebuffer and setup emulation

2025-08-04 Thread Christian Zigotzky
On 04 August 2025 at 04:42 pm, Alex Deucher wrote: On Sun, Aug 3, 2025 at 11:28 AM Christian Zigotzky wrote: Hello, I have the same issue on another machine either. Blank screen during the boot. The Radeon graphics framebuffer device doesn't work anymore. Here is the modifed code from the

Re: [PATCH] PCI/AER: Check for NULL aer_info before ratelimiting in pci_print_aer()

2025-08-04 Thread Breno Leitao
Hello Sathyanarayanan, On Mon, Aug 04, 2025 at 06:50:30AM -0700, Sathyanarayanan Kuppuswamy wrote: > > On 8/4/25 2:17 AM, Breno Leitao wrote: > > Similarly to pci_dev_aer_stats_incr(), pci_print_aer() may be called > > when dev->aer_info is NULL. Add a NULL check before proceeding to avoid > > ca

Re: [PATCH v2 1/2] powerpc/ftrace: support CONFIG_FUNCTION_GRAPH_RETVAL

2025-08-04 Thread Christophe Leroy
Le 22/07/2025 à 10:56, Aditya Bodkhe a écrit : commit a1be9ccc57f0 ("function_graph: Support recording and printing the return value of function") introduced support for function graph return value tracing. Additionally, commit a3ed4157b7d8 ("fgraph: Replace fgraph_ret_regs with ftrace_regs")

Re: radeon_fbdev_river_fbdev: failed to initialize framebuffer and setup emulaton

2025-08-04 Thread Alex Deucher
On Sun, Aug 3, 2025 at 11:28 AM Christian Zigotzky wrote: > > Hello, > > I have the same issue on another machine either. Blank screen during the > boot. The Radeon graphics framebuffer device doesn't work anymore. > > Here is the modifed code from the DRM updates (drm-next-2025-07-30): > > - > ht

[Bug 220407] arch/powerpc/boot/types.h:43:13: error: 'bool' cannot be defined via 'typedef' when building with GCC 15

2025-08-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=220407 Christophe Leroy (christophe.le...@csgroup.eu) changed: What|Removed |Added CC||christoph

[Bug 220407] New: arch/powerpc/boot/types.h:43:13: error: 'bool' cannot be defined via 'typedef' when building with GCC 15

2025-08-04 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=220407 Bug ID: 220407 Summary: arch/powerpc/boot/types.h:43:13: error: 'bool' cannot be defined via 'typedef' when building with GCC 15 Product: Platform Specific/Hardware Version: 2.5

Re: [PATCH] PCI/AER: Check for NULL aer_info before ratelimiting in pci_print_aer()

2025-08-04 Thread Sathyanarayanan Kuppuswamy
On 8/4/25 2:17 AM, Breno Leitao wrote: Similarly to pci_dev_aer_stats_incr(), pci_print_aer() may be called when dev->aer_info is NULL. Add a NULL check before proceeding to avoid calling aer_ratelimit() with a NULL aer_info pointer, returning 1, which does not rate limit, given this is fatal.

Re: [PATCH v2] powerpc/mm: Fix SLB multihit issue during SLB preload

2025-08-04 Thread IBM
"Nicholas Piggin" writes: > Hmm, interesting bug. Impressive work to track it down. > Thanks Nick for taking a look at it. > On Fri Aug 1, 2025 at 8:37 PM AEST, Donet Tom wrote: >> On systems using the hash MMU, there is a software SLB preload cache that >> mirrors the entries loaded into the h

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

2025-08-04 Thread Sabyrzhan Tasbolatov
On Mon, Aug 4, 2025 at 5:04 PM Christophe Leroy wrote: > > Hi, > > Le 03/08/2025 à 21:27, Sabyrzhan Tasbolatov a écrit : > > On Wed, Jul 23, 2025 at 10:33 PM Andrey Ryabinin > > wrote: > >> > >> ... > >> > >> I don't know if it's a real problem or not. I'm just pointing out that we > >> might >

[PATCH v1 15/16] block-dma: properly take MMIO path

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Make sure that CPU is not synced and IOMMU is configured to take MMIO path by providing newly introduced DMA_ATTR_MMIO attribute. Signed-off-by: Leon Romanovsky --- block/blk-mq-dma.c | 13 +++-- include/linux/blk-mq-dma.h | 6 +- include/linux/blk_ty

[PATCH v1 16/16] nvme-pci: unmap MMIO pages with appropriate interface

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Block layer maps MMIO memory through dma_map_phys() interface with help of DMA_ATTR_MMIO attribute. There is a need to unmap that memory with the appropriate unmap function. Signed-off-by: Leon Romanovsky --- drivers/nvme/host/pci.c | 18 +- 1 file changed

[PATCH v1 14/16] block-dma: migrate to dma_map_phys instead of map_page

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky After introduction of dma_map_phys(), there is no need to convert from physical address to struct page in order to map page. So let's use it directly. Signed-off-by: Leon Romanovsky --- block/blk-mq-dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --g

[PATCH v1 13/16] mm/hmm: properly take MMIO path

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky In case peer-to-peer transaction traverses through host bridge, the IOMMU needs to have IOMMU_MMIO flag, together with skip of CPU sync. The latter was handled by provided DMA_ATTR_SKIP_CPU_SYNC flag, but IOMMU flag was missed, due to assumption that such memory can be trea

[PATCH v1 10/16] xen: swiotlb: Open code map_resource callback

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky General dma_direct_map_resource() is going to be removed in next patch, so simply open-code it in xen driver. Signed-off-by: Leon Romanovsky --- drivers/xen/swiotlb-xen.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/xen

[PATCH v1 12/16] mm/hmm: migrate to physical address-based DMA mapping API

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Convert HMM DMA operations from the legacy page-based API to the new physical address-based dma_map_phys() and dma_unmap_phys() functions. This demonstrates the preferred approach for new code that should use physical addresses directly rather than page+offset parameters. T

[PATCH v1 11/16] dma-mapping: export new dma_*map_phys() interface

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Introduce new DMA mapping functions dma_map_phys() and dma_unmap_phys() that operate directly on physical addresses instead of page+offset parameters. This provides a more efficient interface for drivers that already have physical addresses available. The new functions are

[PATCH v1 08/16] kmsan: convert kmsan_handle_dma to use physical addresses

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Convert the KMSAN DMA handling function from page-based to physical address-based interface. The refactoring renames kmsan_handle_dma() parameters from accepting (struct page *page, size_t offset, size_t size) to (phys_addr_t phys, size_t size). A PFN_VALID check is added t

[PATCH v1 09/16] dma-mapping: handle MMIO flow in dma_map|unmap_page

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Extend base DMA page API to handle MMIO flow. Signed-off-by: Leon Romanovsky --- kernel/dma/mapping.c | 24 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index 709405d46b2b4..f5f051737e5

[PATCH v1 05/16] iommu/dma: rename iommu_dma_*map_page to iommu_dma_*map_phys

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Rename the IOMMU DMA mapping functions to better reflect their actual calling convention. The functions iommu_dma_map_page() and iommu_dma_unmap_page() are renamed to iommu_dma_map_phys() and iommu_dma_unmap_phys() respectively, as they already operate on physical addresses

[PATCH v1 07/16] dma-mapping: convert dma_direct_*map_page to be phys_addr_t based

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Convert the DMA direct mapping functions to accept physical addresses directly instead of page+offset parameters. The functions were already operating on physical addresses internally, so this change eliminates the redundant page-to-physical conversion at the API boundary.

[PATCH v1 06/16] iommu/dma: extend iommu_dma_*map_phys API to handle MMIO memory

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Combine iommu_dma_*map_phys with iommu_dma_*map_resource interfaces in order to allow single phys_addr_t flow. Signed-off-by: Leon Romanovsky --- drivers/iommu/dma-iommu.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/io

[PATCH v1 04/16] dma-mapping: rename trace_dma_*map_page to trace_dma_*map_phys

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky As a preparation for following map_page -> map_phys API conversion, let's rename trace_dma_*map_page() to be trace_dma_*map_phys(). Signed-off-by: Leon Romanovsky --- include/trace/events/dma.h | 4 ++-- kernel/dma/mapping.c | 4 ++-- 2 files changed, 4 insertions(+

[PATCH v1 01/16] dma-mapping: introduce new DMA attribute to indicate MMIO memory

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky This patch introduces the DMA_ATTR_MMIO attribute to mark DMA buffers that reside in memory-mapped I/O (MMIO) regions, such as device BARs exposed through the host bridge, which are accessible for peer-to-peer (P2P) DMA. This attribute is especially useful for exporting dev

[PATCH v1 03/16] dma-debug: refactor to use physical addresses for page mapping

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Convert the DMA debug infrastructure from page-based to physical address-based mapping as a preparation to rely on physical address for DMA mapping routines. The refactoring renames debug_dma_map_page() to debug_dma_map_phys() and changes its signature to accept a phys_addr

[PATCH v1 02/16] iommu/dma: handle MMIO path in dma_iova_link

2025-08-04 Thread Leon Romanovsky
From: Leon Romanovsky Make sure that CPU is not synced if MMIO path is taken. Signed-off-by: Leon Romanovsky --- drivers/iommu/dma-iommu.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index ea2e

[PATCH v1 00/16] dma-mapping: migrate to physical address-based API

2025-08-04 Thread Leon Romanovsky
Changelog: v1: * Added new DMA_ATTR_MMIO attribute to indicate PCI_P2PDMA_MAP_THRU_HOST_BRIDGE path. * Rewrote dma_map_* functions to use thus new attribute v0: https://lore.kernel.org/all/cover.1750854543.git.l...@kernel.org/ ---

Re: [PATCH v2] powerpc/mm: Fix SLB multihit issue during SLB preload

2025-08-04 Thread Nicholas Piggin
Hmm, interesting bug. Impressive work to track it down. On Fri Aug 1, 2025 at 8:37 PM AEST, Donet Tom wrote: > On systems using the hash MMU, there is a software SLB preload cache that > mirrors the entries loaded into the hardware SLB buffer. This preload > cache is subject to periodic eviction —

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

2025-08-04 Thread Christophe Leroy
Hi, Le 03/08/2025 à 21:27, Sabyrzhan Tasbolatov a écrit : On Wed, Jul 23, 2025 at 10:33 PM Andrey Ryabinin wrote: ... I don't know if it's a real problem or not. I'm just pointing out that we might have tricky use case here and maybe that's a problem, because nobody had such use case in min

Re: [PATCH v2] powerpc/mm: Fix SLB multihit issue during SLB preload

2025-08-04 Thread Vishal Chourasia
On Fri, Aug 01, 2025 at 04:07:47PM +0530, Donet Tom wrote: > On systems using the hash MMU, there is a software SLB preload cache that > mirrors the entries loaded into the hardware SLB buffer. This preload > cache is subject to periodic eviction — typically after every 256 context > switches — to

Re: [PATCH v3 1/2] PCI/AER: Fix missing uevent on recovery when a reset is requested

2025-08-04 Thread Niklas Schnelle
On Thu, 2025-07-31 at 15:01 +0200, Lukas Wunner wrote: > On Wed, Jul 30, 2025 at 10:24:07PM +0200, Lukas Wunner wrote: > > On Wed, Jul 30, 2025 at 10:01:50PM +0200, Lukas Wunner wrote: > > > On Wed, Jul 30, 2025 at 01:20:57PM +0200, Niklas Schnelle wrote: > > > > Since commit 7b42d97e99d3 ("PCI/ERR

Re: [PATCH 2/3] mm: update core kernel code to use vm_flags_t consistently

2025-08-04 Thread Uladzislau Rezki
Hello, Lorenzo! > So sorry Ulad, I meant to get back to you on this sooner! > > On Tue, Jul 29, 2025 at 08:39:01PM +0200, Uladzislau Rezki wrote: > > On Tue, Jul 29, 2025 at 06:25:39AM +0100, Lorenzo Stoakes wrote: > > > Andrew - FYI there's nothing to worry about here, the type remains > > > pre

Re: [PATCH 2/2] powerpc/powernv/pci: Fix underflow and leak issue

2025-08-04 Thread Cédric Le Goater
On 8/4/25 12:07, Nam Cao wrote: pnv_irq_domain_alloc() allocates interrupts at parent's interrupt domain. If it fails in the progress, all allocated interrupts are freed. The number of successfully allocated interrupts so far is stored "i". However, "i - 1" interrupts are freed. This is broken:

Re: [PATCH 1/2] powerpc/pseries/msi: Fix potential underflow and leak issue

2025-08-04 Thread Cédric Le Goater
On 8/4/25 12:07, Nam Cao wrote: pseries_irq_domain_alloc() allocates interrupts at parent's interrupt domain. If it fails in the progress, all allocated interrupts are freed. The number of successfully allocated interrupts so far is stored "i". However, "i - 1" interrupts are freed. This is brok

[PATCH 2/2] powerpc/powernv/pci: Fix underflow and leak issue

2025-08-04 Thread Nam Cao
pnv_irq_domain_alloc() allocates interrupts at parent's interrupt domain. If it fails in the progress, all allocated interrupts are freed. The number of successfully allocated interrupts so far is stored "i". However, "i - 1" interrupts are freed. This is broken: - One interrupt is not be fre

[PATCH 1/2] powerpc/pseries/msi: Fix potential underflow and leak issue

2025-08-04 Thread Nam Cao
pseries_irq_domain_alloc() allocates interrupts at parent's interrupt domain. If it fails in the progress, all allocated interrupts are freed. The number of successfully allocated interrupts so far is stored "i". However, "i - 1" interrupts are freed. This is broken: - One interrupt is not be f

[PATCH 0/2] powerpc: Fix integer underflow & leak

2025-08-04 Thread Nam Cao
Hi, This series fixes integer overflow & leak problem. I noticed this problem when Gautam reported a kernel bug with another patch series of mine: https://lore.kernel.org/linuxppc-dev/ah9na8zqri0jp...@li-c6426e4c-27cf-11b2-a85c-95d65bc0de0e.ibm.com/ The root cause of that report is a bug in that

Re: [PATCH] powerpc/64: Drop unnecessary 'rc' variable

2025-08-04 Thread Gautam Menghani
On Fri, Aug 01, 2025 at 11:59:08AM +0800, Xichao Zhao wrote: > Simplify the code to enhance readability and maintain a consistent > coding style. > > > Signed-off-by: Xichao Zhao > --- > arch/powerpc/kernel/setup_64.c | 5 + > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git

[PATCH] PCI/AER: Check for NULL aer_info before ratelimiting in pci_print_aer()

2025-08-04 Thread Breno Leitao
Similarly to pci_dev_aer_stats_incr(), pci_print_aer() may be called when dev->aer_info is NULL. Add a NULL check before proceeding to avoid calling aer_ratelimit() with a NULL aer_info pointer, returning 1, which does not rate limit, given this is fatal. This prevents a kernel crash triggered by

radeon_fbdev_river_fbdev: failed to initialize framebuffer and setup emulation

2025-08-04 Thread Christian Zigotzky
FYI: We are using PowerPC machines. + dri-devel > On 03 August 2025 at 05:28 pm, Christian Zigotzky > wrote: > > Hello, > > I have the same issue on another machine either. Blank screen during the > boot. The Radeon graphics framebuffer device doesn't work anymore. > > Here is the modifed

Re: [PATCH v2 2/2] powerpc/fprobe: fix updated fprobe for function-graph tracer

2025-08-04 Thread Venkat
> On 22 Jul 2025, at 2:26 PM, Aditya Bodkhe wrote: > > From: Hari Bathini > > Since commit 4346ba160409 ("fprobe: Rewrite fprobe on function-graph > tracer"), FPROBE depends on HAVE_FUNCTION_GRAPH_FREGS. With previous > patch adding HAVE_FUNCTION_GRAPH_FREGS for powerpc, FPROBE can be > enab

Re: [PATCH v2 1/2] powerpc/ftrace: support CONFIG_FUNCTION_GRAPH_RETVAL

2025-08-04 Thread Venkat
> On 22 Jul 2025, at 2:26 PM, Aditya Bodkhe wrote: > > commit a1be9ccc57f0 ("function_graph: Support recording and printing the > return value of function") introduced support for function graph return > value tracing. > > Additionally, commit a3ed4157b7d8 ("fgraph: Replace fgraph_ret_regs wi

Re: [PATCH v2 1/1] sched: preempt: Move dynamic keys into kernel/sched

2025-08-04 Thread Venkat
> On 16 Jul 2025, at 3:17 PM, Shrikanth Hegde wrote: > > Dynamic preemption can be static key or static call based. > Static key is used to check kernel preemption depending on > the current preemption model. i.e enable for lazy, full. > > Code is currently spread across entry/common.c, arm6

Re: [PATCH] pseries/lparcfg: Add resource group monitoring

2025-08-04 Thread Venkat
> On 16 Jul 2025, at 4:15 PM, Srikar Dronamraju wrote: > > Systems can now be partitioned into resource groups. By default all > systems will be part of default resource group. Once a resource group is > created, and resources allocated to the resource group, those resources > will be removed