summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLizhi Hou <lizhi.hou@amd.com>2026-06-01 21:06:24 -0700
committerLizhi Hou <lizhi.hou@amd.com>2026-06-02 08:36:30 -0700
commit90ae44d1e1bc67e8f6ceef56f184047c5fe775c7 (patch)
tree8535c218646e6f47b9597e3034efc1fa9e60185a
parentb81e8b02e8f26b13ff4d6410f7a9854ba7021b86 (diff)
downloadlinux-90ae44d1e1bc67e8f6ceef56f184047c5fe775c7.tar.gz
linux-90ae44d1e1bc67e8f6ceef56f184047c5fe775c7.zip
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: dbc8fd7a03cb ("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
-rw-r--r--drivers/accel/amdxdna/amdxdna_gem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c
index 00efa8abfeea..63976c3bcbe0 100644
--- a/drivers/accel/amdxdna/amdxdna_gem.c
+++ b/drivers/accel/amdxdna/amdxdna_gem.c
@@ -349,8 +349,11 @@ static int amdxdna_hmm_register(struct amdxdna_gem_obj *abo,
u32 nr_pages;
int ret;
- if (!amdxdna_pasid_on(abo->client))
+ if (!amdxdna_pasid_on(abo->client)) {
+ /* Need to set uva for heap uva validation */
+ abo->mem.uva = addr;
return 0;
+ }
mapp = kzalloc_obj(*mapp);
if (!mapp)