From patchwork Tue Nov 26 11:22:00 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: 13885801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2EE09D3B985 for ; Tue, 26 Nov 2024 11:24:17 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFteF-0003iE-09; Tue, 26 Nov 2024 06:22:27 -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 1tFteD-0003hN-FQ for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:22:25 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFteB-0002Xa-4I for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:22:25 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-434a766b475so3618105e9.1 for ; Tue, 26 Nov 2024 03:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620141; x=1733224941; 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=+qPY7Uz0dqRmk2gQ1cO3DBCcFXLLvxMC18yQC1ilSgA=; b=G31NQHlvGZkGawebft97sYhAhilqUvGvkbd1zMeMwhwlN14M5eRWiTdyyCvvbnxC4R RP34PkS1VK4rlcCJ/lPYuUJR1oGU2dbuBxD8DbTBC/kIlCS8YWBugmj496sPikjghPQZ w8jdIfgZIUwIT9xpBaE+LWrmstHQDEk573vvWcVNlOqpgEd+oKx31Ge3/EUqrg1BZ4R1 oQmGr1FdTou24m7GXGJtJ2gnhCVZIOQ8MyvVsLEZW6eSXAsfHn5FY6LXLW0iTGF3hnoU WKGAmMMyFBQ61vrXbrC+fAX43htEOU62rrRhwji0xmbnQ83nZb9KIhRF+XXZhBwMMnqp KJSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620141; x=1733224941; 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=+qPY7Uz0dqRmk2gQ1cO3DBCcFXLLvxMC18yQC1ilSgA=; b=iszGEgqbX2TzRmlr7cPUQLRrupx5UWgqj/tlUtb+SPzhImqpV9sVs8ENb5HOYfU4uv mbW+xEb/RQl67dPsLjRIRXPf5YUS3oLm8EEip3EbCnmv07AO0mpYK3E55sUfGsnPZkpp MnvgX4S0weMp3vHkbee/8HGTeAu7dMR2oj8B15qpsqYcG86K205BJsCwsFg6dSh3KOyC D8YU0S0H5bsYogHTMkcNZo0VzDbvrCGcADIWi6Aok9PvfzQF1d6VFdKnHgwAHP5zOUJh SZfm9990l1Fcfcx0+ZPdHn8TYUwKY7v3ozSHtbyJncAcBcxY2lIaB6OlpXA6Fo107W9K OiUA== X-Gm-Message-State: AOJu0YwnEDTWFAS8lH9EWv52mLvuaFGNpAj7QnkUXcZAjctjHD5yr/cR pFHnH0F4jE90xid6Ek4r8+ro2qsHA6n4ZsDlYt1/l7COsU5/WNPLDPHC3gIG7rABTEOXiHeIOmJ r X-Gm-Gg: ASbGnctCZvtAFudLkNbDFIWBme3ADC479JrVdLOxNygWLR3n4gsAXVL5r5O9iIN+H6o +dETAp5dQvZn/PSQs1qHOVkVJqHBoV8s7cVt6X0eogGvUiqulfyh/FL5I00P3xigy9yf0g09v+P pbMahqxOssyiafA0hCm2diay/2PQ31awWLahMFjZhgP3EZcU0eP+0k+YyqDlSyQNh5rWKrzoq47 TO9La7CNM+4hxGSfysVWQxUAoWz9St7YQWlapHuzRD/tSuvQHozBeYbTKTxuNVWIJhb6jan X-Google-Smtp-Source: AGHT+IEANCMTxsUE27Mx8fMzBEsH7EvxcIuDdUdjx5zx0IltCtoW4ouBVBLwarjkXR0wzLH5bYDn2w== X-Received: by 2002:a05:600c:a12:b0:434:a19a:5965 with SMTP id 5b1f17b1804b1-434a19a5bf9mr43582535e9.6.1732620141039; Tue, 26 Nov 2024 03:22:21 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434a50613c5sm25019945e9.0.2024.11.26.03.22.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:22:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 01/13] hw/pci: Do not declare PCIBus::flags mask as enum Date: Tue, 26 Nov 2024 12:22:00 +0100 Message-ID: <20241126112212.64524-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org We use PCIBus::flags to mask various flags. It is not an enum, and doing so confuses static analyzers. Rename the enum as singular. Use a generic unsigned type for the mask. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci_bus.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/pci/pci_bus.h b/include/hw/pci/pci_bus.h index 22613125462..6ecfe2e06d5 100644 --- a/include/hw/pci/pci_bus.h +++ b/include/hw/pci/pci_bus.h @@ -19,7 +19,7 @@ struct PCIBusClass { uint16_t (*numa_node)(PCIBus *bus); }; -enum PCIBusFlags { +enum PCIBusFlag { /* This bus is the root of a PCI domain */ PCI_BUS_IS_ROOT = 0x0001, /* PCIe extended configuration space is accessible on this bus */ @@ -32,7 +32,7 @@ enum PCIBusFlags { struct PCIBus { BusState qbus; - enum PCIBusFlags flags; + unsigned flags; const PCIIOMMUOps *iommu_ops; void *iommu_opaque; uint8_t devfn_min; From patchwork Tue Nov 26 11:22:01 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: 13885802 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 60B37D3B985 for ; Tue, 26 Nov 2024 11:24:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFteM-0003mH-1c; Tue, 26 Nov 2024 06:22:34 -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 1tFteJ-0003kP-Nm for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:22:31 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFteG-0002bs-Tq for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:22:31 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-434a8640763so1939345e9.1 for ; Tue, 26 Nov 2024 03:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620147; x=1733224947; 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=XytEl+ZiAvdgFcp20ox+30b5Cy75Cc7byEhOtvETzBY=; b=ab6xEX7/KSPKZkv7SByMMrs0kYhVjUQBBrRexX3FJdSh4nnpyuts4vH/QREzROZ6YY GX6pRdpJxZJFN5g3A/xKSAaFXtvkp7eo1B1g2iZuYZr80xU8kM0MMSQoNfYimvYrS7vD 5OzLv7yzecdjhWr11LqQsA6VlMJ1GPyILVu/gircI7+lUUoROLvRRGf5ZOlJEV8HTC7k 3NiUupdMlVS37Y9+FEiYuKCciVKITRwF1kbgZjtc+1nOAayjGShQlGuyzX7XtAY9D0uX lY5Kjgo7B0bNL5PlFDxf9Z8DlwQqH21i51lpwMsbwB9RauvG++djPSre1dsfyJSugINY 6lWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620147; x=1733224947; 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=XytEl+ZiAvdgFcp20ox+30b5Cy75Cc7byEhOtvETzBY=; b=Co3o+MR7XU5F91Uk27rfOti51cyVknuBFdCGIFeu7+ITng3SCsF1VaotTVrMzjMR4+ ofch+bZN5+NCHqYbMpZ0Uq0zbQZbMCLs7Nb0rOKM89cTP8K6xquAdqm0cHVH0vdiwnKB z14VygmOCMZ7lj2zo6SEN/LhRci7hm19k6EQh6bxN80hnbXWOru635JcfURH5o12hVo4 TrQsUCgm20syke67eQV1v009sBZ+XHU1EYLjn/Icpp1Pp0y6pTMgivN11YiAnOUipqA9 35RAOY7r4fJ3Q6ffDUuTvBLCeK0T4b7N9kJp/DcAFAo9I4lZPbx9Xe3AFx/C5FsRVuFe ikDg== X-Gm-Message-State: AOJu0Yw3Gf2kOAZzUqG0oXZywytcfOsgroQwkykACzmsxShXCioxSrkq TjYdGoioRiLBqN4k/xNHKy4Em8Zt6ZF4oA3T1wfLsNgz9RhuZzqArWKi+XkbzwemLuZry+a4J06 m X-Gm-Gg: ASbGncupjYSrogwqSsB9qYCPvsWUXFw6imyJmT3ArnkCCytAS3lc93nd8ubnK701Fbd lnzH2AzlwLE1Ill+Bc3IXWpMqUdofQ16yl+5zxxaQeFMkvy52GnyX1RY0OW9Q5n18asYAHv1JnX odt0Tv9vQPAvNpeSaKI3M8UU9SOMLdHi5Ktm2UtUraqxNdDEXPkE3jmTlgi24wRHyDMIjDZuZOM SrXNxhtRV/1F+YnsAyQJZEqG02o32JMfoDWDDgLB2MeU2wlCxrosX+JQ7DIXB+yFKrxhBQS X-Google-Smtp-Source: AGHT+IGvdJyMsroF/T4j2TdVAhYjrbc5PWwEABLMtA2phckCyIulZKolLG8ElIFyRkC+RNzR7RccbQ== X-Received: by 2002:a05:600c:3b91:b0:434:a29d:6c71 with SMTP id 5b1f17b1804b1-434a29d6d6bmr39357155e9.27.1732620147073; Tue, 26 Nov 2024 03:22:27 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3825fb25d74sm13208001f8f.47.2024.11.26.03.22.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:22:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 02/13] hw/pci-bridge: Initialize bridge with parent bus flags Date: Tue, 26 Nov 2024 12:22:01 +0100 Message-ID: <20241126112212.64524-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Bridged buses inherit their parent flag, except they can not be a root. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-bridge/pci_expander_bridge.c | 8 ++++++-- hw/pci/pci_bridge.c | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c index 07d411cff52..bbf615f544b 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -336,6 +336,7 @@ static bool pxb_dev_realize_common(PCIDevice *dev, enum BusType type, PXBDev *pxb = PXB_DEV(dev); DeviceState *ds, *bds = NULL; PCIBus *bus; + PCIBus *parent_bus = pci_get_bus(dev); const char *dev_name = NULL; Error *local_err = NULL; MachineState *ms = MACHINE(qdev_get_machine()); @@ -358,12 +359,15 @@ static bool pxb_dev_realize_common(PCIDevice *dev, enum BusType type, ds = qdev_new(type == CXL ? TYPE_PXB_CXL_HOST : TYPE_PXB_HOST); if (type == PCIE) { bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_PCIE_BUS); + bus->flags = parent_bus->flags & ~PCI_BUS_IS_ROOT; } else if (type == CXL) { bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_CXL_BUS); + bus->flags = parent_bus->flags & ~PCI_BUS_IS_ROOT; bus->flags |= PCI_BUS_CXL; PXB_CXL_DEV(dev)->cxl_host_bridge = PXB_CXL_HOST(ds); } else { bus = pci_root_bus_new(ds, "pxb-internal", NULL, NULL, 0, TYPE_PXB_BUS); + bus->flags = parent_bus->flags & ~PCI_BUS_IS_ROOT; bds = qdev_new("pci-bridge"); bds->id = g_strdup(dev_name); qdev_prop_set_uint8(bds, PCI_BRIDGE_DEV_PROP_CHASSIS_NR, pxb->bus_nr); @@ -371,8 +375,8 @@ static bool pxb_dev_realize_common(PCIDevice *dev, enum BusType type, } bus->parent_dev = dev; - bus->address_space_mem = pci_get_bus(dev)->address_space_mem; - bus->address_space_io = pci_get_bus(dev)->address_space_io; + bus->address_space_mem = parent_bus->address_space_mem; + bus->address_space_io = parent_bus->address_space_io; bus->map_irq = pxb_map_irq_fn; PCI_HOST_BRIDGE(ds)->bus = bus; diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c index 2c7bb1a5254..d47ded9e0cf 100644 --- a/hw/pci/pci_bridge.c +++ b/hw/pci/pci_bridge.c @@ -376,6 +376,7 @@ void pci_bridge_initfn(PCIDevice *dev, const char *typename) qbus_init(sec_bus, sizeof(br->sec_bus), typename, DEVICE(dev), br->bus_name); + sec_bus->flags = parent->flags & ~PCI_BUS_IS_ROOT; sec_bus->parent_dev = dev; sec_bus->map_irq = br->map_irq ? br->map_irq : pci_swizzle_map_irq_fn; sec_bus->address_space_mem = &br->address_space_mem; From patchwork Tue Nov 26 11:22:02 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: 13885800 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47771D3B985 for ; Tue, 26 Nov 2024 11:24:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFteX-0003ok-W1; Tue, 26 Nov 2024 06:22:46 -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 1tFteS-0003mu-L0 for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:22:43 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFteM-0002dm-Tg for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:22:37 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-434a8b94fb5so1170305e9.0 for ; Tue, 26 Nov 2024 03:22:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620152; x=1733224952; 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=ym7MlPUFYz2GU5YCplhDtE7b6ovE3xgVe6aZRCcPdv4=; b=O269jXpeoMK9d1++iTv+YTvOFcSfjM9awFg3fi93MDx5LY5PIBYYL2fxJTNi/PeMWK x2kewtuNbVV/z1r6AvUz2mE8nnoIq27syZTxNoddQktPcmloj1pmUQjuFdR78DlCsOyN qjD3N0wCN4BXh/mWKHZYo19e3OsqHUC35LlXpXIteTjvVTBo06DaQHd1M2V3k3GJMbZo JsEeAtCeKrVL1ZmCAsz8mgrJqS+aHGbAgIzsytwNqskzatFWdf9oX6KUy5eSLVAYza0y S1xyhxT51OyYJTmSyUpSn/9iUDwkN5CYQT8mWDUn+4Rgf/edkkQqEIzdgoH4nq77KKN7 FFqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620152; x=1733224952; 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=ym7MlPUFYz2GU5YCplhDtE7b6ovE3xgVe6aZRCcPdv4=; b=rKGiiqfEM2WqwRnq5WjlBvtohAPAWM8dUgR2lEtG3WITwOSow7w0Bj6yDYSKA+lbI+ xP4EjUDEFnY1eZZY2tNrYMCsCKl0u87MQQBoKfSEI1E8JOQAzwJxBQKE4ZeDYG1w+1Cl j0r+pF+q/zn4PpY2tfnUSqznDjqHPk2n38GD+lNuKl7efSYzgUP//z/ZeMmXpXHlOKvj c0rejp9FM1zt/3ib8BCd9gYXJaDXfLDXknwiKpTDYSWymX9LqsbFR72bsdG/igUDeTxf GBYfOo3qWryr1BWSQa8Y/msn4DmpQeYTQu/Sh8uG6CAWCq5vjWkWx2H1zZwngwU2b4a+ 8J/w== X-Gm-Message-State: AOJu0YzwLYZoh5n3X2KrlX5g8DVd7TkE58j9l9fAZLQmS7qiZ7lDUfvV njpQzeq3djOwFV2nokLUfqPwx0SlhFbKsiYuphTSLajoChy8Bon/ivE5Z6KJh6W5Lbn2A/r/PRf s X-Gm-Gg: ASbGncvi2ZczQ4XJIWT6jjGCEmoaezyEXiUeOQvedoON+6SjPvwsooTdcLW1X97/R8h zZ/Bl4LVQOMEW+GSrjiRHLfOLFaZl4M/tR0NKbd9F4eT14nldejEwyJIIts/W1tZx6cnKk9c5RO 3oqLqha1OTTv4K6ATRPrl6LgntkYmvt1vDQR4SyVNRv+h0x4A/dw71MsgS06kWCVDe1daNp7CUR xrYvBjM0wetYvjZhw0v6pb2YecuHAXhJLj8jAwZqtLcyUjA6o690L5CBeRWiqgfc/mgyNAt X-Google-Smtp-Source: AGHT+IFBBmx/zRqWz+0+3nZ5bzn94HIXIH1xaptS/bJKBgN/Ji0e/N+lfNjKX8nxRbW8D6cFnG6cKw== X-Received: by 2002:a7b:c85a:0:b0:431:15f1:421d with SMTP id 5b1f17b1804b1-434a4eb786dmr23408865e9.16.1732620152605; Tue, 26 Nov 2024 03:22:32 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3825fb3134bsm12970699f8f.58.2024.11.26.03.22.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:22:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 03/13] hw/pci: Factor machine_refuses_bar_at_addr_0() helper out Date: Tue, 26 Nov 2024 12:22:02 +0100 Message-ID: <20241126112212.64524-4-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Since we are going to re-use access to the MachineClass::pci_allow_0_address field, factor the current code as a new machine_refuses_bar_at_addr_0() helper. In pci_bar_address() invert 'allow_0_address' logic as 'bar_at_addr_0_refused'. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci/pci.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 1416ae202c3..e05f8a828bb 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -520,6 +520,13 @@ bool pci_bus_bypass_iommu(PCIBus *bus) return host_bridge->bypass_iommu; } +static bool machine_refuses_bar_at_addr_0(void) +{ + MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); + + return !mc->pci_allow_0_address; +} + static void pci_root_bus_internal_init(PCIBus *bus, DeviceState *parent, MemoryRegion *mem, MemoryRegion *io, uint8_t devfn_min) @@ -1472,8 +1479,7 @@ pcibus_t pci_bar_address(PCIDevice *d, { pcibus_t new_addr, last_addr; uint16_t cmd = pci_get_word(d->config + PCI_COMMAND); - MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); - bool allow_0_address = mc->pci_allow_0_address; + bool bar_at_addr_0_refused = machine_refuses_bar_at_addr_0(); if (type & PCI_BASE_ADDRESS_SPACE_IO) { if (!(cmd & PCI_COMMAND_IO)) { @@ -1485,7 +1491,7 @@ pcibus_t pci_bar_address(PCIDevice *d, * TODO: make priorities correct and remove this work around. */ if (last_addr <= new_addr || last_addr >= UINT32_MAX || - (!allow_0_address && new_addr == 0)) { + (bar_at_addr_0_refused && new_addr == 0)) { return PCI_BAR_UNMAPPED; } return new_addr; @@ -1506,7 +1512,7 @@ pcibus_t pci_bar_address(PCIDevice *d, mappings, we handle specific values as invalid mappings. */ if (last_addr <= new_addr || last_addr == PCI_BAR_UNMAPPED || - (!allow_0_address && new_addr == 0)) { + (bar_at_addr_0_refused && new_addr == 0)) { return PCI_BAR_UNMAPPED; } From patchwork Tue Nov 26 11:22:03 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: 13885803 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D906AD3B985 for ; Tue, 26 Nov 2024 11:25:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFtfC-00041A-RN; Tue, 26 Nov 2024 06:23:28 -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 1tFted-0003uH-QH for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:22:53 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFteZ-0002gg-VJ for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:22:50 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3824038142aso3555201f8f.2 for ; Tue, 26 Nov 2024 03:22:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620166; x=1733224966; 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=V/FHFrkLjfSL+r0KQnjlYWTgmdb9j50qofDa5n4Bijs=; b=P4SX3nJ8Vp6RJZ+ihkQdj6vdIKHHI1dbmNsq42BoCGN9fw9FCVwFCPhZqMvctY7AIq 6jQiCN7JUjJAPJoShU9MBou4+IFRiGMgUnl/Ke7MZ7ZRqnzKjyZk0jdDshtjg8Xt9UCH cCpmhpg8MEtYKMPWGAoRHbwS84HO7gE8gGN2/uURE/Bfmwrmh/mgcmFZ7nY2kbvSSx/F y9QO2aXxDbmL2aKtfl+tH65IqlblSR/tt3o8v/xtnEzZSWBa5s+M85Uhtlrk0ITCpqNF e9YifWPO+xtwtikySDHSgzXmlsaf4LtLJihCbir4hM3xVwDnEKb6rOA5Wy1jtx+PMtEm C+bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620166; x=1733224966; 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=V/FHFrkLjfSL+r0KQnjlYWTgmdb9j50qofDa5n4Bijs=; b=fNL2qH7DmNr3o05LO+8ACrThQUX2HgBQTlHdLKhuKy3FxeqejUxS1IznDPteO0wgpe Gi4G4SNK3flTIJMptqIM780Ozv1ocDaspjzZCac7fi21dq3kj1CvcOMYrJvDvPycAGPj vJupvaQyfrRai3MpGUycDsV3wlEKiqvvrJb85MePqg2NVn7zJE7VxVeX0HRDhmBZC7S5 BjnMHDXYpD12njHGUDIQN6EjFHdU5snzRy4Dz7eJr4Qk9gHQZ1fV+YpslLTJXgWxaEhk iuOTgoW/3mWgg1UAxtAKWXnM7a8PHKwq2wXnHaxUYhYv8T8KhJRIObaQ3K/qzTXAEhwL 7Uqg== X-Gm-Message-State: AOJu0Yz9N1tHGUcpOeGeA05b0OO3j9tXquX6PBgvfA6GdACwqNOlnTSg U/tsvMBzxJH+C8clTD9eRErD0l1Mm4yZQpRBMId6dniquA5VD5XAAMRYqwVEcZIE8wBqNg9urwj R X-Gm-Gg: ASbGncv4TvM0eVIYYbtfcvqMEpBccAPqdXQI/77xw+NrjEQOj9gGYGc8z7ppB32elas 0C/OVTNDO/S0jQEXhZSn1QAw0U6WAwtl5+94Lr3hnjvKodJC60O6ALema2GLeYms8eexvvuEpvc q1J6GFZ/AOyBBKUmyTPR+z3V26uyng748wu7Xscj6cSuvazq22TMK+BjS8iNa6yPV6zlNWhvouq QAZTD6oCt2S7TlDTcXCh0930xd6NUofjUNVLmg/wF04vwJ+JMWUQYEWLfXiZmmkq9a5elbV X-Google-Smtp-Source: AGHT+IFQD3d6AiS/0pziBy+6unSAZm4P726MrSNX2osV0nsY0tXODVnNZJr/byHSaMZMlw5SB6lpbw== X-Received: by 2002:a5d:6d01:0:b0:382:4c36:e072 with SMTP id ffacd0b85a97d-38260b969b2mr13375617f8f.30.1732620165804; Tue, 26 Nov 2024 03:22:45 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3825fb264cdsm13228780f8f.49.2024.11.26.03.22.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:22:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 04/13] hw/pci: Introduce PCIBusFlag::PCI_BUS_BAR_AT_ADDR0_REFUSED Date: Tue, 26 Nov 2024 12:22:03 +0100 Message-ID: <20241126112212.64524-5-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Some machines need PCI buses to allow access at BAR0. Introduce the PCI_BUS_BAR_AT_ADDR0_REFUSED flag and the pci_bus_refuse_bar_at_addr_0() helper. Set the flag in pci_root_bus_internal_init() where all root buses are created. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci_bus.h | 6 ++++++ hw/pci/pci.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/hw/pci/pci_bus.h b/include/hw/pci/pci_bus.h index 6ecfe2e06d5..6d7bf682e8f 100644 --- a/include/hw/pci/pci_bus.h +++ b/include/hw/pci/pci_bus.h @@ -26,6 +26,7 @@ enum PCIBusFlag { PCI_BUS_EXTENDED_CONFIG_SPACE = 0x0002, /* This is a CXL Type BUS */ PCI_BUS_CXL = 0x0004, + PCI_BUS_BAR_AT_ADDR0_REFUSED = 0x0008, }; #define PCI_NO_PASID UINT32_MAX @@ -72,4 +73,9 @@ static inline bool pci_bus_allows_extended_config_space(PCIBus *bus) return !!(bus->flags & PCI_BUS_EXTENDED_CONFIG_SPACE); } +static inline bool pci_bus_refuse_bar_at_addr_0(PCIBus *bus) +{ + return !!(bus->flags & PCI_BUS_BAR_AT_ADDR0_REFUSED); +} + #endif /* QEMU_PCI_BUS_H */ diff --git a/hw/pci/pci.c b/hw/pci/pci.c index e05f8a828bb..27b66583e54 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -537,6 +537,9 @@ static void pci_root_bus_internal_init(PCIBus *bus, DeviceState *parent, bus->address_space_mem = mem; bus->address_space_io = io; bus->flags |= PCI_BUS_IS_ROOT; + if (machine_refuses_bar_at_addr_0()) { + bus->flags |= PCI_BUS_BAR_AT_ADDR0_REFUSED; + } /* host bridge */ QLIST_INIT(&bus->child); @@ -1479,7 +1482,7 @@ pcibus_t pci_bar_address(PCIDevice *d, { pcibus_t new_addr, last_addr; uint16_t cmd = pci_get_word(d->config + PCI_COMMAND); - bool bar_at_addr_0_refused = machine_refuses_bar_at_addr_0(); + bool bar_at_addr_0_refused = pci_bus_refuse_bar_at_addr_0(pci_get_bus(d)); if (type & PCI_BASE_ADDRESS_SPACE_IO) { if (!(cmd & PCI_COMMAND_IO)) { From patchwork Tue Nov 26 11:22:04 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: 13885809 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3A72CD3B986 for ; Tue, 26 Nov 2024 11:26:53 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFtfP-00046v-To; Tue, 26 Nov 2024 06:23:44 -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 1tFten-0003wR-Ny for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:06 -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 1tFtek-0002ka-Dm for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:01 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4349cc45219so22497515e9.3 for ; Tue, 26 Nov 2024 03:22:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620173; x=1733224973; 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=531OAHe2E6s/gjTEfxFCkh/CSUMa49twfx2TRTu9rug=; b=fu1eq2LPLYZFT1JFRqcrq/dgHJLG4aatbxi8h011QprBw2hhsCeLOZuP4mY49Yj2vo G5dN0v9kl10AbhDFyveVoQaWbtJ6HDuP6d5FhR5lZAVvEQS9IdjWN8wty6q9vfBAn0HY 5WV/y6/Ez293S4CuXmjrGcKPRxn2wFmoPkkqtZmVCo7wuNup6EbaWK1FsaQ9wzf2J+WJ hm7/zlIcB3IMCWpNuF5DTTahZ0R2NVdnZU/e0t0IZGDFuXYiTImu3W9y7Cj3sySbVOIo XQ5qP5+mvy+djvuLimbVju0cY9CSiwzbqoQq85ljoICpo5tlzAa6M4WafrrytTuqfe6i c4cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620173; x=1733224973; 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=531OAHe2E6s/gjTEfxFCkh/CSUMa49twfx2TRTu9rug=; b=Z4HAqTi0Ugd016pjq49vk2Ac5kDoVI7hvokqAiyRS2lj+xQbd5+NokG1FGYhZxYF/9 OvVoih4NbS1w06NWuewUfimOr5MPItyKFapO/OBegeuqI5hc9sfVxQQBEjPH49jBYcbM 4ct1CnpwwZ7DTm7kM9dHFmTu8sMJmi0LIWkvaggAKr+GkIpbMIjvCcni3ZlV1Z8atcPU 8LxvwuJcHw9zwkSSFBfVOQK1PeAF19wo38mBYAC9WJaj2FexupShQB04gumwAGhKB1iT Xh4Q8R6WKPkvTTuz8XJ/GGz82yywrrQND4WXS+m/qRh8XIc3tVDiWxy3Do4wNZG8M4x5 isew== X-Gm-Message-State: AOJu0YxjAuBeXg+CRTHTiwKiq5H+QQn432yBgOXl6kfnQRMk0oNYbBWs WYKNcmXGsoQBO51E6egNJbVpE5MGMTE+JWH2frHAO/cyodaP2OvhnJkAzWD3NgwrQNT5Wo9uBUl g X-Gm-Gg: ASbGncsTF2c0do+eVhsGbKDO6LCfjbUufsTLmfiDGyIgCszALqW4hPdSAzU7N0ZCEod 4vq+VlzCF65zK+LmyQHYo+2tvy2v2wA46gcTDS2BusG6IiaN+MpyuEO4xhaKtbFZ0V5qqDH6f/B XaIERx9M1/Nmv0mroGrhr+17y0HNTUK4ps0vs7o2+MFqLNNSPyYlmw5stlkLh+XFkyKKZJe87Ep dQX1koD0Cxafo+UBVgJVII49aWKummrer681kJ+ofSu6pPA3rG0+sqYIGTNKKTqZ9Xs331/ X-Google-Smtp-Source: AGHT+IGlSefU/AUIv0V6tDlbe3TEFlshHBlt/NlBgyTesEOFvwph3W7BFNJsTCxNbGO+wmRFjIAk5Q== X-Received: by 2002:a05:600c:154d:b0:434:a815:2b57 with SMTP id 5b1f17b1804b1-434a8152d9dmr7809555e9.20.1732620173600; Tue, 26 Nov 2024 03:22:53 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434a4faf750sm25527775e9.10.2024.11.26.03.22.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:22:53 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 05/13] hw/pci: Propagate bar_at_addr_0_refused to pci_root_bus_internal_init() Date: Tue, 26 Nov 2024 12:22:04 +0100 Message-ID: <20241126112212.64524-6-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Have pci_root_bus_internal_init() callers set the 'bar_at_addr_0_refused' argument. No logical change. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci/pci.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 27b66583e54..8eacb8f82fc 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -529,7 +529,8 @@ static bool machine_refuses_bar_at_addr_0(void) static void pci_root_bus_internal_init(PCIBus *bus, DeviceState *parent, MemoryRegion *mem, MemoryRegion *io, - uint8_t devfn_min) + uint8_t devfn_min, + bool bar_at_addr_0_refused) { assert(PCI_FUNC(devfn_min) == 0); bus->devfn_min = devfn_min; @@ -537,7 +538,7 @@ static void pci_root_bus_internal_init(PCIBus *bus, DeviceState *parent, bus->address_space_mem = mem; bus->address_space_io = io; bus->flags |= PCI_BUS_IS_ROOT; - if (machine_refuses_bar_at_addr_0()) { + if (bar_at_addr_0_refused && machine_refuses_bar_at_addr_0()) { bus->flags |= PCI_BUS_BAR_AT_ADDR0_REFUSED; } @@ -563,7 +564,8 @@ void pci_root_bus_init(PCIBus *bus, size_t bus_size, DeviceState *parent, uint8_t devfn_min, const char *typename) { qbus_init(bus, bus_size, typename, parent, name); - pci_root_bus_internal_init(bus, parent, mem, io, devfn_min); + pci_root_bus_internal_init(bus, parent, mem, io, devfn_min, + true); } PCIBus *pci_root_bus_new(DeviceState *parent, const char *name, @@ -573,7 +575,8 @@ PCIBus *pci_root_bus_new(DeviceState *parent, const char *name, PCIBus *bus; bus = PCI_BUS(qbus_new(typename, parent, name)); - pci_root_bus_internal_init(bus, parent, mem, io, devfn_min); + pci_root_bus_internal_init(bus, parent, mem, io, devfn_min, + true); return bus; } From patchwork Tue Nov 26 11:22:05 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: 13885804 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 697D7D3B984 for ; Tue, 26 Nov 2024 11:25:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFtgO-0005oF-RO; Tue, 26 Nov 2024 06:24:41 -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 1tFtet-0003wy-PI for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:10 -0500 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFtep-0002mF-8F for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:06 -0500 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-53ddb99e9dcso3054169e87.3 for ; Tue, 26 Nov 2024 03:23:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620179; x=1733224979; 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=CLOtH90q6HrNlk2tttqrB7+LmSS1Ew20sdzHgtSgHVA=; b=M9RaepEJcW14Cci3sSEcQuJTTSAuP074Jx9guCrLdZtSqXILgilhsZIEt5EsuWXTED jJ7NAEkY2GxO9p5uJJUOPHKy6CJfwaODRW0i3/jwe5qc3xMt0i7TdsbsUgMFAA9n5PTS RHVP6yL9vetgwN9U2vYmh0HId+BcFXO5xyyzNGE8CRDLj6jyvlvrDOxl/ACsK9RgRPQj Bh6ZO7NwCzxUnve8RbWcf7228hhihsEL0g1Rq5Ufoy9mgUppf2nqpisGDYyWxJOV9r0q Q4IWdP20sHXqULqSjJHibCVB8hHJa82YumXG78VomJy3MUpHE1i2Z5UP5KI5MB/BzVjN /jHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620179; x=1733224979; 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=CLOtH90q6HrNlk2tttqrB7+LmSS1Ew20sdzHgtSgHVA=; b=xSgYmF/8XX5nSLI6pQF0rQyyT+ePDygOb8GzOkRBI/GY1Oj6192z7YeyrImRbQOXf2 Oy7CnA0bCsECDncSBaeiANMHL/XWRUVEGODwhhHxKCPBb8mWOn64qcyuc47E+KlEZ7r6 EYFcjHI4i4ZyIWEMrYfrWGBXphpo9/l4g4FOUr60lRYPhnl71Jg/lhvfsAoeQwvYFUSw qYh6czGtIwY2qJRV9EcLhAPlUqXaPG1JRX07/XK29aYy/VH/32uhGyPuBmSc9T/M+N+Y hmU5biXdJ0pcxyoyO+giSxAFTXYZsJOTIDAJWS4Dy9ZvD4+iWupqBHZ8dXCSvefx9ulg yztg== X-Gm-Message-State: AOJu0Yz0eLANEfLkPVDhXvuK5b5ugM2CZ+cTTqhHE3866HzNRHheApGG DQORBki+f5qqWnT1aHZKoU3jSQUFlV6UAaJ4GA09eTQsS7tpGIlc4zP/75ZNwV204is7HJXZcbX j X-Gm-Gg: ASbGncvhRONn9sQNx35buf7FU30EwXzvvfK8IiMxLzAWJaPri/jyYGBW1kdG0vRydF1 /an4Vt3UXP43wrEU7gI4v7NSvYABZyMN/UsbksqF4t2wmqZAi9WQ0mxHykvgKnstXpn9Q6X4J+O IsIi+6dZkbLjjEJIM8ZeL/ugyw8yynTbedK2Muq08dYjJUi3EwIMZ6pdRtwKXLo45A7iqQNlfIx 49q+6kPT+sA7XdBvOszQzP8u5+mzN3lKKEWwNU6cMwNhpRIwuQKQDiv1ZXmtVBPsACuyR41 X-Google-Smtp-Source: AGHT+IGsj5VzaHU8SAaWvn5jQSkwZvf//JK1pbBPc7Ax707C0OpTerSeHt4R927s6MsqNJ3PMJA0fw== X-Received: by 2002:a05:6512:2388:b0:53d:e8f5:f9d4 with SMTP id 2adb3069b0e04-53de8f5fa18mr1392986e87.36.1732620179597; Tue, 26 Nov 2024 03:22:59 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4349e117bf5sm81335245e9.18.2024.11.26.03.22.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:22:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 06/13] hw/pci: Propagate bar_at_addr_0_refused to pci_root_bus_init() Date: Tue, 26 Nov 2024 12:22:05 +0100 Message-ID: <20241126112212.64524-7-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=philmd@linaro.org; helo=mail-lf1-x131.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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Have pci_root_bus_init() callers set the 'bar_at_addr_0_refused' argument. No logical change. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 3 ++- hw/pci-host/raven.c | 2 +- hw/pci-host/versatile.c | 2 +- hw/pci/pci.c | 5 +++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 135695c5511..b499846083f 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -284,7 +284,8 @@ bool pci_bus_is_express(const PCIBus *bus); void pci_root_bus_init(PCIBus *bus, size_t bus_size, DeviceState *parent, const char *name, MemoryRegion *mem, MemoryRegion *io, - uint8_t devfn_min, const char *typename); + uint8_t devfn_min, const char *typename, + bool bar_at_addr_0_refused); PCIBus *pci_root_bus_new(DeviceState *parent, const char *name, MemoryRegion *mem, MemoryRegion *io, uint8_t devfn_min, const char *typename); diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index a7dfddd69ea..d5087af5ec6 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -313,7 +313,7 @@ static void raven_pcihost_initfn(Object *obj) &s->pci_io_non_contiguous, 1); memory_region_add_subregion(address_space_mem, 0xc0000000, &s->pci_memory); pci_root_bus_init(&s->pci_bus, sizeof(s->pci_bus), DEVICE(obj), NULL, - &s->pci_memory, &s->pci_io, 0, TYPE_PCI_BUS); + &s->pci_memory, &s->pci_io, 0, TYPE_PCI_BUS, true); /* Bus master address space */ memory_region_init(&s->bm, obj, "bm-raven", 4 * GiB); diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c index d257acee172..f82262f8d1e 100644 --- a/hw/pci-host/versatile.c +++ b/hw/pci-host/versatile.c @@ -407,7 +407,7 @@ static void pci_vpb_realize(DeviceState *dev, Error **errp) pci_root_bus_init(&s->pci_bus, sizeof(s->pci_bus), dev, "pci", &s->pci_mem_space, &s->pci_io_space, - PCI_DEVFN(11, 0), TYPE_PCI_BUS); + PCI_DEVFN(11, 0), TYPE_PCI_BUS, true); h->bus = &s->pci_bus; object_initialize(&s->pci_dev, sizeof(s->pci_dev), TYPE_VERSATILE_PCI_HOST); diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 8eacb8f82fc..f7158fb9573 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -561,11 +561,12 @@ bool pci_bus_is_express(const PCIBus *bus) void pci_root_bus_init(PCIBus *bus, size_t bus_size, DeviceState *parent, const char *name, MemoryRegion *mem, MemoryRegion *io, - uint8_t devfn_min, const char *typename) + uint8_t devfn_min, const char *typename, + bool bar_at_addr_0_refused) { qbus_init(bus, bus_size, typename, parent, name); pci_root_bus_internal_init(bus, parent, mem, io, devfn_min, - true); + bar_at_addr_0_refused); } PCIBus *pci_root_bus_new(DeviceState *parent, const char *name, From patchwork Tue Nov 26 11:22:06 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: 13885806 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A745D3B985 for ; Tue, 26 Nov 2024 11:26:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFtgT-0006Mk-EV; Tue, 26 Nov 2024 06:24:45 -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 1tFtfA-00041V-MO for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:26 -0500 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFtf5-0002pZ-2B for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:21 -0500 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-53dde9acbb0so3240619e87.3 for ; Tue, 26 Nov 2024 03:23:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620194; x=1733224994; 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=WlPdyc/DTHUeKFvLcv8XiL1CJLw++4u5ykrc9rCsGw0=; b=kL3XWD4GFgeZTLHRbeakLUGuvKuZVApvnRo89G5+ETHvGhglGVFX7UAbd1CTX4wn5I YIi+HluaTdhjBjfZH4Nig4OoWdBb0rzgUJ2TGJrcx2XKxh9/9awkcR61QLsFIUdDuhhg T3YjKQVl7XNbE2sF3sjl9cRqNEhLOoRo9DuJRMzs3wN4n7k3jv2DhHvZ1WI3Z3jXiUWa od9nlaqu0ML5uyjo7qJ5j2rlyL9iKLi2eSCLAsMxj1m1zqiKKcbX7xZiTveiRJQfldzb pMLvcxftqBmfTyXoGPSSveg89Zl4qzyEwJHd3W5iplS1hKAK/29uAfxqkAlQ5LKtL/ZK AsGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620194; x=1733224994; 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=WlPdyc/DTHUeKFvLcv8XiL1CJLw++4u5ykrc9rCsGw0=; b=WIb48BXwGO1wn1Ma6sjgMXQi/XoGgEYlyRJWPpqIjNOwd0EotaDLNXcLWVC4UAa2S9 /2Zf/2JgWCwsuaEnB+XLDag4/xLldkI77yNGSLG2NdIPellNn0g17W/8hOD0+XjEcVSX qeqRRXUPUaN2SW1vvOLUvAMnAN/KY6mWoOkcDGjEySkyZbdF5nT0rVg9HtVJyXuAJlWF ToXRdCQEUqyXSIxfbeB+Z4jzUcciOkFG6RzWkxPkTuzFAVZNx/DpGAsY6OdpFBDp029P lthr1SEGM7bQM0R/mSXhIwq0VxbFVs8dv3723gUxp7+6+XlBk1zdZxi1odH+Ao00gMa5 pbUQ== X-Gm-Message-State: AOJu0YwlAygWSF2cH6PYxWlj8ltt9ANVOmNJsbKuNkOMjClTNpSWng12 0M2DOefNm3A5ZHnan0WG5vp23fDKOhzW89k6oPgNZdgr2VlTzNQ8AeniXEq8VgUEwnHR3H+7xkJ e X-Gm-Gg: ASbGncvWcG+eIQgPM3uAgXApxFLLLCC0M1y7t8WPcnidJqL0riDUXSLxXKCjYqTmKVn eaOz4m9CJMClZqzrhYPkWgw+2nXoJ0WNCHNwqX7Th6mSZgyglYlRjegDm+8fEQJvWNo97j5n6fN R32aTqOyKmJ+QR/6U8EWaktwy/iXQ/s426vZPoUwSnNtepGhyy2FMA8Z1fWxgm/lAuolxgrYYzF QHZMsy4qyXQ0s9kpxVutojNreuvNO+NX/KmUaE6OtkHnp+EpsjkxQt/iFcMiUm3EpVPj+Ix X-Google-Smtp-Source: AGHT+IHl4P76Zn9v74qJkH7XPImD4yqbhApgnoCfXWDHkPezXOG5kjcaZJpW7cIhbBeU8MgQWJsrow== X-Received: by 2002:a05:6512:2209:b0:536:73b5:d971 with SMTP id 2adb3069b0e04-53dd39b0ddcmr7303704e87.38.1732620194134; Tue, 26 Nov 2024 03:23:14 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4349d60de86sm90041125e9.35.2024.11.26.03.23.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:23:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 07/13] hw/pci: Propagate bar_at_addr_0_refused to pci_root_bus_new() Date: Tue, 26 Nov 2024 12:22:06 +0100 Message-ID: <20241126112212.64524-8-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=philmd@linaro.org; helo=mail-lf1-x130.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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Have pci_root_bus_new() callers set the 'bar_at_addr_0_refused' argument. No logical change. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 3 ++- hw/pci-bridge/pci_expander_bridge.c | 9 ++++++--- hw/pci-host/gt64120.c | 2 +- hw/pci-host/i440fx.c | 2 +- hw/pci-host/q35.c | 2 +- hw/pci-host/remote.c | 2 +- hw/pci/pci.c | 7 ++++--- 7 files changed, 16 insertions(+), 11 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index b499846083f..f5454db0eb5 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -288,7 +288,8 @@ void pci_root_bus_init(PCIBus *bus, size_t bus_size, DeviceState *parent, bool bar_at_addr_0_refused); PCIBus *pci_root_bus_new(DeviceState *parent, const char *name, MemoryRegion *mem, MemoryRegion *io, - uint8_t devfn_min, const char *typename); + uint8_t devfn_min, const char *typename, + bool bar_at_addr_0_refused); void pci_root_bus_cleanup(PCIBus *bus); void pci_bus_irqs(PCIBus *bus, pci_set_irq_fn set_irq, void *irq_opaque, int nirq); diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c index bbf615f544b..d4b472a8305 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -358,15 +358,18 @@ static bool pxb_dev_realize_common(PCIDevice *dev, enum BusType type, ds = qdev_new(type == CXL ? TYPE_PXB_CXL_HOST : TYPE_PXB_HOST); if (type == PCIE) { - bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_PCIE_BUS); + bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_PCIE_BUS, + true); bus->flags = parent_bus->flags & ~PCI_BUS_IS_ROOT; } else if (type == CXL) { - bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_CXL_BUS); + bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_CXL_BUS, + true); bus->flags = parent_bus->flags & ~PCI_BUS_IS_ROOT; bus->flags |= PCI_BUS_CXL; PXB_CXL_DEV(dev)->cxl_host_bridge = PXB_CXL_HOST(ds); } else { - bus = pci_root_bus_new(ds, "pxb-internal", NULL, NULL, 0, TYPE_PXB_BUS); + bus = pci_root_bus_new(ds, "pxb-internal", NULL, NULL, 0, TYPE_PXB_BUS, + true); bus->flags = parent_bus->flags & ~PCI_BUS_IS_ROOT; bds = qdev_new("pci-bridge"); bds->id = g_strdup(dev_name); diff --git a/hw/pci-host/gt64120.c b/hw/pci-host/gt64120.c index 14fc803d279..3cc92e7200f 100644 --- a/hw/pci-host/gt64120.c +++ b/hw/pci-host/gt64120.c @@ -1193,7 +1193,7 @@ static void gt64120_realize(DeviceState *dev, Error **errp) phb->bus = pci_root_bus_new(dev, "pci", &s->pci0_mem, get_system_io(), - PCI_DEVFN(18, 0), TYPE_PCI_BUS); + PCI_DEVFN(18, 0), TYPE_PCI_BUS, true); pci_create_simple(phb->bus, PCI_DEVFN(0, 0), "gt64120_pci"); memory_region_init_io(&phb->conf_mem, OBJECT(phb), diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 4f0a0438d77..35a54b953a7 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -268,7 +268,7 @@ static void i440fx_pcihost_realize(DeviceState *dev, Error **errp) memory_region_add_coalescing(&phb->conf_mem, 0, 4); b = pci_root_bus_new(dev, NULL, s->pci_address_space, - s->io_memory, 0, TYPE_PCI_BUS); + s->io_memory, 0, TYPE_PCI_BUS, true); phb->bus = b; d = pci_create_simple(b, 0, s->pci_type); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index f3e713318ed..e47ba7aa0c2 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -65,7 +65,7 @@ static void q35_host_realize(DeviceState *dev, Error **errp) pci->bus = pci_root_bus_new(DEVICE(s), "pcie.0", s->mch.pci_address_space, s->mch.address_space_io, - 0, TYPE_PCIE_BUS); + 0, TYPE_PCIE_BUS, true); qdev_realize(DEVICE(&s->mch), BUS(pci->bus), &error_fatal); } diff --git a/hw/pci-host/remote.c b/hw/pci-host/remote.c index bfb25ef6af8..646e14de4e9 100644 --- a/hw/pci-host/remote.c +++ b/hw/pci-host/remote.c @@ -43,7 +43,7 @@ static void remote_pcihost_realize(DeviceState *dev, Error **errp) pci->bus = pci_root_bus_new(DEVICE(s), "remote-pci", s->mr_pci_mem, s->mr_sys_io, - 0, TYPE_PCIE_BUS); + 0, TYPE_PCIE_BUS, true); } static void remote_pcihost_class_init(ObjectClass *klass, void *data) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index f7158fb9573..5fea39e4dfa 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -571,13 +571,14 @@ void pci_root_bus_init(PCIBus *bus, size_t bus_size, DeviceState *parent, PCIBus *pci_root_bus_new(DeviceState *parent, const char *name, MemoryRegion *mem, MemoryRegion *io, - uint8_t devfn_min, const char *typename) + uint8_t devfn_min, const char *typename, + bool bar_at_addr_0_refused) { PCIBus *bus; bus = PCI_BUS(qbus_new(typename, parent, name)); pci_root_bus_internal_init(bus, parent, mem, io, devfn_min, - true); + bar_at_addr_0_refused); return bus; } @@ -622,7 +623,7 @@ PCIBus *pci_register_root_bus(DeviceState *parent, const char *name, { PCIBus *bus; - bus = pci_root_bus_new(parent, name, mem, io, devfn_min, typename); + bus = pci_root_bus_new(parent, name, mem, io, devfn_min, typename, true); pci_bus_irqs(bus, set_irq, irq_opaque, nirq); pci_bus_map_irqs(bus, map_irq); return bus; From patchwork Tue Nov 26 11:22:07 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: 13885811 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9896CD3B985 for ; Tue, 26 Nov 2024 11:27:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFtgV-0006g4-V7; Tue, 26 Nov 2024 06:24:48 -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 1tFtfL-00047B-OI for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:36 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFtfG-0002sa-3n for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:35 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-432d866f70fso50748995e9.2 for ; Tue, 26 Nov 2024 03:23:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620207; x=1733225007; 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=RnoyXVdD8DdnXViSwr+RJ/lWQxJ2OgIe+SEcc7eHt/g=; b=jrWUtcKrnOGHzzC8zLhDSafXS9MMzFnvZfLpz/MlsRTWzJl6mNicR8lVmdFHEjwq7e uOMhNSbAZdMNvsKhztPx+f7WSoBZvljYQwkgP1IGzmraeLj0mFF4dVt26iAsGckwz4Gk XOzoCxdKJuuSDU9McEorzMbueXaTjhYbqb2IQCl+A44/6BD5bTqlKd8K8m6hN/ezYluW WZUqOnNsFLYqd7cXQaBUzjnfu9ayK63BLiW57CfpMYqQH2Or4670FgnyIIOc3YLrKysU W/1j3Xat5M3doUlVDJilmJPI2dJMuJ0K3Q7HjCtOexQtV5XPsbzBPCHH4AA0CPqfVPAd Rldw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620207; x=1733225007; 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=RnoyXVdD8DdnXViSwr+RJ/lWQxJ2OgIe+SEcc7eHt/g=; b=Q7WlusNrzOO1YX5VgM7J4jY871WAjU0DRCfIgWMEMF9I9AXIpLNhtt/qIL2VSHHayk s3+D2IbGPn3MSJgZII/3vSwNPx1uprMAGxwgfLmLTm9IbwMgK0gT+lRpMZZxM++swWel Rsg20YI2vgCd291/t2pXC3tG4iqUu7AgM669qh1ROCTreAtHliOoQSNUBwdCVBQ2ux0p Aq95FrwvBcSFD8urtrjJayoNAHs3QRY5xeraixDA+VU6vCrW8ZbEHLG7N26untFRe/0i oF6VWQT2LDwEaIB8FdV2v35/qAgfJXTe0T6jLb8GEeviCtDtEdLbuK3WNELnT9ommNGv 7MoA== X-Gm-Message-State: AOJu0YxXppUpQCcGVTZZ2wPcIFpi3K3H+zH5E6bSG1QXaSJsdPfEbJP0 N8Mhmj2B9V43xxvJu/9WXs5VMa2ek2A/kbmicWeWGjw6iBWkupSHHjzUadsYkSH2IWyTreI9mnw h X-Gm-Gg: ASbGncvWHaf45T6LSG79u939cPe75B7eIl6MpXTBYk26rX7jPha0ef3xzNvfm+xM7jT +ylrkL2jbXOPbIMTMJwbM6osqKjmEc4KdzhpLQHekZkSL0yTfOe2CFSaDrRo+8POU+kKCBv56YB 1NNIGDaIo+Kftn5Pf20zsPdNmzVL+tP4YpCv2hLpwDnzsHXKUFiCxBcqVzBP3dn2D8V5XX0rqhG rQZ5Yo+k/NgqCVs7VhJ10nL2i+jnMKVZS0I/Bf2YmZ/4dU3e6jHJsqMJqqVF2b7GYLX0tmC X-Google-Smtp-Source: AGHT+IE86je2bY5Ff4z81RfqLwFbRKqw0cw+L5Y7X3+IJXyfozJ9/PHqRDu8tzHFYroJp2IDBzQLLQ== X-Received: by 2002:a05:600c:6a06:b0:434:9fb5:fe04 with SMTP id 5b1f17b1804b1-4349fb5ff09mr50911695e9.28.1732620207379; Tue, 26 Nov 2024 03:23:27 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433b46430f1sm225022165e9.43.2024.11.26.03.23.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:23:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 08/13] hw/pci: Propagate bar_at_addr_0_refused to pci_register_root_bus() Date: Tue, 26 Nov 2024 12:22:07 +0100 Message-ID: <20241126112212.64524-9-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Have pci_register_root_bus() callers set the 'bar_at_addr_0_refused' argument. No logical change. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 2 +- hw/alpha/typhoon.c | 2 +- hw/pci-host/articia.c | 3 ++- hw/pci-host/astro.c | 3 ++- hw/pci-host/bonito.c | 2 +- hw/pci-host/designware.c | 2 +- hw/pci-host/dino.c | 2 +- hw/pci-host/gpex.c | 3 ++- hw/pci-host/grackle.c | 2 +- hw/pci-host/mv64361.c | 2 +- hw/pci-host/pnv_phb3.c | 2 +- hw/pci-host/pnv_phb4.c | 2 +- hw/pci-host/ppc440_pcix.c | 2 +- hw/pci-host/ppc4xx_pci.c | 2 +- hw/pci-host/ppce500.c | 3 ++- hw/pci-host/sabre.c | 2 +- hw/pci-host/sh_pci.c | 2 +- hw/pci-host/uninorth.c | 8 ++++---- hw/pci-host/xilinx-pcie.c | 2 +- hw/pci/pci.c | 5 +++-- hw/ppc/ppc440_uc.c | 2 +- hw/ppc/spapr_pci.c | 2 +- hw/s390x/s390-pci-bus.c | 2 +- 23 files changed, 32 insertions(+), 27 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index f5454db0eb5..216b1cbc13a 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -310,7 +310,7 @@ PCIBus *pci_register_root_bus(DeviceState *parent, const char *name, void *irq_opaque, MemoryRegion *mem, MemoryRegion *io, uint8_t devfn_min, int nirq, - const char *typename); + const char *typename, bool bar_at_addr_0_refused); void pci_unregister_root_bus(PCIBus *bus); void pci_bus_set_route_irq_fn(PCIBus *, pci_route_irq_fn); PCIINTxRoute pci_device_route_intx_to_irq(PCIDevice *dev, int pin); diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index e8711ae16a3..37f5e07e726 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -891,7 +891,7 @@ PCIBus *typhoon_init(MemoryRegion *ram, qemu_irq *p_isa_irq, b = pci_register_root_bus(dev, "pci", typhoon_set_irq, sys_map_irq, s, &s->pchip.reg_mem, &s->pchip.reg_io, - devfn_min, 64, TYPE_PCI_BUS); + devfn_min, 64, TYPE_PCI_BUS, true); phb->bus = b; sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); diff --git a/hw/pci-host/articia.c b/hw/pci-host/articia.c index f3fcc49f812..847b4c54e2a 100644 --- a/hw/pci-host/articia.c +++ b/hw/pci-host/articia.c @@ -184,7 +184,8 @@ static void articia_realize(DeviceState *dev, Error **errp) /* devfn_min is 8 that matches first PCI slot in AmigaOne */ h->bus = pci_register_root_bus(dev, NULL, articia_pcihost_set_irq, amigaone_pcihost_bus0_map_irq, dev, &s->mem, - &s->io, PCI_DEVFN(8, 0), 4, TYPE_PCI_BUS); + &s->io, PCI_DEVFN(8, 0), 4, TYPE_PCI_BUS, + true); pdev = pci_create_simple_multifunction(h->bus, PCI_DEVFN(0, 0), TYPE_ARTICIA_PCI_HOST); ARTICIA_PCI_HOST(pdev)->as = s; diff --git a/hw/pci-host/astro.c b/hw/pci-host/astro.c index 379095b3566..1831646f9e7 100644 --- a/hw/pci-host/astro.c +++ b/hw/pci-host/astro.c @@ -454,7 +454,8 @@ static void elroy_pcihost_init(Object *obj) phb->bus = pci_register_root_bus(DEVICE(s), "pci", elroy_set_irq, elroy_pci_map_irq, s, &s->pci_mmio, &s->pci_io, - PCI_DEVFN(0, 0), ELROY_IRQS, TYPE_PCI_BUS); + PCI_DEVFN(0, 0), ELROY_IRQS, TYPE_PCI_BUS, + true); sysbus_init_mmio(sbd, &s->this_mem); diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 1516d0074dd..b2c931bacdb 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -635,7 +635,7 @@ static void bonito_host_realize(DeviceState *dev, Error **errp) phb->bus = pci_register_root_bus(dev, "pci", pci_bonito_set_irq, pci_bonito_map_irq, dev, &bs->pci_mem, get_system_io(), - PCI_DEVFN(5, 0), 32, TYPE_PCI_BUS); + PCI_DEVFN(5, 0), 32, TYPE_PCI_BUS, true); for (size_t i = 0; i < 3; i++) { char *name = g_strdup_printf("pci.lomem%zu", i); diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c index c3fc37b9047..eb6d995d3ed 100644 --- a/hw/pci-host/designware.c +++ b/hw/pci-host/designware.c @@ -700,7 +700,7 @@ static void designware_pcie_host_realize(DeviceState *dev, Error **errp) &s->pci.memory, &s->pci.io, 0, 4, - TYPE_PCIE_BUS); + TYPE_PCIE_BUS, true); pci->bus->flags |= PCI_BUS_EXTENDED_CONFIG_SPACE; memory_region_init(&s->pci.address_space_root, diff --git a/hw/pci-host/dino.c b/hw/pci-host/dino.c index 283fc0dc575..8c01372e18c 100644 --- a/hw/pci-host/dino.c +++ b/hw/pci-host/dino.c @@ -473,7 +473,7 @@ static void dino_pcihost_init(Object *obj) phb->bus = pci_register_root_bus(DEVICE(s), "pci", dino_set_irq, dino_pci_map_irq, s, &s->pci_mem, get_system_io(), - PCI_DEVFN(0, 0), 32, TYPE_PCI_BUS); + PCI_DEVFN(0, 0), 32, TYPE_PCI_BUS, true); /* Set up windows into PCI bus memory. */ for (i = 1; i < 31; i++) { diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c index e9cf455bf52..299f4d4f840 100644 --- a/hw/pci-host/gpex.c +++ b/hw/pci-host/gpex.c @@ -135,7 +135,8 @@ static void gpex_host_realize(DeviceState *dev, Error **errp) pci->bus = pci_register_root_bus(dev, "pcie.0", gpex_set_irq, pci_swizzle_map_irq_fn, s, &s->io_mmio, - &s->io_ioport, 0, 4, TYPE_PCIE_BUS); + &s->io_ioport, 0, 4, TYPE_PCIE_BUS, + true); pci_bus_set_route_irq_fn(pci->bus, gpex_route_intx_pin_to_irq); qdev_realize(DEVICE(&s->gpex_root), BUS(pci->bus), &error_fatal); diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index 8e589ff2c9e..2934da19bee 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -58,7 +58,7 @@ static void grackle_realize(DeviceState *dev, Error **errp) s, &s->pci_mmio, &s->pci_io, - 0, 4, TYPE_PCI_BUS); + 0, 4, TYPE_PCI_BUS, true); pci_create_simple(phb->bus, 0, "grackle"); } diff --git a/hw/pci-host/mv64361.c b/hw/pci-host/mv64361.c index 1036d8600d7..d61e3ecc0a7 100644 --- a/hw/pci-host/mv64361.c +++ b/hw/pci-host/mv64361.c @@ -92,7 +92,7 @@ static void mv64361_pcihost_realize(DeviceState *dev, Error **errp) name = g_strdup_printf("pci.%d", s->index); h->bus = pci_register_root_bus(dev, name, mv64361_pcihost_set_irq, pci_swizzle_map_irq_fn, dev, - &s->mem, &s->io, 0, 4, TYPE_PCI_BUS); + &s->mem, &s->io, 0, 4, TYPE_PCI_BUS, true); g_free(name); pci_create_simple(h->bus, 0, TYPE_MV64361_PCI_BRIDGE); } diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index 2a74dbe45f5..633c92c6a56 100644 --- a/hw/pci-host/pnv_phb3.c +++ b/hw/pci-host/pnv_phb3.c @@ -1009,7 +1009,7 @@ void pnv_phb3_bus_init(DeviceState *dev, PnvPHB3 *phb) dev->id ? dev->id : NULL, pnv_phb3_set_irq, pnv_phb3_map_irq, phb, &phb->pci_mmio, &phb->pci_io, - 0, 4, TYPE_PNV_PHB3_ROOT_BUS); + 0, 4, TYPE_PNV_PHB3_ROOT_BUS, true); object_property_set_int(OBJECT(pci->bus), "phb-id", phb->phb_id, &error_abort); diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 99991008c13..a9b46af564f 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -1563,7 +1563,7 @@ void pnv_phb4_bus_init(DeviceState *dev, PnvPHB4 *phb) pci->bus = pci_register_root_bus(dev, dev->id ? dev->id : NULL, pnv_phb4_set_irq, pnv_phb4_map_irq, phb, &phb->pci_mmio, &phb->pci_io, - 0, 4, TYPE_PNV_PHB4_ROOT_BUS); + 0, 4, TYPE_PNV_PHB4_ROOT_BUS, true); object_property_set_int(OBJECT(pci->bus), "phb-id", phb->phb_id, &error_abort); diff --git a/hw/pci-host/ppc440_pcix.c b/hw/pci-host/ppc440_pcix.c index 07924bce28a..b0e2aa96872 100644 --- a/hw/pci-host/ppc440_pcix.c +++ b/hw/pci-host/ppc440_pcix.c @@ -498,7 +498,7 @@ static void ppc440_pcix_realize(DeviceState *dev, Error **errp) memory_region_init(&s->iomem, OBJECT(dev), "pci-io", 64 * KiB); h->bus = pci_register_root_bus(dev, NULL, ppc440_pcix_set_irq, ppc440_pcix_map_irq, &s->irq, &s->busmem, &s->iomem, - PCI_DEVFN(1, 0), 1, TYPE_PCI_BUS); + PCI_DEVFN(1, 0), 1, TYPE_PCI_BUS, true); memory_region_init(&s->bm, OBJECT(s), "bm-ppc440-pcix", UINT64_MAX); memory_region_add_subregion(&s->bm, 0x0, &s->busmem); diff --git a/hw/pci-host/ppc4xx_pci.c b/hw/pci-host/ppc4xx_pci.c index b6c6c8993c4..9c17e3c655e 100644 --- a/hw/pci-host/ppc4xx_pci.c +++ b/hw/pci-host/ppc4xx_pci.c @@ -329,7 +329,7 @@ static void ppc4xx_pcihost_realize(DeviceState *dev, Error **errp) b = pci_register_root_bus(dev, NULL, ppc4xx_pci_set_irq, ppc4xx_pci_map_irq, s->irq, get_system_memory(), get_system_io(), 0, ARRAY_SIZE(s->irq), - TYPE_PCI_BUS); + TYPE_PCI_BUS, true); h->bus = b; pci_create_simple(b, 0, TYPE_PPC4xx_HOST_BRIDGE); diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index b70631045a0..fb659d4c707 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -465,7 +465,8 @@ static void e500_pcihost_realize(DeviceState *dev, Error **errp) b = pci_register_root_bus(dev, NULL, mpc85xx_pci_set_irq, mpc85xx_pci_map_irq, s, &s->busmem, &s->pio, - PCI_DEVFN(s->first_slot, 0), 4, TYPE_PCI_BUS); + PCI_DEVFN(s->first_slot, 0), 4, TYPE_PCI_BUS, + true); h->bus = b; /* Set up PCI view of memory */ diff --git a/hw/pci-host/sabre.c b/hw/pci-host/sabre.c index 1707feb9513..06f6a15bf2d 100644 --- a/hw/pci-host/sabre.c +++ b/hw/pci-host/sabre.c @@ -381,7 +381,7 @@ static void sabre_realize(DeviceState *dev, Error **errp) pci_sabre_set_irq, pci_sabre_map_irq, s, &s->pci_mmio, &s->pci_ioport, - 0, 0x40, TYPE_PCI_BUS); + 0, 0x40, TYPE_PCI_BUS, true); pci_create_simple(phb->bus, 0, TYPE_SABRE_PCI_DEVICE); diff --git a/hw/pci-host/sh_pci.c b/hw/pci-host/sh_pci.c index 4edebced5eb..8da59ad573d 100644 --- a/hw/pci-host/sh_pci.c +++ b/hw/pci-host/sh_pci.c @@ -132,7 +132,7 @@ static void sh_pcic_host_realize(DeviceState *dev, Error **errp) get_system_memory(), get_system_io(), PCI_DEVFN(0, 0), PCI_NUM_PINS, - TYPE_PCI_BUS); + TYPE_PCI_BUS, true); memory_region_init_io(&s->memconfig_p4, OBJECT(s), &sh_pci_reg_ops, s, "sh_pci", 0x224); memory_region_init_alias(&s->memconfig_a7, OBJECT(s), "sh_pci.2", diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index e4c1abd8715..f2d410fa4aa 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -124,7 +124,7 @@ static void pci_unin_main_realize(DeviceState *dev, Error **errp) s, &s->pci_mmio, &s->pci_io, - PCI_DEVFN(11, 0), 4, TYPE_PCI_BUS); + PCI_DEVFN(11, 0), 4, TYPE_PCI_BUS, true); pci_create_simple(h->bus, PCI_DEVFN(11, 0), "uni-north-pci"); @@ -174,7 +174,7 @@ static void pci_u3_agp_realize(DeviceState *dev, Error **errp) s, &s->pci_mmio, &s->pci_io, - PCI_DEVFN(11, 0), 4, TYPE_PCI_BUS); + PCI_DEVFN(11, 0), 4, TYPE_PCI_BUS, false); pci_create_simple(h->bus, PCI_DEVFN(11, 0), "u3-agp"); } @@ -218,7 +218,7 @@ static void pci_unin_agp_realize(DeviceState *dev, Error **errp) s, &s->pci_mmio, &s->pci_io, - PCI_DEVFN(11, 0), 4, TYPE_PCI_BUS); + PCI_DEVFN(11, 0), 4, TYPE_PCI_BUS, false); pci_create_simple(h->bus, PCI_DEVFN(11, 0), "uni-north-agp"); } @@ -251,7 +251,7 @@ static void pci_unin_internal_realize(DeviceState *dev, Error **errp) s, &s->pci_mmio, &s->pci_io, - PCI_DEVFN(14, 0), 4, TYPE_PCI_BUS); + PCI_DEVFN(14, 0), 4, TYPE_PCI_BUS, false); pci_create_simple(h->bus, PCI_DEVFN(14, 0), "uni-north-internal-pci"); } diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c index 24f691ea829..634d24c479b 100644 --- a/hw/pci-host/xilinx-pcie.c +++ b/hw/pci-host/xilinx-pcie.c @@ -135,7 +135,7 @@ static void xilinx_pcie_host_realize(DeviceState *dev, Error **errp) pci->bus = pci_register_root_bus(dev, s->name, xilinx_pcie_set_irq, pci_swizzle_map_irq_fn, s, &s->mmio, - &s->io, 0, 4, TYPE_PCIE_BUS); + &s->io, 0, 4, TYPE_PCIE_BUS, true); qdev_realize(DEVICE(&s->root), BUS(pci->bus), &error_fatal); } diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 5fea39e4dfa..889821f64c0 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -619,11 +619,12 @@ PCIBus *pci_register_root_bus(DeviceState *parent, const char *name, void *irq_opaque, MemoryRegion *mem, MemoryRegion *io, uint8_t devfn_min, int nirq, - const char *typename) + const char *typename, bool bar_at_addr_0_refused) { PCIBus *bus; - bus = pci_root_bus_new(parent, name, mem, io, devfn_min, typename, true); + bus = pci_root_bus_new(parent, name, mem, io, devfn_min, typename, + bar_at_addr_0_refused); pci_bus_irqs(bus, set_irq, irq_opaque, nirq); pci_bus_map_irqs(bus, map_irq); return bus; diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 1312aa2080e..c93a7744dc1 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -1016,7 +1016,7 @@ static void ppc460ex_pcie_realize(DeviceState *dev, Error **errp) snprintf(buf, sizeof(buf), "pcie.%d", s->num); pci->bus = pci_register_root_bus(DEVICE(s), buf, ppc460ex_set_irq, pci_swizzle_map_irq_fn, s, &s->busmem, - &s->iomem, 0, 4, TYPE_PCIE_BUS); + &s->iomem, 0, 4, TYPE_PCIE_BUS, true); ppc460ex_pcie_register_dcrs(s); } diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 7e24084673f..e6e8018c1cd 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1886,7 +1886,7 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp) pci_spapr_set_irq, pci_swizzle_map_irq_fn, sphb, &sphb->memspace, &sphb->iospace, PCI_DEVFN(0, 0), PCI_NUM_PINS, - TYPE_PCI_BUS); + TYPE_PCI_BUS, true); /* * Despite resembling a vanilla PCI bus in most ways, the PAPR diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 40b2567aa70..1ca9df42c5a 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -834,7 +834,7 @@ static void s390_pcihost_realize(DeviceState *dev, Error **errp) b = pci_register_root_bus(dev, NULL, s390_pci_set_irq, s390_pci_map_irq, NULL, get_system_memory(), get_system_io(), 0, - 64, TYPE_PCI_BUS); + 64, TYPE_PCI_BUS, true); pci_setup_iommu(b, &s390_iommu_ops, s); bus = BUS(b); From patchwork Tue Nov 26 11:22:08 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: 13885808 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 74B52D3B985 for ; Tue, 26 Nov 2024 11:26:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFtgc-0007TB-RH; Tue, 26 Nov 2024 06:24:55 -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 1tFtfQ-0004A8-Eb for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:45 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFtfO-0002uv-Ez for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:40 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-434a10588f3so14202005e9.1 for ; Tue, 26 Nov 2024 03:23:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620216; x=1733225016; 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=KmjwRfDIQiUm8za7VsqVbrrytj9VplHKG4K4/ENa984=; b=BOhYvLSdzjt1xhenph6peYqQAZCaFEfgTDDtWJwzRS8p/m5xjIPCKAYrBQvIoc/h9C FPSJ4P/JaPdXdSLwTjzygzPr7h8oKKHAvq9ZPH2zbJEmTu9zSyKrAHfZIl8/wWciHG93 dAo3KTAjE0AdvObLhPSF9XB7FVd0ohOHaA8chV5pyLOTrM5IY4ybwW8LgO2XXuhHc9L/ YQy72N5VEAfHQlfLsfyIwo1yZId+5twyFUg15U6GXaCqX85BvzCC1yeK98yu3sNPY06R 59HvK2OtTQOKUqoJSBREoo8nkupH1faqv3rH9vgPcusDID4pMzjQ0Al3YZA6NFp4N8wj FBUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620216; x=1733225016; 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=KmjwRfDIQiUm8za7VsqVbrrytj9VplHKG4K4/ENa984=; b=GjCIBM3PyazSORUSsQgqkcwAMpjLJsmhbkHlcXpQm5SeaniYPwFEgRsv1u5RM3aX8q 1wL1yCbAu3706FO6d779XaDNUzI+OeNj8cOoO/wUyyggOBZd9lEfSK0+316C24Aq12oK EHRSnSRsc2c14ZuStw2opOe00ziHvj4fAIn2ouPc6IVgBu1yMWjJalZYe37tYTggKQQN cYhcDZcg5lkgzCIR4OE8BN7uacGaNGiHkDuH3o0UJMAN/mTV+2yBNHfrfSz5oC5sO8qA IEgwZLD9/4Dq0vJjomxnNTlg9u6UazGsi2VRs5lmxurC2Jox9h4PQUA1WPxePo9tPZrW Uegg== X-Gm-Message-State: AOJu0YxwQt42aQTsN3jXGgiXBj7eNqhRT65Oe250Sn/6KNkjzT5YssuH wAUeyyjN3VfppWcO90vnUrrV6kaUJERW73VfetoI6P2Wb0rLbj2I2s6qvkW0f5hXIwhu39AlY7v j X-Gm-Gg: ASbGncvxWsVS8dWr0ma89xLibDODyC7PnECO4obhMbfOR517e0H6o32O3FTYJpH9t/k j6AoefyWtXXmKq1uZfyKWrcNZNztYqKCS5eRC8b3TOnfAvtEt03AwUiR98cwpOas9MBw2fh+lT3 ZQihkA0tUAdIAQZMReIQ3X3Z7h5QaAoNEOGFjUOSI1oVFPUfP1jSHD8xAGYGl008eoi40Ma888j tS0iK8FmlF/kJLEnlaL61alGLB3fMMR9XLiCw2fhFyxJZi1V9/cuwCTpONvrg2ThF3ndth1 X-Google-Smtp-Source: AGHT+IGNwk5YaoQ3MtMRaeTJJiZlPzdpzODnHSlG5QE/xiL6kyITv2jIVbls5681MCpH5aDCJT12rw== X-Received: by 2002:a05:600c:3589:b0:434:a4b3:5ebe with SMTP id 5b1f17b1804b1-434a4b35f4amr28161585e9.24.1732620216243; Tue, 26 Nov 2024 03:23:36 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433b01e1188sm231855865e9.1.2024.11.26.03.23.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:23:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 09/13] hw/ppc/spapr: Create host bridge setting bar_at_addr_0_refused=false Date: Tue, 26 Nov 2024 12:22:08 +0100 Message-ID: <20241126112212.64524-10-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Since all sPAPR machines set MachineClass::pci_allow_0_address (see commit e402463073 "pci: allow 0 address for PCI IO/MEM regions"), directly create the host bridge passing bar_at_addr_0_refused=false to pci_register_root_bus(). Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/spapr.c | 1 - hw/ppc/spapr_pci.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 5c02037c564..8af56bd68a2 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4600,7 +4600,6 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) mc->default_display = "std"; mc->kvm_type = spapr_kvm_type; machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SPAPR_PCI_HOST_BRIDGE); - mc->pci_allow_0_address = true; assert(!mc->get_hotplug_handler); mc->get_hotplug_handler = spapr_get_hotplug_handler; hc->pre_plug = spapr_machine_device_pre_plug; diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index e6e8018c1cd..1d12c0b4112 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1886,7 +1886,7 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp) pci_spapr_set_irq, pci_swizzle_map_irq_fn, sphb, &sphb->memspace, &sphb->iospace, PCI_DEVFN(0, 0), PCI_NUM_PINS, - TYPE_PCI_BUS, true); + TYPE_PCI_BUS, false); /* * Despite resembling a vanilla PCI bus in most ways, the PAPR From patchwork Tue Nov 26 11:22:09 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: 13885813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0498FD3B985 for ; Tue, 26 Nov 2024 11:28:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFtgZ-0007Ap-CH; Tue, 26 Nov 2024 06:24:51 -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 1tFtfZ-0004PJ-1B for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:53 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFtfV-0002wt-Vb for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:48 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-38231e9d518so3580296f8f.0 for ; Tue, 26 Nov 2024 03:23:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620224; x=1733225024; 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=XbkFF2paUrkpAUmAqN3hhRRzk+I4qHRGaYiXnMozHls=; b=a12MTDIbHYNk/5NKUibpm6rJS/qv7ZIcaCul2JsIsHp8H6rniRJKhtQSoExIbk6Vb8 oANoPtmBHYinCFRgX3+KTTosrbWK/ubV7pYTgswhBL0hpPU21uFoJUFzclzoML7fCFfa BvXyjo06bS0rJFkWqq34KuqpiJXjCTiuERYonAEQBSLJWvzn3+krkmEWR4+GvyS7upgo G1lrVmCqozSgY3fgZerC3Kdex1qWwXqyTtnZkz5DkDLUO/oY31Nl54HYvLwOoy3c6YXI dmoXFfNU4SYC38Aof1qlAu/cEM82hH5pnt+hzyFhem8YR9i10jSBfmfT5LGYnl2da/VO slmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620224; x=1733225024; 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=XbkFF2paUrkpAUmAqN3hhRRzk+I4qHRGaYiXnMozHls=; b=jjeOGMinMaGSV6J4tjPoTxmhM+VoBbctVSe6UCN5kHgOpo1OVJnRtwEnW2KcMgR+0X 3PzpobQhC3e7XipU1NgEl7pYjjSXJHcec8A177CR9B22qvXGjTwHEkdHzK6SNJtE59bP tUqjcTSx8+WGrHG15+zRFheJjGfovL7f5KEPFJZzb31Mo5WcA0qQJOFUPK9G7mspHw7e 7ViN4lZWOo3NDNvscmXOyZFUFLMjC9EaxhqjzkR4W4S9OhMlupN7j75QaqC6BGZ8aqvv GkH7vc/2+nlOtNzvLg7dJVaRIdSbRjgJ9BHy7ln2hYuvoo8LkcFeUTB0aGrIeXhLHjhk ZEqg== X-Gm-Message-State: AOJu0YwziXEC7u95viM5BJiDrXijNrrlxzvYxUBdWgiQvAFXU5tn0xwP lYL0rgN7zO8LzeQsKQtoxo5e0Ik/krz0Tnwi9f6kfLs3pba2sb6yfOg6EAEJWvG4jlnwlJBla1y 8 X-Gm-Gg: ASbGnctD38+zdH5PZ8zt/pK8G/v9VZQc82rKOQ+amo2R9nsKGuNkixuz0PWz81fdiAs rMLbjxcSAMTyRH6Dpq+yfWM9HJwO9uJqpW+nIUmIvetuH0WS7u1mOqRSeM3hNjBfK/CZQPGof1X 3ZYVhq9HjfLWAgVIBvID+yWgv+rUXYNvPxybmhJxGKn1509/P8WqDJgQLAupY75gF1+8/9g9GEF deNHu2qYM1+GKAupy+26kW9fgP+fheBlXH22TKuZ8QjtQ6oT411GsLVsVToSOlMyhXziG0t X-Google-Smtp-Source: AGHT+IGVJGQGmqR2LIP3EyCzcTfjg1DnII8zvKaRsbXqZxvrY+rrJa/LEXrhLDekfN1yenvhqiAMhw== X-Received: by 2002:adf:e18c:0:b0:382:2d59:b166 with SMTP id ffacd0b85a97d-38260b83dfbmr13189768f8f.31.1732620224148; Tue, 26 Nov 2024 03:23:44 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3825fad6441sm13364242f8f.4.2024.11.26.03.23.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:23:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 10/13] hw/pci-host/gpex: Expose 'refuse-bar-at-addr-0' property Date: Tue, 26 Nov 2024 12:22:09 +0100 Message-ID: <20241126112212.64524-11-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Expose the "refuse-bar-at-addr-0" property so machines using a GPEX host bridge can set this flag on the bus. While the default property is set to 'false', all caller set it to 'true' so there is no logical change so far. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci-host/gpex.h | 1 + hw/arm/sbsa-ref.c | 2 ++ hw/arm/virt.c | 2 ++ hw/i386/microvm.c | 2 ++ hw/loongarch/virt.c | 2 ++ hw/mips/loongson3_virt.c | 2 ++ hw/openrisc/virt.c | 2 ++ hw/pci-host/gpex.c | 4 +++- hw/riscv/virt.c | 2 ++ hw/xen/xen-pvh-common.c | 2 ++ hw/xtensa/virt.c | 2 ++ 11 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h index dce883573ba..44c6463afb3 100644 --- a/include/hw/pci-host/gpex.h +++ b/include/hw/pci-host/gpex.h @@ -64,6 +64,7 @@ struct GPEXHost { int irq_num[GPEX_NUM_IRQS]; bool allow_unmapped_accesses; + bool refuse_bar_at_addr_0; struct GPEXConfig gpex_cfg; }; diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index e3195d54497..f6cf43cf0c9 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -647,6 +647,8 @@ static void create_pcie(SBSAMachineState *sms) int i; dev = qdev_new(TYPE_GPEX_HOST); + object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0", + true, &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); /* Map ECAM space */ diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 1a381e9a2bd..06affc3638b 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1510,6 +1510,8 @@ static void create_pcie(VirtMachineState *vms) MachineClass *mc = MACHINE_GET_CLASS(ms); dev = qdev_new(TYPE_GPEX_HOST); + object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0", + true, &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); ecam_id = VIRT_ECAM_ID(vms->highmem_ecam); diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 86637afa0f3..2231fd8f9cf 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -108,6 +108,8 @@ static void create_gpex(MicrovmMachineState *mms) int i; dev = qdev_new(TYPE_GPEX_HOST); + object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0", + true, &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); /* Map only the first size_ecam bytes of ECAM space */ diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 9a635d1d3d3..b5a26d3c23d 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -712,6 +712,8 @@ static void virt_devices_init(DeviceState *pch_pic, int i; gpex_dev = qdev_new(TYPE_GPEX_HOST); + object_property_set_bool(OBJECT(gpex_dev), "refuse-bar-at-addr-0", + true, &error_fatal); d = SYS_BUS_DEVICE(gpex_dev); sysbus_realize_and_unref(d, &error_fatal); pci_bus = PCI_HOST_BRIDGE(gpex_dev)->bus; diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c index f3b6326cc59..21af0b5bc86 100644 --- a/hw/mips/loongson3_virt.c +++ b/hw/mips/loongson3_virt.c @@ -430,6 +430,8 @@ static inline void loongson3_virt_devices_init(MachineState *machine, LoongsonMachineState *s = LOONGSON_MACHINE(machine); dev = qdev_new(TYPE_GPEX_HOST); + object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0", + true, &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); pci_bus = PCI_HOST_BRIDGE(dev)->bus; diff --git a/hw/openrisc/virt.c b/hw/openrisc/virt.c index 47d2c9bd3c7..cde9379a992 100644 --- a/hw/openrisc/virt.c +++ b/hw/openrisc/virt.c @@ -380,6 +380,8 @@ static void openrisc_virt_pcie_init(OR1KVirtState *state, int i; dev = qdev_new(TYPE_GPEX_HOST); + object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0", + true, &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); /* Map ECAM space. */ diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c index 299f4d4f840..b888f4e831d 100644 --- a/hw/pci-host/gpex.c +++ b/hw/pci-host/gpex.c @@ -136,7 +136,7 @@ static void gpex_host_realize(DeviceState *dev, Error **errp) pci->bus = pci_register_root_bus(dev, "pcie.0", gpex_set_irq, pci_swizzle_map_irq_fn, s, &s->io_mmio, &s->io_ioport, 0, 4, TYPE_PCIE_BUS, - true); + s->refuse_bar_at_addr_0); pci_bus_set_route_irq_fn(pci->bus, gpex_route_intx_pin_to_irq); qdev_realize(DEVICE(&s->gpex_root), BUS(pci->bus), &error_fatal); @@ -155,6 +155,8 @@ static Property gpex_host_properties[] = { */ DEFINE_PROP_BOOL("allow-unmapped-accesses", GPEXHost, allow_unmapped_accesses, true), + DEFINE_PROP_BOOL("refuse-bar-at-addr-0", GPEXHost, + refuse_bar_at_addr_0, false), DEFINE_PROP_UINT64(PCI_HOST_ECAM_BASE, GPEXHost, gpex_cfg.ecam.base, 0), DEFINE_PROP_SIZE(PCI_HOST_ECAM_SIZE, GPEXHost, gpex_cfg.ecam.size, 0), DEFINE_PROP_UINT64(PCI_HOST_PIO_BASE, GPEXHost, gpex_cfg.pio.base, 0), diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 45a8c4f8190..8999fc348cb 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1158,6 +1158,8 @@ static inline DeviceState *gpex_pcie_init(MemoryRegion *sys_mem, pio_base, NULL); object_property_set_int(OBJECT(GPEX_HOST(dev)), PCI_HOST_PIO_SIZE, pio_size, NULL); + object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0", + true, &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index 218ac851cf7..3131a2dd280 100644 --- a/hw/xen/xen-pvh-common.c +++ b/hw/xen/xen-pvh-common.c @@ -139,6 +139,8 @@ static inline void xenpvh_gpex_init(XenPVHMachineState *s, object_initialize_child(OBJECT(s), "gpex", &s->pci.gpex, TYPE_GPEX_HOST); + object_property_set_bool(OBJECT(s), "refuse-bar-at-addr-0", + true, &error_fatal); dev = DEVICE(&s->pci.gpex); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); diff --git a/hw/xtensa/virt.c b/hw/xtensa/virt.c index 5310a888613..dcb39a67868 100644 --- a/hw/xtensa/virt.c +++ b/hw/xtensa/virt.c @@ -62,6 +62,8 @@ static void create_pcie(MachineState *ms, CPUXtensaState *env, int irq_base, int i; dev = qdev_new(TYPE_GPEX_HOST); + object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0", + true, &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); /* Map only the first size_ecam bytes of ECAM space. */ From patchwork Tue Nov 26 11:22:10 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: 13885807 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17576D3B985 for ; Tue, 26 Nov 2024 11:26:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFtgg-0007ws-TE; Tue, 26 Nov 2024 06:24:59 -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 1tFtff-0004cQ-P9 for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:56 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFtfc-0002ym-VX for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:55 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4316f3d3c21so48157995e9.3 for ; Tue, 26 Nov 2024 03:23:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620230; x=1733225030; 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=5+ncjcv7Qm8z1k3YSKR9YOc81bQXCEn50hblae0ujWI=; b=mPjTnidVBAmieTlEBb3JK2OCO1rPpoTDuxdZndla7PRHQH2bsD2x6HV5LtV7Vo5T/x qf5pQMegmGDGMifh0OFa7xj5H2cK9pKHX3GxpGykMg7utWwOorvHjRMNHnyrxqfGrnaG ajDJRwJV84A+pHSGvIV3Wi82seXl3nqX0Xwmc0sBhxHrEaKageI0VR7p1gZxPTfSdJfn AiwY7Q6ESsiqPM+WI+K/qbmdyLDbLHNp9Bg6X+QW8APWOplHbPMAZzHFODOfekaGHShP B0RCJXUGjDj+XauBlYOKJkMTXWQG7SpYnx8FVBPXmrgl5OscSlp6aMWpggF7mqo4TbN8 NEoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620230; x=1733225030; 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=5+ncjcv7Qm8z1k3YSKR9YOc81bQXCEn50hblae0ujWI=; b=QWldOePgPqcrnodbdoJoGshkcn7KI+2Yje2RVQWXxH3HaVY0LSxINtoQ9EmzmkJFMA gFGosGsJsa+Rl4/lxu5+k6jWR1hSxS/Ex825jbzUCEZpb68d1YSUxMEbl2awlBOD8I6Q PhXvPKkqsE86RgTil4ODCLcL9jCt7yvUdxn77wr84zFSTq4easB52dO3vopZvbFS+dkS tiCn5UenKrZ83j1eO21xne8O35RveXuA/KAm6daHcEuzc+MBKyh/ZQEWocHnSNr4HxOl lg5eVk1nHEf1QhzIlRBU5BXOtByvR9FzDWslw6CRj+hlkhPz2BdXfHWYfQzfEIRonMWN OGeQ== X-Gm-Message-State: AOJu0YzfNn+g6IrYHhh/ZJhBVxzTJVHOpQh8P8ArWyGomyNB3umj6Cdl zVMRWEyYLGLkWgPkZq9ElYSpa/d54dKfpHOS0aXzqUGaMFe8b16GApxCSyXsz0U2peYBcMPl9l2 l X-Gm-Gg: ASbGnctCe5D6UPz3LlenfSmEA5ta4+WzWW2tbrjhghlyKYzWNXUF2cyRDUs8Es9Sfto k7kku8JB+BaTZBMo4yoM1q3y8MfcNGHH+bzOWrDK1qZmw+QFU1Aw1pm2Yr3xfZKncOrofEExsJ7 kgEEwTHNjYzmPNAXFk6Yx/qIrlmr3nHho4ZjmjsHzYgrQcWU7uhZcavczXsmfigB4BecVYUo3Qm FwOWFR/MfYugTwvuGLOFy72SZXgBDnyOfV0BeDHrrN4zBaarJz19xarqgfDm8xceTu49BFc X-Google-Smtp-Source: AGHT+IEWnMepl8291UsjGt1x7FxwGMlx+dTJpW2PPVSPZnH6RlwpFeqa5cY5lPOr9MHCyA/gXIc+0g== X-Received: by 2002:a05:600c:3d09:b0:434:a711:ace4 with SMTP id 5b1f17b1804b1-434a711b1acmr16755115e9.17.1732620230484; Tue, 26 Nov 2024 03:23:50 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434a8051ddesm9540385e9.8.2024.11.26.03.23.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:23:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 11/13] hw/arm/virt: Create GPEX host bridge without refuse-bar-at-addr-0 Date: Tue, 26 Nov 2024 12:22:10 +0100 Message-ID: <20241126112212.64524-12-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org ARM virt and sbsa-ref machines set MachineClass::pci_allow_0_address (see commit 74de8c3568 "hw/arm/virt: Allow zero address for PCI IO space"), directly create the GPEX host bridge using the default 'false' value of the "refuse-bar-at-addr-0" property. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/sbsa-ref.c | 3 --- hw/arm/virt.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index f6cf43cf0c9..c232b933c07 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -647,8 +647,6 @@ static void create_pcie(SBSAMachineState *sms) int i; dev = qdev_new(TYPE_GPEX_HOST); - object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0", - true, &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); /* Map ECAM space */ @@ -898,7 +896,6 @@ static void sbsa_ref_class_init(ObjectClass *oc, void *data) mc->default_cpu_type = ARM_CPU_TYPE_NAME("neoverse-n2"); mc->valid_cpu_types = valid_cpu_types; mc->max_cpus = 512; - mc->pci_allow_0_address = true; mc->minimum_page_bits = 12; mc->block_default_type = IF_IDE; mc->no_cdrom = 1; diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 06affc3638b..f9ec3c22409 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1510,8 +1510,6 @@ static void create_pcie(VirtMachineState *vms) MachineClass *mc = MACHINE_GET_CLASS(ms); dev = qdev_new(TYPE_GPEX_HOST); - object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0", - true, &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); ecam_id = VIRT_ECAM_ID(vms->highmem_ecam); @@ -3126,7 +3124,6 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) #endif mc->block_default_type = IF_VIRTIO; mc->no_cdrom = 1; - mc->pci_allow_0_address = true; /* We know we will never create a pre-ARMv7 CPU which needs 1K pages */ mc->minimum_page_bits = 12; mc->possible_cpu_arch_ids = virt_possible_cpu_arch_ids; From patchwork Tue Nov 26 11:22:11 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: 13885810 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 14755D3B986 for ; Tue, 26 Nov 2024 11:27:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFtgj-0008Fp-4B; Tue, 26 Nov 2024 06:25: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 1tFtfk-0004kf-Ex for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:24:01 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFtfi-00031e-7s for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:24:00 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4349fd77b33so16573265e9.2 for ; Tue, 26 Nov 2024 03:23:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620236; x=1733225036; 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=P0iDFiy4g206+uiI3tz8kmnBegTpSA+b+66gFGs5ekU=; b=xMNe6qCssTdvInzhR/rWRpAKzc4TYxKSKdMEHWwPrU2iE40rqgBcSEJlsTBc5AxlMO 4Kn5qmdYpj0mbq0pbZmavVwYbreK9DWWaE26bkkCtkCJRDPx0763nz6yejg3750uxQPj aHhk1FNsvMyaMgVYT3yeCIGeMmfgV5rEvceNsDJ0kSjndjJSTziqQB9jq9kCWYjIW3uw 3IkU/zTylI6qmITcNzqmy9lJSbmYrSOgO4iQp05k9Um+IZOysMowECSq1jDNDg7noiSc /YNrE8TykBCbWERq2fLxvWiTS19s5SdArGyiQ7JTtAZYZUOZkZvpYDDj+t5XX/I2s1Ze BXow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620236; x=1733225036; 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=P0iDFiy4g206+uiI3tz8kmnBegTpSA+b+66gFGs5ekU=; b=auxh3tP/421v5SIDGTkJmQliy6W1xHrkywBuI7PZfwocY1Hb4r1ZqXzM+OHEKqk2tJ bA/7gvOyaAztG5twzoeJGq40WKcrsabAEyHgxaRygRyQmc5LmgbuAZIG5iaksMnzMgdn HHhIdXE9ELBRDMZcFtfhlXsRonT5CFqb3/Z90rQV/DQT1s375sjF+8QbEoDz4IWSwlOE yQmY4AhRltam8m0fZnIihoUujDGrZfxgj3aAjl30M9OnIc02yOj66qnSF3iLDXOx4GuD gOAp5qLJSZFG7ex2mI5LkwBqgbqZLUyfBPgDfbU9uCd84pkuuVHsixjFpx2K0S2rttcJ DowA== X-Gm-Message-State: AOJu0Yx9sq3o54Wjls/2TVUbGQdHHSs2svTZgJdoLzyNZeWKRVS5btDB uWrTPwFd4N51EpfjnB7wVv0gJJ3uluHnN3v3Z76ge9lXyPE+xE20CqZdHuxovxhR1fyK8qIQ9Zc y X-Gm-Gg: ASbGncu0pBu14g7arXxcQFHfgvvTCM5M4zA+zfg8Jv3uGnv/Bsjn1xLC5bX20sZzWhM S3E+ugPwdr0cRs5uBPpwAnfMWycC/ynHY76ZPXLvnUxgK9c6mLoAWBuYBPbgD475FRoBeYeKhaA HurffgHdXJAVek/ilNx7UCafHJyAh1wyHAN2f6Fgy8JEYgNystHXiRGCZmVC32Wwacy62AvXD4j CpyyWP1xV0vGuPIvEJY7m7/085JTTB5LmwLpjtvSb+XiI6PUn4marjLKn4BWVqze8vhQ0TM X-Google-Smtp-Source: AGHT+IFg/gi+61i2OJlRicWC3cP19bowqD2mQdjF+QnLLM120B87cgN7yu5W5xYlEgHd5cop0f4Byg== X-Received: by 2002:a05:600c:4683:b0:42f:7e87:3438 with SMTP id 5b1f17b1804b1-433ce39e773mr149650775e9.0.1732620236161; Tue, 26 Nov 2024 03:23:56 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4349eeb375fsm75702535e9.3.2024.11.26.03.23.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:23:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 12/13] hw/riscv/virt: Create GPEX host bridge without refuse-bar-at-addr-0 Date: Tue, 26 Nov 2024 12:22:11 +0100 Message-ID: <20241126112212.64524-13-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org RISCV virt machine set MachineClass::pci_allow_0_address (see commit acead54c78 "riscv: virt: Allow PCI address 0"), directly create the GPEX host bridge using the default 'false' value of the "refuse-bar-at-addr-0" property. Signed-off-by: Philippe Mathieu-Daudé --- hw/riscv/virt.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 8999fc348cb..b28edb9ffd5 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1158,8 +1158,6 @@ static inline DeviceState *gpex_pcie_init(MemoryRegion *sys_mem, pio_base, NULL); object_property_set_int(OBJECT(GPEX_HOST(dev)), PCI_HOST_PIO_SIZE, pio_size, NULL); - object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0", - true, &error_fatal); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); @@ -1807,7 +1805,6 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) mc->default_cpu_type = TYPE_RISCV_CPU_BASE; mc->block_default_type = IF_VIRTIO; mc->no_cdrom = 1; - mc->pci_allow_0_address = true; mc->possible_cpu_arch_ids = riscv_numa_possible_cpu_arch_ids; mc->cpu_index_to_instance_props = riscv_numa_cpu_index_to_props; mc->get_default_cpu_node_id = riscv_numa_get_default_cpu_node_id; From patchwork Tue Nov 26 11:22:12 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: 13885812 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ABBC5D3B987 for ; Tue, 26 Nov 2024 11:27:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFtha-0000ZD-W2; Tue, 26 Nov 2024 06:25:55 -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 1tFtfq-0004vT-8o for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:24:07 -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 1tFtfn-00033O-PT for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:24:05 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4349e4e252dso19877025e9.0 for ; Tue, 26 Nov 2024 03:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620242; x=1733225042; 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=I1K533phtUA49BKbxwAi+Y+nPI04Ofc/dicjSAgZ7ZU=; b=dvdaaZ5TohMDmblaYitF2ib78JY/Cpoqr22fu1Ye4gZegV/9NYV1ZqWIFxkr/tbotn 3wNbIpJkRhZGua68n4ab+VfUNAgPb+azSzC0B+YO8CwRxoGbyUxWTrCIIhQbdi1pa1kD OxYQAmEz0BQT9Ve0a8o8iUpWl8Ldwglzst6XbV87AtDh5JTPi2YmucxQSjUJLtyS6uvZ Jt5xKFKMJ9zA0SuMys4Qp0ZYTw8XWqGfSfSiFjcjUYtSHLSxn0rQwPj5AFbpCHJ90Yl5 m5my4UPiDsFGsPCaC6eFOnchyrTee363fZ3gsaeaZjUEdnFCjtqi/fut6Yc/hw8nc/OY Vp2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620242; x=1733225042; 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=I1K533phtUA49BKbxwAi+Y+nPI04Ofc/dicjSAgZ7ZU=; b=HkhHEqMqrW4VwWjpS6WrSGRHH7faCR8kx6KtpHBAElS+HsYxh01YuYbEPd0HpNjXAu 2w04Xap6oyb+fSkXU+575B8m5vCHRNtc93czyMGqTL8RgQHESSAz18piEJj0zVLhPSSD TTP6IWYfy9TvLrGzdLQ9o4OUgzdMEoCgqm8dCJz+HOQ0wL/lau+1C8H0YoTFM+BHk/IP mXFuPE1yt1hmqBim5LA/Kkm6bbw1bJxEsWFxhnGbamuR+9HyqF0yZJ9Q/P2vBAna9Y92 Nr1vRcbXsHKOBxENhjpl3ROJmJ6VY4XFwYA3/IV0eYLhOGTHzelhMvbFj38rLCbxvckT RcOg== X-Gm-Message-State: AOJu0Yx7a/qpATql9TzDQe3HsqKGOcIiWT1kzBeqRGlu376bw4jx4Rsu rC8F/4YzPbpy80snafOneqSkcRg6FJkLlgIrQJVEXRnJs6Ec+fbfRG+/a+7BEeBBJLVzcWeqYa+ c X-Gm-Gg: ASbGncv8EIv0I23d8lAn3G3xNZ63etXDI2QVmdtFAiWycv0yW6I2pTw3dTb8kt6WPgW r2aeB6Rac+1Nh4/dSZCgqcOuXYqO/5afYPMwEwtJBKv/phukeFsYZXUdrwty5TOJF3T8qhasLhR Xo5xoTVwUTq5dfbSljp5NQoi8l0jPhgxS7rcPD23F3yezbwcGY4torW/xGOmRONIgA9vzXTCNwD 0oUm+JTGE8QyFPcSum8OaZtFsXmLH/7Xw5Xkrf2AWsdMMFSCcmo/qxAz7CMUoNlSfhEnmmh X-Google-Smtp-Source: AGHT+IHP+w7KPVZqFwGD6ZQa1TaFx7h4ILbPIh23SwG6AbXHFY77A2H/DCB+w8KbnsjoKbp+aTe7IA== X-Received: by 2002:a05:600c:3d9b:b0:434:a4a6:5212 with SMTP id 5b1f17b1804b1-434a4a65461mr31141935e9.0.1732620241847; Tue, 26 Nov 2024 03:24:01 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3825faff9cdsm13070159f8f.28.2024.11.26.03.24.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:24:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 13/13] hw/pci/pci: Remove legacy MachineClass::pci_allow_0_address flag Date: Tue, 26 Nov 2024 12:22:12 +0100 Message-ID: <20241126112212.64524-14-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-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=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org There are no more users of MachineClass::pci_allow_0_address, remove the field along with the machine_refuses_bar_at_addr_0() method. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/boards.h | 1 - hw/pci/pci.c | 10 +--------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 36fbb9b59df..66fb2eddd34 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -284,7 +284,6 @@ struct MachineClass { no_floppy:1, no_cdrom:1, no_sdcard:1, - pci_allow_0_address:1, legacy_fw_cfg_order:1; bool is_default; const char *default_machine_opts; diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 889821f64c0..20362da7b89 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -45,7 +45,6 @@ #include "hw/pci/msi.h" #include "hw/pci/msix.h" #include "hw/hotplug.h" -#include "hw/boards.h" #include "qapi/error.h" #include "qemu/cutils.h" #include "pci-internal.h" @@ -520,13 +519,6 @@ bool pci_bus_bypass_iommu(PCIBus *bus) return host_bridge->bypass_iommu; } -static bool machine_refuses_bar_at_addr_0(void) -{ - MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); - - return !mc->pci_allow_0_address; -} - static void pci_root_bus_internal_init(PCIBus *bus, DeviceState *parent, MemoryRegion *mem, MemoryRegion *io, uint8_t devfn_min, @@ -538,7 +530,7 @@ static void pci_root_bus_internal_init(PCIBus *bus, DeviceState *parent, bus->address_space_mem = mem; bus->address_space_io = io; bus->flags |= PCI_BUS_IS_ROOT; - if (bar_at_addr_0_refused && machine_refuses_bar_at_addr_0()) { + if (bar_at_addr_0_refused) { bus->flags |= PCI_BUS_BAR_AT_ADDR0_REFUSED; }