Re: [Qemu-devel] [RFC 4/5] exec: allow to get a pointer for some mmio memory region

2017-02-07 Thread Frederic Konrad
On 02/04/2017 02:59 PM, Frederic Konrad wrote: > On 02/04/2017 01:41 PM, Paolo Bonzini wrote: >> > ... >>> >>> Doesn't hotplug use dynamic MemoryRegion? In which case we better >>> make that work with MTTCG. I wonder if we can't simply handle that >>> with a safe_work for this case? >> >> Hot-unplu

Re: [Qemu-devel] [RFC 4/5] exec: allow to get a pointer for some mmio memory region

2017-02-04 Thread Frederic Konrad
On 02/04/2017 01:41 PM, Paolo Bonzini wrote: > ... >> >> Doesn't hotplug use dynamic MemoryRegion? In which case we better >> make that work with MTTCG. I wonder if we can't simply handle that >> with a safe_work for this case? > > Hot-unplug works because the backing memory is only freed when th

Re: [Qemu-devel] [RFC 4/5] exec: allow to get a pointer for some mmio memory region

2017-02-04 Thread Paolo Bonzini
On 03/02/2017 13:09, Frederic Konrad wrote: > On 02/03/2017 06:26 PM, Paolo Bonzini wrote: >> >> >> On 03/02/2017 09:06, fred.kon...@greensocs.com wrote: >>> +host = mr->ops->request_ptr(mr->opaque, addr - mr->addr, &size, >>> &offset); >>> + >>> +if (!host || !size) { >>> +memor

Re: [Qemu-devel] [RFC 4/5] exec: allow to get a pointer for some mmio memory region

2017-02-04 Thread Edgar E. Iglesias
On Fri, Feb 03, 2017 at 09:26:19AM -0800, Paolo Bonzini wrote: > > > On 03/02/2017 09:06, fred.kon...@greensocs.com wrote: > > +host = mr->ops->request_ptr(mr->opaque, addr - mr->addr, &size, > > &offset); > > + > > +if (!host || !size) { > > +memory_region_transaction_commit();

Re: [Qemu-devel] [RFC 4/5] exec: allow to get a pointer for some mmio memory region

2017-02-03 Thread Frederic Konrad
On 02/03/2017 06:26 PM, Paolo Bonzini wrote: > > > On 03/02/2017 09:06, fred.kon...@greensocs.com wrote: >> +host = mr->ops->request_ptr(mr->opaque, addr - mr->addr, &size, >> &offset); >> + >> +if (!host || !size) { >> +memory_region_transaction_commit(); >> +return fals

Re: [Qemu-devel] [RFC 4/5] exec: allow to get a pointer for some mmio memory region

2017-02-03 Thread Paolo Bonzini
On 03/02/2017 09:06, fred.kon...@greensocs.com wrote: > +host = mr->ops->request_ptr(mr->opaque, addr - mr->addr, &size, &offset); > + > +if (!host || !size) { > +memory_region_transaction_commit(); > +return false; > +} > + > +sub = g_new(MemoryRegion, 1); > +

[Qemu-devel] [RFC 4/5] exec: allow to get a pointer for some mmio memory region

2017-02-03 Thread fred . konrad
From: KONRAD Frederic This introduces a special callback which allows to run code from some MMIO devices. SysBusDevice with a MemoryRegion which implements the request_ptr callback will be notified when the guest try to execute code from their offset. Then it will be able to eg: pre-load some co