* [PATCH] drm/amdgpu: OR init_pte_flags into invalid leaf PTE updates
@ 2026-04-14 18:48 Siwei He
2026-04-16 14:29 ` Philip Yang
0 siblings, 1 reply; 2+ messages in thread
From: Siwei He @ 2026-04-14 18:48 UTC (permalink / raw)
To: amd-gfx; +Cc: felix.kuehling, harish.kasiviswanathan, Siwei He
Invalid leaf clears that only set AMDGPU_PTE_EXECUTABLE match the old
GMC9 fault-priority workaround but omit adev->gmc.init_pte_flags.
On GFX12 that includes AMDGPU_PTE_IS_PTE; without it, some cleared
PTEs can fault as no-retry and bypass the SVM/XNACK handler when a
VA is reused after a BO unmap.
Apply init_pte_flags in amdgpu_vm_pte_update_flags() alongside
EXECUTABLE so range-driven clears (e.g. amdgpu_vm_clear_freed) match
amdgpu_vm_pt_clear() for leaf templates.
Signed-off-by: Siwei He <siwei.he@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
index 31a437ce9570..a930f1522f96 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
@@ -693,8 +693,11 @@ static void amdgpu_vm_pte_update_flags(struct amdgpu_vm_update_params *params,
!(flags & AMDGPU_PTE_VALID) &&
!(flags & AMDGPU_PTE_PRT_FLAG(params->adev))) {
- /* Workaround for fault priority problem on GMC9 */
- flags |= AMDGPU_PTE_EXECUTABLE;
+ /* Workaround for fault priority problem on GMC9 and GFX12,
+ * EXECUTABLE for GMC9 fault priority and init_pte_flags
+ * (e.g. AMDGPU_PTE_IS_PTE on GFX12)
+ */
+ flags |= AMDGPU_PTE_EXECUTABLE | adev->gmc.init_pte_flags;
}
/*
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] drm/amdgpu: OR init_pte_flags into invalid leaf PTE updates
2026-04-14 18:48 [PATCH] drm/amdgpu: OR init_pte_flags into invalid leaf PTE updates Siwei He
@ 2026-04-16 14:29 ` Philip Yang
0 siblings, 0 replies; 2+ messages in thread
From: Philip Yang @ 2026-04-16 14:29 UTC (permalink / raw)
To: Siwei He, amd-gfx; +Cc: felix.kuehling, harish.kasiviswanathan
[-- Attachment #1: Type: text/plain, Size: 1663 bytes --]
On 2026-04-14 14:48, Siwei He wrote:
> Invalid leaf clears that only set AMDGPU_PTE_EXECUTABLE match the old
> GMC9 fault-priority workaround but omit adev->gmc.init_pte_flags.
> On GFX12 that includes AMDGPU_PTE_IS_PTE; without it, some cleared
> PTEs can fault as no-retry and bypass the SVM/XNACK handler when a
> VA is reused after a BO unmap.
>
> Apply init_pte_flags in amdgpu_vm_pte_update_flags() alongside
> EXECUTABLE so range-driven clears (e.g. amdgpu_vm_clear_freed) match
> amdgpu_vm_pt_clear() for leaf templates.
>
> Signed-off-by: Siwei He<siwei.he@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
> index 31a437ce9570..a930f1522f96 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
> @@ -693,8 +693,11 @@ static void amdgpu_vm_pte_update_flags(struct amdgpu_vm_update_params *params,
> !(flags & AMDGPU_PTE_VALID) &&
> !(flags & AMDGPU_PTE_PRT_FLAG(params->adev))) {
>
> - /* Workaround for fault priority problem on GMC9 */
> - flags |= AMDGPU_PTE_EXECUTABLE;
> + /* Workaround for fault priority problem on GMC9 and GFX12,
> + * EXECUTABLE for GMC9 fault priority and init_pte_flags
> + * (e.g. AMDGPU_PTE_IS_PTE on GFX12)
> + */
> + flags |= AMDGPU_PTE_EXECUTABLE | adev->gmc.init_pte_flags;
Looks good to me, !(flags & AMDGPU_PTE_PRT_FLAG(params->adev) handles the NPA mapping update case correctly too.
Reviewed-by: Philip Yang<philip.yang@amd.com>
> }
>
> /*
[-- Attachment #2: Type: text/html, Size: 2352 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-16 14:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-14 18:48 [PATCH] drm/amdgpu: OR init_pte_flags into invalid leaf PTE updates Siwei He
2026-04-16 14:29 ` Philip Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox