From 4912f62a8f263e5673012de6ed489402af2d63bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 2 Jun 2023 15:54:30 +0200 Subject: [PATCH] Revert "Add patch to fix Linux kernel regression with mmap and `MAP_32BIT`" This reverts commit d496154ab169bade5dc1e9f1b69444dc5036334f. The Linux kernel regression has been patched in 6.1.30 and 6.3.4. --- .../mono-linux-disable-mmap-MAP_32BIT.diff | 47 ------------------- patch_mono.py | 1 - 2 files changed, 48 deletions(-) delete mode 100644 files/patches/mono-linux-disable-mmap-MAP_32BIT.diff diff --git a/files/patches/mono-linux-disable-mmap-MAP_32BIT.diff b/files/patches/mono-linux-disable-mmap-MAP_32BIT.diff deleted file mode 100644 index dafa238..0000000 --- a/files/patches/mono-linux-disable-mmap-MAP_32BIT.diff +++ /dev/null @@ -1,47 +0,0 @@ -From e019d4ac4735e774d0a3c15bb36d5eb3ebfa3053 Mon Sep 17 00:00:00 2001 -From: Raphael Robatsch -Date: Tue, 9 May 2023 11:55:02 +0200 -Subject: [PATCH] Disable mmap(MAP_32BIT) support - -mmap(2) with flag MAP_32BIT can erroneously return ENOMEM on recent -kernels. Disable MAP_32BIT support for now. - -Reference: https://lore.kernel.org/linux-mm/cb8dc31a-fef2-1d09-f133-e9f7b9f9e77a@sony.com/ -Reference: https://lore.kernel.org/all/20230414185919.4175572-1-Liam.Howlett@oracle.com/T/#m00a0ac8a72bf2f26711b7f8cc56612a8ef62c3d0 ---- - mono/mini/mini-amd64.h | 2 -- - mono/utils/mono-codeman.c | 4 ---- - 2 files changed, 6 deletions(-) - -diff --git a/mono/mini/mini-amd64.h b/mono/mini/mini-amd64.h -index a5c03c4877c..536a79ef59d 100644 ---- a/mono/mini/mini-amd64.h -+++ b/mono/mini/mini-amd64.h -@@ -390,9 +390,7 @@ typedef struct { - - #endif /* !HOST_WIN32 */ - --#if !defined(__linux__) - #define MONO_ARCH_NOMAP32BIT 1 --#endif - - #ifdef TARGET_WIN32 - #define MONO_AMD64_ARG_REG1 AMD64_RCX -diff --git a/mono/utils/mono-codeman.c b/mono/utils/mono-codeman.c -index 234aac4b0ca..5eccda92bd0 100644 ---- a/mono/utils/mono-codeman.c -+++ b/mono/utils/mono-codeman.c -@@ -68,11 +68,7 @@ static const MonoCodeManagerCallbacks *code_manager_callbacks; - #define MAX_WASTAGE 32 - #define MIN_BSIZE 32 - --#ifdef __x86_64__ --#define ARCH_MAP_FLAGS MONO_MMAP_32BIT --#else - #define ARCH_MAP_FLAGS 0 --#endif - - #define MONO_PROT_RWX (MONO_MMAP_READ|MONO_MMAP_WRITE|MONO_MMAP_EXEC|MONO_MMAP_JIT) - --- -2.40.1 diff --git a/patch_mono.py b/patch_mono.py index 5d06a51..6f803ac 100755 --- a/patch_mono.py +++ b/patch_mono.py @@ -34,7 +34,6 @@ def main(raw_args): 'wasm_m2n_trampolines_hook.diff', 'btls-cmake-args-linux-mingw.diff', 'btls-cmake-arm64.diff', - 'mono-linux-disable-mmap-MAP_32BIT.diff', ] if os.path.isfile(os.path.join(mono_source_root, 'mono/tools/offsets-tool/offsets-tool.py')):