From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxyEu-0006dX-Q7 for qemu-devel@nongnu.org; Thu, 28 May 2015 09:52:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxyEo-0007N4-S5 for qemu-devel@nongnu.org; Thu, 28 May 2015 09:52:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxyEo-0007Mw-MZ for qemu-devel@nongnu.org; Thu, 28 May 2015 09:52:46 -0400 Message-ID: <1432821161.6250.11.camel@nilsson.home.kraxel.org> From: Gerd Hoffmann Date: Thu, 28 May 2015 15:52:41 +0200 In-Reply-To: <20150528125925.GG6488@HEDWIG.INI.CMU.EDU> References: <20150528125925.GG6488@HEDWIG.INI.CMU.EDU> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] i386: drop FDC in pc-q35-2.4+ if neither List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gabriel L. Somlo" Cc: mst@redhat.com, lersek@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, pbonzini@redhat.com, John Snow On Do, 2015-05-28 at 08:59 -0400, Gabriel L. Somlo wrote: > > It is Very annoying to carry forward an outdatEd coNtroller with a mOdern > > Machine type. > > > > Hence, let us not instantiate the FDC when all of the following apply: > > - the machine type is pc-q35-2.4 or later, > > - "-device isa-fdc" is not passed on the command line (nor in the config > > file), > > - no "-drive if=floppy,..." is requested. > > Don't forget the FDC0 entry in the ACPI DSDT ! No worries, everything is fine here. > Right now, FDC0's _STA method returns 0x0F or 0x00, depending on the > value of \_SB_.PCI0.ISA_.FDEN, Yes. > which is hard-coded to 1 (so 0x0F > always, basically :) ) Yes on piix4. On q35 FDEN maps to the floppy drive enable bit of the ich9 lpc. And ich9_lpc_machine_ready() sets this (and other) enable bits. /me double checks things. Ok, in theory. In practice there seems to be something wrong. linux kernel log on q35 (with floppy) yields this: [root@fedora ~]# dmesg | grep pnp pnp: PnP ACPI init pnp 00:00: Plug and Play ACPI device, IDs PNP0b00 (active) pnp 00:01: Plug and Play ACPI device, IDs PNP0303 (active) pnp 00:02: Plug and Play ACPI device, IDs PNP0f13 (active) pnp 00:03: Plug and Play ACPI device, IDs PNP0501 (active) pnp: PnP ACPI: found 4 devices Floppy (PNP0700) is not present. Hmm ... Seems be be this: --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -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? cheers, Gerd