From patchwork Mon Oct 9 19:57:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Hildebrand X-Patchwork-Id: 13414392 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 8AEA8CD612F for ; Mon, 9 Oct 2023 19:58:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.614456.955535 (Exim 4.92) (envelope-from ) id 1qpwOQ-0003Y7-8H; Mon, 09 Oct 2023 19:58:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 614456.955535; Mon, 09 Oct 2023 19:58: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 1qpwOQ-0003Y0-5E; Mon, 09 Oct 2023 19:58:18 +0000 Received: by outflank-mailman (input) for mailman id 614456; Mon, 09 Oct 2023 19:58: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 1qpwOP-0003Ue-06 for xen-devel@lists.xenproject.org; Mon, 09 Oct 2023 19:58:17 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20602.outbound.protection.outlook.com [2a01:111:f400:fe5b::602]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2df0c804-66de-11ee-9b0d-b553b5be7939; Mon, 09 Oct 2023 21:58:14 +0200 (CEST) Received: from MN2PR11CA0029.namprd11.prod.outlook.com (2603:10b6:208:23b::34) by BL1PR12MB5378.namprd12.prod.outlook.com (2603:10b6:208:31d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Mon, 9 Oct 2023 19:58:10 +0000 Received: from BL6PEPF0001AB58.namprd02.prod.outlook.com (2603:10b6:208:23b:cafe::39) by MN2PR11CA0029.outlook.office365.com (2603:10b6:208:23b::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36 via Frontend Transport; Mon, 9 Oct 2023 19:58:10 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB58.mail.protection.outlook.com (10.167.241.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Mon, 9 Oct 2023 19:58:09 +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.27; Mon, 9 Oct 2023 14:58:09 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) 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.27; Mon, 9 Oct 2023 12:57:59 -0700 Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Mon, 9 Oct 2023 14:57:57 -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: 2df0c804-66de-11ee-9b0d-b553b5be7939 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KzIRiSvH2+8AHEmJpDg3ZDlWH+d6pVDS1Fd5PxYl04hMFB4V3uYC2lyBn1422Urvp5KPuMRwThvDHBCSVruwoCqNvQUB8w3L+eATw+tbQueMBSM4OWe/2RhXIe3Dmio5mcBWfOc50whkETRStyvpTcHBozsLWOwE0VQtRWj0yIYrAwhAQkHZd2aiE0qH/OqV1Utk2nx/C/RxF+l5IBukl3czthFDwgMJyF2iL7BQ0k9anXEwHa0VqfKtmWR97lYVTpiS2N53zb60ZLbNIzlJXJG+zwX2WRkcBtnx9oZ0gY0iXAVFpA1nApEpUFjKWDZUYGa7mkem3iD8FXue0tRc7A== 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=5tFoqijnrmC0w4wv+Wq5XMW+oCAoSLFk0LkyRA0dK/o=; b=cp1RJ9A/hFW/CJ3WvcTo4jrOaxvUEACv1iVIpf+rcFu1sxhLGHKmloIlz3TUrIdMC0LnLfc4/nYKTENIZHwsSvuEBvJInXcfhJwx1RNAtGHuO3Y6J4GOH6YQXdQbHiLJLK8F7Exw6ek4R/8Gz/onpT8qlidztVTZKNt/C5Y/skWvDSUiuf4oeMi5cFsCBnYtR1OYcy7H3qzs1BNUrPQ/XyWhrblGnDY1tDW5VLjNfXHuQG3rBML7IdOjsSi/+WJKDS8/SiXlTjYFPDkMZ3Zb0t4KDVchNsNETywnF/Q3+bCOYevRD9JluZTU+42yFzhdTSIz3dVXrNrptkc8dFP8uw== 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=5tFoqijnrmC0w4wv+Wq5XMW+oCAoSLFk0LkyRA0dK/o=; b=HjBBSPZkc3JyTJBw5p4shdWBpWXzuikgf/l2bGiP8FUqrazOEaWxWSqrAIgZxaHwgl7u+3B0CoGM1StPAA1VzBChSZb4Aqbl2AN0aRSLniMP25qfZ2Z2dnQBxUSchLDlLlMnwiIll3ia9HF+484N6jfeiXJ/bWEHlWzAX6/pTlM= 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 , Stewart Hildebrand , Stefano Stabellini , Julien Grall Subject: [PATCH v3 1/5] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option Date: Mon, 9 Oct 2023 15:57:40 -0400 Message-ID: <20231009195747.889326-2-stewart.hildebrand@amd.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009195747.889326-1-stewart.hildebrand@amd.com> References: <20231009195747.889326-1-stewart.hildebrand@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB58:EE_|BL1PR12MB5378:EE_ X-MS-Office365-Filtering-Correlation-Id: 66e59378-0410-4dd6-06b6-08dbc9020fc2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HJU+0TlR3XQIkUK5cygvK1KAwvCDhR99BvJh6RIX96ULMBg18ERDufeIKbQ1V7eCWnsGntj2wYAD/uoF1RpyD0/oFPbo8FfBSmAxtpPvPwPj0haUT4nEH2jOjFUjAoN7FjJMrjmz9aUrtQ5ScTk6Efd2EDxXyCTfqgdYQiRxSkCZ5/IFjIHPUw377ikUKwLu5+0xWIK1VpJAag4O1jrh4reG1tdBTDXLHDOqZ5vFrQCpWva4vDFvh/GEjlMEM1flqbWyjhlc7z+6aQjNcCfL639oV77uZIcOHGv2KZzfcJeAR6KdZgqHw0aNM4YXYgr3kK4G+vljcfD8Fz2DOWPsYWMg4rzcReQy1h6xJ7QkOg61+yJMQ174SmMqRvaaLlwt4a5l9Yv9e0QGbUGz/CiBlYC2Ix2yVQFO2NUuedoEfiSAcD2Re2mvq+HvsIJJrjg0ojYz7JTLhrKdRHJ9LpG+obJxBMGX+L48IBwLtLNnuE22obXVCsZtlf4I96Cnbd7wicJCEEyEKRSfXMHvxsu9nJeq+WSqGuoy0GdjzRRqPzyiBOBujckkTTg7CmH6UXxMIKg4TIslxRjXYYSXLIENAbde3Xv2GCGyTN6bg/JlkCkPL/mev3OP6dzfIbI8NPbqKG8Z0sRrDZtMgl7dx68lBW77MpY5lzsCNM61qD1Y+a8J1bhSqMRKYhjSoS4xl91D3NS4dl5SXCS8sIiBg+xu4URpsHja21GsarvnKVw0E/BMTPR8iu5W/mimuNWx/PS1PfFoVjqG34TydbQveHun/Q== 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:(13230031)(4636009)(346002)(136003)(39860400002)(396003)(376002)(230922051799003)(186009)(451199024)(64100799003)(1800799009)(82310400011)(40470700004)(46966006)(36840700001)(2616005)(426003)(26005)(336012)(1076003)(40460700003)(81166007)(82740400003)(86362001)(36756003)(356005)(40480700001)(8936002)(44832011)(2906002)(4326008)(478600001)(6666004)(47076005)(36860700001)(8676002)(5660300002)(6916009)(316002)(966005)(41300700001)(54906003)(70206006)(70586007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 19:58:09.3767 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 66e59378-0410-4dd6-06b6-08dbc9020fc2 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: BL6PEPF0001AB58.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5378 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]) v2->v3: * add Julien's A-b 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-08/msg02361.html --- xen/arch/arm/Kconfig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 632dd9792e3c..fcb5a0920c5c 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -191,6 +191,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 Mon Oct 9 19:57:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Hildebrand X-Patchwork-Id: 13414393 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 1CAFFCD612F for ; Mon, 9 Oct 2023 19:58:38 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.614457.955546 (Exim 4.92) (envelope-from ) id 1qpwOW-0003sL-IG; Mon, 09 Oct 2023 19:58:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 614457.955546; Mon, 09 Oct 2023 19:58:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qpwOW-0003sC-FJ; Mon, 09 Oct 2023 19:58:24 +0000 Received: by outflank-mailman (input) for mailman id 614457; Mon, 09 Oct 2023 19:58:23 +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 1qpwOV-0003Ue-GX for xen-devel@lists.xenproject.org; Mon, 09 Oct 2023 19:58:23 +0000 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2062f.outbound.protection.outlook.com [2a01:111:f400:7e8c::62f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 31fde5ea-66de-11ee-9b0d-b553b5be7939; Mon, 09 Oct 2023 21:58:21 +0200 (CEST) Received: from MN2PR12CA0011.namprd12.prod.outlook.com (2603:10b6:208:a8::24) by DM4PR12MB6277.namprd12.prod.outlook.com (2603:10b6:8:a5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36; Mon, 9 Oct 2023 19:58:17 +0000 Received: from BL6PEPF0001AB54.namprd02.prod.outlook.com (2603:10b6:208:a8:cafe::f6) by MN2PR12CA0011.outlook.office365.com (2603:10b6:208:a8::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36 via Frontend Transport; Mon, 9 Oct 2023 19:58:17 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB54.mail.protection.outlook.com (10.167.241.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Mon, 9 Oct 2023 19:58:17 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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.27; Mon, 9 Oct 2023 14:58:16 -0500 Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Mon, 9 Oct 2023 14:58:14 -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: 31fde5ea-66de-11ee-9b0d-b553b5be7939 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X98xNMBmrTWnBRF/PrQMksTjP8Ww9l7DhxPVIrTMb0qhdX34siUTpiqOvplT3+9kk+BZsMklLZtgsbsJxtuJxcUHEUT9dRfdWjyG/x72aQ7PKILsTsOnY93h7W6M8o1i87KYzV+/mJ7ypAvSDcPNt7C7m9TvRxRMdFoYcWnKfof8tP52/MulZQGlfrGpDd1s7k8tBnEhcsbffPeUg5JLHQGIWb1Bw3kZB+Ra5xlNUuom1p5BCS8DhIQi8Pq7baWcAd+PON62UWZ21vSEhhaDNaMGCULhyKnQ6w15MQlveNo/pdDp9WG6VmlJolOOQVOEe/83WSjBY9JFI+KgvNT2Hw== 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=EmlGqKWuCnjtMUmBTT4XxuCpBI3jirRl8+SAumX9cok=; b=ZQqI+mAJ0N1Hp1G9+KNw7nn5vPqp56HjgteOaXvbsRoVzb+uBYV1IGAZPHqCrThxlee8KprxdVUehT3O2wiCP+kl54LC4TepGXfT1qDJrKmQCfADpC4bVioMHdSxUBfprXkIsyGf1OHB3fLMNiJaDsmP5Ik0p9PrU1yo8KbEbQU5otZnSDT2ROeWb51/LgXKRPhIdKcmAjONm0GpKMf8uCKRkJkOcUxu22ZrzZwZbnk+pghs5EkDap+XdrqU0YAAyktBjqLHFuIgEPNFiMG4A/+qxayJKpSWoVtMBcNIPiJMoaVD22IoTLBGWRDQG/2DcAVeyUNWLXGdduLRBJ/UxA== 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=EmlGqKWuCnjtMUmBTT4XxuCpBI3jirRl8+SAumX9cok=; b=TDcyOLKfGKn7fSuxu9WtSMZcpyI1o+SSUCnqTZ/ErUQwMsvWZdBEw3/WPqRIkxAEU8AoyDcuqXQ30DrKj5bp4VGl9knlyfQn0tYbxYuEgvMzxWnuofWLT9F6JSVF9vvsVsKXpocM/29w7BoH93IBgSI0KJzOc1y5tJhSe8qkl5w= 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 , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [PATCH v3 2/5] xen/arm: pci: plumb xen_arch_domainconfig with pci info Date: Mon, 9 Oct 2023 15:57:41 -0400 Message-ID: <20231009195747.889326-3-stewart.hildebrand@amd.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009195747.889326-1-stewart.hildebrand@amd.com> References: <20231009195747.889326-1-stewart.hildebrand@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB54:EE_|DM4PR12MB6277:EE_ X-MS-Office365-Filtering-Correlation-Id: 6640b990-1e25-4928-6937-08dbc9021498 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oA8S9neqiZOn8F+7xLbug+1XADmhxrFbnUqtBM9F3nEO6v/esyxHcb1ZoZRwwF3hEq0BXD2nm5sPzpWe86BYFRElyDXWteQn8hIrIQzLottSyJOIrj7itS8ktqvzUGsaMX9GyctsybcvU9LKFXTGSMYKg7mGyUZiKSzI7dKshzSbyQmUKDLjQqMHErhBciGCWG8kGA2Ww0fMfu9tnrYpIrHKaF0TMAQtoZJQerjVQjIlcAv/0bkZTpKWKle2gEic0CKPtIFPjWXNo8Zw58y7TBGPeJSAKfuljXVwnJUVmJ4iZ5h8WE7Wmc/eVdU2JrfBQ0GGmd3GSW8/a0R2FdjXjvUQ0n4Z1TAEf7rmn/b/zE/ezcEP7/yRIpdhlITnZKTgVlsK0wOlz5beIsvmZDyG8hBFO9BQm/b5j5Zdg+b1/gYRUp1eLVNdT1LKftjI7T9rfI6T0taEWaIO9VNoAcETOzj2/6H99ofmByL64+3AsrCDodMjur9xBPEGcUubA4Dk//clL51sWf0W+a3jIK3Hhb9V6T3LXL6ZxMfLlnGI6VFn6sU9+lAk9Ls9FbV2vcvZDOu9qrdZSLhmBkq6dWtmGPa5vEPBS0R36qBF4tSR3MEy8LfYn/yFBh6a2FPkSoGqnNl2lEzdSvlOnZUQs9AC8na8RLfnP7NyUwKQapQv8+4LkwSO4mF/2TXdUEljgp3nn08TYqkidhsoMSMR9UWhagYYWSaG2rIt8kdQ3xuUOmjX5ii1BTsCCbAfLLkQ3MSSL3BzpLV8ZP3Bnl1lhdO36w== 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:(13230031)(4636009)(396003)(39860400002)(376002)(346002)(136003)(230922051799003)(82310400011)(451199024)(64100799003)(186009)(1800799009)(36840700001)(46966006)(40470700004)(86362001)(82740400003)(81166007)(356005)(36756003)(40460700003)(2906002)(40480700001)(478600001)(4326008)(44832011)(41300700001)(5660300002)(8936002)(8676002)(336012)(426003)(1076003)(2616005)(54906003)(83380400001)(6916009)(7416002)(70586007)(70206006)(6666004)(316002)(26005)(36860700001)(47076005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 19:58:17.5238 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6640b990-1e25-4928-6937-08dbc9021498 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: BL6PEPF0001AB54.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6277 Add a flag to struct xen_arch_domainconfig to allow specifying at domain creation time whether the domain uses vPCI. Add a corresponding flag to struct arch_domain to indicate vPCI and set it accordingly. Bump XEN_DOMCTL_INTERFACE_VERSION since we're modifying struct xen_arch_domainconfig. Signed-off-by: Stewart Hildebrand --- v2->v3: * new patch --- xen/arch/arm/domain.c | 10 ++++++++++ xen/arch/arm/include/asm/domain.h | 2 ++ xen/include/public/arch-arm.h | 4 ++++ xen/include/public/domctl.h | 2 +- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 28e3aaa5e482..9470c28595da 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -687,6 +687,13 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config) return -EINVAL; } + if ( (config->arch.pci_flags & XEN_DOMCTL_CONFIG_PCI_VPCI) && + !IS_ENABLED(CONFIG_HAS_VPCI) ) + { + dprintk(XENLOG_INFO, "vPCI support not enabled\n"); + return -EINVAL; + } + return 0; } @@ -737,6 +744,9 @@ int arch_domain_create(struct domain *d, BUG(); } + if ( config->arch.pci_flags & XEN_DOMCTL_CONFIG_PCI_VPCI ) + d->arch.has_vpci = true; + if ( (rc = domain_vgic_register(d, &count)) != 0 ) goto fail; diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h index 99e798ffff68..0a66ed09a617 100644 --- a/xen/arch/arm/include/asm/domain.h +++ b/xen/arch/arm/include/asm/domain.h @@ -119,6 +119,8 @@ struct arch_domain void *tee; #endif + bool has_vpci; + } __cacheline_aligned; struct arch_vcpu diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index 6a4467e8f5d1..5c8424341aad 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -300,6 +300,8 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t); #define XEN_DOMCTL_CONFIG_TEE_OPTEE 1 #define XEN_DOMCTL_CONFIG_TEE_FFA 2 +#define XEN_DOMCTL_CONFIG_PCI_VPCI (1U << 0) + struct xen_arch_domainconfig { /* IN/OUT */ uint8_t gic_version; @@ -323,6 +325,8 @@ struct xen_arch_domainconfig { * */ uint32_t clock_frequency; + /* IN */ + uint8_t pci_flags; }; #endif /* __XEN__ || __XEN_TOOLS__ */ diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index a33f9ec32b08..dcd42b3d603d 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -21,7 +21,7 @@ #include "hvm/save.h" #include "memory.h" -#define XEN_DOMCTL_INTERFACE_VERSION 0x00000016 +#define XEN_DOMCTL_INTERFACE_VERSION 0x00000017 /* * NB. xen_domctl.domain is an IN/OUT parameter for this operation. From patchwork Mon Oct 9 19:57:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Hildebrand X-Patchwork-Id: 13414394 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 5CD89CD612F for ; Mon, 9 Oct 2023 19:58:53 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.614461.955556 (Exim 4.92) (envelope-from ) id 1qpwOn-0004QJ-07; Mon, 09 Oct 2023 19:58:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 614461.955556; Mon, 09 Oct 2023 19:58:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qpwOm-0004QC-TX; Mon, 09 Oct 2023 19:58:40 +0000 Received: by outflank-mailman (input) for mailman id 614461; Mon, 09 Oct 2023 19:58:40 +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 1qpwOl-0003BY-Uh for xen-devel@lists.xenproject.org; Mon, 09 Oct 2023 19:58:39 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20630.outbound.protection.outlook.com [2a01:111:f400:7e89::630]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3c661224-66de-11ee-98d3-6d05b1d4d9a1; Mon, 09 Oct 2023 21:58:39 +0200 (CEST) Received: from MN2PR14CA0024.namprd14.prod.outlook.com (2603:10b6:208:23e::29) by PH0PR12MB7840.namprd12.prod.outlook.com (2603:10b6:510:28a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Mon, 9 Oct 2023 19:58:34 +0000 Received: from BL6PEPF0001AB55.namprd02.prod.outlook.com (2603:10b6:208:23e:cafe::c1) by MN2PR14CA0024.outlook.office365.com (2603:10b6:208:23e::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37 via Frontend Transport; Mon, 9 Oct 2023 19:58:34 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB55.mail.protection.outlook.com (10.167.241.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Mon, 9 Oct 2023 19:58:34 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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.27; Mon, 9 Oct 2023 14:58:34 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 9 Oct 2023 14:58:33 -0500 Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Mon, 9 Oct 2023 14:58:31 -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: 3c661224-66de-11ee-98d3-6d05b1d4d9a1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LJOZwGEsBeE83cSOr9msavyWscOISD6/IPDPwLViRPbZ4Q72d883YDW3ykht2uDR0ZQMjFKSYVAfpqsBK33kG+3sowM9UcKcCrZLjEfUh8b8wueYh6Na4M06zcuauK9tvysJonuNv4RdLkWAHJVj5K3y19bMHlHTSBWTAyZAG0SNXPipSSqLhM+Vewu5LLW65bBV+OKY2HMLRtea+wIV2QZL398byhTSPBmQ5uvYDRpQpjnXMkcb06E0Hc4Y/dzqcvJaXj8THL8Pl8ypdFZp3CvXPGzz7/1/QrwZUdq2cm5St/oJJMOCc5VFKmO1mOooHFt2ccX0NO+K83d6cxBGKQ== 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=LOZmhrmNckz6NkJakVLSz/H8hX/OOGQLeh4TaQxTWhU=; b=J2KugG39pg7JAxKg+FDYS9NCrP7yR8wxfiWa0dEwSl8iiyyML0apPMbOBN74f0L2pLbLpDCWv8rOacc0d2sq+GaHFaDT3bl/OK5MgK66W/tZ5rcb3xk1P+MG4yuZrdKFSSABN1c31m8rc5hQX6hYqugX3wsCTSyv+rVS3ZP7WGeaQ4mt9eXaCJrKHqHoc3SV1NqzHkH+jWmfUQhJ1Mq6WVUZLn8me7LcqQzgqailNNU3oqJ3HC5aDFa9UYVwFCOXr/QLe36qIMt6eMGrJGlRPYKO3Yavvoa8V9W1sZI7Rw/f7X2KthR9cElSyFnfzv4GHiCsMpIkVUiM94AIvLKyBg== 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=LOZmhrmNckz6NkJakVLSz/H8hX/OOGQLeh4TaQxTWhU=; b=SwoZCxbb1qlbtGR4K8kkDIzfhowXdf732ZI1eJXx9lbU0vJSwezvqQTqz8MNHWvNffNCMGv7HpzoGQ/HB9q46bxMtB4bxfZtt5cRD4HUObXVW6EkF1TithQTqNDVZwcnyFcSigd1dHtjJEF0QnzpyLUzSEhsWFxEL7WROE0XpVA= 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 , Rahul Singh , "Stewart Hildebrand" Subject: [PATCH v3 3/5] xen/arm: make has_vpci() depend on d->arch.has_vpci Date: Mon, 9 Oct 2023 15:57:42 -0400 Message-ID: <20231009195747.889326-4-stewart.hildebrand@amd.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009195747.889326-1-stewart.hildebrand@amd.com> References: <20231009195747.889326-1-stewart.hildebrand@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB55:EE_|PH0PR12MB7840:EE_ X-MS-Office365-Filtering-Correlation-Id: 775c1503-b014-443b-b828-08dbc9021eaa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TxCCyZBVM1GbquonS/9QKZN/EYaLRIgQV84EYUSoRTp27dREMtSNQZpZfEwkSv54ovsImuOn7XNhU+ZZ0F7zBoxtsNrzgP6Hmg+NYxfBWhojimZyNoXWWDCYsaIm3Ks60jFgDbUD9R+/6wl9saV4ixDthzHLT3Yj0I5S7xFc6f6ezD3dVMAsUcQcwFQwgnT9oRN2LdF4PxFYeOREGaPzGiFfMaW/LqzrQFznrOZ3FyNpJrmWbKBr+atW1bvpeUlt65Byr8bGPebuuOH+WqPr0qAYk6fSqGf2hM4NiRLyzQCWbcWPYX8DYeoPFF2A6l4dlEzy5iaovkdj0rTy5M1o01p2LTvcJqQLOGTLTo8Is7YYT705sXUxbLd9comPva2VAH/ypK7ImZpVfhwZF9Z+zmw0k4vl3lZ3k9f9HVQRIyTtmLK6Ws3EyrrEcND0Z8/NUrD4eWpKdnQ4i+kp+8qpVoE7pAk0P9gfmUXA0qJV+ktcY20W7bFcsdWrQSHKRDyU3GflgYBoA4S4Jlk8mZg8LwcSrKmEA/qiPxHj6SfkiL8mIzhK4dVTr1JA6pheNzdz/XWWS/wbE0Na5f1PyPrYhyr/eaSAmZfApytbLa/CuMm937gWxRvNgxDgQ7jOm9nRXqdz6xn5WYUEFQrmEf0Y9fJcIyke7Jc7HArPURcUrJh+ArNTzR74miLYqqaQpcHYX8I0TLCx9zYCngqaSAsGwxFRxmGBfy/E2WZRepNYqsm03tLomZZ9se5l3k5dCkIPbJ3arUVUsrLnLcLUa/VDmZCujdNENGdENNbVIrRMi6g= 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:(13230031)(4636009)(136003)(396003)(346002)(376002)(39860400002)(230922051799003)(1800799009)(82310400011)(64100799003)(451199024)(186009)(36840700001)(40470700004)(46966006)(356005)(86362001)(81166007)(36756003)(40460700003)(40480700001)(82740400003)(2906002)(966005)(478600001)(41300700001)(8936002)(5660300002)(4326008)(44832011)(8676002)(6666004)(426003)(2616005)(336012)(1076003)(83380400001)(54906003)(36860700001)(316002)(6916009)(70206006)(47076005)(26005)(70586007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 19:58:34.4210 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 775c1503-b014-443b-b828-08dbc9021eaa 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: BL6PEPF0001AB55.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7840 From: Oleksandr Andrushchenko VPCI is disabled on ARM. Make it depend on d->arch.has_vpci to enable the PCI passthrough support on ARM. 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. v2->v3: * use d->arch.has_vpci since plumbing struct arch_domain with a vPCI flag 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-08/msg02361.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 0a66ed09a617..ebba2c25dceb 100644 --- a/xen/arch/arm/include/asm/domain.h +++ b/xen/arch/arm/include/asm/domain.h @@ -300,8 +300,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) ( (d)->arch.has_vpci ) struct arch_vcpu_io { struct instr_details dabt_instr; /* when the instruction is decoded */ From patchwork Mon Oct 9 19:57:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Hildebrand X-Patchwork-Id: 13414395 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 1B2AFCD6133 for ; Mon, 9 Oct 2023 19:59:11 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.614471.955566 (Exim 4.92) (envelope-from ) id 1qpwP7-000571-8k; Mon, 09 Oct 2023 19:59:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 614471.955566; Mon, 09 Oct 2023 19:59:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qpwP7-00056s-5b; Mon, 09 Oct 2023 19:59:01 +0000 Received: by outflank-mailman (input) for mailman id 614471; Mon, 09 Oct 2023 19:59:00 +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 1qpwP6-0003Ue-08 for xen-devel@lists.xenproject.org; Mon, 09 Oct 2023 19:59:00 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20600.outbound.protection.outlook.com [2a01:111:f400:7eab::600]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 48871664-66de-11ee-9b0d-b553b5be7939; Mon, 09 Oct 2023 21:58:58 +0200 (CEST) Received: from MN2PR13CA0008.namprd13.prod.outlook.com (2603:10b6:208:160::21) by SA1PR12MB6680.namprd12.prod.outlook.com (2603:10b6:806:253::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.27; Mon, 9 Oct 2023 19:58:53 +0000 Received: from BL6PEPF0001AB57.namprd02.prod.outlook.com (2603:10b6:208:160:cafe::da) by MN2PR13CA0008.outlook.office365.com (2603:10b6:208:160::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.20 via Frontend Transport; Mon, 9 Oct 2023 19:58:53 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB57.mail.protection.outlook.com (10.167.241.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Mon, 9 Oct 2023 19:58:53 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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.27; Mon, 9 Oct 2023 14:58:52 -0500 Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Mon, 9 Oct 2023 14:58:51 -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: 48871664-66de-11ee-9b0d-b553b5be7939 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cQuDWzum0CuhmzM7egEHV7OjwogQRjxtzGaO5JaKbbcfkzZkKCIR4YsM9odwy5zmgiHf7iOg48+fvlbVxL5pfBjTMUj2C/0IJhTugrsQvKv7Yt1IJ9taDKr3skc5fD/31T/MEbGJC9qTe0id6xZlU2HsaWgO4sKxvBlF4LXvZY7ls4+BgT9o/S4mPWXxbo7w7yEzJos0Kpo5G/Ai+l0QHUGG/lpiDAba3JF+tYRxJuq4cKIUoH82xVEqElrwneteYRE1zsmW2sk6mxnfP+YDEGam6fqFZTJpn9XWsw38UTo3s7c0mWWDiHWDc/cIkZ51g4Msh0sri88T2AFhAjjw1g== 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=I6WEOoMs+pzdjzi1jL0lpLVB/53RytXMX+c0QXchhzI=; b=AspjglAjvn3niV+v2naQZ8tQ3Y29rJdAa6Dx43duQoygJJ224fk6se8Vhh8dxdwH+69L2qKRAp1tDU7KLH9TLFrnkbpXAAeDHu1nwcZOcdJAPH5lsCDrwBNMQf5hwpG61fPCYrMcbSpiA2MLntkA2jH+h3ECP98B/1wWGtyM6T24zC66HYBePB/+XeSTZ04NAKmcdT3lq4mYxZzBwlwITW+NGHvg4/r4cUgmpA2JUFFDacsnPR+LvFx3PlJm+2SriE/XVqyHQQdvsgaOfnRkWpqsTMVLHOxo/Qbt6jkkNXHF/baOOxJGo4nBKrg/H9efOb1DpTyruOMumQ+uyrSJ+g== 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=I6WEOoMs+pzdjzi1jL0lpLVB/53RytXMX+c0QXchhzI=; b=KXwNpb13M2p6gkH/DuwsaWqyoIiEiPQcFW2pfbuOOomco6fFD9IHmlvh0eW+OWfm+ZZhrhVSCqYiwPiuySp8s0SomFukRaAaqLlRyTYexL8eRu6ePvANY5bKtmA6QzXutv2P1TBha+My0M6RbtXb3VKVOWRQD+oHsJQ6Oeu+bgo= 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 Subject: [PATCH v3 4/5] xen/arm: enable vPCI for dom0 Date: Mon, 9 Oct 2023 15:57:43 -0400 Message-ID: <20231009195747.889326-5-stewart.hildebrand@amd.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009195747.889326-1-stewart.hildebrand@amd.com> References: <20231009195747.889326-1-stewart.hildebrand@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB57:EE_|SA1PR12MB6680:EE_ X-MS-Office365-Filtering-Correlation-Id: bf522a57-67e7-4c2a-149d-08dbc90229e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: px2o0iB+6/+jM6kCe48/vmf50l1tVLUGgXBHhbdXe4IEOGcRo2BeRtozkbCIIVw2HOLC1LWZ1w2z9PytOKzGe+g3hE0ymtU/Gw2tEsC0LEDxQNwtX0/0PjeZ+ELn6NsKql1VQPtClRYuuTVH83PWgQiYXR/LQvmSW07mLDYve49qFU4yCMI97Ajuso66Lf8KeO8S7LdZIsjB9sB0Hvkwtn2w5ZXMvcwuPLnCLKYOP+G7WkMI4VI04wzts2yLNCOCAayNlS43os4RptKmbUz0EZQg0D/6RwaMCp4N5MWwlSrNGV93o4BxhqYdtLyRGoErXlKts7i1rsGNmwno84l+N3uJW1CMh18Gce53k4rP+0p88BxhsdHTbbpQ1LPtad222Talir723pyiDDwmw7XMxT02YMxX195HA8rL1OYzRvnV+6P+dMEtALAnhpgZdZG98Ur5lDfR4TbEXVQh1VNUHaxcaelMMF3Rma3QXCi9HKXa+kxdj0mphfA3fIfuOOGRgFjS9WS6Oia2cEv09fFmb6Pn7J+LXcAPG1E0LRk6kdAgr3+aoHdzq2TcrZENjuY5gHfciwlTG7lSqddfDAigrIn2WeS15xDbYxvSu2hdqH135bBzhWb2By7jtFgozK3XgWIPOI1ERcmv/3+q/2AKEEURiMRm7xdUHbZHKGM6oGBTzh6fE1o6WkNEzKDb82G7fCsJAjEDatKd3xKmHw+QXqs4m6ErzpXn9wPUSUW5bS0I4e74cMZInOuOQ3tXv0/w 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:(13230031)(4636009)(346002)(136003)(39860400002)(396003)(376002)(230922051799003)(186009)(1800799009)(82310400011)(64100799003)(451199024)(46966006)(36840700001)(40470700004)(36860700001)(41300700001)(81166007)(2616005)(356005)(70206006)(316002)(6916009)(54906003)(70586007)(966005)(2906002)(44832011)(5660300002)(8936002)(4326008)(8676002)(478600001)(40460700003)(86362001)(47076005)(40480700001)(1076003)(426003)(336012)(26005)(6666004)(82740400003)(36756003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 19:58:53.2388 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf522a57-67e7-4c2a-149d-08dbc90229e2 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: BL6PEPF0001AB57.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6680 Set the pci flags in xen_arch_domainconfig to enable vPCI for dom0. Signed-off-by: Stewart Hildebrand --- Julien had a suggestion to make this conditional on pci_passthrough_enabled [1]. However, in v5 of the PCI ARM SMMU series [2], we propose removing the pci_passthrough_enabled flag. If pci_passthrough_enabled is gone, the conditions under which vPCI should be enabled for dom0 aren't entirely clear to me (other than CONFIG_HAS_VPCI=y). v2->v3: * new patch [1] https://lists.xenproject.org/archives/html/xen-devel/2023-10/msg00475.html [2] https://lists.xenproject.org/archives/html/xen-devel/2023-10/msg00210.html --- xen/arch/arm/domain_build.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 24c9019cc43c..c1174535f430 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -3912,6 +3912,9 @@ void __init create_dom0(void) panic("SVE vector length error\n"); } + if ( IS_ENABLED(CONFIG_HAS_VPCI) ) + dom0_cfg.arch.pci_flags = XEN_DOMCTL_CONFIG_PCI_VPCI; + dom0 = domain_create(0, &dom0_cfg, CDF_privileged | CDF_directmap); if ( IS_ERR(dom0) ) panic("Error creating domain 0 (rc = %ld)\n", PTR_ERR(dom0)); From patchwork Mon Oct 9 19:57:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Hildebrand X-Patchwork-Id: 13414396 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 5EBAECD612F for ; Mon, 9 Oct 2023 20:03:36 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.614476.955576 (Exim 4.92) (envelope-from ) id 1qpwTJ-0007AV-PT; Mon, 09 Oct 2023 20:03:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 614476.955576; Mon, 09 Oct 2023 20:03:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qpwTJ-0007AO-Mo; Mon, 09 Oct 2023 20:03:21 +0000 Received: by outflank-mailman (input) for mailman id 614476; Mon, 09 Oct 2023 20:03:20 +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 1qpwPP-0003BY-Hf for xen-devel@lists.xenproject.org; Mon, 09 Oct 2023 19:59:19 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2062f.outbound.protection.outlook.com [2a01:111:f400:fe59::62f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 54d874eb-66de-11ee-98d3-6d05b1d4d9a1; Mon, 09 Oct 2023 21:59:18 +0200 (CEST) Received: from BLAPR03CA0165.namprd03.prod.outlook.com (2603:10b6:208:32f::9) by MW6PR12MB8957.namprd12.prod.outlook.com (2603:10b6:303:23a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36; Mon, 9 Oct 2023 19:59:15 +0000 Received: from BL6PEPF0001AB53.namprd02.prod.outlook.com (2603:10b6:208:32f:cafe::82) by BLAPR03CA0165.outlook.office365.com (2603:10b6:208:32f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37 via Frontend Transport; Mon, 9 Oct 2023 19:59:13 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB53.mail.protection.outlook.com (10.167.241.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.14 via Frontend Transport; Mon, 9 Oct 2023 19:59:13 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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.27; Mon, 9 Oct 2023 14:59:12 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 9 Oct 2023 14:59:12 -0500 Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Mon, 9 Oct 2023 14:59:11 -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: 54d874eb-66de-11ee-98d3-6d05b1d4d9a1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y/anAwwkZngEKRyIF/ZqHr+NR4hGb1WJK3OIlbi47P5FNBT3ulYSRSnhM7/Uue0pFhQfvhTK53Yu5mQGcNOO/zBbjBJ+nvarCTHN0At7SgJtpz23igClfI+P5hSOuL9qr+fJdSqa2ERCiAMxrkGkC1gCKpPLcRagA/BtM967yonuGW3TWiuxVGAlSmyNhUJkQGY8Xg0OEroXjl0zBmA+dk2KkEzh8QBqshqCii67qPD6aVQ5thoxD5gR0qhH5vGVBjNrCbyY2YMjLT1+yVfCZ/dUomSazhgCiykixcpS8anMCKqJEbV9xpqvBWkHW5IxWNsLBTK0Jo9Cj/rQL9YiUw== 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=3Wqj1m40g3xzBzCIIdI1/Tnlmb7S3hlwdRDoDUE9rvM=; b=noUmLRDL6YMkUym/bT304o3W78Ibf9CGAwzkbM2nYzXRRgxPtgNGb/zX98slCCgxNzQBlBJRffioUoIJ2aSb5rVPjDgQzJlNYyZcinMJnXqYPs0ntDo5UdihqisSIMb37ajlbUAReV6MKH2gYvof0oawBljanf1Lfe5dI7SbCNnUqXrkLzAX9Se8ybLkkMbmildtn9pQ+/yTkxQ/chtI15duXlvzdPP4c6lqopLfizUhhexMimB/tA2uQoLwq1llxU5YVL8Adq5pjaLcxufJyNBJJaFucKLytBpOUgjEMGkTTdiXT/AAXJm7gFOg/ShENz3onpi296FarxvIash0bQ== 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=3Wqj1m40g3xzBzCIIdI1/Tnlmb7S3hlwdRDoDUE9rvM=; b=gOlxOMgvp7k7LEt0CYMqiJDHe99I59Y/3Xzfg+D4dKgv5F5rM0V2aLLHevvGXlg1GfPK04Lbx7P3oWNPsSWP8TEWlIusEBLBC54TDgI5IpHfMHAgOyYKYMBst3XeFwBKo6qrH3UpVeAHPLOCLSvehRGlrv+W/V6V9vNNxc176gc= 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 , Wei Liu , Anthony PERARD , Juergen Gross , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v3 5/5] [FUTURE] xen/arm: enable vPCI for domUs Date: Mon, 9 Oct 2023 15:57:44 -0400 Message-ID: <20231009195747.889326-6-stewart.hildebrand@amd.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009195747.889326-1-stewart.hildebrand@amd.com> References: <20231009195747.889326-1-stewart.hildebrand@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB53:EE_|MW6PR12MB8957:EE_ X-MS-Office365-Filtering-Correlation-Id: ba39dcb4-52ac-4e55-d66b-08dbc90235a7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nhYyEbDac9PtHgA1RXkabYZapbM+IAhiYaAtu2loOexcgYu5ZXjMcNTlUK9Aenv3zVZI0BLiAwpxfY4OHa0vtwVMIOTT+Fbxag0fWEOF19rdlB1ajPFTrhmly8NV1Ky+RIRmZhxONhjhlndf0LsWQMYdSNF5EcVhwBZaeR9ewRrD7JRJLCF2TLKUUJcpcJdlhuE7dttVpvTDn+t+3bkeL7aW4gnLEFKcNlY3cNlqxhC2qALo605PYEgO0a/IXBVRiNgHuAsIRUaFLW7PZZ3SPSvjLa1X1hP2FcpgCigrYe0owuCn4tA6MLeaOmrsCmc1kptRKA+7gpPHLXGRCgJg4qdfOa9+r3epEzwkAxkPG3eUj2Xko8xw04zD5zAjcPTH8POaAk2B0Mdyj1UDHEW2VyDno2RaQU16RVYKWqV3A1721223n58XtbbP98zn0rgRbRzRaf7Nwjur8u4S3C7pcn6FF0Z7+lDEFCdUfvR6n7kV1M54LoiZ5Q4kanhBLONRlIfIm3pwBLjb7MCpTQOzXK/L6Yynd+GepYGaAKC/PjfX1+028zfIWkRoB76teSi+o28qB+yafXLIegsDV8YS4ic6REOHUbl6cY+PNt+nkeFutaeWPxobYEiYuezQ5ZLperV0QQyY4g6AQmqqkitbdRVffdusVmAloHDFzLpPht37lVCSs4akiO2K2Yd2Uxs4qq98fcJu2Ed9/TwLKGFSDCu4P/Ayn3a6dGPPHrNOfkjG1Sfmf+H7AXM7dK73OZdk 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:(13230031)(4636009)(376002)(346002)(39860400002)(136003)(396003)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(82310400011)(40470700004)(46966006)(36840700001)(356005)(86362001)(36756003)(81166007)(82740400003)(40480700001)(2906002)(478600001)(966005)(41300700001)(8676002)(4326008)(5660300002)(44832011)(8936002)(6666004)(336012)(2616005)(426003)(1076003)(40460700003)(316002)(6916009)(54906003)(26005)(70206006)(70586007)(36860700001)(47076005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 19:59:13.0054 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba39dcb4-52ac-4e55-d66b-08dbc90235a7 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: BL6PEPF0001AB53.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8957 Select HAS_VPCI_GUEST_SUPPORT in Kconfig for enabling vPCI in domUs. Set the pci flags in xen_arch_domainconfig to enable vPCI if a pci device has been specified in the xl domain config file. 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. I'll coordinate with Volodymyr to include this in the vPCI series or resend afterwards. Meanwhile, I'll include it here until the Kconfig and xen_arch_domainconfig prerequisites have been committed. v2->v3: * set pci flags in toolstack v1->v2: * new patch [1] https://lists.xenproject.org/archives/html/xen-devel/2023-08/msg02361.html --- tools/libs/light/libxl_arm.c | 3 +++ xen/arch/arm/Kconfig | 1 + 2 files changed, 4 insertions(+) diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c index 15391917748c..931b2f8852ff 100644 --- a/tools/libs/light/libxl_arm.c +++ b/tools/libs/light/libxl_arm.c @@ -222,6 +222,9 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc, config->arch.sve_vl = d_config->b_info.arch_arm.sve_vl / 128U; } + if (d_config->num_pcidevs) + config->arch.pci_flags = XEN_DOMCTL_CONFIG_PCI_VPCI; + return 0; } diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index fcb5a0920c5c..6f33373f9035 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -196,6 +196,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