From patchwork Fri Jul 7 01:47:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Hildebrand X-Patchwork-Id: 13304326 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 BE435EB64DD for ; Fri, 7 Jul 2023 01:49:05 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.560137.875797 (Exim 4.92) (envelope-from ) id 1qHaaW-0001z1-83; Fri, 07 Jul 2023 01:48:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 560137.875797; Fri, 07 Jul 2023 01:48:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qHaaW-0001ys-55; Fri, 07 Jul 2023 01:48:48 +0000 Received: by outflank-mailman (input) for mailman id 560137; Fri, 07 Jul 2023 01:48:47 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qHaaV-0001Z8-0G for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 01:48:47 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2060e.outbound.protection.outlook.com [2a01:111:f400:fe5a::60e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 68efa17a-1c68-11ee-b237-6b7b168915f2; Fri, 07 Jul 2023 03:48:46 +0200 (CEST) Received: from DM6PR12CA0008.namprd12.prod.outlook.com (2603:10b6:5:1c0::21) by CH2PR12MB4924.namprd12.prod.outlook.com (2603:10b6:610:6b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.25; Fri, 7 Jul 2023 01:48:41 +0000 Received: from DM6NAM11FT113.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1c0:cafe::c2) by DM6PR12CA0008.outlook.office365.com (2603:10b6:5:1c0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24 via Frontend Transport; Fri, 7 Jul 2023 01:48:41 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT113.mail.protection.outlook.com (10.13.173.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 01:48:40 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul 2023 20:48:40 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Thu, 6 Jul 2023 18:48:40 -0700 Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 6 Jul 2023 20:48:38 -0500 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 68efa17a-1c68-11ee-b237-6b7b168915f2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FwrDHSjpgab8eEyIQmL2noTteZUW/k+KJjSIc1Fx80w3/WBDJ2O6Dq5I9b1DEPntgvwAoJFRO1p4oQPQQtdVyPWaqtG52jKAH7fOcvbCjyXNogKaD2uZuMg7Ps6GN0RiQwm6WLx3cTjkcoWinHdSBck06PTGhUTUV9fF74I0sj0+rdZQgRpTAut4LkY14vwK2/EHsCwyIxH2Wpn8LtJbOWkxt/5mA+dx/vNZiwRNhurOH1nXU60aDujhUoba3aiAQl0yV2TaTx5u9QBpscJpwez/arVs/HvaEBRSHLCJIH7X3GnqfFqjpuVSqlSjBgBupl2LjenztgV1rH8IFa4njA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=a0rigZ++MbBuGufh9GmN/eA2TQY7krzeh8M2cqJ+47o=; b=jDOqKn0OOUvevYEDsBK2B0xYguJz4VLwFg7GHZi9CQXO4fgwUlnehNXF/oVbHb/M8z67evZI3ZeZNMKwEgy6t08KXveMlbrL+gQaTVEM/IUHG2E7M2hcBMDynCwYjc+XZnuiAtXSG6mygIsil4bJX/Q0EN3LNaxksUv+lBR3sF4NuqknW9z8TLnwQ9dfFV5g6nLPemv89Leir0h69lnhnjDVV6CXuANQGhscEJqCLeQ50ZbmXbzqIR3bY0HhCj9jv1XtKcheJOkYMk4bFO9zurlmVocOR60FHxmZD5FF1EWIxelLGZ/mwDPqHpCRxd8NV5X4nu9dHRU2EohPn5RFrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a0rigZ++MbBuGufh9GmN/eA2TQY7krzeh8M2cqJ+47o=; b=aaQWF0ydzLDaP2t/YDNkF57HjRTFioGZyj3qiPtJFvvO745Zdr6MfW7ReYPSC43IhcJFC8em283VTMESFK2bG2VjC4BKRReGfC1QAodLSfaNwwohxoHdVijpOOmbTjIVE/+0xJGzBL3ZdYDv9++LP13t4xeDzg630USisfQEVog= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Stewart Hildebrand To: CC: Rahul Singh , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= , "Oleksandr Tyshchenko" , Artem Mygaiev , Stewart Hildebrand , Stefano Stabellini Subject: [PATCH v2 1/3] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option Date: Thu, 6 Jul 2023 21:47:48 -0400 Message-ID: <20230707014754.51333-2-stewart.hildebrand@amd.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707014754.51333-1-stewart.hildebrand@amd.com> References: <20230707014754.51333-1-stewart.hildebrand@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT113:EE_|CH2PR12MB4924:EE_ X-MS-Office365-Filtering-Correlation-Id: 08e8f078-2347-45cd-0310-08db7e8c4a4b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JWStyl0azENLkvX6rVue17JMZJmqIK8SUWLXigJ0PQuLe1cLlH5hjMnLj64WADpBEQ9S6Hv4K9+6bYmsdwYhL7FkgO2QbxI40g7pOd1+duYRexg9rFlaUTOJwyAKDO9fqgRkADyAM6f6Ew0S2+kFbfpPGB+xIZ1gghu4VmwwM1NShjuW3o9GzbRhDdskipOxdjPcNUvDYAV26enUn04QvCSbIly5gvOzdbTIF2Pxe1eh3AI/Khqb9PwKFNMjtGtatobTe25E0/dMf+UdkMo33OWRvxZ58S6CWKbCbyNf+6Ue5QAGO4gp0Z02U4Hr2+p7r0srZ0IEgjAIKgYl0N9Pr9doK09grL1Am+xfAnoxT0YvY/LISInAXq/e5zaU0pXlTQPHNe2GVeF8EbJKVRHTrEBAUNg5YZ0eOmi4tLfsgXcSq2OqlYwLP+WEfEZv/MlOvUId/yRku0lxGx9QRTOXMREYiROiSXATjuEhJa9+6ZpUrlcxFPXQjoTiXkA9RQOkq1Xm6qgL+pY0rO6TK+mQ3nbf4WMbgIjh5tJzNhWiRGbuJka0PC/lM3e+XpGxrnXNfkYPkIlSKfvXXeeGo1Wry5tx10Y1gJ5fwCAEpPbnVBKFv+vq6N0ymMjFjRFn4BKgIeBC7bFl1GsUJUki1XV1p8qrkhi2LfmM0kUt0l2q1EpH1n2roA/xg5SlcLJfB/8iiQSEl5skHi7aZGkpdjXzu/uT1aqaaTutRONQ1NsT89TZsOmGDIJfCzoSxWyPgdTIftXzK9fk+r39zqGt4FoYInPA6VsyfaP6E37NYE6wNaU= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(136003)(376002)(346002)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(6666004)(40460700003)(82740400003)(478600001)(54906003)(81166007)(356005)(5660300002)(8676002)(8936002)(2906002)(36756003)(82310400005)(44832011)(40480700001)(70586007)(4326008)(6916009)(70206006)(316002)(41300700001)(1076003)(26005)(86362001)(36860700001)(426003)(47076005)(186003)(336012)(2616005)(966005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 01:48:40.9227 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 08e8f078-2347-45cd-0310-08db7e8c4a4b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT113.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4924 From: Rahul Singh Setting CONFIG_PCI_PASSTHROUGH=y will enable PCI passthrough on ARM, even though the feature is not yet complete in the current upstream codebase. The purpose of this is to make it easier to enable the necessary configs (HAS_PCI, HAS_VPCI) for testing and development of PCI passthrough on ARM. Since PCI passthrough on ARM is still work in progress at this time, make it depend on EXPERT. Signed-off-by: Rahul Singh Signed-off-by: Stewart Hildebrand Signed-off-by: Stefano Stabellini Acked-by: Julien Grall --- (cherry picked from commit 9a08f1f7ce28ec619640ba9ce11018bf443e9a0e from the downstream branch [1]) v1->v2: * drop "ARM" naming since it is already in an ARM category * depend on EXPERT instead of UNSUPPORTED Changes from downstream to v1: * depends on ARM_64 (Stefano) * Don't select HAS_VPCI_GUEST_SUPPORT since this config option is not currently used in the upstream codebase. This will want to be re-added here once the vpci series [2] is merged. * Don't select ARM_SMMU_V3 since this option can already be selected independently. While PCI passthrough on ARM depends on an SMMU, it does not depend on a particular version or variant of an SMMU. * Don't select HAS_ITS since this option can already be selected independently. HAS_ITS may want to be added here once the MSI series [1] is merged. * Don't select LATE_HWDOM since this option is unrelated to PCI passthrough. [1] https://gitlab.com/xen-project/people/bmarquis/xen-arm-poc/-/commits/poc/pci-passthrough [2] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg00863.html --- xen/arch/arm/Kconfig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 439cc94f3344..4e0cc421ad48 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -190,6 +190,15 @@ config STATIC_SHM help This option enables statically shared memory on a dom0less system. +config PCI_PASSTHROUGH + bool "PCI passthrough" if EXPERT + depends on ARM_64 + select HAS_PCI + select HAS_VPCI + default n + help + This option enables PCI device passthrough + endmenu menu "ARM errata workaround via the alternative framework" From patchwork Fri Jul 7 01:47:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Hildebrand X-Patchwork-Id: 13304327 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 32908EB64D9 for ; Fri, 7 Jul 2023 01:49:36 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.560144.875807 (Exim 4.92) (envelope-from ) id 1qHab0-0002dU-PA; Fri, 07 Jul 2023 01:49:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 560144.875807; Fri, 07 Jul 2023 01:49:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qHab0-0002dN-L0; Fri, 07 Jul 2023 01:49:18 +0000 Received: by outflank-mailman (input) for mailman id 560144; Fri, 07 Jul 2023 01:49:17 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qHaaz-0001vF-KV for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 01:49:17 +0000 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2061d.outbound.protection.outlook.com [2a01:111:f400:7ea9::61d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7a515c76-1c68-11ee-8611-37d641c3527e; Fri, 07 Jul 2023 03:49:15 +0200 (CEST) Received: from DS7PR06CA0042.namprd06.prod.outlook.com (2603:10b6:8:54::23) by CH3PR12MB9455.namprd12.prod.outlook.com (2603:10b6:610:1c1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24; Fri, 7 Jul 2023 01:49:11 +0000 Received: from DM6NAM11FT075.eop-nam11.prod.protection.outlook.com (2603:10b6:8:54:cafe::d0) by DS7PR06CA0042.outlook.office365.com (2603:10b6:8:54::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.24 via Frontend Transport; Fri, 7 Jul 2023 01:49:11 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT075.mail.protection.outlook.com (10.13.173.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 01:49:10 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul 2023 20:49:09 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul 2023 18:49:09 -0700 Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 6 Jul 2023 20:49:07 -0500 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7a515c76-1c68-11ee-8611-37d641c3527e ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SnOZJns/niXhn3xR2a5/TYZGKfGzSLLfXme5c222SnTBpNxXpq1m/0G6WmOHgoFFZUH/45SQf6s/TMflukRHLvfflhZhxvFvcWiLawzBO3tvSC8UL1yeItmuA1DaCXDZIOZmSOXztP02brvu2CED2Q18GnaYmMf23UXMV3XSoeQoO93Hi/7Jp9F14P8ip0ySWd0R/pGudTDkt7XOPjhFaRN1CZoYSXIADCSTicRzpYgwzGvW6JwhRRg3CiRM3BnwVvcMXZG4tu3XEi9FoOEoBes38u/GySl3vpNjvzlqFfF9nwhMRIKIuyroo7aJ8Um6XVBoD5HufdcRzVeQw+oDHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=J6Ah2WjT8kbxrdDWolhQZENd36EfFXTl5wpUnTMUypc=; b=QhXg62O01DFPZ6ae+JxAyo0+vGapmpDPeAeiPd3k/qU8XWqUocJd8ceNMgEbVFcLrwba7RVV7dNAzQ00nx4gC5eVyJNYRY71eUk9PjtRAJE1MJbywKLxuWVBFB9bkjycVI1utPQgUhTgxKFdY8CGpUsNU0jL7r7mj2NHn9n5er8VIbSP3HZ7HukgquaOJ7JIptCQLQdNSbnItz9HW5Y919vkv6UthnXRnUMwnEyLf+GxG/VYl9kweXWuxxpDIzJvxKhuv2oFn5N5ALN7pCnBXywuqcIBVZ4GXRy63Me3rgi3R68TGxxGZ0nh/J9PucOu98lEn477Q5GcpNeX4wxk2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J6Ah2WjT8kbxrdDWolhQZENd36EfFXTl5wpUnTMUypc=; b=cAEb0gNgU+74FUZ8FKXrA9GOiOlyesRWj4L9ktZbwXI7PHE/oFUY7LUk7WyuD2Ia/BfcF4fJfcyE70CH3V55Ytebl6fNyY8/KaVaQ/0O1dAp2P9cgKOaDPC0zS6KfvUicgEFtSQKnhb4I6fFydog+lFYHhSmzg6G2/3UQ6zPM74= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Stewart Hildebrand To: CC: Oleksandr Andrushchenko , "Stefano Stabellini" , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= , Oleksandr Tyshchenko , Artem Mygaiev , Rahul Singh , Stewart Hildebrand Subject: [PATCH v2 2/3] xen/arm: make has_vpci depend on CONFIG_HAS_VPCI Date: Thu, 6 Jul 2023 21:47:49 -0400 Message-ID: <20230707014754.51333-3-stewart.hildebrand@amd.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707014754.51333-1-stewart.hildebrand@amd.com> References: <20230707014754.51333-1-stewart.hildebrand@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT075:EE_|CH3PR12MB9455:EE_ X-MS-Office365-Filtering-Correlation-Id: 934a342b-161a-41a8-5942-08db7e8c5bd3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rkNcz9P1w3SriLHGQuEYLTzPIDJle+OS9sVSTpzXjRvH+QdnUEjl/Iwf0n6TIZfU2s2qmdE12G8nORjAkfvxebvu2ZBwB7eI1JdsE99SaJMQu3DXjGS9imFk3GsERnIm06FYtGFO2nlHosAnp7IbPC+KaOSBw7tk4sGptmJyler/i5yi5JLVmf+CNnyMLIdREx2diQw7bJGrgH/rko49hQezqaBO/IXFbP2vni1cWjADGjXlNf5PqYud0mx50mOWPQZ2bw6XeC2hZi5Cjx1wne6Ts39WPS6tR1hMhWUfXmyfg1G5QczXFy8flGePfodCdY9f/sNPiCS6CgANsBglUhALyN0L9gecysbrCz9Ub9Q+mLaKrsfnFMxswsa/SPyoAHAa1b78fx6/uKvfj+FGD2iK9uDBU86Nre5VcNzIb6np5/Pi3oP7qyHeBkqCU0MD0RH1YOC/QXaiEkqSM9Az/k4BO9U5pjwttKNxzTgBikpJeMnYsPi4PR2iETlj+OAI/CJgK8/7ozFAmn2JXKb3VGlJLJB8V2AI4doCS+ca4/Tdq2ueninUSwqI6Vogc5HrBxWjBwI9F+htbGR8N6owDWldeFG3V+DMdEP2SB9MEYKyEUKv6ZR8kgmG9r3A1NarOM3L+1Fxcmwjib29sidR1CT0tOW6a0daRMZDu7aVoP6BUDlCBoJmifyBH9znVhQDNWr+fyLF3U8hlVgVicoDa8ct5/NhTeTDVXoISf6Ao8LO/4EZoDBQG/pumgJn5xfjSDX/bTKUwz2bKNLeiUfHRbL7iY3en0gyJuqEBv0r8nQ= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(396003)(376002)(346002)(451199021)(46966006)(40470700004)(36840700001)(40480700001)(966005)(356005)(54906003)(70206006)(81166007)(6666004)(70586007)(36756003)(40460700003)(7416002)(44832011)(5660300002)(86362001)(8676002)(2906002)(82310400005)(316002)(8936002)(6916009)(4326008)(41300700001)(82740400003)(478600001)(36860700001)(83380400001)(426003)(47076005)(2616005)(336012)(186003)(26005)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 01:49:10.3374 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 934a342b-161a-41a8-5942-08db7e8c5bd3 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT075.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9455 From: Oleksandr Andrushchenko VPCI is disabled on ARM. Make it depend on CONFIG_HAS_VPCI to test the PCI passthrough support. Also make it depend on is_hardware_domain for now. The is_hardware_domain check should be removed when vPCI is upstreamed. While here, remove the comment on the preceding line. Signed-off-by: Oleksandr Andrushchenko Signed-off-by: Rahul Singh Signed-off-by: Stewart Hildebrand --- There are two downstreams [1] [2] that have independently made a version this change, each with different Signed-off-by's. I simply picked one at random for the Author: field, and added both Signed-off-by lines. Please let me know if there are any objections. v1->v2: * add is_hardware_domain check. This will need to be removed after the vPCI series [3] is merged. downstream->v1: * change to IS_ENABLED(CONFIG_HAS_VPCI) instead of hardcoded to true * remove the comment on the preceding line [1] https://gitlab.com/xen-project/people/bmarquis/xen-arm-poc/-/commit/27be1729ce8128dbe37275ce7946b2fbd2e5a382 [2] https://github.com/xen-troops/xen/commit/bf12185e6fb2e31db0d8e6ea9ccd8a02abadec17 [3] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg00863.html --- xen/arch/arm/include/asm/domain.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h index 99e798ffff68..1a13965a26b8 100644 --- a/xen/arch/arm/include/asm/domain.h +++ b/xen/arch/arm/include/asm/domain.h @@ -298,8 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {} #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag) -/* vPCI is not available on Arm */ -#define has_vpci(d) ({ (void)(d); false; }) +#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); }) struct arch_vcpu_io { struct instr_details dabt_instr; /* when the instruction is decoded */ From patchwork Fri Jul 7 01:47:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Hildebrand X-Patchwork-Id: 13304328 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.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 C314DEB64D9 for ; Fri, 7 Jul 2023 01:50:07 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.560148.875817 (Exim 4.92) (envelope-from ) id 1qHabV-0003CP-2K; Fri, 07 Jul 2023 01:49:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 560148.875817; Fri, 07 Jul 2023 01:49:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qHabU-0003CI-VF; Fri, 07 Jul 2023 01:49:48 +0000 Received: by outflank-mailman (input) for mailman id 560148; Fri, 07 Jul 2023 01:49:48 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qHabU-0003C2-9k for xen-devel@lists.xenproject.org; Fri, 07 Jul 2023 01:49:48 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2060b.outbound.protection.outlook.com [2a01:111:f400:7e8a::60b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 8bb89ff7-1c68-11ee-8611-37d641c3527e; Fri, 07 Jul 2023 03:49:45 +0200 (CEST) Received: from DM6PR08CA0045.namprd08.prod.outlook.com (2603:10b6:5:1e0::19) by PH7PR12MB6858.namprd12.prod.outlook.com (2603:10b6:510:1b4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 7 Jul 2023 01:49:42 +0000 Received: from DM6NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::e2) by DM6PR08CA0045.outlook.office365.com (2603:10b6:5:1e0::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.18 via Frontend Transport; Fri, 7 Jul 2023 01:49:41 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT082.mail.protection.outlook.com (10.13.173.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6521.45 via Frontend Transport; Fri, 7 Jul 2023 01:49:41 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul 2023 20:49:41 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 6 Jul 2023 18:49:36 -0700 Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Thu, 6 Jul 2023 20:49:35 -0500 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8bb89ff7-1c68-11ee-8611-37d641c3527e ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B0o+3lXWQeqZudrKIF62XdbSLShHKLVTmY2T+HZ5DItGyIPq6tniV5ISp1ThQrde3Bwkpfbbj/XhXUd2O6rK3ujP+lEAm0yV6gPN3wh2LtokMUMOwtvq7I6Un1R4F9SWqQbJg9LW4Wc/3nhOOtSE5Sw4lp7PgLQ7xkifa5x80DDTnslp8VXZX3/qoySsBoE+ktVRP/TNCgf0NDMoFE5iCSZWgRcHhJOfZVhXYPb9okuwgB/n54DkYOuV9dCyp+xUvp1fqdGp7u1Pl+Nk2WcBKf47wp2EqGT5s0UHwl4rtjNk6diX5zsYVvnLCszJrJfcRVKl0foaS6+ycM1/hS1gFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jPCXqi/U65BB6VinNnJwgiyIk9hy9wUXqeK8zlTJAwY=; b=ax7iQYtkA+iEPNvKlrx+8RTlGPxMM4YF2RM8uz0FK238SmtAM1UorcJZVqBamTc4w26mP5Mg/vbl4mC4Whp+X+sH2f61vbF3xFrp+nVnLb5IO6+m1dftRVZRLssroWZaGkyEQQpQcDhs5Di7TWB2mmVixDP7eccxMFn2IkMQVnuFZobi+PS8cPBNNe1zpl339sDgC1cSGfWUN472WTFAnE//WysBESzCHmNC19D6IWvQakfzplJS6zNJ9X5K3FnqBXew3b35ztRkATQgvhaUQEfejkdzzPgG4ca9U5WGMbYNVVU+NpZ2i1xNzO7lWHSqXnVltghu2nSCnuLVE0qVFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jPCXqi/U65BB6VinNnJwgiyIk9hy9wUXqeK8zlTJAwY=; b=UsKuO10iXzNIGr31hH0Q7/o5L542UE4hGK50yN2sNewqHIHzD5JarJAQNjoZO9APUDBu4DTcYDAL41kT81BNSbDk8rA1QTn6WA6GiPntnE4eUsJdyjuol8DiP/zA6SUP7K9n4KlxW6WDBvVZBPvXX3ZmDmUb5iPJFo94zlEkBmk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Stewart Hildebrand To: CC: Stewart Hildebrand , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= , "Oleksandr Tyshchenko" , Artem Mygaiev Subject: [PATCH v2 3/3] [FUTURE] xen/arm: enable vPCI for domUs Date: Thu, 6 Jul 2023 21:47:50 -0400 Message-ID: <20230707014754.51333-4-stewart.hildebrand@amd.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707014754.51333-1-stewart.hildebrand@amd.com> References: <20230707014754.51333-1-stewart.hildebrand@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT082:EE_|PH7PR12MB6858:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a0c01cc-2de7-442e-2f3d-08db7e8c6e84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fa3m/Y+/11O8fiTmtpMmA6moCdDqlq8uf7vfPz+lWLACpLr/ODwmXlX2kDTapRTTrPIJ8EO6Hn76IUWQym+g8nQ6juy0Awk+L96gGPGmwr7SMGmNf18nB9Wz2l/z6npc+Sf2HwGWt29q3OD3ZcdjTh9pjUXDFwTTI8dQjKaHklxRo2Td8J1Kda9/35qRGVIbtRcT2i2ljXCL5qQsVDPMR/5d5H2iB14eIc/O4BNDJ4jSC089hqlDzTjgU7cv0C9CkdKIc9L24W9Ixcjep+acvpOLmr1Nx6M7INMFNyCMsCJXKUf/9FADgjntyHhiBm6ERj46nOCIFtzk3HnjGmwKKzvNHHCyHh74sPwMfha0TCRoKaUp6MGzAbDIqkFe9V+qNEdrZ46vA1z2giDWZbioOgIOPyFVzDPtujZVqBosDQTDh14MkgUVhGq6/2DNZRcUEFxtAhV9xGuYs4ZZSVtiNmsavb84Mqzq4Dhj+cbItQTqH/6Vy7Irnt/vOQ6Puuo0H1KneyVvWwpLz6TxBgg94cJh1q5XfUwt12noi7kINswDZdD9DaCUa3diYGll7z1AjfeL3Jjfqlg3uJSz3Hnqnyus6wmv+h/xd4xDXBJfcfDZkFOospelipOBCqUgd7jQdFwdG1qKMxa3rFE3aHDvCrK4Lk/0KfTtmTzdU0tkzZF735V4STczqitUKjb3TKVBVH3qwNOE9rIH2+kIj6f0uYzmaEFDoXKM4HOGsN9WL/ueigHeZSqJqF1MLlTJG3kqgE6dSVk/Z7KOwjk52iipBw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(136003)(396003)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(5660300002)(2616005)(8676002)(40480700001)(86362001)(36860700001)(82740400003)(426003)(47076005)(83380400001)(40460700003)(8936002)(81166007)(54906003)(41300700001)(36756003)(316002)(6916009)(4326008)(70586007)(336012)(186003)(1076003)(6666004)(966005)(26005)(356005)(478600001)(2906002)(82310400005)(70206006)(44832011)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2023 01:49:41.6953 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a0c01cc-2de7-442e-2f3d-08db7e8c6e84 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6858 Remove is_hardware_domain check in has_vpci, and select HAS_VPCI_GUEST_SUPPORT in Kconfig. [1] https://lists.xenproject.org/archives/html/xen-devel/2023-06/msg00863.html Signed-off-by: Stewart Hildebrand --- As the tag implies, this patch is not intended to be merged (yet). Note that CONFIG_HAS_VPCI_GUEST_SUPPORT is not currently used in the upstream code base. It will be used by the vPCI series [1]. This patch is intended to be merged as part of the vPCI series. v1->v2: * new patch --- xen/arch/arm/Kconfig | 1 + xen/arch/arm/include/asm/domain.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 4e0cc421ad48..75dfa2f5a82d 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -195,6 +195,7 @@ config PCI_PASSTHROUGH depends on ARM_64 select HAS_PCI select HAS_VPCI + select HAS_VPCI_GUEST_SUPPORT default n help This option enables PCI device passthrough diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h index 1a13965a26b8..6e016b00bae1 100644 --- a/xen/arch/arm/include/asm/domain.h +++ b/xen/arch/arm/include/asm/domain.h @@ -298,7 +298,7 @@ static inline void arch_vcpu_block(struct vcpu *v) {} #define arch_vm_assist_valid_mask(d) (1UL << VMASST_TYPE_runstate_update_flag) -#define has_vpci(d) ({ IS_ENABLED(CONFIG_HAS_VPCI) && is_hardware_domain(d); }) +#define has_vpci(d) ({ (void)(d); IS_ENABLED(CONFIG_HAS_VPCI); }) struct arch_vcpu_io { struct instr_details dabt_instr; /* when the instruction is decoded */