diff mbox

i386: drop FDC in pc-q35-2.4+ if neither

Message ID 55672949.5000502@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini May 28, 2015, 2:42 p.m. UTC
On 28/05/2015 15:52, Gerd Hoffmann wrote:
> @@ -494,7 +494,7 @@ static void ich9_lpc_machine_ready(Notifier *n, void *opaque)
>          /* lpt */
>          pci_conf[0x82] |= 0x04;
>      }
> -    if (memory_region_present(io_as, 0x3f0)) {
> +    if (memory_region_present(io_as, 0x3f2)) {
>          /* floppy */
>          pci_conf[0x82] |= 0x08;
>      }
> 
> Oh, and this ...
> 
> $ virsh qemu-monitor-command fedora-org-q35.base --hmp "info mtree" | grep fdc
>     00000000000003f1-00000000000003f5 (prio 0, RW): fdc
>     00000000000003f7-00000000000003f7 (prio 0, RW): fdc
> 
> ... looks fishy too.  Shouldn't that be 0x3f2-0x3f6 for the first range?

I think 0x3f0-0x3f5 based on this:

hw/block/fdc.c:    FD_REG_SRA = 0x00,
hw/block/fdc.c:    FD_REG_SRB = 0x01,
hw/block/fdc.c:    FD_REG_DOR = 0x02,
hw/block/fdc.c:    FD_REG_TDR = 0x03,
hw/block/fdc.c:    FD_REG_MSR = 0x04,
hw/block/fdc.c:    FD_REG_DSR = 0x04,
hw/block/fdc.c:    FD_REG_FIFO = 0x05,
hw/block/fdc.c:    FD_REG_DIR = 0x07,
hw/block/fdc.c:    FD_REG_CCR = 0x07,

So:


Paolo

Comments

Gerd Hoffmann May 28, 2015, 2:56 p.m. UTC | #1
Hi,

> > $ virsh qemu-monitor-command fedora-org-q35.base --hmp "info mtree" | grep fdc
> >     00000000000003f1-00000000000003f5 (prio 0, RW): fdc
> >     00000000000003f7-00000000000003f7 (prio 0, RW): fdc
> > 
> > ... looks fishy too.  Shouldn't that be 0x3f2-0x3f6 for the first range?
> 
> I think 0x3f0-0x3f5 based on this:
> 
> hw/block/fdc.c:    FD_REG_SRA = 0x00,
> hw/block/fdc.c:    FD_REG_SRB = 0x01,
> hw/block/fdc.c:    FD_REG_DOR = 0x02,
> hw/block/fdc.c:    FD_REG_TDR = 0x03,
> hw/block/fdc.c:    FD_REG_MSR = 0x04,
> hw/block/fdc.c:    FD_REG_DSR = 0x04,
> hw/block/fdc.c:    FD_REG_FIFO = 0x05,
> hw/block/fdc.c:    FD_REG_DIR = 0x07,
> hw/block/fdc.c:    FD_REG_CCR = 0x07,
> 
> So:
> 
> diff --git a/hw/block/fdc.c b/hw/block/fdc.c
> index d8a8edd..c761291 100644
> --- a/hw/block/fdc.c
> +++ b/hw/block/fdc.c
> @@ -2186,7 +2186,7 @@ static void fdctrl_realize_common(FDCtrl *fdctrl, Error **errp)
>  }
>  
>  static const MemoryRegionPortio fdc_portio_list[] = {
> -    { 1, 5, 1, .read = fdctrl_read, .write = fdctrl_write },
> +    { 0, 6, 1, .read = fdctrl_read, .write = fdctrl_write },
>      { 7, 1, 1, .read = fdctrl_read, .write = fdctrl_write },
>      PORTIO_END_OF_LIST(),
>  };

The io ranges for FDC0 in hw/i386/acpi-dsdt-isa.dsl are not consistent
with that though.  If 0x3f0 is correct (which seems to be the case from
a brief look) this needs to be fixed up.

cheers,
  Gerd
Paolo Bonzini May 28, 2015, 3:20 p.m. UTC | #2
On 28/05/2015 16:56, Gerd Hoffmann wrote:
> > diff --git a/hw/block/fdc.c b/hw/block/fdc.c
> > index d8a8edd..c761291 100644
> > --- a/hw/block/fdc.c
> > +++ b/hw/block/fdc.c
> > @@ -2186,7 +2186,7 @@ static void fdctrl_realize_common(FDCtrl *fdctrl, Error **errp)
> >  }
> >  
> >  static const MemoryRegionPortio fdc_portio_list[] = {
> > -    { 1, 5, 1, .read = fdctrl_read, .write = fdctrl_write },
> > +    { 0, 6, 1, .read = fdctrl_read, .write = fdctrl_write },
> >      { 7, 1, 1, .read = fdctrl_read, .write = fdctrl_write },
> >      PORTIO_END_OF_LIST(),
> >  };
>
> The io ranges for FDC0 in hw/i386/acpi-dsdt-isa.dsl are not consistent
> with that though.  If 0x3f0 is correct (which seems to be the case from
> a brief look) this needs to be fixed up.

Agreed.  Who draws the short straw? :)

Paolo
Gerd Hoffmann May 28, 2015, 3:49 p.m. UTC | #3
On Do, 2015-05-28 at 17:20 +0200, Paolo Bonzini wrote:
> 
> On 28/05/2015 16:56, Gerd Hoffmann wrote:
> > > diff --git a/hw/block/fdc.c b/hw/block/fdc.c
> > > index d8a8edd..c761291 100644
> > > --- a/hw/block/fdc.c
> > > +++ b/hw/block/fdc.c
> > > @@ -2186,7 +2186,7 @@ static void fdctrl_realize_common(FDCtrl *fdctrl, Error **errp)
> > >  }
> > >  
> > >  static const MemoryRegionPortio fdc_portio_list[] = {
> > > -    { 1, 5, 1, .read = fdctrl_read, .write = fdctrl_write },
> > > +    { 0, 6, 1, .read = fdctrl_read, .write = fdctrl_write },
> > >      { 7, 1, 1, .read = fdctrl_read, .write = fdctrl_write },
> > >      PORTIO_END_OF_LIST(),
> > >  };
> >
> > The io ranges for FDC0 in hw/i386/acpi-dsdt-isa.dsl are not consistent
> > with that though.  If 0x3f0 is correct (which seems to be the case from
> > a brief look) this needs to be fixed up.
> 
> Agreed.  Who draws the short straw? :)

====  <- mine is 4 ch^Winches ;)

cheers,
  Gerd

PS: patch sent.
diff mbox

Patch

diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index d8a8edd..c761291 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2186,7 +2186,7 @@  static void fdctrl_realize_common(FDCtrl *fdctrl, Error **errp)
 }
 
 static const MemoryRegionPortio fdc_portio_list[] = {
-    { 1, 5, 1, .read = fdctrl_read, .write = fdctrl_write },
+    { 0, 6, 1, .read = fdctrl_read, .write = fdctrl_write },
     { 7, 1, 1, .read = fdctrl_read, .write = fdctrl_write },
     PORTIO_END_OF_LIST(),
 };