]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
nouveau/vmm: start tracking if the LPT PTE is valid. (v6)
authorDave Airlie <airlied@redhat.com>
Wed, 4 Feb 2026 03:00:07 +0000 (13:00 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 4 Feb 2026 20:05:09 +0000 (06:05 +1000)
commitd19512f5abb198daf29da877f6a02c667a95c03d
treeaab7ffa588a65919a526ae0fe9877a97fc08ad34
parent9dc983a85eb9b546bbe2ef3f2345e338aa655789
nouveau/vmm: start tracking if the LPT PTE is valid. (v6)

When NVK enabled large pages userspace tests were seeing fault
reports at a valid address.

There was a case where an address moving from 64k page to 4k pages
could expose a race between unmapping the 4k page, mapping the 64k
page and unref the 4k pages.

Unref 4k pages would cause the dual-page table handling to always
set the LPTE entry to SPARSE or INVALID, but if we'd mapped a valid
LPTE in the meantime, it would get trashed. Keep track of when
a valid LPTE has been referenced, and don't reset in that case.

This adds an lpte valid tracker and lpte reference count.

Whenever an lpte is referenced, it gets made valid and the ref count
increases, whenever it gets unreference the refcount is tracked.

Link: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14610
Reviewed-by: Mary Guillemard <mary@mary.zone>
Tested-by: Mary Guillemard <mary@mary.zone>
Tested-by: Mel Henning <mhenning@darkrefraction.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patch.msgid.link/20260204030208.2313241-4-airlied@gmail.com
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.h