From nobody Mon Feb 9 23:42:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1605750766; cv=none; d=zohomail.com; s=zohoarc; b=GoY1Px4uvFnOgzxmPykldvkKTgLvv24skdnSZAVBKcKAWS7ZnePkjFewmdaIb1GnIaNmwJ4hEBDykn56VFtz3vKM55L+i3tW1X4nKTs328vFbDGo3MsCm7Z6dl63vKmWjwYVeW6PdWoUPQn9WufZXlDY/ZEgsNX/3RzUGZldAhY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605750766; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YSAfcDr2PgaM2lbqxzM2LwwbsygEHza3TaZuWNOrhCg=; b=ITaGDgJIKhEQdeB6SoOYkxxvgWAFTv+vfIL/zzN9MS8phrjoYf/6npQRdCpy7aB76o7HbrcG1pBXiKZOXyGx8xrded5/omJJ9gW61NsPWSIushaCdnWUvSiIhYslCHX6l/2ExCBv0sIlaePKKWkkK7ycu+PV/hz4iMyS0FWTfig= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1605750766512595.3080403735272; Wed, 18 Nov 2020 17:52:46 -0800 (PST) Received: from localhost ([::1]:35542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfZ7t-00016h-Bh for importer@patchew.org; Wed, 18 Nov 2020 20:52:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfZ6E-0008FY-L8 for qemu-devel@nongnu.org; Wed, 18 Nov 2020 20:51:02 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:2154) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfZ6B-0003NK-3R for qemu-devel@nongnu.org; Wed, 18 Nov 2020 20:51:02 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4Cc2gq6qGkz6xyM; Thu, 19 Nov 2020 09:50:31 +0800 (CST) Received: from localhost (10.174.184.155) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Thu, 19 Nov 2020 09:50:38 +0800 From: Jiahui Cen To: Subject: [PATCH v10 3/9] hw/arm/virt: Write extra pci roots into fw_cfg Date: Thu, 19 Nov 2020 09:48:35 +0800 Message-ID: <20201119014841.7298-4-cenjiahui@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201119014841.7298-1-cenjiahui@huawei.com> References: <20201119014841.7298-1-cenjiahui@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.174.184.155] X-CFilter-Loop: Reflected Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=45.249.212.35; envelope-from=cenjiahui@huawei.com; helo=szxga07-in.huawei.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/18 20:50:45 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: xieyingtai@huawei.com, Peter Maydell , Jiahui Cen , berrange@redhat.com, Eduardo Habkost , "Michael S. Tsirkin" , Laszlo Ersek , Richard Henderson , Shannon Zhao , miaoyubo@huawei.com, Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , philmd@redhat.com, wu.wubin@huawei.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Add bus property to virt machine for primary PCI root bus and use it to add extra pci roots behind it. Signed-off-by: Jiahui Cen Signed-off-by: Yubo Miao --- hw/arm/virt.c | 7 +++++-- include/hw/arm/virt.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 27dbeb549e..847257aa5c 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1289,7 +1289,8 @@ static void create_pcie(VirtMachineState *vms) } =20 pci =3D PCI_HOST_BRIDGE(dev); - if (pci->bus) { + vms->bus =3D pci->bus; + if (vms->bus) { for (i =3D 0; i < nb_nics; i++) { NICInfo *nd =3D &nd_table[i]; =20 @@ -1346,7 +1347,7 @@ static void create_pcie(VirtMachineState *vms) =20 switch (vms->iommu) { case VIRT_IOMMU_SMMUV3: - create_smmu(vms, pci->bus); + create_smmu(vms, vms->bus); qemu_fdt_setprop_cells(vms->fdt, nodename, "iommu-map", 0x0, vms->iommu_phandle, 0x0, 0x10000); break; @@ -1481,6 +1482,8 @@ void virt_machine_done(Notifier *notifier, void *data) exit(1); } =20 + fw_cfg_add_extra_pci_roots(vms->bus, vms->fw_cfg); + virt_acpi_setup(vms); virt_build_smbios(vms); } diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index aad6d69841..abf54fab49 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -163,6 +163,7 @@ struct VirtMachineState { DeviceState *gic; DeviceState *acpi_dev; Notifier powerdown_notifier; + PCIBus *bus; }; =20 #define VIRT_ECAM_ID(high) (high ? VIRT_HIGH_PCIE_ECAM : VIRT_PCIE_ECAM) --=20 2.28.0