From patchwork Fri Dec 6 18:13:51 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: 847850 Delivered-To: patch@linaro.org Received: by 2002:a5d:50c2:0:b0:385:e875:8a9e with SMTP id f2csp927363wrt; Fri, 6 Dec 2024 10:15:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXvzOLhYhhlUoUE7icbgpEI+o0Ch/24t2Pem/DxM4LploS1xc7fNvsX7pwRXOPAqsmSy2jRJA==@linaro.org X-Google-Smtp-Source: AGHT+IGFgIzsDgJyRs151hl+Z7iCm3UKar4A4xaWn4qO7OR9hZxAMdjnl6vW7RVRo+VuxIeEuBJp X-Received: by 2002:a05:6214:628:b0:6d8:b292:1e17 with SMTP id 6a1803df08f44-6d8e713a647mr63933666d6.15.1733508933728; Fri, 06 Dec 2024 10:15:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733508933; cv=none; d=google.com; s=arc-20240605; b=JP7A3MVN8l429ZmCC1+ejqMX8Xk5yjXXKM4yZ2vA/r7u9iB1mceYUe0Igh0g9hQo9G ppm4QLbr8gTnz3CYBFZ/Wq+kVrwq0eWgo7uF/vID2e55qFES60TZj7xXGiGKU6XYxsc9 40uA2v9EEq4HfDJx6oz3+ACAptNYRcbu6oOEZb1Fo8L2kVX1BHjkNxclrSiUqnZJQb6c WJ69nChAAEjZ0R5ztzYq3GdTthBrTI6w6xUx6kNxMlY5qVeY/R0DFkuP1gEHlRFgAvAS KnIWHUVaVvut5W8x9Jwf5idbcIU91A+2X5gMH4P00JglbYZG+bJfQiqVqcs8dwWu9m+5 qEIA== 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=SvVPy+gwf8NA8vrmhM2eQ3IGQk6ahNK7Fgaq5e8ko14=; fh=/se7qvbamC+8T0oV1yZ7XZR6lg5FTZjegQ1Lqkt03Zc=; b=Zah49GtgjrV48NiC48YYo1ACIEpDbgJM70pI9MF0b7BmbN76lOABq29h92fcSzngxd qJAx8un63DoWDUKKvBnmFrozwVVK6r6O+39kQpAdyD0TYmHt7NTjo4Utu50dAAO6+AUY +kpAEDPDi7guebi9s1N1jKWP+iHOqMnJzKRBKoIPop8Kcg0ivxI0+2LUKbf/To+NCofY 4luQOCR/t7Al8r1HzX5yKPOSzcu6aVB7uVanEYS7M1lgjXsPEdOKyrG/VviXr21bIMA5 2znOjs/EjkDeu1E0567SEEia12T4X6clc1UO/kYkyPFpxjZMhznls22+YBanx8zuf2lT 2JNQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PYc4rXas; 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 6a1803df08f44-6d8f5ce1c89si4597036d6.333.2024.12.06.10.15.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Dec 2024 10:15:33 -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=PYc4rXas; 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 1tJcqy-0001tU-3U; Fri, 06 Dec 2024 13:15:01 -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 1tJcqn-0001p5-PL for qemu-devel@nongnu.org; Fri, 06 Dec 2024 13:14:51 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tJcqm-0005R1-6A for qemu-devel@nongnu.org; Fri, 06 Dec 2024 13:14:49 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-37ed3bd6114so1046802f8f.2 for ; Fri, 06 Dec 2024 10:14:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733508886; x=1734113686; 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=SvVPy+gwf8NA8vrmhM2eQ3IGQk6ahNK7Fgaq5e8ko14=; b=PYc4rXasb3NI1BFNCi5nsKR4zPfNLk9ooRYSz4Mvbf2LGKwddbzZ//PfntnGC74Iwx bdYpn7AznzmK1Us7jzntkptkh8PvUrSE6PC/xJ6QhXgUNt2EJnrI2yCn0igOq+9y2SYm MzbrfpfUVNvO0EoSPn27u3L5n+8K/15gvMqzGtMXEagRA9lqoOyByZII8SRFhrN0bZu4 txDpHUAnqwkuxno7GPv6pk07qhMDT3s+Ttz+XKzzF9SO+4Sy89VSeBzaEunQPX4bxWKl 2i7CW33sLntD3OrlfW+wZ1fh8nQeBDdKGLkDge4H8hOExQ8nn45koNVbxpL2m+xpnmg0 hM0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733508886; x=1734113686; 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=SvVPy+gwf8NA8vrmhM2eQ3IGQk6ahNK7Fgaq5e8ko14=; b=MgG2xKnDM2bnAfdcSZh+L/QjpYjYwmVnev0OCoQNyhU6S8giksl4ABsoZzm6mUFitv v8VjUFl22Yjw0S9M0M+Cx5nHMkcNb/eRlri6MhYVH6ekeVoFrvXI+Q7iIz3LErTNRfir /GksZVe6W2ZO8tJnu00dNglfAdlvpg3KRwXzqzGxYYvpl2X6Q3r8y6+a2fuYYiF480AG /kA7FLEGGEXc+ZKqzSWWqy2dcYdhR8AJ92UaFCQQPh7/cEAsWEkJKWcOqzc7aYyuHGo+ T4tv+lsMepQJ6woUyttgoDKNwOnkYs7yh75nxzYTOFghp51vLdxIBO6jINzzrjn0HHnp Vi8A== X-Forwarded-Encrypted: i=1; AJvYcCVYTigZv1ctG+p11xknjTj6JBKznz0YOtfl43vwE5wue2JDqNlez+k0g4uZmmuW/TNCfk6MBHamKep5@nongnu.org X-Gm-Message-State: AOJu0Yy9KxdJ72a+t/LfGS/jKqAeknN/rcKGx9Cmw40j4XdrQd5U8ikU 3lL/AmQivXbxhlPznJSL/3f92DGP7gEhEFELk3Gh7rtH+wGUmV6r64qtj1tMAyY= X-Gm-Gg: ASbGnctr/HU+fMSqMX9Z0gVRGPt1X4ZX0Y2Ep5e97mv0rA4X8Q8jVC2tGnQv1ZJd6PK iAirpL0SHXXUxfaP1Do/JGhuDYDY2iRB7UXWOPbEQUdxtJXHkExhFLdnCGzt7YTnOzGpAo5DkBp g0X892uiC/BorzNzy0irE+3gFuupCqTHcQBPLKSIQAigbhTURx2FY9tlwJtUPKzaXK9YuWfdLH2 3kMJSD3tFPk2WtXr4cQTYr7OXAT0qYA8JDITBY3cfSZ2XVSCNEOsHZmzqazvOB+G+Y= X-Received: by 2002:a5d:59a6:0:b0:385:e013:73f6 with SMTP id ffacd0b85a97d-3862b3e8503mr3000827f8f.50.1733508886570; Fri, 06 Dec 2024 10:14:46 -0800 (PST) Received: from localhost.localdomain ([95.127.41.180]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3862e767db6sm1612934f8f.26.2024.12.06.10.14.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Dec 2024 10:14:43 -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 5/6] hw: Use pci_bus_add_fw_cfg_extra_pci_roots() Date: Fri, 6 Dec 2024 19:13:51 +0100 Message-ID: <20241206181352.6836-6-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::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 We want to remove fw_cfg_add_extra_pci_roots() which introduced PCI bus knowledge within the generic hw/nvram/fw_cfg.c file. Replace the calls by the pci_bus_add_fw_cfg_extra_pci_roots() which is a 1:1 equivalent, but using correct API. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/virt.c | 3 ++- hw/hppa/machine.c | 2 +- hw/i386/pc.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 1a381e9a2bd..191e1d65a8f 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1750,7 +1750,8 @@ void virt_machine_done(Notifier *notifier, void *data) exit(1); } - fw_cfg_add_extra_pci_roots(vms->bus, vms->fw_cfg); + pci_bus_add_fw_cfg_extra_pci_roots(vms->fw_cfg, vms->bus, + &error_abort); virt_acpi_setup(vms); virt_build_smbios(vms); diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index a31dc32a9f7..4e673353225 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -240,7 +240,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms, PCIBus *pci_bus, g_memdup2(qemu_version, sizeof(qemu_version)), sizeof(qemu_version)); - fw_cfg_add_extra_pci_roots(pci_bus, fw_cfg); + pci_bus_add_fw_cfg_extra_pci_roots(fw_cfg, pci_bus, &error_abort); return fw_cfg; } diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 317aaca25a0..3a656f398fd 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -628,7 +628,8 @@ void pc_machine_done(Notifier *notifier, void *data) /* set the number of CPUs */ x86_rtc_set_cpus_count(x86ms->rtc, x86ms->boot_cpus); - fw_cfg_add_extra_pci_roots(pcms->pcibus, x86ms->fw_cfg); + pci_bus_add_fw_cfg_extra_pci_roots(x86ms->fw_cfg, pcms->pcibus, + &error_abort); acpi_setup(); if (x86ms->fw_cfg) {