From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSleg-00078s-UP for qemu-devel@nongnu.org; Mon, 08 Feb 2016 08:15:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSled-0005lx-NC for qemu-devel@nongnu.org; Mon, 08 Feb 2016 08:15:02 -0500 Received: from mx2.parallels.com ([199.115.105.18]:50400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSled-0005lt-Gz for qemu-devel@nongnu.org; Mon, 08 Feb 2016 08:14:59 -0500 Date: Mon, 8 Feb 2016 16:14:44 +0300 From: Roman Kagan Message-ID: <20160208131443.GC6420@rkaganb.sw.ru> 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> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20160205192507.41fc6024@nial.brq.redhat.com> 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: Igor Mammedov Cc: Peter Maydell , Eduardo Habkost , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Paolo Bonzini , John Snow , Richard Henderson 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.