Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-17 Thread Peter Maydell
On 6 July 2017 at 15:56, Paolo Bonzini wrote: > > > On 06/07/2017 16:52, Peter Maydell wrote: >> On 5 July 2017 at 13:21, Paolo Bonzini wrote: >>> >>> >>> On 04/07/2017 19:02, Peter Maydell wrote: Many board models and several devices need to create

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-07 Thread Peter Maydell
On 7 July 2017 at 14:18, Igor Mammedov wrote: > On Thu, 6 Jul 2017 17:26:10 +0100 > Peter Maydell wrote: >> * globally rename memory_region_init_ram to memory_region_init_ram_nomigrate >>(and document that it is the caller's job to arrange to

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-07 Thread Igor Mammedov
On Thu, 6 Jul 2017 17:26:10 +0100 Peter Maydell wrote: > On 6 July 2017 at 15:56, Paolo Bonzini wrote: > > > > > > On 06/07/2017 16:52, Peter Maydell wrote: > >> On 5 July 2017 at 13:21, Paolo Bonzini wrote: > >>> > >>> >

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-07 Thread Igor Mammedov
On Thu, 6 Jul 2017 15:52:44 +0100 Peter Maydell wrote: > On 5 July 2017 at 13:21, Paolo Bonzini wrote: > > > > > > On 04/07/2017 19:02, Peter Maydell wrote: > >> Many board models and several devices need to create auxiliary > >> regions of RAM

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-07 Thread Paolo Bonzini
On 07/07/2017 13:58, Peter Maydell wrote: >>> >>> memory_region_init_ram(mr, owner, name, ram_size, ); >>> if (err) { >>> error_propagate(errp, err); >>> return; >>> } >>> /* Note that owner_dev may be NULL if owner is not a DeviceState; >>> * in that case

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-07 Thread Peter Maydell
On 6 July 2017 at 18:26, Paolo Bonzini wrote: > > > On 06/07/2017 19:13, Peter Maydell wrote: >> Slightly awkward because owner is an Object but vmstate_register_ram() >> needs a DeviceState. Is this OK, or too much magic? >> >> DeviceState *owner_dev; >> Error *err =

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-07 Thread Paolo Bonzini
On 07/07/2017 12:43, Peter Maydell wrote: > On 6 July 2017 at 18:47, Peter Maydell wrote: >> On 6 July 2017 at 18:26, Paolo Bonzini wrote: >>> Maybe, for memory_region_init_ram only, the owner argument can be made a >>> DeviceState (or NULL)? >>

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-07 Thread Peter Maydell
On 6 July 2017 at 18:47, Peter Maydell wrote: > On 6 July 2017 at 18:26, Paolo Bonzini wrote: >> Maybe, for memory_region_init_ram only, the owner argument can be made a >> DeviceState (or NULL)? > > Something that might influence things here -- of

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-06 Thread Peter Maydell
On 6 July 2017 at 18:26, Paolo Bonzini wrote: > > > On 06/07/2017 19:13, Peter Maydell wrote: >> Slightly awkward because owner is an Object but vmstate_register_ram() >> needs a DeviceState. Is this OK, or too much magic? >> >> DeviceState *owner_dev; >> Error *err =

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-06 Thread Paolo Bonzini
On 06/07/2017 19:13, Peter Maydell wrote: > Slightly awkward because owner is an Object but vmstate_register_ram() > needs a DeviceState. Is this OK, or too much magic? > > DeviceState *owner_dev; > Error *err = NULL; > > memory_region_init_ram(mr, owner, name, ram_size, ); >

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-06 Thread Peter Maydell
On 5 July 2017 at 13:21, Paolo Bonzini wrote: > > > On 04/07/2017 19:02, Peter Maydell wrote: >> Many board models and several devices need to create auxiliary >> regions of RAM (in addition to the main lump of 'system' memory), >> to model static RAMs, video memory, ROMs,

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-06 Thread Paolo Bonzini
On 06/07/2017 18:26, Peter Maydell wrote: > > I think that to avoid getting tangled up in trying to fix > or deal with these handful of oddball cases at the same time > as doing a global change to the easy cases, we should: > > * globally rename memory_region_init_ram to

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-06 Thread Peter Maydell
On 6 July 2017 at 15:56, Paolo Bonzini wrote: > > > On 06/07/2017 16:52, Peter Maydell wrote: >> On 5 July 2017 at 13:21, Paolo Bonzini wrote: >>> >>> >>> On 04/07/2017 19:02, Peter Maydell wrote: Many board models and several devices need to create

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-06 Thread Paolo Bonzini
On 06/07/2017 16:52, Peter Maydell wrote: > On 5 July 2017 at 13:21, Paolo Bonzini wrote: >> >> >> On 04/07/2017 19:02, Peter Maydell wrote: >>> Many board models and several devices need to create auxiliary >>> regions of RAM (in addition to the main lump of 'system'

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-06 Thread Peter Maydell
On 5 July 2017 at 13:21, Paolo Bonzini wrote: > > > On 04/07/2017 19:02, Peter Maydell wrote: >> Many board models and several devices need to create auxiliary >> regions of RAM (in addition to the main lump of 'system' memory), >> to model static RAMs, video memory, ROMs,

Re: [Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-05 Thread Paolo Bonzini
On 04/07/2017 19:02, Peter Maydell wrote: > Many board models and several devices need to create auxiliary > regions of RAM (in addition to the main lump of 'system' memory), > to model static RAMs, video memory, ROMs, etc. Currently they do > this with a sequence like: >

[Qemu-devel] [PATCH 0/3] Add new utility function memory_region_allocate_aux_memory()

2017-07-04 Thread Peter Maydell
Many board models and several devices need to create auxiliary regions of RAM (in addition to the main lump of 'system' memory), to model static RAMs, video memory, ROMs, etc. Currently they do this with a sequence like: memory_region_init_ram(sram, NULL, "sram", 0x1, _fatal);