b3c4e94e70
* rocr: Add ProtectMemory API and use it in RemoveAccess Replace munmap + mmap with mprotect when removing memory access. This improves performance by 5-10x, ensures atomicity (no race condition window), and prepares for WSL/DXG compatibility fixes. Suggested-by: David Yat Sin <David.YatSin@amd.com> Signed-off-by: Flora Cui <flora.cui@amd.com> Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com> * rocr: Skip CPU mapping operations on WSL On WSL, CPU cannot access GPU VRAM due to platform restrictions. CPU access would fault-in system RAM instead, causing data corruption and memory leaks. Return HSA_STATUS_ERROR to fail fast rather than silently creating broken mappings. GPU-to-GPU mappings remain functional. Signed-off-by: Flora Cui <flora.cui@amd.com> Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com> * rocr: reduce ifdef linux v2: Fix IsDXG check logic Signed-off-by: David Yat Sin <David.YatSin@amd.com> Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com> --------- Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com> Signed-off-by: David Yat Sin <David.YatSin@amd.com> Signed-off-by: Flora Cui <flora.cui@amd.com>