From 2760bfb1fdd1b9eb336ec7e21f88fdf3a399a444 Mon Sep 17 00:00:00 2001 From: Mukul Joshi Date: Mon, 27 Jul 2026 16:41:28 -0400 Subject: [PATCH] drm/amdgpu: Drop BUG_ON in PDE address verification for GFX 12.1 Update the address mask to support 52-bits addresses when validating the PDE addresses for GFX 12.1. Currently the address mask was incorrect and only permitted 48-bits addresses. Additionally, drop the BUG_ON() and replace it with code to reset the invalid address and valid bit if the address verification fails. This should help generate a page fault instead of crashing the kernel. Signed-off-by: Mukul Joshi Reviewed-by: Philip Yang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c b/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c index 0d89cae582a8..e8e35d1b2276 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c @@ -575,7 +575,12 @@ static void gmc_v12_1_get_vm_pde(struct amdgpu_device *adev, int level, if (!(*flags & AMDGPU_PDE_PTE_GFX12) && !(*flags & AMDGPU_PTE_SYSTEM)) *addr = adev->vm_manager.vram_base_offset + *addr - adev->gmc.vram_start; - BUG_ON(*addr & 0xFFFF00000000003FULL); + + if (*addr & ~adev->gmc.pte_addr_mask) { + dev_err(adev->dev, "Invalid PDE address: %llx\n", *addr); + *addr = 0; + *flags &= ~AMDGPU_PTE_VALID; + } *flags |= AMDGPU_PTE_SNOOPED;