From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZhip-0000xD-Eg for qemu-devel@nongnu.org; Tue, 07 May 2013 09:14:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZhio-0008M1-7X for qemu-devel@nongnu.org; Tue, 07 May 2013 09:14:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZhin-0008Lo-TH for qemu-devel@nongnu.org; Tue, 07 May 2013 09:14:22 -0400 Message-ID: <5188FE1B.3070809@redhat.com> Date: Tue, 07 May 2013 15:14:03 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1362925309-3852-1-git-send-email-i.mitsyanko@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/3] Fix memory migration for exynos 4210 SoC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Igor Mitsyanko , qemu-devel@nongnu.org, anthony@codemonkey.ws, afaerber@suse.de Il 07/05/2013 15:09, Peter Maydell ha scritto: > On 10 March 2013 14:21, Igor Mitsyanko wrote: >> First two patches fix issues in exynos4210 code which were blocking proper memory >> migration. >> >> Third patch makes memory_region_init_ram_ptr assert if memory region size is not a >> multiple of TARGET_PAGE_SIZE. >> >> Igor Mitsyanko (3): >> hw/exynos4210.c: set chipid_and_omr array size to TARGET_PAGE_SIZE >> exynos4210.c: register chipid_mem and rom_mem with vmstate >> memory.c: only allow memory sizes which are a multiple of target page >> size > > I was talking to Paolo about this patchset on IRC, and we came to > the conclusion that for the chipid_and_omr bit the right solution > is not to misuse memory_region_init_ram_ptr() for this, but just > to implement it as a device with an mmio region. ... or at least, just use memory_region_init_ram() and copy the initial contents to it with address_space_rw. There are probably some bugs in small memory_region_init_ram regions too, but some problems you're seeing are exclusive to memory_region_init_ram_ptr, and the others are more easily fixed if you concentrate on memory_region_init_ram. I think memory_region_init_ram_ptr should assert that the size is a multiple of the page size. It is a special interface that is meant to be used for things like mmap-ed files (not coincidentially, pci-assign and VFIO are the main users). Besides exynos4210, hw/display/g364fb.c would also be better off using address_space_map/unmap. Paolo > We should probably still look at fixing the bugs with small > ramblocks and/or asserting if you try to create them, though. > > thanks > -- PMM >