From patchwork Thu Mar 28 15:54:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 783611 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2800304wrt; Thu, 28 Mar 2024 08:59:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWbBnbUf0oY5qJwQvvlGbSGuObPPJLhJtv3B9/+0iuafXf/jbjBIGAS2aNhRy0sXjLMedd/2Pokmoa2ETFI6jyR X-Google-Smtp-Source: AGHT+IGkXQ0lkhE9oozJOmOHMaB316CYykQXJbsdwI/Je40J1H8Bj3uqjNeJONCF3qLIVVTODWg1 X-Received: by 2002:a0c:9d01:0:b0:696:755f:c0c9 with SMTP id m1-20020a0c9d01000000b00696755fc0c9mr3052437qvf.0.1711641585720; Thu, 28 Mar 2024 08:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711641585; cv=none; d=google.com; s=arc-20160816; b=Y4wQcVO1tzRYwX89zwXSj9YHuMa3x1B0WKkbtk1jvCvdEhNpDE3gwJ3MNSpLjNHB/u ZMcQQdk5Q8Rq/YQX4p7R1+Fae3xVw/HvB8Zxsb8KHZv/F/iT+2bFFN4jHrNdGZIURrg4 XkxSOFCxu34+2NBCk2zzaKxR10Isuuq6M128TMhw41eFcPcfEvsmz2XKJmDJJPbImn6H 4lpXI39ZHqSfuNTPDgdfBtKSmV+N6x1QCZbUOYkctCzqIHZuHOHUpjw8Ah9aISN5MRZP 4XPnxyPw5NPNP/14NWUtZZeFBpwDRTffJO0gLXywrPcflX8ODRoI48ExurDdCYzDrUVT kwdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=K6394pyfYpf5VBXUXIwRMOR2ZbX+o8CbfYrADQtuSgY=; fh=UDxTSeEolXQUwGzf6K2+0ghcCN8FdfJ4W87Ih9funHA=; b=panjPX+ctoETO7jtlcAxI5F+/gEo2JhjrrQkRkFzhPP2WKOCuEe3k8m05iyZIA8JEG 0AItD7ok1T6gPd0QnBIhWXggHFtmfVuwgPEmlo+ciF02XtF1GX5l0ZLmd04n+wZ1qy/6 RhNREdrX8i4NpuSjccxPyoiRsLZ7vBBTPR1/YmelFBgMofaWYnk2cT/iuK0sQVRgysyX pJ7CfhgtHW/vb4opFCpg6A3zN58MCAEedXUQP0LDD5m5787OQvu6kyPD80JPV8LBcr39 drppvBTxQ19AWPFatQMLhmMNL6DB7lKzt23AT8PUZKnvKtInVi2QLXhpRZf7laqgC3Zx re/g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jhd29j4M; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z8-20020a0cd788000000b00696ac628ca1si1657122qvi.54.2024.03.28.08.59.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Mar 2024 08:59:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jhd29j4M; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rps8Z-0001ni-Uq; Thu, 28 Mar 2024 11:57:56 -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 1rps8R-0001Wt-VC for qemu-devel@nongnu.org; Thu, 28 Mar 2024 11:57:48 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rps8Q-0002pM-3j for qemu-devel@nongnu.org; Thu, 28 Mar 2024 11:57:47 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-56bb22ff7baso1289250a12.3 for ; Thu, 28 Mar 2024 08:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711641464; x=1712246264; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K6394pyfYpf5VBXUXIwRMOR2ZbX+o8CbfYrADQtuSgY=; b=jhd29j4MdfwOf113zIcv8UX2buDkfsD4w6qamHe3Z57LvS0+lYQ2reoVjpM1L6bY7x CNDLuowdOkZrj4PvzFecJvhHUL8tT4sSNKS9LFdBQLz7sARYfd45Y5FPuLiLEtVl2H59 2/B9J879qAk1mvWzYMSiJlvNm22orYnWbRWhFgTrTOQblhOA0pVU4lNaBDqkAXmJMouS aAYZIF8k7KvPwmImynj6vTvlLDAXyEIaxl/6GbhrBdE7wrgHj1leI8HDmzbpEQGOr0CJ mDNxQBxbhl6P+JCTlHPPcOWAFjmFMZGQZtB/O5NFOD+yR3wRz0D5OEE5oqiCXx3XK/Qo 6QHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711641464; x=1712246264; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K6394pyfYpf5VBXUXIwRMOR2ZbX+o8CbfYrADQtuSgY=; b=hPEL4I926jpNAMpKOGEXvA0DDuzBszvO4xp26DRxtnLBigzI9yOF7QJgk0t9xkoQZO Bnkt0VGmpT/z/JECSMkko6bKojHRFKq/M4L398+ASHOy4TP9Wh/bLGvmJu7RpvMLTEZ3 ER+WMfC8PBmOCd5tMvYNxTZSdgW6PiFuFSBUptrvI/ovrAk0C22FpUZh1+HzxtQJSVyA dCF/sz+SZdOIhd/U6/r4VOOwv1NT+hK/7AnL7r/yNTPdo8y7nXvzc/SLUV5WdaNdOpni kXTtNEPtj/OcPZQBd04PL53EgNxp8AcGh2gSAmZdeSfIgxO8A1fnbXx5yhioANa9TYtU GzCw== X-Gm-Message-State: AOJu0YzpfXJwPlwKZ7NcbqZ05wrPCpBGa5paLg8XQmRxua4nRfjbqdo4 aq9uNzFKQpyRfHxlrPH5MU3CbqBqmD7llTDHBYlVgmf5uN/zk7FdUmAFBsxaaFwMQMQk5uMKS8J y X-Received: by 2002:a50:d750:0:b0:565:e610:c358 with SMTP id i16-20020a50d750000000b00565e610c358mr2278668edj.38.1711641464364; Thu, 28 Mar 2024 08:57:44 -0700 (PDT) Received: from m1x-phil.lan (pas38-h02-176-184-5-52.dsl.sta.abo.bbox.fr. [176.184.5.52]) by smtp.gmail.com with ESMTPSA id p12-20020a50c94c000000b005689bfe2688sm980668edh.39.2024.03.28.08.57.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 28 Mar 2024 08:57:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Eduardo Habkost , Stefano Stabellini , xen-devel@lists.xenproject.org, Bernhard Beschow , Thomas Huth , Marcel Apfelbaum , "Michael S. Tsirkin" , Paolo Bonzini , Igor Mammedov , Anthony Perard , Ani Sinha , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [RFC PATCH-for-9.1 29/29] hw/i386/pc: Move ISA-only PC machine to pc_isa.c Date: Thu, 28 Mar 2024 16:54:37 +0100 Message-ID: <20240328155439.58719-30-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240328155439.58719-1-philmd@linaro.org> References: <20240328155439.58719-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=philmd@linaro.org; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Extract the ISA-only PC machine code from pc_piix.c to a new file, pc_isa.c. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 + hw/i386/pc_isa.c | 33 +++++++++++++++++++++++++++++++++ hw/i386/pc_piix.c | 23 ----------------------- hw/i386/meson.build | 1 + 4 files changed, 35 insertions(+), 23 deletions(-) create mode 100644 hw/i386/pc_isa.c diff --git a/MAINTAINERS b/MAINTAINERS index a07af6b9d4..a68fa813b8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1812,6 +1812,7 @@ M: Marcel Apfelbaum S: Supported F: include/hw/i386/ F: hw/i386/ +X: hw/i386/pc_isa.c F: hw/pci-host/i440fx.c F: hw/pci-host/q35.c F: hw/pci-host/pam.c diff --git a/hw/i386/pc_isa.c b/hw/i386/pc_isa.c new file mode 100644 index 0000000000..a98c75f3ae --- /dev/null +++ b/hw/i386/pc_isa.c @@ -0,0 +1,33 @@ +/* + * QEMU ISA PC System Emulator + * + * Copyright (c) 2003-2004 Fabrice Bellard + * + * SPDX-License-Identifier: MIT + */ + +#include "qemu/osdep.h" +#include "qom/object.h" +#include "hw/boards.h" +#include "hw/i386/pc.h" +#include "hw/char/parallel-isa.h" +#include "target/i386/cpu-qom.h" + +static void pc_init_isa(MachineState *machine) +{ + pc_piix_init(machine, NULL); +} + +static void isapc_machine_options(MachineClass *m) +{ + m->desc = "ISA-only PC"; + m->max_cpus = 1; + m->option_rom_has_mr = true; + m->rom_file_has_mr = false; + m->default_nic = "ne2k_isa"; + m->default_cpu_type = X86_CPU_TYPE_NAME("486"); + m->no_parallel = !module_object_class_by_name(TYPE_ISA_PARALLEL); +} + +DEFINE_PC_MACHINE(isapc, "isapc", pc_init_isa, + isapc_machine_options, TYPE_PC_MACHINE); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 4a3ae72fe4..f94221ab92 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -434,13 +434,6 @@ static void pc_set_south_bridge(Object *obj, int value, Error **errp) * hw_compat_*, pc_compat_*, or * pc_*_machine_options(). */ -#ifdef CONFIG_ISAPC -static void pc_init_isa(MachineState *machine) -{ - pc_piix_init(machine, NULL); -} -#endif - #ifdef CONFIG_XEN static void pc_xen_hvm_init_pci(MachineState *machine) { @@ -820,22 +813,6 @@ static void pc_i440fx_2_4_machine_options(MachineClass *m) DEFINE_I440FX_MACHINE(v2_4, "pc-i440fx-2.4", NULL, pc_i440fx_2_4_machine_options) -#ifdef CONFIG_ISAPC -static void isapc_machine_options(MachineClass *m) -{ - m->desc = "ISA-only PC"; - m->max_cpus = 1; - m->option_rom_has_mr = true; - m->rom_file_has_mr = false; - m->default_nic = "ne2k_isa"; - m->default_cpu_type = X86_CPU_TYPE_NAME("486"); - m->no_parallel = !module_object_class_by_name(TYPE_ISA_PARALLEL); -} - -DEFINE_PC_MACHINE(isapc, "isapc", pc_init_isa, - isapc_machine_options, TYPE_PC_MACHINE); -#endif - #ifdef CONFIG_XEN static void xenfv_4_2_machine_options(MachineClass *m) { diff --git a/hw/i386/meson.build b/hw/i386/meson.build index 1a6e731196..0576fc6541 100644 --- a/hw/i386/meson.build +++ b/hw/i386/meson.build @@ -12,6 +12,7 @@ i386_ss.add(when: 'CONFIG_X86_IOMMU', if_true: files('x86-iommu.c'), if_false: files('x86-iommu-stub.c')) i386_ss.add(when: 'CONFIG_AMD_IOMMU', if_true: files('amd_iommu.c'), if_false: files('amd_iommu-stub.c')) +i386_ss.add(when: 'CONFIG_ISAPC', if_true: files('pc_isa.c')) i386_ss.add(when: 'CONFIG_I440FX', if_true: files('pc_piix.c')) i386_ss.add(when: 'CONFIG_MICROVM', if_true: files('microvm.c', 'acpi-microvm.c', 'microvm-dt.c')) i386_ss.add(when: 'CONFIG_Q35', if_true: files('pc_q35.c'))