[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 41/43] tcg: comment on which functions have to be cal
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 41/43] tcg: comment on which functions have to be called with mmap_lock held |
Date: |
Wed, 9 Sep 2015 15:50:11 +0200 |
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
translate-all.c | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/translate-all.c b/translate-all.c
index 5329982..a12139b 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -171,11 +171,13 @@ void cpu_gen_init(void)
}
/* return non zero if the very first instruction is invalid so that
- the virtual CPU can trigger an exception.
-
- '*gen_code_size_ptr' contains the size of the generated code (host
- code).
-*/
+ * the virtual CPU can trigger an exception.
+ *
+ * '*gen_code_size_ptr' contains the size of the generated code (host
+ * code).
+ *
+ * Called with mmap_lock held for user-mode emulation.
+ */
int cpu_gen_code(CPUArchState *env, TranslationBlock *tb, int
*gen_code_size_ptr)
{
TCGContext *s = &tcg_ctx;
@@ -420,6 +422,9 @@ static void page_init(void)
#endif
}
+/* If alloc=1:
+ * Called with mmap_lock held for user-mode emulation.
+ */
static PageDesc *page_find_alloc(tb_page_addr_t index, int alloc)
{
PageDesc *pd;
@@ -1029,6 +1034,7 @@ static void build_page_bitmap(PageDesc *p)
}
}
+/* Called with mmap_lock held for user mode emulation. */
TranslationBlock *tb_gen_code(CPUState *cpu,
target_ulong pc, target_ulong cs_base,
int flags, int cflags)
@@ -1076,6 +1082,8 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
* 'is_cpu_write_access' should be true if called from a real cpu write
* access: the virtual CPU will exit the current TB if code is modified inside
* this TB.
+ *
+ * Called with mmap_lock held for user-mode emulation
*/
void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end)
{
@@ -1092,6 +1100,8 @@ void tb_invalidate_phys_range(tb_page_addr_t start,
tb_page_addr_t end)
* 'is_cpu_write_access' should be true if called from a real cpu write
* access: the virtual CPU will exit the current TB if code is modified inside
* this TB.
+ *
+ * Called with mmap_lock held for user-mode emulation
*/
void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
int is_cpu_write_access)
@@ -1240,6 +1250,7 @@ void tb_invalidate_phys_page_fast(tb_page_addr_t start,
int len)
}
#if !defined(CONFIG_SOFTMMU)
+/* Called with mmap_lock held. */
static void tb_invalidate_phys_page(tb_page_addr_t addr,
uintptr_t pc, void *puc,
bool locked)
@@ -1309,7 +1320,10 @@ static void tb_invalidate_phys_page(tb_page_addr_t addr,
}
#endif
-/* add the tb in the target page and protect it if necessary */
+/* add the tb in the target page and protect it if necessary
+ *
+ * Called with mmap_lock held for user-mode emulation.
+ */
static inline void tb_alloc_page(TranslationBlock *tb,
unsigned int n, tb_page_addr_t page_addr)
{
@@ -1365,7 +1379,8 @@ static inline void tb_alloc_page(TranslationBlock *tb,
}
/* add a new TB and link it to the physical page tables. phys_page2 is
- (-1) to indicate that only one page contains the TB. */
+ * (-1) to indicate that only one page contains the TB.
+ */
static void tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc,
tb_page_addr_t phys_page2)
{
--
2.4.3
- [Qemu-devel] [PULL 25/43] cutils: Add qemu_strtoll() wrapper, (continued)
- [Qemu-devel] [PULL 25/43] cutils: Add qemu_strtoll() wrapper, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 29/43] checkpatch: adapt some tests to QEMU, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 30/43] checkpatch: remove tests that are not relevant outside the kernel, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 31/43] vhost-scsi: fix wrong vhost-scsi firmware path, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 32/43] configure: factor out adding disas configure, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 34/43] configure: Add support for jemalloc, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 35/43] scripts/dump-guest-memory.py: fix after RAMBlock change, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 33/43] add macro file for coccinelle, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 37/43] cpus: remove tcg_halt_cond and tcg_cpu_thread globals, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 36/43] cpus: protect work list with work_mutex, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 41/43] tcg: comment on which functions have to be called with mmap_lock held,
Paolo Bonzini <=
- [Qemu-devel] [PULL 39/43] remove unused spinlock., Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 40/43] tcg: add memory barriers in page_find_alloc accesses, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 42/43] exec: make mmap_lock/mmap_unlock globally available, Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 38/43] replace spinlock by QemuMutex., Paolo Bonzini, 2015/09/09
- [Qemu-devel] [PULL 43/43] cpu-exec: fix lock hierarchy for user-mode emulation, Paolo Bonzini, 2015/09/09
- Re: [Qemu-devel] [PULL 00/43] First batch of misc changes for 2.5 (2015-09-09), Peter Maydell, 2015/09/09