From patchwork Tue Apr 7 10:56:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yubo Miao X-Patchwork-Id: 11477925 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B3211805 for ; Tue, 7 Apr 2020 10:58:28 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7B1F32063A for ; Tue, 7 Apr 2020 10:58:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B1F32063A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:45080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLlw3-0001HJ-ID for patchwork-qemu-devel@patchwork.kernel.org; Tue, 07 Apr 2020 06:58:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47290) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLlvG-00080J-AM for qemu-devel@nongnu.org; Tue, 07 Apr 2020 06:57:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLlvF-0007SM-3u for qemu-devel@nongnu.org; Tue, 07 Apr 2020 06:57:38 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:3224 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jLlvE-0007P1-Cs for qemu-devel@nongnu.org; Tue, 07 Apr 2020 06:57:36 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id E2023E5B0D510805F3F6; Tue, 7 Apr 2020 18:57:27 +0800 (CST) Received: from DESKTOP-D7EVK5B.china.huawei.com (10.173.221.29) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Tue, 7 Apr 2020 18:57:17 +0800 From: Yubo Miao To: , , Subject: [PATCH v5 0/8] pci_expander_brdige:acpi:Support pxb-pcie for ARM Date: Tue, 7 Apr 2020 18:56:58 +0800 Message-ID: <20200407105706.1920-1-miaoyubo@huawei.com> X-Mailer: git-send-email 2.24.1.windows.2 MIME-Version: 1.0 X-Originating-IP: [10.173.221.29] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 45.249.212.190 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: berrange@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, xiexiangyou@huawei.com, miaoyubo@huawei.com, imammedo@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: miaoyubo Changes with v4 v5->v4: Not using specific resources for PXB. Instead, the resources for pxb are composed of the bar space of the pci-bridge/pcie-root-port behined it and the config space of devices behind it. Only if the bios(uefi for arm) support multiple roots, configure space of devices behind pxbs could be obtained. The uefi work is updated for discussion by the following link: https://edk2.groups.io/g/devel/message/56901?p=,,,20,0,0,0::Created,,add+extra+roots+for+Arm,20,2,0,72723351 [PATCH] ArmVirtPkg/FdtPciHostBridgeLib: add extra roots for Arm. Currently pxb-pcie is not supported by arm, the reason for it is pxb-pcie is not described in DSDT table and only one main host bridge is described in acpi tables, which means it is not impossible to present different io numas for different devices. This series of patches make arm to support PXB-PCIE. Users can configure pxb-pcie with certain numa, Example command is: -device pxb-pcie,id=pci.7,bus_nr=128,numa_node=0,bus=pcie.0,addr=0x9 miaoyubo (8): acpi:Extract two APIs from acpi_dsdt_add_pci fw_cfg: Write the extra roots into the fw_cfg acpi:Extract crs build form acpi_build.c acpi: Refactor the source of host bridge and build tables for pxb acpi: align the size to 128k unit-test: The files changed. unit-test: Add testcase for pxb unit-test: add the binary file and clear diff.h hw/acpi/aml-build.c | 275 +++++++++++++++++++++++++++++++ hw/arm/virt-acpi-build.c | 251 ++++++++++++++++++++++------- hw/arm/virt.c | 23 +++ hw/i386/acpi-build.c | 285 --------------------------------- include/hw/acpi/aml-build.h | 23 +++ tests/data/acpi/virt/DSDT.pxb | Bin 0 -> 7802 bytes tests/qtest/bios-tables-test.c | 58 ++++++- 7 files changed, 564 insertions(+), 351 deletions(-) create mode 100644 tests/data/acpi/virt/DSDT.pxb