Re: [Qemu-devel] [PATCH v3 07/11] bonito: convert north bridge register mapping to memory API

2011-11-24 Thread Benoît Canet
Thanks On Thu, Nov 24, 2011 at 9:40 AM, Avi Kivity wrote: > On 11/23/2011 01:03 AM, Peter Maydell wrote: > > 2011/11/22 Benoît Canet : > > > static int bonito_initfn(PCIDevice *dev) > > > { > > > PCIBonitoState *s = DO_UPCAST(PCIBonitoState, dev, dev); > > > +SysBusDevice *sysbus = sys

Re: [Qemu-devel] [PATCH v3 07/11] bonito: convert north bridge register mapping to memory API

2011-11-24 Thread Avi Kivity
On 11/23/2011 01:03 AM, Peter Maydell wrote: > 2011/11/22 Benoît Canet : > > static int bonito_initfn(PCIDevice *dev) > > { > > PCIBonitoState *s = DO_UPCAST(PCIBonitoState, dev, dev); > > +SysBusDevice *sysbus = sysbus_from_qdev(&dev->qdev); > > This looks odd. The device here is a PCIBo

Re: [Qemu-devel] [PATCH v3 07/11] bonito: convert north bridge register mapping to memory API

2011-11-23 Thread Peter Maydell
2011/11/23 Benoît Canet : > It would work using memory_region_add_subregion() and get_system_memory() > but Avi previously noticed me that using get_system_memory() in devices > is wrong because it goes against one of the goals of the memory API : > avoiding global knowledge. Yes. It's a bit diffi

Re: [Qemu-devel] [PATCH v3 07/11] bonito: convert north bridge register mapping to memory API

2011-11-23 Thread Benoît Canet
2011/11/23 Peter Maydell > 2011/11/22 Benoît Canet : > > static int bonito_initfn(PCIDevice *dev) > > { > > PCIBonitoState *s = DO_UPCAST(PCIBonitoState, dev, dev); > > +SysBusDevice *sysbus = sysbus_from_qdev(&dev->qdev); > > This looks odd. The device here is a PCIBonitoState, which >

Re: [Qemu-devel] [PATCH v3 07/11] bonito: convert north bridge register mapping to memory API

2011-11-22 Thread Peter Maydell
2011/11/22 Benoît Canet : >  static int bonito_initfn(PCIDevice *dev) >  { >     PCIBonitoState *s = DO_UPCAST(PCIBonitoState, dev, dev); > +    SysBusDevice *sysbus = sysbus_from_qdev(&dev->qdev); This looks odd. The device here is a PCIBonitoState, which is-a PCIDevice, which is-a DeviceState. I

[Qemu-devel] [PATCH v3 07/11] bonito: convert north bridge register mapping to memory API

2011-11-22 Thread Benoît Canet
Signed-off-by: Benoît Canet --- hw/bonito.c | 39 ++- 1 files changed, 18 insertions(+), 21 deletions(-) diff --git a/hw/bonito.c b/hw/bonito.c index fdb8198..9260848 100644 --- a/hw/bonito.c +++ b/hw/bonito.c @@ -201,9 +201,7 @@ typedef struct PCIBonitoStat