qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in


From: Roman Kagan
Subject: Re: [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in DSDT
Date: Mon, 8 Feb 2016 16:14:44 +0300
User-agent: Mutt/1.5.24 (2015-08-30)

On Fri, Feb 05, 2016 at 07:25:07PM +0100, Igor Mammedov wrote:
> On Thu, 4 Feb 2016 23:54:13 +0200
> "Michael S. Tsirkin" <address@hidden> wrote:
> > -static Aml *build_fdc_device_aml(void)
> > +static Aml *build_fdinfo_aml(int idx, uint8_t type, uint8_t cylinders,
> > +                             uint8_t heads, uint8_t sectors)
> > +{
> > +    Aml *dev, *fdi;
> > +
> > +    dev = aml_device("FLP%c", 'A' + idx);
> > +
> > +    aml_append(dev, aml_name_decl("_ADR", aml_int(idx)));
> > +
> > +    fdi = aml_package(0x10);
> > +    aml_append(fdi, aml_int(idx));  /* Drive Number */
> > +    aml_append(fdi,
> > +        aml_int(cmos_get_fd_drive_type(type)));  /* Device Type */
> > +    aml_append(fdi,
> > +        aml_int(cylinders - 1));  /* Maximum Cylinder Number */
> this puts uint64_t(-1) in AML i.e. cylinders == 0 and overflow happens here
> 
> CCing Jon

I guess this is the effect of John's fdc rework.  I used to think zero
geometry was impossible at the time this patch was developed.

I wonder if it hasn't been fixed already by

  commit fd9bdbd3459e5b9d51534f0747049bc5b6145e07
  Author: John Snow <address@hidden>
  Date:   Wed Feb 3 11:28:55 2016 -0500

      fdc: fix detection under Linux
      
      Accidentally, I removed a "feature" where empty drives had geometry
      values applied to them, which allows seek on empty drives to work
      "by accident," as QEMU actually tries to disallow that.
      
      Seeks on empty drives should work, though, but the easiest thing is to
      restore the misfeature where empty drives have non-zero geometries
      applied.
      
      Document the hack accordingly.
      
      [Maintainer edit]
      
      This fix corrects a regression introduced in d5d47efc, where
      pick_geometry was modified such that it would not operate on empty
      drives, and as a result if there is no diskette inserted, QEMU
      no longer populates it with geometry bounds. As a result, seek fails
      when QEMU denies to move the current track, but reports success anyway.
      This can confuse the guest, leading to kernel panics in the guest.
      
      
      Signed-off-by: John Snow <address@hidden>
      Reviewed-by: Eric Blake <address@hidden>
      Message-id: address@hidden

Roman.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]