On 9 November 2015 at 10:44, Paolo Bonzini <pbonz...@redhat.com> 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 <peter.mayd...@linaro.org> > > 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