From patchwork Fri Dec 13 23:30:44 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: 850306 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1780027wry; Fri, 13 Dec 2024 15:35:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWltJSoQjbAPyGMkcGdzxfFudb0RseIJewcX4YkZtFH9+yeRzt16UoU6GZA6vuAgc3JuQpjng==@linaro.org X-Google-Smtp-Source: AGHT+IHOLE7EMgdrKxZiqVJJIS1lD/E+wfsVaouMqRzWkUCAIUjGzS9kb3Qp/WTwJhb4CJuH8adg X-Received: by 2002:a05:622a:481b:b0:467:5e1c:1ab6 with SMTP id d75a77b69052e-467a578f2admr90055571cf.24.1734132929905; Fri, 13 Dec 2024 15:35:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734132929; cv=none; d=google.com; s=arc-20240605; b=jW1l6WHwZGOobD4CszSV91IkdKqJJoFK1jZ9QYqXFrCKmnLq9P1dmFjiYGoS290LXD mv483MZFsW9ISjwhrQOq7L8cp8r1A1Bc0he8b6X6H3Zb6zr+YcUMgntwFPqgKJPWxRNx z1+W1gDxpv8BXZuKGtLVUIl8/LfkdLzDTpQx2rD9Wk+FFSXIGShOA32Avoog6ibJahjZ gF5226MbGtNjN6qupKfCfRgjL8gz5GF4cVSDmjO4k39JODma3H6IAIeboGWe7BgAh79q SRRQJkF29Acew646e8ZI2AlNpd+7eI9jlLhJn+0wnPsZBtuq5BreAftXqCa36ElzvkqS 5VsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fhXlFUTDfxapy11V5i3YVoLs5g9dq7c+juyIoRheajs=; fh=iBCV4w7YK1vyHYfwyxOoXBCd3sIBF9+yH+94qSO9meY=; b=Gcky0Q1hLxHJ/suezC/80CKczRLaLlvYv3InPrlgnAH1f3lqNjx6qxE6CkwVOwFLBD r3bR0rc00GwFh3OQpJ4npoS9+c/aJZANQhL52zyI0VpotoSA142vXBg2HlnXk2z39hOf O2SaMXUC1Tskfz/gqK3/gMXl58h2dH+QUYJzk2+etp4WeebJ2LrBrtdtzr9pL3dbNw6w LYbzvEybqyb4sUB/5R9XNMtNZQLEltWeTtYar3d9O2lJAPEZM+LeWKXucyBBuz997hoV ct7qwsodtAW+i1X8wH2jGcXDCGjrydKXJnDS7eT5InoBq4RwryrKOJKW3sUtTyzl15Lj /YXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X4s0EIe2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-467b2e9ad8bsi4596841cf.330.2024.12.13.15.35.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 15:35:29 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X4s0EIe2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMF8x-0003kG-UQ; Fri, 13 Dec 2024 18:32: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 1tMF8T-0003FL-51 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 18:31:56 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMF8O-00032k-A5 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 18:31:52 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4361c705434so16543415e9.3 for ; Fri, 13 Dec 2024 15:31:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734132706; x=1734737506; 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=fhXlFUTDfxapy11V5i3YVoLs5g9dq7c+juyIoRheajs=; b=X4s0EIe2ELGx3YmUocM8WKb42HxZ0Xt/HaimTCUrXZjoXIZNv/JYoKVD7G53xzDSug VeZ+hb/OLEpePt2YkytOzeTCmqjEXhYofaVQATrO4phHoxBBGNDZJeJGctjPzeJ2Bteh V9FB0GPxLsL2HTrRv9fJ2ifbPlZvVwIbXDS5t+9YHi6WsH0+UG2Azb6O7Ve3YMbEEpwj b88P0a5QWvKtClsDakd2QLn4db1ptLeVMUR3MB78gKxlhU22z6jGFArJ2HT26EYhBTNe 8AxgzhjaazHcW8VCWi945uEjCcAwuESoBBPkQIaDDF1CjYIFGuaL0m1dQmVix3ASyUvN KvZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734132706; x=1734737506; 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=fhXlFUTDfxapy11V5i3YVoLs5g9dq7c+juyIoRheajs=; b=lLyx2kMUT0N+H0GKpB2EEp7dJXAvzpOAhc3iYyoi+y33gboRYxhDq8cv8jPRT//Iji 4/oUZFiGIyRB2PqbaJTcqNZqhJ4lz8rVwT1/9JWqrwb1cLV2NRav87MoOMFrybrYkOUC +E7C/QVLX9uqPyAxXyUN8Blsye49HZLhy9GyTMDXaW6pnP8AeZpX1Di6j9JMnNGB/ISf lGuimEM+UBp2/tyKCy/Rg6+jg85Tc35QTb1QIvP8ABQA4ALL8P74DmU6QJfPtxEHOsmN EPXlY2PnmSrU5qyGj7dLD2E9XLrPdTwhHj24BZPx5BcMlpFy9+GiAS00GFyNUlzEnBNk /kng== X-Gm-Message-State: AOJu0YzmfEwbyOi+wM9Fwi9DZ9YMHFRLb3nVHc5Dpw0ZFYxXaV/qOsxd 6pbCtuiHDPVNl3F/v/Wp5pcquqh7whKAtRg1Fklh74CGFz3O5uBLaGejsVsRati8FnN115ccw2K qdHA= X-Gm-Gg: ASbGnctQAFFOXKXKJ2cfX64IlSPy59S2jJ1MJYKjHQ34emguh6HBpcijfb07PynbVpn 274W1IJ+jJ5qydHq5A44Modffzj76sPZPGa88C4nbCXqYXO7tW35GntVYGncfuO1FdWmVcEaMeZ peCcZScSaE/BBs6Ii1mumEoWsBIfrLlRbjTPwR/PpwuWNGNvY2ql6syYdMqt1m83Rr8N5tCR6ss luOW59IrN/hDbcOAuXrpg3XcsYycYvhxYBVUOhPLR/HnDxhsjoy56/kLBZlqV9VGISgFEB4Dyy6 QBs3eQ== X-Received: by 2002:a05:600c:4f07:b0:434:a711:ace4 with SMTP id 5b1f17b1804b1-4362aa50f6emr39461595e9.17.1734132705994; Fri, 13 Dec 2024 15:31:45 -0800 (PST) Received: from localhost.localdomain ([45.93.146.194]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162b1sm827473f8f.38.2024.12.13.15.31.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Dec 2024 15:31:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?D?= =?utf-8?q?aniel_P_=2E_Berrang=C3=A9?= Subject: [PULL 09/20] hw/pci: Add pci_bus_add_fw_cfg_extra_pci_roots() helper Date: Sat, 14 Dec 2024 00:30:44 +0100 Message-ID: <20241213233055.39574-10-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241213233055.39574-1-philmd@linaro.org> References: <20241213233055.39574-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org pci_bus_add_fw_cfg_extra_pci_roots() calls the fw_cfg API with PCI bus specific arguments. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Message-Id: <20241206181352.6836-5-philmd@linaro.org> --- include/hw/pci/pci.h | 3 +++ hw/pci/pci.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index c0717e31219..603c456c3a8 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -297,6 +297,9 @@ int pci_bus_get_irq_level(PCIBus *bus, int irq_num); uint32_t pci_bus_get_slot_reserved_mask(PCIBus *bus); void pci_bus_set_slot_reserved_mask(PCIBus *bus, uint32_t mask); void pci_bus_clear_slot_reserved_mask(PCIBus *bus, uint32_t mask); +bool pci_bus_add_fw_cfg_extra_pci_roots(FWCfgState *fw_cfg, + PCIBus *bus, + Error **errp); /* 0 <= pin <= 3 0 = INTA, 1 = INTB, 2 = INTC, 3 = INTD */ static inline int pci_swizzle(int slot, int pin) { diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 8844251eceb..bf0a1840dbe 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -217,6 +217,22 @@ static uint16_t pcibus_numa_node(PCIBus *bus) return NUMA_NODE_UNASSIGNED; } +bool pci_bus_add_fw_cfg_extra_pci_roots(FWCfgState *fw_cfg, + PCIBus *bus, + Error **errp) +{ + Object *obj; + + if (!bus) { + return true; + } + obj = OBJECT(bus); + + return fw_cfg_add_file_from_generator(fw_cfg, obj->parent, + object_get_canonical_path_component(obj), + "etc/extra-pci-roots", errp); +} + static GByteArray *pci_bus_fw_cfg_gen_data(Object *obj, Error **errp) { PCIBus *bus = PCI_BUS(obj);