Linux/ARM64: Make mremap() non-moving due to VA space woes.

This reduces overall performance on ARM64, but we have no choice.
Linux kernel default userspace VA is 48 bit, but we'd need 47 bit.
mremap() ignores address hints due to a kernel API issue. The mapping
may move to an undesired address which will cause an assert or crash.

Reported by Raymond W. Ko.
This commit is contained in:
Mike Pall 2021-03-10 19:58:31 +01:00
parent ec6edc5c39
commit 67dbec82f4

View File

@ -365,7 +365,7 @@ static void *CALL_MREMAP_(void *ptr, size_t osz, size_t nsz, int flags)
#define CALL_MREMAP(addr, osz, nsz, mv) CALL_MREMAP_((addr), (osz), (nsz), (mv)) #define CALL_MREMAP(addr, osz, nsz, mv) CALL_MREMAP_((addr), (osz), (nsz), (mv))
#define CALL_MREMAP_NOMOVE 0 #define CALL_MREMAP_NOMOVE 0
#define CALL_MREMAP_MAYMOVE 1 #define CALL_MREMAP_MAYMOVE 1
#if LJ_64 && !LJ_GC64 #if LJ_64 && (!LJ_GC64 || LJ_TARGET_ARM64)
#define CALL_MREMAP_MV CALL_MREMAP_NOMOVE #define CALL_MREMAP_MV CALL_MREMAP_NOMOVE
#else #else
#define CALL_MREMAP_MV CALL_MREMAP_MAYMOVE #define CALL_MREMAP_MV CALL_MREMAP_MAYMOVE