Jinoh Kang (@iamahuman) commented about dlls/ntdll/unix/virtual.c:
+ a problem since in that case we didn't have permission to lock the memory either */ + if (ret && errno != EPERM) + goto failed; + dontneed_page = mem; + } + /* Force the page into memory to make madvise() have real work to do */ + *mem = 3; + /* Evict the page from memory to force the kernel to send an IPI to all threads of this process, + which has the side effect of executing a memory barrier in those threads */ + success = !madvise( mem, page_size, MADV_DONTNEED ); +#ifdef __aarch64__ + /* Some ARMv8 processors can broadcast TLB invalidations using the TLBI instruction, + the madvise trick does not work on those */ + if (success && !once++) + FIXME( "memory barrier may not work on this platform\n" ); +#endif I think this should be unconditional and not specific to aarch64. `mprotect()` is and always will be a hack, and other archs might implement TLBI like operation too.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/741#note_61472