Re: [PATCH v2] perf test amd ibs: avoid using executable heap
From: Ravi Bangoria
Date: Thu Jul 02 2026 - 07:12:02 EST
>>>> permission under SELinux (things like JIT or regex compilation need it
>>>> as well). mmap() with MAP_ANONYMOUS will give us a zeroed mapping that
>>>> begins on a page boundary, so the result is equivalent to the original
>>>> code even without a memset() or the page-alignment dance.
>>>
>>> I would argue that having RWX is a problem, you really want RW->RO->RX
>>> transitions, so even with mmap() you want to combine with mprotect().
>>
>> My original intent for using RWX was to generate sufficient Icache miss
>> samples for the IBS Fetch unit by overwriting the code prior to execution.
>> I am wondering whether it would be possible to achieve the same result
>> by using CLFLUSH with RX permissions. Something like below (build tested
>> only).
>
> So for a test it is fine to have RWX
Sure, makes sense.
Thanks,
Ravi