From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL9ye-0007Cw-0d for qemu-devel@nongnu.org; Thu, 07 Jul 2016 10:08:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bL9yY-0006XN-1R for qemu-devel@nongnu.org; Thu, 07 Jul 2016 10:08:26 -0400 Received: from mail-lf0-x235.google.com ([2a00:1450:4010:c07::235]:35726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bL9yX-0006XB-Do for qemu-devel@nongnu.org; Thu, 07 Jul 2016 10:08:21 -0400 Received: by mail-lf0-x235.google.com with SMTP id l188so12175688lfe.2 for ; Thu, 07 Jul 2016 07:08:21 -0700 (PDT) References: <1467735496-16256-1-git-send-email-alex.bennee@linaro.org> <1467735496-16256-3-git-send-email-alex.bennee@linaro.org> From: Sergey Fedorov Message-ID: <577E6252.5060204@linaro.org> Date: Thu, 7 Jul 2016 17:08:18 +0300 MIME-Version: 1.0 In-Reply-To: <1467735496-16256-3-git-send-email-alex.bennee@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 2/6] tcg: set up tb->page_addr before insertion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= , mttcg@listserver.greensocs.com, qemu-devel@nongnu.org, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org, bobby.prani@gmail.com, rth@twiddle.net Cc: mark.burton@greensocs.com, pbonzini@redhat.com, jan.kiszka@siemens.com, peter.maydell@linaro.org, claudio.fontana@huawei.com, Peter Crosthwaite On 05/07/16 19:18, Alex Bennée wrote: > This ensures that if we find the TB on the slow path that tb->page_addr > is correctly set before being tested. > > Signed-off-by: Alex Bennée Reveiwed-by: Sergey Fedorov > --- > translate-all.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/translate-all.c b/translate-all.c > index 96efe48..97e834a 100644 > --- a/translate-all.c > +++ b/translate-all.c > @@ -1126,10 +1126,6 @@ static void tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc, > { > uint32_t h; > > - /* add in the hash table */ > - h = tb_hash_func(phys_pc, tb->pc, tb->flags); > - qht_insert(&tcg_ctx.tb_ctx.htable, tb, h); > - > /* add in the page list */ > tb_alloc_page(tb, 0, phys_pc & TARGET_PAGE_MASK); > if (phys_page2 != -1) { > @@ -1138,6 +1134,10 @@ static void tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc, > tb->page_addr[1] = -1; > } > > + /* add in the hash table */ > + h = tb_hash_func(phys_pc, tb->pc, tb->flags); > + qht_insert(&tcg_ctx.tb_ctx.htable, tb, h); > + > #ifdef DEBUG_TB_CHECK > tb_page_check(); > #endif