From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIcBh-0004gZ-2L for qemu-devel@nongnu.org; Fri, 24 Jul 2015 08:34:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIcBf-00019K-Qn for qemu-devel@nongnu.org; Fri, 24 Jul 2015 08:34:53 -0400 Sender: Richard Henderson References: <1437455978.5809.2.camel@kernel.crashing.org> From: Richard Henderson Message-ID: <55B230DF.8000900@twiddle.net> Date: Fri, 24 Jul 2015 05:34:39 -0700 MIME-Version: 1.0 In-Reply-To: <1437455978.5809.2.camel@kernel.crashing.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3] tcg/ppc: Improve unaligned load/store handling on 64-bit backend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt , qemu-devel@nongnu.org Cc: Paolo Bonzini , qemu-ppc@nongnu.org, Alexander Graf , Aurelien Jarno On 07/20/2015 10:19 PM, Benjamin Herrenschmidt wrote: > Currently, we get to the slow path for any unaligned access in the > backend, because we effectively preserve the bottom address bits > below the alignment requirement when comparing with the TLB entry, > so any non-0 bit there will cause the compare to fail. > > For the same number of instructions, we can instead add the access > size - 1 to the address and stick to clearing all the bottom bits. > > That means that normal unaligned accesses will not fallback (the HW > will handle them fine). Only when crossing a page boundary well we > end up having a mismatch because we'll end up pointing to the next > page which cannot possibly be in that same TLB entry. > > Signed-off-by: Benjamin Herrenschmidt > --- > > v3. Add MO_ALIGN support for front-ends requiring aligned accesses > v2. This is the correct version of the patch, the one that > actually works :-) > > tcg/ppc/tcg-target.c | 41 +++++++++++++++++++++++++++++++---------- > 1 file changed, 31 insertions(+), 10 deletions(-) Applied to tcg-next. r~