From nobody Sat May 18 19:47:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1714070709; cv=none; d=zohomail.com; s=zohoarc; b=FwzNzKhV43bKYFbMKW74oouGTERm8zmLMKxwIdUtkyO1OFWL2FwzxseAcEN+9zsaThyXErErMNuhASmJvpiKnLq7cnKPxrI/c6HR9xNCy8K9Ph3my/FCsYMjhg6sfXhd/E5dBsz3XJcJYpqNLLPuNRg9QTPzxakWAoyS722CGnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1714070709; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kcZZ0kZSAdohuUyLtWV7fjOmIzrCShpRO748CvVclCE=; b=UAGUgcHBocNPOxItaoop13fmlylMxuxeitnVHeDtqZylmnO2OfTaIaxTU5y5zQzJlzW6owpMhme/8fyG5lHNjtYowjnlbgZvPwwPB9lH7R6YfN9JKVtf7bMSXoRA8U18KbgWy+7lDcZdDQT2B2tDDUfM8YjPhZONW5lWgZgsYPE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714070709293413.162318140299; Thu, 25 Apr 2024 11:45:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0450-0000bg-5h; Thu, 25 Apr 2024 14:44:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s044y-0000bR-K0 for qemu-devel@nongnu.org; Thu, 25 Apr 2024 14:44:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s044B-0004ra-Jg for qemu-devel@nongnu.org; Thu, 25 Apr 2024 14:44:20 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-515-Y22rRTz_PEqS2jvnYdN4Ow-1; Thu, 25 Apr 2024 14:43:25 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9992A18065AD; Thu, 25 Apr 2024 18:43:20 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0F0885AD060; Thu, 25 Apr 2024 18:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714070609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kcZZ0kZSAdohuUyLtWV7fjOmIzrCShpRO748CvVclCE=; b=Gk5wdU/p6/HrzdnceVqMGmjhPopm9SkrOddghffgNCwELFTy9Rwjp9SvGTlmDqtAKhpJB8 LizieSFHKubYSeqm0tiu37wz3k1rVlLvWdQgmr4n+aLfgAadp8ayJDWEQLAQ3P+5q3OJXh nCDBIbiwc7zsMC0Qwznko3p8i/1ndTg= X-MC-Unique: Y22rRTz_PEqS2jvnYdN4Ow-1 From: Thomas Huth To: Paolo Bonzini , "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Miroslav Rezanina Subject: [PATCH 1/3] hw/i386/pc: Allow to compile without CONFIG_FDC_ISA Date: Thu, 25 Apr 2024 20:43:13 +0200 Message-ID: <20240425184315.553329-2-thuth@redhat.com> In-Reply-To: <20240425184315.553329-1-thuth@redhat.com> References: <20240425184315.553329-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.669, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1714070710460100004 Content-Type: text/plain; charset="utf-8" The q35 machine can work without FDC. But to be able to also link a QEMU binary that does not include the FDC code, we have to make it possible to disable the spots that call into the FDC code. Signed-off-by: Thomas Huth Acked-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/pc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 08c7de416f..93c48f6747 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -439,16 +439,19 @@ static void pc_boot_set(void *opaque, const char *boo= t_device, Error **errp) =20 static void pc_cmos_init_floppy(MC146818RtcState *rtc_state, ISADevice *fl= oppy) { - int val, nb, i; + int val, nb; FloppyDriveType fd_type[2] =3D { FLOPPY_DRIVE_TYPE_NONE, FLOPPY_DRIVE_TYPE_NONE }; =20 +#ifdef CONFIG_FDC_ISA /* floppy type */ if (floppy) { - for (i =3D 0; i < 2; i++) { + for (int i =3D 0; i < 2; i++) { fd_type[i] =3D isa_fdc_get_drive_type(floppy, i); } } +#endif + val =3D (cmos_get_fd_drive_type(fd_type[0]) << 4) | cmos_get_fd_drive_type(fd_type[1]); mc146818rtc_set_cmos_data(rtc_state, 0x10, val); @@ -1132,7 +1135,7 @@ static void pc_superio_init(ISABus *isa_bus, bool cre= ate_fdctrl, int i; DriveInfo *fd[MAX_FD]; qemu_irq *a20_line; - ISADevice *fdc, *i8042, *port92, *vmmouse; + ISADevice *i8042, *port92, *vmmouse; =20 serial_hds_isa_init(isa_bus, 0, MAX_ISA_SERIAL_PORTS); parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS); @@ -1142,11 +1145,13 @@ static void pc_superio_init(ISABus *isa_bus, bool c= reate_fdctrl, create_fdctrl |=3D !!fd[i]; } if (create_fdctrl) { - fdc =3D isa_new(TYPE_ISA_FDC); +#ifdef CONFIG_FDC_ISA + ISADevice *fdc =3D isa_new(TYPE_ISA_FDC); if (fdc) { isa_realize_and_unref(fdc, isa_bus, &error_fatal); isa_fdc_init_drives(fdc, fd); } +#endif } =20 if (!create_i8042) { --=20 2.44.0 From nobody Sat May 18 19:47:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1714070725; cv=none; d=zohomail.com; s=zohoarc; b=l9+tAoI3xEK7xYK6HzZNENKtA4ejPanRGmbfVP86rAk4CGpCAlv8eRbTthmkHx6Mew8omeDj7eZMoC1IPnwsv3/TJTKNcEqGYH82DPIkaJp5LGcuU109X8zxvpf15NCdHI8iW3HPFu6cJGg2/5LCfi7IPuKpfTU3DM6F7DB6vUY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1714070725; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HK/Mu4wX7TUuR/ttgNQYSivxZmZbrLJ789VRMxr4e0M=; b=IHRrd8PWLsk5z8Q5BhkQgztAqzKP/hudGxjawFeuxN6qUddAJLPg3WJC3AEUl1DWfE3OY0WmONB7c944TukwVCrAOudeAU+Pe2bEtS4icqrQDYtvCxa10bVtsoTpv/8V0nIdzRQ0ROLvttFk9cIIhpLhcLYpmgYw6TH6jhZLtHA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171407072568391.40676543376048; Thu, 25 Apr 2024 11:45:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s045l-00014h-IV; Thu, 25 Apr 2024 14:45:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s045j-0000zy-Nf for qemu-devel@nongnu.org; Thu, 25 Apr 2024 14:45:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s044n-0005Sv-6p for qemu-devel@nongnu.org; Thu, 25 Apr 2024 14:45:07 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-101-cCQf2W8ZOau6fP0D-6wOKA-1; Thu, 25 Apr 2024 14:43:24 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E612A3C02531; Thu, 25 Apr 2024 18:43:22 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1EE825AD060; Thu, 25 Apr 2024 18:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714070647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HK/Mu4wX7TUuR/ttgNQYSivxZmZbrLJ789VRMxr4e0M=; b=ZzmZ8cjbFgam47QpQy04xJVR84gkOGRX8KEHr/s8kknZzYAQLt79zANFwY80EnvRVMdxaS Dq8nN5V4fdY3CMIFpXiE6q/ULmHCWvp9ECU5zhgnuj0GusNRZgqfwGGwEvbsc1/Or5l+Jc KPJLYb53xkGBIMnEbKlLG1S52FUN4KE= X-MC-Unique: cCQf2W8ZOau6fP0D-6wOKA-1 From: Thomas Huth To: Paolo Bonzini , "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Miroslav Rezanina Subject: [PATCH 2/3] hw/i386/Kconfig: Allow to compile Q35 without FDC_ISA Date: Thu, 25 Apr 2024 20:43:14 +0200 Message-ID: <20240425184315.553329-3-thuth@redhat.com> In-Reply-To: <20240425184315.553329-1-thuth@redhat.com> References: <20240425184315.553329-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.669, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1714070726711100001 Content-Type: text/plain; charset="utf-8" The q35 machine can be used without floppy disk controller (FDC), but due to our current Kconfig setup, the FDC code is still always included in the binary. To fix this, the "PC" config option should only imply the "FDC_ISA" instead of always selecting it. The i440fx and the isa-pc machine currently always instantiate the FDC, so we have to add the select statements now there instead. Signed-off-by: Thomas Huth Acked-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index a6ee052f9a..0b08580862 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -32,7 +32,7 @@ config PC imply VGA_PCI imply VIRTIO_VGA imply NVDIMM - select FDC_ISA + imply FDC_ISA select I8259 select I8254 select PCKBD @@ -70,6 +70,7 @@ config I440FX imply VMPORT imply VMMOUSE select ACPI_PIIX4 + select FDC_ISA select PC_PCI select PC_ACPI select PCI_I440FX @@ -83,6 +84,7 @@ config ISAPC bool imply VGA_ISA select ISA_BUS + select FDC_ISA select PC select IDE_ISA # FIXME: it is in the same file as i440fx, and does not compile --=20 2.44.0 From nobody Sat May 18 19:47:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1714070708; cv=none; d=zohomail.com; s=zohoarc; b=ANbsFZU5Cfy/UOoK84yMjfNKTI8qjrpHX1pWBZEJTwwjTUWKWmBzeVaG99Hg7HVMqFXghWQGzhShbEQExa0/htqIU1s2zMx1M4NK1M0lp/dvTjCTfkxudki0V+pSw0/gGdFQdlp+nHnq8PYzhwUMUi5YWP+r5Ob3Mjd2X84SCRw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1714070708; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=N9vbo3uUKhHLnzOebXa1LE4hx2mSttzc84PuJ7uRBhA=; b=WXbrMec2ileo7ieNKxC9hHt+d6DCo1d6cO07V+8X0uxgXEXI+D4i10//R04jkjD3Z/qVxOeEaFx+i5UgtLKNLVWiHXa7h8hjYOR2ObE7yyvzLjEaS8cIe+8LsAEXgV7r+PpZY490q8s7MX9vddTrQHPHfH8zU5UHir7OaXCu0gg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714070708816292.70642210121105; Thu, 25 Apr 2024 11:45:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s044w-0000bL-Nq; Thu, 25 Apr 2024 14:44:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s044t-0000an-Vk for qemu-devel@nongnu.org; Thu, 25 Apr 2024 14:44:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s0449-0004rQ-0X for qemu-devel@nongnu.org; Thu, 25 Apr 2024 14:44:15 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-452-mChfVDq6O26UZud04czTgA-1; Thu, 25 Apr 2024 14:43:25 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 64FA518065AF; Thu, 25 Apr 2024 18:43:25 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.192.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 661925AD060; Thu, 25 Apr 2024 18:43:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714070607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N9vbo3uUKhHLnzOebXa1LE4hx2mSttzc84PuJ7uRBhA=; b=FnIKJtV9etFsfE8c25gqT7ZSer/IbFMMpJS9VoAEAEazANFp8+nWMxFxml3JTxkeLx6GwR 20bmkrGutyGumxFY+GSptoTkO1t5g2BTYTG6kuC2K7h8qwlyi7qFWb66I6t72ChmxZdJtp zQdRYiJtDZhBU5thB/01YLSrojv39z4= X-MC-Unique: mChfVDq6O26UZud04czTgA-1 From: Thomas Huth To: Paolo Bonzini , "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Miroslav Rezanina Subject: [RFC PATCH 3/3] hw/i386: Add the possibility to use i440fx and isapc without FDC Date: Thu, 25 Apr 2024 20:43:15 +0200 Message-ID: <20240425184315.553329-4-thuth@redhat.com> In-Reply-To: <20240425184315.553329-1-thuth@redhat.com> References: <20240425184315.553329-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.669, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1714070710455100003 Content-Type: text/plain; charset="utf-8" The i440fx and the isapc machines can be used in binaries without FDC, too. We just have to make sure that they don't try to instantiate the FDC when it is not available. Signed-off-by: Thomas Huth Acked-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/pc_piix.c | 6 ++++-- hw/i386/Kconfig | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 8850c49c66..99efb3c45c 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -317,8 +317,8 @@ static void pc_init1(MachineState *machine, const char = *pci_type) } =20 /* init basic PC hardware */ - pc_basic_device_init(pcms, isa_bus, x86ms->gsi, x86ms->rtc, true, - 0x4); + pc_basic_device_init(pcms, isa_bus, x86ms->gsi, x86ms->rtc, + !MACHINE_CLASS(pcmc)->no_floppy, 0x4); =20 pc_nic_init(pcmc, isa_bus, pcms->pcibus); =20 @@ -501,6 +501,7 @@ static void pc_i440fx_machine_options(MachineClass *m) m->default_machine_opts =3D "firmware=3Dbios-256k.bin"; m->default_display =3D "std"; m->default_nic =3D "e1000"; + m->no_floppy =3D !module_object_class_by_name(TYPE_ISA_FDC); m->no_parallel =3D !module_object_class_by_name(TYPE_ISA_PARALLEL); machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE); machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE); @@ -931,6 +932,7 @@ static void isapc_machine_options(MachineClass *m) pcmc->has_reserved_memory =3D false; m->default_nic =3D "ne2k_isa"; m->default_cpu_type =3D X86_CPU_TYPE_NAME("486"); + m->no_floppy =3D !module_object_class_by_name(TYPE_ISA_FDC); m->no_parallel =3D !module_object_class_by_name(TYPE_ISA_PARALLEL); } =20 diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index 0b08580862..f2ef6d1ef2 100644 --- a/hw/i386/Kconfig +++ b/hw/i386/Kconfig @@ -70,7 +70,6 @@ config I440FX imply VMPORT imply VMMOUSE select ACPI_PIIX4 - select FDC_ISA select PC_PCI select PC_ACPI select PCI_I440FX @@ -84,7 +83,6 @@ config ISAPC bool imply VGA_ISA select ISA_BUS - select FDC_ISA select PC select IDE_ISA # FIXME: it is in the same file as i440fx, and does not compile --=20 2.44.0