Re: [PATCH 4/5] powerpc/spufs: consider vm_pgoff in spufs_mem_mmap_access()
From: Lorenzo Stoakes (ARM)
Date: Sat Nov 14 2026 - 14:00:12 EST
On Thu, Nov 12, 2026 at 11:09:00PM +0100, David Hildenbrand (Arm) wrote:
> spufs_mem_mmap_access() calculates the local store offset relative to the
> start of the VMA and ignores vm_pgoff. After VMA splits, debugger reads and
> writes access the wrong part of the local store. Mappings created with a
> nonzero file offset have the same problem.
>
> Properly take the vm_pgoff into account, just like spufs_mem_mmap_fault()
> already does.
>
> Fixes: a352894d0705 ("spufs: use new vm_ops->access to allow local state access from gdb")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
Seems sensible for similar reasoning for previous patch so:
Acked-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
> ---
> arch/powerpc/platforms/cell/spufs/file.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
> index 98c47bafaf678..0a46d6f7178ab 100644
> --- a/arch/powerpc/platforms/cell/spufs/file.c
> +++ b/arch/powerpc/platforms/cell/spufs/file.c
> @@ -248,7 +248,8 @@ static int spufs_mem_mmap_access(struct vm_area_struct *vma,
> void *buf, int len, int write)
> {
> struct spu_context *ctx = vma->vm_file->private_data;
> - unsigned long offset = address - vma->vm_start;
> + unsigned long offset = address - vma->vm_start +
> + (vma->vm_pgoff << PAGE_SHIFT);
> char *local_store;
>
> if (write && !(vma->vm_flags & VM_WRITE))
>
> --
> 2.43.0
>
--
Cheers, Lorenzo