On 23/03/2015 17:00, Peter Maydell wrote: > On 23 March 2015 at 15:47, Paolo Bonzini <pbonz...@redhat.com> wrote: >> Ok, so most ld*_phys users are already using cs->as. > > But this is only because when the AddressSpace* argument > to ld*_phys was introduced we made it be cs->as for > existing callers, to retain the existing behaviour. > That doesn't mean that callers using cs->as are doing > the right thing. In general I would expect that any > caller that's not part of the CPU itself should not be > rummaging around inside the CPU struct to find an > AddressSpace to use...
None of them does, uses of ld*_phys(cs->as, ...) are almost all in target-* already. There's just hw/ppc/spapr_hcall.c and hw/ppc/spapr_iommu.c that are using cs->as in hw/, but they are correct because these are hypercalls. The others use &address_space_memory. I sent a patch to fix megasas and vmware. Paolo