diff options
author | Emilio G. Cota <cota@braap.org> | 2017-07-26 20:22:51 -0400 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2018-06-15 07:42:55 -1000 |
commit | 0b5c91f74f3c83a36f37740969df8c775c997e69 (patch) | |
tree | b40f7bcd0f1ff33f63a59c9e6f2112a12b55ef4e /include/exec/exec-all.h | |
parent | 45c73de594414904b0d6a7ade70fb4514d35f79c (diff) | |
download | qemu-0b5c91f74f3c83a36f37740969df8c775c997e69.zip qemu-0b5c91f74f3c83a36f37740969df8c775c997e69.tar.gz qemu-0b5c91f74f3c83a36f37740969df8c775c997e69.tar.bz2 |
translate-all: use per-page locking in !user-mode
Groundwork for supporting parallel TCG generation.
Instead of using a global lock (tb_lock) to protect changes
to pages, use fine-grained, per-page locks in !user-mode.
User-mode stays with mmap_lock.
Sometimes changes need to happen atomically on more than one
page (e.g. when a TB that spans across two pages is
added/invalidated, or when a range of pages is invalidated).
We therefore introduce struct page_collection, which helps
us keep track of a set of pages that have been locked in
the appropriate locking order (i.e. by ascending page index).
This commit first introduces the structs and the function helpers,
to then convert the calling code to use per-page locking. Note
that tb_lock is not removed yet.
While at it, rename tb_alloc_page to tb_page_add, which pairs with
tb_page_remove.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/exec/exec-all.h')
-rw-r--r-- | include/exec/exec-all.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 07653d3..8d92e3c 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -359,7 +359,8 @@ struct TranslationBlock { /* original tb when cflags has CF_NOCACHE */ struct TranslationBlock *orig_tb; /* first and second physical page containing code. The lower bit - of the pointer tells the index in page_next[] */ + of the pointer tells the index in page_next[]. + The list is protected by the TB's page('s) lock(s) */ uintptr_t page_next[2]; tb_page_addr_t page_addr[2]; |