Skip to content

Commit aa5b306

Browse files
committed
qemu: fix crash on macOS 11.2
1 parent db2922b commit aa5b306

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

patches/qemu-5.2.0-asi.patch

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,34 @@ index 5773c561cb..165e631e04 100644
247247
--
248248
2.28.0
249249

250+
From c8b356ceda87e21cda1598bcaaf3985b44065991 Mon Sep 17 00:00:00 2001
251+
From: osy <50960678+osy@users.noreply.github.com>
252+
Date: Fri, 22 Jan 2021 22:41:32 -0800
253+
Subject: [PATCH] tcg: disable assertion for mprotect(PROT_NONE)
254+
255+
On macOS 11.2, the system returns error if you try to PROT_NONE a JIT
256+
region.
257+
---
258+
tcg/tcg.c | 4 ++--
259+
1 file changed, 2 insertions(+), 2 deletions(-)
260+
261+
diff --git a/tcg/tcg.c b/tcg/tcg.c
262+
index c218e0c1b7..7a300016f6 100644
263+
--- a/tcg/tcg.c
264+
+++ b/tcg/tcg.c
265+
@@ -741,10 +741,10 @@ void tcg_region_init(void)
266+
267+
tcg_region_bounds(i, &start, &end);
268+
rc = qemu_mprotect_none(end, page_size);
269+
- g_assert(!rc);
270+
+ //g_assert(!rc);
271+
if (splitwx_diff) {
272+
rc = qemu_mprotect_none(end + splitwx_diff, page_size);
273+
- g_assert(!rc);
274+
+ //g_assert(!rc);
275+
}
276+
}
277+
278+
--
279+
2.28.0
280+

0 commit comments

Comments
 (0)