From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVaF7-0006x7-1p for qemu-devel@nongnu.org; Sat, 29 Aug 2015 03:08:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZVaF3-0008BS-SX for qemu-devel@nongnu.org; Sat, 29 Aug 2015 03:08:00 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:34868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVaF3-0008B2-Lu for qemu-devel@nongnu.org; Sat, 29 Aug 2015 03:07:57 -0400 Received: by wicne3 with SMTP id ne3so34537440wic.0 for ; Sat, 29 Aug 2015 00:07:56 -0700 (PDT) Sender: Paolo Bonzini References: <1439397664-70734-1-git-send-email-pbonzini@redhat.com> <1439397664-70734-6-git-send-email-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: <55E15A4E.6080009@redhat.com> Date: Sat, 29 Aug 2015 09:07:58 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 05/10] cpu-exec: elide more icount code if CONFIG_USER_ONLY List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: mttcg@greensocs.com, QEMU Developers , =?UTF-8?B?S09OUkFEIEZyw6lkw6lyaWM=?= 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