From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSG3c-0005bf-3e for qemu-devel@nongnu.org; Wed, 27 Jul 2016 00:02:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSG3X-0007wP-Tj for qemu-devel@nongnu.org; Wed, 27 Jul 2016 00:02:55 -0400 Message-ID: <1469592160.5978.116.camel@kernel.crashing.org> From: Benjamin Herrenschmidt Date: Wed, 27 Jul 2016 14:02:40 +1000 In-Reply-To: <20160727023654.GZ17429@voom.fritz.box> References: <1469571686-7284-1-git-send-email-benh@kernel.crashing.org> <1469571686-7284-26-git-send-email-benh@kernel.crashing.org> <20160727023654.GZ17429@voom.fritz.box> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 26/32] ppc: Speed up dcbz List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On Wed, 2016-07-27 at 12:36 +1000, David Gibson wrote: > > -=C2=A0=C2=A0=C2=A0 do_dcbz(env, addr, dcbz_size, GETPC()); > > +=C2=A0=C2=A0=C2=A0 /* Try fast path translate */ > > +=C2=A0=C2=A0=C2=A0 haddr =3D tlb_vaddr_to_host(env, addr, MMU_DATA_S= TORE, env->dmmu_idx); >=20 > It worries me slightly that this doesn't take any length to verify.=C2=A0= I > guess it's ok in practice, because memory blocks will always be at > least cache line size aligned. It's safe ;-) The translate returns a qemu page size address which is always 4K. We don't need to verify=C2=A0 because we just aligned the address to the cache block size which is always smaller than 4k. So we can't possibly be crossing a page boundary. (grep for tlb_vaddr_to_host in target-s390 for other examples of use of tlb_vaddr_to_host). Cheers, Ben.