From a8664a74710ee6b7a680beb1f79b85f4a72a34bc Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Mon, 8 Jan 2024 22:27:25 +0000 Subject: [PATCH] VMM: Default access should be none After a memory handle is created. hsa_amd_vmem_get_access should return HSA_ACCESS_PERMISSION_NONE insread of reporting the allocation as invalid. Change-Id: I1a09d15c220d48497d09c89059493e538f82aeb9 [ROCm/ROCR-Runtime commit: 2f97049da5c7fb4606367dfff0f8c2dfc8932b87] --- .../runtime/hsa-runtime/core/runtime/runtime.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp index f9b20223df..0ed152d460 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -3287,7 +3287,10 @@ hsa_status_t Runtime::VMemoryGetAccess(const void* va, hsa_access_permission_t* *perms = agentPermsIt->second.permissions; return HSA_STATUS_SUCCESS; } - return HSA_STATUS_ERROR_INVALID_ALLOCATION; + + /* Set access was not called on this memory handle */ + *perms = HSA_ACCESS_PERMISSION_NONE; + return HSA_STATUS_SUCCESS; } hsa_status_t Runtime::VMemoryExportShareableHandle(int* dmabuf_fd,