Skip to content

Commit 90ae44d

Browse files
committed
accel/amdxdna: Preserve user address when PASID is disabled
When PASID is not used, the buffer user address is set to AMDXDNA_INVALID_ADDR. As a result, heap buffer user address validation fails even though the original userspace address is available. Preserve the userspace address regardless of PASID usage so heap buffer address validation works correctly. Fixes: dbc8fd7 ("accel/amdxdna: Add expandable device heap support") Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com> Link: https://patch.msgid.link/20260602040624.2206774-1-lizhi.hou@amd.com
1 parent b81e8b0 commit 90ae44d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/accel/amdxdna/amdxdna_gem.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,11 @@ static int amdxdna_hmm_register(struct amdxdna_gem_obj *abo,
349349
u32 nr_pages;
350350
int ret;
351351

352-
if (!amdxdna_pasid_on(abo->client))
352+
if (!amdxdna_pasid_on(abo->client)) {
353+
/* Need to set uva for heap uva validation */
354+
abo->mem.uva = addr;
353355
return 0;
356+
}
354357

355358
mapp = kzalloc_obj(*mapp);
356359
if (!mapp)

0 commit comments

Comments
 (0)