From 09010eb68a33a3098137c5affbc7acb238c71567 Mon Sep 17 00:00:00 2001 From: JeniferC99 <150404595+JeniferC99@users.noreply.github.com> Date: Wed, 19 Nov 2025 10:33:50 -0800 Subject: [PATCH] Revert "rocr: Fix VMM cpu mapping clean up (#1831)" (#1923) This reverts commit 2327cd35c89bc8a8b5ba1ec16caea982c5028725. --- .../runtime/hsa-runtime/core/runtime/runtime.cpp | 12 ------------ 1 file changed, 12 deletions(-) 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 8e10b7be74..50391f02a6 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -3707,18 +3707,6 @@ hsa_status_t Runtime::VMemoryHandleUnmap(void* va, size_t size) { } for (auto mappedHandleIt : mappedHandles) { - /* Need to remove the default CPU mapping that was added in MappedHandle constructor. - * We remove it before calling RemoveAccess(). Otherwise we would unnecessarily call mmap(..,PROT_NONE,..) - * and then later call munmap. - */ - auto cpu_agent = static_cast(mappedHandleIt.second->agentOwner())->GetNearestCpuAgent(); - auto cpu_agent_it = mappedHandleIt.second->allowed_agents.find(cpu_agent); - if (cpu_agent_it != mappedHandleIt.second->allowed_agents.end()) { - if (munmap(cpu_agent_it->second.va, cpu_agent_it->second.size) != 0) { - return HSA_STATUS_ERROR; - } - } - // Remove access from all agents that were allowed access for (auto agentPermsIt = mappedHandleIt.second->allowed_agents.begin(); agentPermsIt != mappedHandleIt.second->allowed_agents.end();) {