From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBNfX-0003Vx-3u for qemu-devel@nongnu.org; Mon, 19 Aug 2013 07:30:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBNfO-000644-RC for qemu-devel@nongnu.org; Mon, 19 Aug 2013 07:30:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBNfO-00063d-A9 for qemu-devel@nongnu.org; Mon, 19 Aug 2013 07:30:34 -0400 Message-ID: <5212026D.20803@redhat.com> Date: Mon, 19 Aug 2013 13:33:01 +0200 From: Laszlo Ersek MIME-Version: 1.0 References: <1376347400-21035-1-git-send-email-mst@redhat.com> <1376347400-21035-2-git-send-email-mst@redhat.com> <5211EC7D.8040209@redhat.com> <5211FCF0.2000702@redhat.com> <20130819111805.GC21552@redhat.com> In-Reply-To: <20130819111805.GC21552@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 1/2] memory: export migration page size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Peter Maydell , Paolo Bonzini , QEMU Developers , Gerd Hoffmann On 08/19/13 13:18, Michael S. Tsirkin wrote: > On Mon, Aug 19, 2013 at 01:09:36PM +0200, Laszlo Ersek wrote: >> On 08/19/13 12:21, Peter Maydell wrote: >>> On 19 August 2013 10:59, Laszlo Ersek wrote: >>>> On 08/13/13 00:43, Michael S. Tsirkin wrote: >>>>> Migration code assumes that each RAM block is a multiple of target page >>>>> size. >>>> >>>> Isn't that a valid assumption, considering the TARGET_PAGE_ALIGN() macro >>>> call in qemu_ram_alloc_from_ptr() [exec.c]? >>> >>> That macro only makes the size we store in the ramblock data >>> structure be a multiple of the page size -- it does nothing to ensure >>> that the actual memory that was passed in by the caller is the >>> right size. (It will have the right effect where qemu_ram_alloc_from_ptr >>> is allocating the memory itself, obviously.) >> >> Which is the case for 2/2, see my comments there: >> >> memory_region_init_ram() >> qemu_ram_alloc() >> qemu_ram_alloc_from_ptr() <---- host==NULL >> TARGET_PAGE_ALIGN() >> >> Laszlo > > The issue this addresses is not the size of RAM allocated. > The issue is the size of the MR. > Migration code assumes the size of the MR > is a multiple of TARGET_PAGE_SIZE. You're right. Thanks. Laszlo