Re: [Qemu-devel] [PATCH v2 for-1.6 v2 2/2] loader: put FW CFG ROM files into RAM

2013-08-13 Thread Michael S. Tsirkin
On Tue, Aug 13, 2013 at 04:47:00PM +0200, Paolo Bonzini wrote: > Il 12/08/2013 20:56, Michael S. Tsirkin ha scritto: > >> > Similarly, what you're trying to do here doesn't require > >> > that the guest sees any specific host pointer, so you should > >> > just use memory_region_init_ram(). > > I wa

Re: [Qemu-devel] [PATCH v2 for-1.6 v2 2/2] loader: put FW CFG ROM files into RAM

2013-08-13 Thread Paolo Bonzini
Il 12/08/2013 20:56, Michael S. Tsirkin ha scritto: >> > Similarly, what you're trying to do here doesn't require >> > that the guest sees any specific host pointer, so you should >> > just use memory_region_init_ram(). > I was concerned that we are wasting resources here. > In particular, huge pag

Re: [Qemu-devel] [PATCH v2 for-1.6 v2 2/2] loader: put FW CFG ROM files into RAM

2013-08-12 Thread Paolo Bonzini
Il 12/08/2013 20:37, Peter Maydell ha scritto: > > I seem to recall having a conversation with Paolo along these > lines a few months back (we fixed the exynos devices which > were incorrectly using the _ram_ptr function); he can correct > me if I'm off-base here. Yeah, I think you're right. Pao

Re: [Qemu-devel] [PATCH v2 for-1.6 v2 2/2] loader: put FW CFG ROM files into RAM

2013-08-12 Thread Michael S. Tsirkin
On Mon, Aug 12, 2013 at 07:37:21PM +0100, Peter Maydell wrote: > On 12 August 2013 19:16, Michael S. Tsirkin wrote: > > +static void *rom_set_mr(Rom *rom, Object *owner, const char *name) > > +{ > > +/* > > + * Migration code expects that all RAM blocks are full pages. > > + * Round MR

Re: [Qemu-devel] [PATCH v2 for-1.6 v2 2/2] loader: put FW CFG ROM files into RAM

2013-08-12 Thread Peter Maydell
On 12 August 2013 19:16, Michael S. Tsirkin wrote: > +static void *rom_set_mr(Rom *rom, Object *owner, const char *name) > +{ > +/* > + * Migration code expects that all RAM blocks are full pages. > + * Round MR size up to satisfy this condition. > + */ > +unsigned size = ROUND

[Qemu-devel] [PATCH v2 for-1.6 v2 2/2] loader: put FW CFG ROM files into RAM

2013-08-12 Thread Michael S. Tsirkin
ROM files that are put in FW CFG are copied to guest ram, by BIOS, but they are not backed by RAM so they don't get migrated. Each time we change two bytes in such a ROM this breaks cross-version migration: since we can migrate after BIOS has read the first byte but before it has read the second o