Re: [Qemu-devel] [PATCH] i440fx: implement reset

2013-02-20 Thread David Woodhouse
On Wed, 2013-02-20 at 20:25 +, David Woodhouse wrote: > On Wed, 2013-02-20 at 19:20 +0100, Andreas Färber wrote: > > > And then all the *existing* uses of DO_UPCAST should be fixed to > use it > > > too? Such as in i440fx_write_config() ? > > > > Outside the scope of this patch. > > Well, may

Re: [Qemu-devel] [PATCH] i440fx: implement reset

2013-02-20 Thread David Woodhouse
On Wed, 2013-02-20 at 19:20 +0100, Andreas Färber wrote: > > And then all the *existing* uses of DO_UPCAST should be fixed to use it > > too? Such as in i440fx_write_config() ? > > Outside the scope of this patch. Well, maybe. But I might as well start by cleaning up the rest of the file that was

Re: [Qemu-devel] [PATCH] i440fx: implement reset

2013-02-20 Thread Andreas Färber
Am 20.02.2013 19:14, schrieb Paolo Bonzini: > Il 20/02/2013 19:04, David Woodhouse ha scritto: PCII440FXState *d = I440FX_PCI_WHATEVER_CAST_MACRO_NAME(dev); >> Yeah, that's the easy bit. The bit that I'm vaguely confused by would be >> something like >> >> #define I440FX_PCI_WHATEVER_CAST_

Re: [Qemu-devel] [PATCH] i440fx: implement reset

2013-02-20 Thread Andreas Färber
Am 20.02.2013 19:04, schrieb David Woodhouse: > On Wed, 2013-02-20 at 18:42 +0100, Andreas Färber wrote: >> >> PCII440FXState *d = I440FX_PCI_WHATEVER_CAST_MACRO_NAME(dev); > > Yeah, that's the easy bit. The bit that I'm vaguely confused by would be > something like > > #define I440FX_PCI_WHA

Re: [Qemu-devel] [PATCH] i440fx: implement reset

2013-02-20 Thread Paolo Bonzini
Il 20/02/2013 19:04, David Woodhouse ha scritto: >> > PCII440FXState *d = I440FX_PCI_WHATEVER_CAST_MACRO_NAME(dev); > Yeah, that's the easy bit. The bit that I'm vaguely confused by would be > something like > > #define I440FX_PCI_WHATEVER_CAST_MACRO_NAME(obj) \ > OBJECT_CHECK(PCII440FXSta

Re: [Qemu-devel] [PATCH] i440fx: implement reset

2013-02-20 Thread David Woodhouse
On Wed, 2013-02-20 at 18:42 +0100, Andreas Färber wrote: > > PCII440FXState *d = I440FX_PCI_WHATEVER_CAST_MACRO_NAME(dev); Yeah, that's the easy bit. The bit that I'm vaguely confused by would be something like #define I440FX_PCI_WHATEVER_CAST_MACRO_NAME(obj) \ OBJECT_CHECK(PCII440FXStat

Re: [Qemu-devel] [PATCH] i440fx: implement reset

2013-02-20 Thread Andreas Färber
Am 20.02.2013 18:24, schrieb David Woodhouse: > On Wed, 2013-02-20 at 17:17 +0100, Andreas Färber wrote: >>> +static void i440fx_reset(DeviceState *ds) >>> +{ >>> +PCIDevice *dev = DO_UPCAST(PCIDevice, qdev, ds); >>> +PCII440FXState *d = DO_UPCAST(PCII440FXState, dev, dev); >> >> Please don

Re: [Qemu-devel] [PATCH] i440fx: implement reset

2013-02-20 Thread David Woodhouse
On Wed, 2013-02-20 at 17:17 +0100, Andreas Färber wrote: > > +static void i440fx_reset(DeviceState *ds) > > +{ > > +PCIDevice *dev = DO_UPCAST(PCIDevice, qdev, ds); > > +PCII440FXState *d = DO_UPCAST(PCII440FXState, dev, dev); > > Please don't use DO_UPCAST() on QOM objects, there's QOM ca

Re: [Qemu-devel] [PATCH] i440fx: implement reset

2013-02-20 Thread Andreas Färber
Am 20.02.2013 17:17, schrieb Andreas Färber: > Am 20.02.2013 16:35, schrieb David Woodhouse: >> This implements reset functionality for the i440FX, resetting all the >> PAM registers to their power-on defaults of no RAM access and thus >> forwarding all access to the 0xc-0xf range to PCI ad

Re: [Qemu-devel] [PATCH] i440fx: implement reset

2013-02-20 Thread Andreas Färber
Am 20.02.2013 16:35, schrieb David Woodhouse: > This implements reset functionality for the i440FX, resetting all the > PAM registers to their power-on defaults of no RAM access and thus > forwarding all access to the 0xc-0xf range to PCI address space > (i.e. to the actual ROM) instead of

[Qemu-devel] [PATCH] i440fx: implement reset

2013-02-20 Thread David Woodhouse
This implements reset functionality for the i440FX, resetting all the PAM registers to their power-on defaults of no RAM access and thus forwarding all access to the 0xc-0xf range to PCI address space (i.e. to the actual ROM) instead of RAM. Fixing this is sufficient to work around a KVM b