summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorShaobo Song <shnusongshaobo@gmail.com>2022-06-24 23:02:17 +0800
committerRichard Henderson <richard.henderson@linaro.org>2022-07-12 10:30:10 +0530
commitba8924113ca459d02ee67656a713f7ff494b968e (patch)
tree950686eb0dfad3877581a155d22b34247f596534
parent9fed1bca6bc643ce91b6117f4974421aaede4751 (diff)
downloadfocaccia-qemu-ba8924113ca459d02ee67656a713f7ff494b968e.tar.gz
focaccia-qemu-ba8924113ca459d02ee67656a713f7ff494b968e.zip
tcg: Fix returned type in alloc_code_gen_buffer_splitwx_memfd()
This fixes a bug in POSIX-compliant environments. Since we had allocated
a buffer named 'tcg-jit' with read-write access protections we need a int
type to combine these access flags and return it, whereas we had inexplicably
return a bool type. It may cause an unnecessary protection change in
tcg_region_init().

Cc: qemu-stable@nongnu.org
Fixes: 7be9ebcf924c ("tcg: Return the map protection from alloc_code_gen_buffer")
Signed-off-by: Shaobo Song <shnusongshaobo@gmail.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220624150216.3627-1-shnusongshaobo@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--tcg/region.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tcg/region.c b/tcg/region.c
index 71ea81d671..88d6bb273f 100644
--- a/tcg/region.c
+++ b/tcg/region.c
@@ -548,7 +548,7 @@ static int alloc_code_gen_buffer_anon(size_t size, int prot,
 #ifdef CONFIG_POSIX
 #include "qemu/memfd.h"
 
-static bool alloc_code_gen_buffer_splitwx_memfd(size_t size, Error **errp)
+static int alloc_code_gen_buffer_splitwx_memfd(size_t size, Error **errp)
 {
     void *buf_rw = NULL, *buf_rx = MAP_FAILED;
     int fd = -1;