[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 07/33] linux-user/elfload: ensure mmap_lock() hel
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v5 07/33] linux-user/elfload: ensure mmap_lock() held while setting up |
Date: |
Thu, 27 Oct 2016 16:10:04 +0100 |
Future patches will enforce the holding of mmap_lock() when we are
manipulating internal memory structures. Technically it doesn't matter
in the case of elfload as we haven't started executing yet. However it
is easier to grab the lock when required than special case the
translate-all API.
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
---
v4
- split from assert patch
---
linux-user/elfload.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 816272a..547053c 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1842,6 +1842,8 @@ static void load_elf_image(const char *image_name, int
image_fd,
info->pt_dynamic_addr = 0;
#endif
+ mmap_lock();
+
/* Find the maximum size of the image and allocate an appropriate
amount of memory to handle that. */
loaddr = -1, hiaddr = 0;
@@ -2002,6 +2004,8 @@ static void load_elf_image(const char *image_name, int
image_fd,
load_symbols(ehdr, image_fd, load_bias);
}
+ mmap_unlock();
+
close(image_fd);
return;
--
2.10.1
- [Qemu-devel] [PATCH v5 00/33] MTTCG Base Enabling patches with ARM on x86 defaults, Alex Bennée, 2016/10/27
- [Qemu-devel] [PATCH v5 02/33] translate_all: DEBUG_FLUSH -> DEBUG_TB_FLUSH, Alex Bennée, 2016/10/27
- [Qemu-devel] [PATCH v5 01/33] cpus: make all_vcpus_paused() return bool, Alex Bennée, 2016/10/27
- [Qemu-devel] [PATCH v5 04/33] cpu-exec: include cpu_index in CPU_LOG_EXEC messages, Alex Bennée, 2016/10/27
- [Qemu-devel] [PATCH v5 05/33] docs: new design document multi-thread-tcg.txt (DRAFTING), Alex Bennée, 2016/10/27
- [Qemu-devel] [PATCH v5 07/33] linux-user/elfload: ensure mmap_lock() held while setting up,
Alex Bennée <=
- [Qemu-devel] [PATCH v5 08/33] translate-all: Add assert_(memory|tb)_lock annotations, Alex Bennée, 2016/10/27
- [Qemu-devel] [PATCH v5 10/33] target-arm/arm-powerctl: wake up sleeping CPUs, Alex Bennée, 2016/10/27
- [Qemu-devel] [PATCH v5 03/33] translate-all: add DEBUG_LOCKING asserts, Alex Bennée, 2016/10/27
- [Qemu-devel] [PATCH v5 09/33] tcg: protect translation related stuff with tb_lock., Alex Bennée, 2016/10/27
- [Qemu-devel] [PATCH v5 12/33] tcg: cpus rm tcg_exec_all(), Alex Bennée, 2016/10/27
- [Qemu-devel] [PATCH v5 14/33] tcg: add kick timer for single-threaded vCPU emulation, Alex Bennée, 2016/10/27
- [Qemu-devel] [PATCH v5 13/33] tcg: add options for enabling MTTCG, Alex Bennée, 2016/10/27
- [Qemu-devel] [PATCH v5 17/33] cpus: re-factor out handle_icount_deadline, Alex Bennée, 2016/10/27