On 02/08/2016 08:14 AM, Roman Kagan wrote: > 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" <m...@redhat.com> 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 <js...@redhat.com> > 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 <js...@redhat.com> > Reviewed-by: Eric Blake <ebl...@redhat.com> > Message-id: 1454106932-17236-1-git-send-email-js...@redhat.com > > Roman. >
Yes, hopefully solved on my end. The geometry values for an empty disk are not well defined (they certainly don't have any *meaning*) so if you are populating tables based on an empty drive, I just hope you also have the mechanisms needed to update said tables when the media changes. What do the guests use these values for? Are they fixed at boot? --js