Skip to content

Commit 9d20ee8

Browse files
committed
[qemu]In interpreter mode, disable allocation of _EXEC memory
1 parent 771e1a7 commit 9d20ee8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

qemu/accel/tcg/translate-all.c

+6
Original file line numberDiff line numberDiff line change
@@ -1019,12 +1019,18 @@ void free_code_gen_buffer(struct uc_struct *uc)
10191019
static inline void *alloc_code_gen_buffer(struct uc_struct *uc)
10201020
{
10211021
TCGContext *tcg_ctx = uc->tcg_ctx;
1022+
#if CONFIG_TCG_INTERPRETER
1023+
int prot = PROT_WRITE | PROT_READ;
1024+
#else
10221025
int prot = PROT_WRITE | PROT_READ | PROT_EXEC;
1026+
#endif
10231027
int flags = MAP_PRIVATE | MAP_ANONYMOUS;
10241028
size_t size = tcg_ctx->code_gen_buffer_size;
10251029
void *buf;
1030+
#if !CONFIG_TCG_INTERPRETER
10261031
#ifdef USE_MAP_JIT
10271032
flags |= MAP_JIT;
1033+
#endif
10281034
#endif
10291035
buf = mmap(NULL, size, prot, flags, -1, 0);
10301036
if (buf == MAP_FAILED) {

qemu/configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -2570,7 +2570,7 @@ if test "$have_sprr" = "yes" ; then
25702570
fi
25712571

25722572
if test "$interpreter" = "yes" ; then
2573-
echo "HAVE_INTERPRETER=y" >> $config_host_mak
2573+
echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak
25742574
fi
25752575

25762576
# Hold two types of flag:

0 commit comments

Comments
 (0)