From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alx7D-0002Gh-5f for qemu-devel@nongnu.org; Fri, 01 Apr 2016 07:19:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alx77-0002QN-KI for qemu-devel@nongnu.org; Fri, 01 Apr 2016 07:19:47 -0400 Received: from g2t4619.austin.hp.com ([15.73.212.82]:59504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alx77-0002QE-Ff for qemu-devel@nongnu.org; Fri, 01 Apr 2016 07:19:41 -0400 References: <1459138565-6244-1-git-send-email-jitendra.kolhe@hpe.com> <20160328094945-mutt-send-email-mst@redhat.com> <56FA5385.1030608@redhat.com> <56FA5D33.2020802@hpe.com> <56FA5D7B.2000001@redhat.com> From: Jitendra Kolhe Message-ID: <56FE5944.5010005@hpe.com> Date: Fri, 1 Apr 2016 16:49:32 +0530 MIME-Version: 1.0 In-Reply-To: <56FA5D7B.2000001@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] migration: skip sending ram pages released by virtio-balloon driver. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , "Michael S. Tsirkin" Cc: JBottomley@Odin.com, ehabkost@redhat.com, crosthwaite.peter@gmail.com, simhan@hpe.com, armbru@redhat.com, quintela@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, borntraeger@de.ibm.com, mohan_parthasarathy@hpe.com, stefanha@redhat.com, amit.shah@redhat.com, den@openvz.org, dgilbert@redhat.com, rth@twiddle.net On 3/29/2016 4:18 PM, Paolo Bonzini wrote: > > > 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. > You are right, I was wrongly calculating offsets for hot-plugged RAMblocks. I will have to use qemu_ram_block_from_host() to get ram_addr_t to get correct offsets in the bitmap. > Paolo >