From patchwork Fri Dec 6 18:13:52 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: 847853 Delivered-To: patch@linaro.org Received: by 2002:a5d:50c2:0:b0:385:e875:8a9e with SMTP id f2csp927776wrt; Fri, 6 Dec 2024 10:16:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWDBzr2UpyHP830IJ45K/bBLJ4vIsCk+Dbydod4z32Z123r3BIt5E4l46ulQQu/3uHk8LxeMA==@linaro.org X-Google-Smtp-Source: AGHT+IGE5CuCp7GDR88aL9N8ArM3kRHVcZOvpq0Fcwq6G7u05LM8ISoljKgmlG62b+kmd++hse/+ X-Received: by 2002:a05:620a:4592:b0:7b6:672d:7fbb with SMTP id af79cd13be357-7b6bcb46a73mr652683085a.47.1733508987465; Fri, 06 Dec 2024 10:16:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733508987; cv=none; d=google.com; s=arc-20240605; b=Lxyyn1WnRHuVbOxt5FhkyfdzI5mxnrea8LyHtd8JntV2EA5Jyj7+IRQuQgYmKS8j08 whOn7NtKlOXbFE1Y33LZLvAgRVD2em7Qpk2S6Nabvr9JLQctrFbC+bGMEROk/Lcq8MEU RsW60ISDFV/HtxoHBrsSTeMrQCAvSamDEyAuWQxmMWFcHbOX6vTA56LXY4epInj4u5lU uYewP3yD5rjfd8XUbV8EX5KJ1xXYe7cRPAUCU2GkhrKCEWDLV8leWsSffEyi23Zbs74q 4RbQ0uKz31PQM6VDWhtfi2mnK65Rq4OqnVmGo74WKhk7SlSVxMp1RBIoiM6R2wyAp0gF p9fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=drnor6SocDhMk0Sf/VXY5/KGSh3UPEWhTs9UqjHuGlg=; fh=D3DQMAWsiUlbi9UMsTSJEr0KAnXSFlZLzsE6CsRL6Gs=; b=IGeQLV9ayNOGgjN4BkNq7/EXBK448+1M5l0CrD3yPos6cSq4lW66JulSU058tqRnDd Ps9cBySnBdxumDn8TzphuJCKwF/TmIfAIbfE9fOHXWUFNGl1BcKBikwZh7DKZ78P/9Oh sgB8L0zA5+UEAylOyBh6c6HcNwfWx+APn433mn8TTo0nqJYs9LQ7HiMhQno1jR2AZ2J/ 6FHjWxW389Tl0TQMG3qM3bEotE26bYKj3DpZnhrI/8C9FyG57j1XbcvSeL5Z4MT0DaCB gGYz8kOziYrkpqLXg/vuVG4A4g1nfMQCCna80AyCXuE8tcE8o9GWqPbGeuWyosdV57H0 cuBg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BSDhbKH4; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b6b5abdab8si469031285a.579.2024.12.06.10.16.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Dec 2024 10:16:27 -0800 (PST) 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=BSDhbKH4; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tJcrv-0003Kq-Uj; Fri, 06 Dec 2024 13:16:00 -0500 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 1tJcrI-0002e0-1e for qemu-devel@nongnu.org; Fri, 06 Dec 2024 13:15:21 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tJcrA-0005Sl-JL for qemu-devel@nongnu.org; Fri, 06 Dec 2024 13:15:14 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4349f160d62so16581035e9.2 for ; Fri, 06 Dec 2024 10:15:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733508911; x=1734113711; 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=drnor6SocDhMk0Sf/VXY5/KGSh3UPEWhTs9UqjHuGlg=; b=BSDhbKH4cTIS9c9S3Rsrp4CKbevQE5m+sQYvxe9VEntFqFC1mbS4wwsYD8ArzZ3Hin tONTi/Z5KYVMtmUTXJIZq0RTdCxH26L3lV3uV1eodXpdviCYRIzQbt2aj+khT/ZIWfnN Mj9XGSztoUGv0RcM+wsJL2mFDsZEQRzOQOy6zgBJerAvxVpyN+kYOYTtVmvTzFahFQzA vzEHmtcVR1efdcEzHv1q5qAtrbLSBKwDGbL0u0JL4QFMF0gtHtMMZxD5xmtCZu1nsTLb jZbFj6fbpbWFL9Mqa2l4vAZ7fNSlCgDX4VF8knITirzkR4FWPReeNVXI6WlUnaWEq4xp Chmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733508911; x=1734113711; 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=drnor6SocDhMk0Sf/VXY5/KGSh3UPEWhTs9UqjHuGlg=; b=t0Pnh4/0mU1BcJMHigZu3S8+BOslwWKWcKiWKDT+qNERYzgf+L9CEyRTXH4V3gguU/ Qwl1tQW/2uObwi1qp64/0ocoGq4V1z7QbJRtmfiCF+zlS6ohhE9jFnYB8AfSy0EOCUp9 OQYi07g118FFrGrT0kdEWr88I7S/ALH4bwpmrmmi0JbFkpsC154bicK5DPzr07N+d67U wj17L/tUjiLZlMvjiH4mJtGd1VE0LKHzKY3T14po1LTziFeSsGen1YTGBXH9vjNNBqL1 9RmksGbCUonug8EeS9N/TOa/0xLjU8vhanpbko+Ieu4f3hK+XYz9Ickx186lI3DwQjz7 vIWA== X-Forwarded-Encrypted: i=1; AJvYcCVN/jUQG37qXRQXXKtSe4B5fyf2EnvsFbxAstVy8RLyu8r27ImQHfeamHLRZuLbXTRBGnoAeupCNsCz@nongnu.org X-Gm-Message-State: AOJu0YzKoHVLMjptS7hnVfN7dkt4Jh+Wv+sw9I1AqbPfp6OLvppAjHi+ VOsvaqG73sd3GzBCdoT/ByhKAF8AqhCcUeLFT4pYZcFsMfYAGRQSytoG7jXKBrs= X-Gm-Gg: ASbGnctne1z0jRK54MjhKCbFMfPdSo3vyrlF269Caf4noLX1y8Ua9asZK6G3RylOdGs dRcB8xJPFRjjjWtninbtOl5+SSD0wF6GrDRko0eJ+G4zqoEHsTjOUctsxA3Axvz55fXdcjpU6lI RZnN/ECHe8d40WgB37AfEjreQtCfwCH12FfyOo9dzRPOcc7xJm2NrYC2dUdv9pLMO+JJDEyyVU0 MdnJXUrxndOSjbJ4wjZ17AtI+0zg6hfBDpd/Nlhs8JPUKsLoNJbHb4M06s6JAaZLGk= X-Received: by 2002:a05:600c:3aca:b0:431:5863:4240 with SMTP id 5b1f17b1804b1-434dded69bfmr34076075e9.24.1733508910870; Fri, 06 Dec 2024 10:15:10 -0800 (PST) Received: from localhost.localdomain ([95.127.41.180]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434da1133c3sm62876255e9.31.2024.12.06.10.14.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Dec 2024 10:14:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Jiahui Cen , qemu-devel@nongnu.org Cc: Gerd Hoffmann , Eduardo Habkost , Gustavo Romero , Paolo Bonzini , Marcel Apfelbaum , "Michael S. Tsirkin" , Richard Henderson , Zhao Liu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH 6/6] hw/nvram/fw_cfg: Remove fw_cfg_add_extra_pci_roots() Date: Fri, 6 Dec 2024 19:13:52 +0100 Message-ID: <20241206181352.6836-7-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241206181352.6836-1-philmd@linaro.org> References: <20241206181352.6836-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 Now that all uses of fw_cfg_add_extra_pci_roots() have been converted to the newer pci_bus_add_fw_cfg_extra_pci_roots(), we can remove that bogus method. hw/nvram/fw_cfg must stay generic. Device specific entries have to be implemented using TYPE_FW_CFG_DATA_GENERATOR_INTERFACE. This mostly reverts commit 0abd38885ac0fcdb08653922f339849cad387961 ("fw_cfg: Refactor extra pci roots addition"). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé --- include/hw/nvram/fw_cfg.h | 9 --------- hw/nvram/fw_cfg.c | 23 ----------------------- 2 files changed, 32 deletions(-) diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index fcb06f18cc3..80a1549ad05 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -312,15 +312,6 @@ bool fw_cfg_add_file_from_generator(FWCfgState *s, Object *parent, const char *part, const char *filename, Error **errp); -/** - * fw_cfg_add_extra_pci_roots: - * @bus: main pci root bus to be scanned from - * @s: fw_cfg device being modified - * - * Add a new fw_cfg item... - */ -void fw_cfg_add_extra_pci_roots(PCIBus *bus, FWCfgState *s); - FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase, AddressSpace *dma_as); FWCfgState *fw_cfg_init_mem(hwaddr ctl_addr, hwaddr data_addr); diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index b94cd27bd85..053db7e08cc 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -41,7 +41,6 @@ #include "qemu/cutils.h" #include "qapi/error.h" #include "hw/acpi/aml-build.h" -#include "hw/pci/pci_bus.h" #include "hw/loader.h" #define FW_CFG_FILE_SLOTS_DFLT 0x20 @@ -1057,28 +1056,6 @@ bool fw_cfg_add_file_from_generator(FWCfgState *s, return true; } -void fw_cfg_add_extra_pci_roots(PCIBus *bus, FWCfgState *s) -{ - int extra_hosts = 0; - - if (!bus) { - return; - } - - QLIST_FOREACH(bus, &bus->child, sibling) { - /* look for expander root buses */ - if (pci_bus_is_root(bus)) { - extra_hosts++; - } - } - - if (extra_hosts && s) { - uint64_t *val = g_malloc(sizeof(*val)); - *val = cpu_to_le64(extra_hosts); - fw_cfg_add_file(s, "etc/extra-pci-roots", val, sizeof(*val)); - } -} - static void fw_cfg_machine_reset(void *opaque) { MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());