Re: [Qemu-devel] [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users

2016-04-04 Thread Paolo Bonzini
On 04/04/2016 10:38, Michael S. Tsirkin wrote: > > > I agree but I think we need a better name for this function. > > > qemu_ram_offset_to_ptr? > > > > What about qemu_map_ram_ptr? > > > > Paolo > > OK but this seems to imply there's also an unmap operation? Actually there is one, even though

Re: [Qemu-devel] [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users

2016-04-04 Thread Michael S. Tsirkin
On Mon, Apr 04, 2016 at 10:03:12AM +0200, Paolo Bonzini wrote: > > > On 03/04/2016 15:49, Michael S. Tsirkin wrote: > > I agree but I think we need a better name for this function. > > qemu_ram_offset_to_ptr? > > What about qemu_map_ram_ptr? > > Paolo OK but this seems to imply there's also an

Re: [Qemu-devel] [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users

2016-04-04 Thread Paolo Bonzini
On 03/04/2016 15:49, Michael S. Tsirkin wrote: > I agree but I think we need a better name for this function. > qemu_ram_offset_to_ptr? What about qemu_map_ram_ptr? Paolo > Will also serve to make sure backporting patches across this > API change does not cause issues.

Re: [Qemu-devel] [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users

2016-04-03 Thread Paolo Bonzini
On 03/04/2016 15:49, Michael S. Tsirkin wrote: > > I agree but I think we need a better name for this function. > qemu_ram_offset_to_ptr? > Will also serve to make sure backporting patches across this > API change does not cause issues. Yes, this makes sense. If it were all in 2.6, there would

Re: [Qemu-devel] [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users

2016-04-03 Thread Michael S. Tsirkin
On Thu, Mar 24, 2016 at 12:03:35PM +0100, Paolo Bonzini wrote: > Let users of qemu_get_ram_ptr and qemu_ram_ptr_length pass in an > address that is relative to the MemoryRegion. This basically means > what address_space_translate returns. > > invalidate_and_set_dirty has to add back mr->ram_addr,

Re: [Qemu-devel] [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users

2016-03-25 Thread Paolo Bonzini
> > > If called by address_space_unmap, is this addition still correct? > > > > No, thanks for the careful review! That's another opportunity > > for cleanup actually, splitting the (few) users of qemu_ram_addr_from_host > > that really need a ram_addr_t and those (the majority) that need a > > M

Re: [Qemu-devel] [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users

2016-03-25 Thread Fam Zheng
On Fri, 03/25 07:58, Paolo Bonzini wrote: > > > - Original Message - > > From: "Fam Zheng" > > To: "Paolo Bonzini" > > Cc: qemu-devel@nongnu.org, "arei gonglei" , > > m...@redhat.com > > Sent: Friday, March 25, 2016 7:20:38 AM > > Subject: Re: [PATCH 2/2] memory: hide mr->ram_addr from

Re: [Qemu-devel] [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users

2016-03-25 Thread Paolo Bonzini
- Original Message - > From: "Fam Zheng" > To: "Paolo Bonzini" > Cc: qemu-devel@nongnu.org, "arei gonglei" , > m...@redhat.com > Sent: Friday, March 25, 2016 7:20:38 AM > Subject: Re: [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users > > On Thu, 03/24 12:03, Paolo Bonz

Re: [Qemu-devel] [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users

2016-03-24 Thread Fam Zheng
On Thu, 03/24 12:03, Paolo Bonzini wrote: > Let users of qemu_get_ram_ptr and qemu_ram_ptr_length pass in an > address that is relative to the MemoryRegion. This basically means > what address_space_translate returns. > > invalidate_and_set_dirty has to add back mr->ram_addr, but reads do > not n

[Qemu-devel] [PATCH 2/2] memory: hide mr->ram_addr from qemu_get_ram_ptr users

2016-03-24 Thread Paolo Bonzini
Let users of qemu_get_ram_ptr and qemu_ram_ptr_length pass in an address that is relative to the MemoryRegion. This basically means what address_space_translate returns. invalidate_and_set_dirty has to add back mr->ram_addr, but reads do not need it at all. Signed-off-by: Paolo Bonzini --- exe