From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya5FP-0002BC-L0 for qemu-devel@nongnu.org; Mon, 23 Mar 2015 12:30:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ya5FM-0003AC-6B for qemu-devel@nongnu.org; Mon, 23 Mar 2015 12:30:39 -0400 Received: from mail-we0-x22e.google.com ([2a00:1450:400c:c03::22e]:33611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya5FL-0003A8-W7 for qemu-devel@nongnu.org; Mon, 23 Mar 2015 12:30:36 -0400 Received: by weop45 with SMTP id p45so142367249weo.0 for ; Mon, 23 Mar 2015 09:30:35 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <55103FA7.10402@redhat.com> Date: Mon, 23 Mar 2015 17:30:31 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <55102594.6000902@redhat.com> <55102EB4.6010106@redhat.com> <551030F7.6030702@redhat.com> <5510359F.8080400@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] RFC: memory API changes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Peter Crosthwaite , QEMU Developers , Greg Bellows , "Edgar E. Iglesias" , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Richard Henderson On 23/03/2015 17:00, Peter Maydell wrote: > On 23 March 2015 at 15:47, Paolo Bonzini 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