[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/8] tcg: Clarify "thread safaty" check in tb_ad
From: |
Artyom Tarasenko |
Subject: |
Re: [Qemu-devel] [PATCH 5/8] tcg: Clarify "thread safaty" check in tb_add_jump() |
Date: |
Thu, 24 Mar 2016 13:23:47 +0100 |
s/safaty/safety/ ?
On Thu, Mar 24, 2016 at 11:39 AM, <address@hidden> wrote:
> From: Sergey Fedorov <address@hidden>
>
> The check does not give an absolute guarantee of thread safety because
> there still may be a race condition between two threads which both have
> just read zero from jmp_list_next[n] and proceed with list modification.
> Clarify this in the comment to attract here some attention.
>
> Signed-off-by: Sergey Fedorov <address@hidden>
> Signed-off-by: Sergey Fedorov <address@hidden>
> ---
> include/exec/exec-all.h | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
> index cd96219a89e7..4f36d109ac7f 100644
> --- a/include/exec/exec-all.h
> +++ b/include/exec/exec-all.h
> @@ -390,7 +390,10 @@ static inline void tb_set_jmp_target(TranslationBlock
> *tb,
> static inline void tb_add_jump(TranslationBlock *tb, int n,
> TranslationBlock *tb_next)
> {
> - /* NOTE: this test is only needed for thread safety */
> + /* FIXME: This test provides only some probablistic "thread safety" for
> + * user-mode emulation; appropriate synchronization/locking scheme should
> + * be implemented.
> + */
> if (!tb->jmp_list_next[n]) {
> /* patch the native jump address */
> tb_set_jmp_target(tb, n, (uintptr_t)tb_next->tc_ptr);
> --
> 2.7.3
>
>
--
Regards,
Artyom Tarasenko
SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu
- Re: [Qemu-devel] [PATCH 1/8] tcg: Clean up direct block chaining data fields, (continued)
[Qemu-devel] [PATCH 2/8] tcg: Use uintptr_t type for jmp_list_{next|first} fields of TB, sergey . fedorov, 2016/03/24
[Qemu-devel] [PATCH 5/8] tcg: Clarify "thread safaty" check in tb_add_jump(), sergey . fedorov, 2016/03/24
[Qemu-devel] [PATCH 3/8] tcg: Rearrange tb_link_page() to avoid forward declaration, sergey . fedorov, 2016/03/24
[Qemu-devel] [PATCH 6/8] tcg: Rename tb_jmp_remove() to tb_remove_from_jmp_list(), sergey . fedorov, 2016/03/24
[Qemu-devel] [PATCH 8/8] tcg: Clean up tb_jmp_unlink(), sergey . fedorov, 2016/03/24
[Qemu-devel] [PATCH 4/8] tcg: Init TB's direct jumps before making it visible, sergey . fedorov, 2016/03/24