[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/10] cpu-exec: elide more icount code if CONFI
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 05/10] cpu-exec: elide more icount code if CONFIG_USER_ONLY |
Date: |
Sat, 29 Aug 2015 09:07:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 28/08/2015 16:56, Peter Maydell wrote:
> What's the rationale for this? Mostly we prefer not to
> add ifdefs in code if we can get away with compiling it for
> both cases, even if the resulting code isn't used.
True. The rationale is three-fold:
1) It makes sense to abort if TB_EXIT_ICOUNT_EXPIRED is returned from
user-mode emulation TCG code. Then you need to either leave the
unreachable code after abort() or #ifdef cpu_exec_nocache out.
2) Dually, cpu_exec_nocache's future locking requirements (take tb_lock,
mostly) are not yet respected as of this patch. Marking the function as
#ifdef CONFIG_SOFTMMU explains why. Once you do that, you have to
abort() either in cpu_exec_nocache or in the caller.
Reason (2) is stronger for me. You mentioned a few times your hope that
MTTCG would lead to more correct and more documented thread support in
user-mode emulation, and I think this patch does improve the
documentation slightly.
Paolo
[Qemu-devel] [PATCH 07/10] tcg: comment on which functions have to be called with mmap_lock held, Paolo Bonzini, 2015/08/12