From cfb1ab45acfde9cfb8777235c3423ce32dc3a9e3 Mon Sep 17 00:00:00 2001 From: Joseph Greathouse Date: Thu, 29 Aug 2024 13:56:16 +0000 Subject: [PATCH] hsakmt: Only set exec flag when requested Previous code would blindly set executable bit on all allocations. Change-Id: Id1154f08f6ba21c633905fd46b06053994d6f3cc [ROCm/ROCR-Runtime commit: 75143555fa068ac6afd2879b4398681c341a1215] --- projects/rocr-runtime/libhsakmt/src/fmm.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/projects/rocr-runtime/libhsakmt/src/fmm.c b/projects/rocr-runtime/libhsakmt/src/fmm.c index 65863f45d6..f833d843c7 100644 --- a/projects/rocr-runtime/libhsakmt/src/fmm.c +++ b/projects/rocr-runtime/libhsakmt/src/fmm.c @@ -1385,11 +1385,8 @@ static uint32_t fmm_translate_hsa_to_ioc_flags(HsaMemFlags flags) KFD_IOC_ALLOC_MEM_FLAGS_UNCACHED); if (!flags.ui32.ReadOnly) ioc_flags |= KFD_IOC_ALLOC_MEM_FLAGS_WRITABLE; - /* TODO: Since, ROCr interfaces doesn't allow caller to set page - * permissions, mark all user allocations with exec permission. - * Check for flags.ui32.ExecuteAccess once ROCr is ready. - */ - ioc_flags |= KFD_IOC_ALLOC_MEM_FLAGS_EXECUTABLE; + if (flags.ui32.ExecuteAccess) + ioc_flags |= KFD_IOC_ALLOC_MEM_FLAGS_EXECUTABLE; return ioc_flags; }