From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvk1T-0002cT-2r for qemu-devel@nongnu.org; Mon, 09 Nov 2015 05:50:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zvk1S-0008Al-4t for qemu-devel@nongnu.org; Mon, 09 Nov 2015 05:50:03 -0500 Received: from mail-yk0-x235.google.com ([2607:f8b0:4002:c07::235]:34845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvk1R-0008Ac-VD for qemu-devel@nongnu.org; Mon, 09 Nov 2015 05:50:02 -0500 Received: by ykek133 with SMTP id k133so257537235yke.2 for ; Mon, 09 Nov 2015 02:50:01 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <56407909.2080607@redhat.com> References: <1446747358-18214-1-git-send-email-peter.maydell@linaro.org> <1446747358-18214-4-git-send-email-peter.maydell@linaro.org> <56407909.2080607@redhat.com> From: Peter Maydell Date: Mon, 9 Nov 2015 10:49:42 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 03/16] tlb_set_page_with_attrs: Take argument specifying AddressSpace to use List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Patch Tracking , QEMU Developers , qemu-arm@nongnu.org, "Edgar E. Iglesias" , =?UTF-8?B?QWxleCBCZW5uw6ll?= , =?UTF-8?Q?Andreas_F=C3=A4rber?= On 9 November 2015 at 10:44, Paolo Bonzini wrote: > > > On 05/11/2015 19:15, Peter Maydell wrote: >> Add an argument to tlb_set_page_with_attrs which allows the target CPU code >> to tell the core code which AddressSpace to use. >> >> The AddressSpace is specified by the index into the array of ASes which >> were registered with cpu_address_space_init(). >> >> Signed-off-by: Peter Maydell > > Can it be deduced from the attributes instead? Basically, you would have > > int cpu_get_asidx(MemTxAttrs attrs); > > in cpu.h, which is called by tlb_set_page_with_attrs. > cpu_get_phys_page_asidx_debug could also be replaced by > cpu_get_phys_page_attrs_debug. For ARM it could, certainly (and as you say, if we go that way then some of the extra passing around of asidxes collapses, and in particular we don't need to keep them separately in the iotlb entries). I wasn't convinced that this would be true for all possible uses of AddressSpaces. thanks -- PMM