From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akwTK-0007sH-UI for qemu-devel@nongnu.org; Tue, 29 Mar 2016 12:26:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akwTK-00063D-3C for qemu-devel@nongnu.org; Tue, 29 Mar 2016 12:26:26 -0400 Received: from mail-vk0-x22b.google.com ([2607:f8b0:400c:c05::22b]:35476) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akwTI-00062g-SH for qemu-devel@nongnu.org; Tue, 29 Mar 2016 12:26:26 -0400 Received: by mail-vk0-x22b.google.com with SMTP id e6so25318387vkh.2 for ; Tue, 29 Mar 2016 09:26:24 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <56FA3D71.2010505@gmail.com> References: <1458815961-31979-1-git-send-email-sergey.fedorov@linaro.org> <1458815961-31979-2-git-send-email-sergey.fedorov@linaro.org> <87poukq9fk.fsf@linaro.org> <56F3F377.4070809@gmail.com> <87mvpnrkby.fsf@linaro.org> <56F4039A.5050907@redhat.com> <56F9AC4E.4070304@twiddle.net> <56FA3D71.2010505@gmail.com> From: Peter Maydell Date: Tue, 29 Mar 2016 17:26:04 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [Qemu-arm] [PATCH 1/8] tcg: Clean up direct block chaining data fields List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Fedorov Cc: Sergey Fedorov , Stefan Weil , Claudio Fontana , QEMU Developers , Alexander Graf , Blue Swirl , qemu-arm , "Vassili Karpov (malc)" , Paolo Bonzini , =?UTF-8?B?QWxleCBCZW5uw6ll?= , Aurelien Jarno , Richard Henderson On 29 March 2016 at 09:31, Sergey Fedorov wrote: > On 29/03/16 01:12, Richard Henderson wrote: >> On 03/24/2016 08:11 AM, Paolo Bonzini wrote: >>> There is also a case where a TB jumps to itself; it then appears twice >>> in the list with different values in the low bits, such as this: >>> >>> tb->jmp_list_first = tb | 0; >>> .--------------------' | >>> | .-------' >>> tb->jmp_list_next[0] = tb | 2; >> >> Of course, it begs the question of why TB would be in its own list, >> even if it does jump to itself. We only need the points-to list in >> order to invalidate a TB and unlink it. But if TB is being >> invalidated, we don't need to reset the jump within TB itself. > > If we're going to move tb_phys_invalidate() outside of tb_lock, we > probably need to reset all jumps to the TB, even if it jumps to itself, > so that it eventually finish its execution. This is likely also the historical reason for the current code -- originally we handled requesting a CPU exit by unlinking the TB, so you needed to be able to detach jumps-to-self (these days we do it by checking a flag at the start of each TB). thanks -- PMM