From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPb8S-0006CF-G0 for qemu-devel@nongnu.org; Tue, 19 Jul 2016 15:56:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPb8O-0003oa-81 for qemu-devel@nongnu.org; Tue, 19 Jul 2016 15:56:55 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:34702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPb8N-0003nQ-Vk for qemu-devel@nongnu.org; Tue, 19 Jul 2016 15:56:52 -0400 Received: by mail-lf0-x243.google.com with SMTP id l69so2120011lfg.1 for ; Tue, 19 Jul 2016 12:56:51 -0700 (PDT) References: <1468917141-8155-1-git-send-email-pbonzini@redhat.com> <1468917141-8155-6-git-send-email-pbonzini@redhat.com> From: Sergey Fedorov Message-ID: <578E8601.1080107@gmail.com> Date: Tue, 19 Jul 2016 22:56:49 +0300 MIME-Version: 1.0 In-Reply-To: <1468917141-8155-6-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/10] tcg: Prepare TB invalidation for lockless TB lookup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: sergey.fedorov@linaro.org, alex.bennee@linaro.org On 19/07/16 11:32, Paolo Bonzini wrote: > It looks much better now :) > When invalidating a translation block, set an invalid flag into the > TranslationBlock structure first. It is also necessary to check whether > the target TB is still valid after acquiring 'tb_lock' but before calling > tb_add_jump() since TB lookup is to be performed out of 'tb_lock' in > future. Note that we don't have to check 'last_tb'; an already invalidated > TB will not be executed anyway and it is thus safe to patch it. > > Suggested-by: Sergey Fedorov > Signed-off-by: Paolo Bonzini > --- > cpu-exec.c | 5 +++-- > include/exec/exec-all.h | 2 ++ > translate-all.c | 3 +++ > 3 files changed, 8 insertions(+), 2 deletions(-) (snip) > diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h > index acda7b6..bc0bcc5 100644 > --- a/include/exec/exec-all.h > +++ b/include/exec/exec-all.h > @@ -213,6 +213,8 @@ struct TranslationBlock { > #define CF_USE_ICOUNT 0x20000 > #define CF_IGNORE_ICOUNT 0x40000 /* Do not generate icount code */ > > + uint16_t invalid; Why not "int"? > + > void *tc_ptr; /* pointer to the translated code */ > uint8_t *tc_search; /* pointer to search data */ > /* original tb when cflags has CF_NOCACHE */ > Thanks, Sergey