On 29/03/2016 12:47, Jitendra Kolhe wrote:
> > Indeed.  It is correct for the main system RAM, but hot-plugged RAM
> > would also have a zero-based section.offset_within_region.  You need to
> > add memory_region_get_ram_addr(section.mr), just like the call to
> > balloon_page adds memory_region_get_ram_ptr(section.mr).
> > 
> > Paolo
> 
> I am only interested in the offset from memory region base. 
> Would below guest PA to host offset work, as we do in
> address_space_translate_internal()?
> (Guest pa - section.offset_within_address_space + 
> section.offset_within_region)

Yes, that would work.  But I'm not sure why you're not interested in the
ram_addr_t.

Paolo

Reply via email to