From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSsIn-000580-Gx for qemu-devel@nongnu.org; Mon, 08 Feb 2016 15:20:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSsIk-0002EL-AW for qemu-devel@nongnu.org; Mon, 08 Feb 2016 15:20:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSsIj-0002EA-PL for qemu-devel@nongnu.org; Mon, 08 Feb 2016 15:20:50 -0500 References: <1454612376-7072-1-git-send-email-mst@redhat.com> <1454612376-7072-49-git-send-email-mst@redhat.com> <20160205192507.41fc6024@nial.brq.redhat.com> <20160208131443.GC6420@rkaganb.sw.ru> From: John Snow Message-ID: <56B8F89F.3090603@redhat.com> Date: Mon, 8 Feb 2016 15:20:47 -0500 MIME-Version: 1.0 In-Reply-To: <20160208131443.GC6420@rkaganb.sw.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 48/49] i386: populate floppy drive information in DSDT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Roman Kagan , Igor Mammedov , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Peter Maydell , Eduardo Habkost , Paolo Bonzini , Richard Henderson 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" 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 > 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 > Reviewed-by: Eric Blake > Message-id: 1454106932-17236-1-git-send-email-jsnow@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