From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agZYJ-0007tj-Lk for qemu-devel@nongnu.org; Thu, 17 Mar 2016 11:09:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agZYF-0003n3-II for qemu-devel@nongnu.org; Thu, 17 Mar 2016 11:09:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agZYF-0003mz-Cg for qemu-devel@nongnu.org; Thu, 17 Mar 2016 11:09:27 -0400 References: <1458222382-6498-1-git-send-email-sergey.fedorov@linaro.org> <1458222382-6498-5-git-send-email-sergey.fedorov@linaro.org> From: Paolo Bonzini Message-ID: <56EAC8A2.7060700@redhat.com> Date: Thu, 17 Mar 2016 16:09:22 +0100 MIME-Version: 1.0 In-Reply-To: <1458222382-6498-5-git-send-email-sergey.fedorov@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/5] tcg: reorder removal from lists in tb_phys_invalidate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: sergey.fedorov@linaro.org, qemu-devel@nongnu.org Cc: Sergey Fedorov , Richard Henderson , Peter Crosthwaite On 17/03/2016 14:46, sergey.fedorov@linaro.org wrote: > void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr= ) > { > - CPUState *cpu; > PageDesc *p; > unsigned int h, n1; > + tb_page_addr_t pc; > tb_page_addr_t phys_pc; > TranslationBlock *tb1, *tb2; > =20 > - /* remove the TB from the hash list */ > - phys_pc =3D tb->page_addr[0] + (tb->pc & ~TARGET_PAGE_MASK); > - h =3D tb_phys_hash_func(phys_pc); > - tb_hash_remove(&tcg_ctx.tb_ctx.tb_phys_hash[h], tb); > - > - /* remove the TB from the page list */ > - if (tb->page_addr[0] !=3D page_addr) { > - p =3D page_find(tb->page_addr[0] >> TARGET_PAGE_BITS); > - tb_page_remove(&p->first_tb, tb); > - invalidate_page_bitmap(p); > - } > - if (tb->page_addr[1] !=3D -1 && tb->page_addr[1] !=3D page_addr) { > - p =3D page_find(tb->page_addr[1] >> TARGET_PAGE_BITS); > - tb_page_remove(&p->first_tb, tb); > - invalidate_page_bitmap(p); > - } > - > - tcg_ctx.tb_ctx.tb_invalidated_flag =3D 1; > - Did you investigate the removal of this setting of tb_invalidated_flag? My recollection is that it is okay to remove it because at worse it would cause a tb_add_jump from an invalidated source to a valid destination. This should be harmless as long as the source has been tb_phys_invalidated and not tb_flushed. But this needs to be checked. Paolo