From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdtEZ-0004Ce-IU for qemu-devel@nongnu.org; Mon, 21 Sep 2015 01:01:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZdtEV-0005DY-FA for qemu-devel@nongnu.org; Mon, 21 Sep 2015 01:01:47 -0400 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:34691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdtEV-0005CP-8V for qemu-devel@nongnu.org; Mon, 21 Sep 2015 01:01:43 -0400 Received: by wicfx3 with SMTP id fx3so128704824wic.1 for ; Sun, 20 Sep 2015 22:01:42 -0700 (PDT) Sender: Paolo Bonzini References: <1440375847-17603-1-git-send-email-cota@braap.org> <1440375847-17603-14-git-send-email-cota@braap.org> From: Paolo Bonzini Message-ID: <55FF8F31.2060002@redhat.com> Date: Mon, 21 Sep 2015 07:01:37 +0200 MIME-Version: 1.0 In-Reply-To: <1440375847-17603-14-git-send-email-cota@braap.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 13/38] cputlb: add physical address to CPUTLBEntry List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Emilio G. Cota" , qemu-devel@nongnu.org, mttcg@listserver.greensocs.com Cc: alex.bennee@linaro.org, Frederic Konrad , mark.burton@greensocs.com, a.rigo@virtualopensystems.com, guillaume.delbergue@greensocs.com On 24/08/2015 02:23, Emilio G. Cota wrote: > Having the physical address in the TLB entry will allow us > to portably obtain the physical address of a memory access, > which will prove useful when implementing a scalable emulation > of atomic instructions. It came to my mind that addr_read and addr_code only differ in the bottom TARGET_PAGE_BITS bits, and they are always zero in addr_phys. So we could store addr_code as addr_read ^ (addr_phys & (TARGET_PAGE_SIZE - 1)) and discard the bottom bits of addr_phys. This would make it possible to include addr_phys without growing the size of the TLB entry. Paolo