From patchwork Wed Apr 24 03:34:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henry Wang X-Patchwork-Id: 13641121 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 E1DBFC4345F for ; Wed, 24 Apr 2024 03:35:24 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.711014.1110625 (Exim 4.92) (envelope-from ) id 1rzTPZ-0002J7-1k; Wed, 24 Apr 2024 03:35:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 711014.1110625; Wed, 24 Apr 2024 03:35:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rzTPY-0002J0-Uk; Wed, 24 Apr 2024 03:35:08 +0000 Received: by outflank-mailman (input) for mailman id 711014; Wed, 24 Apr 2024 03:35:07 +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 1rzTPX-0002In-9K for xen-devel@lists.xenproject.org; Wed, 24 Apr 2024 03:35:07 +0000 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20600.outbound.protection.outlook.com [2a01:111:f403:2415::600]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id a2c7f7d7-01eb-11ef-b4bb-af5377834399; Wed, 24 Apr 2024 05:35:04 +0200 (CEST) Received: from MN2PR20CA0015.namprd20.prod.outlook.com (2603:10b6:208:e8::28) by SN7PR12MB6931.namprd12.prod.outlook.com (2603:10b6:806:261::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.44; Wed, 24 Apr 2024 03:35:01 +0000 Received: from MN1PEPF0000ECDB.namprd02.prod.outlook.com (2603:10b6:208:e8:cafe::e8) by MN2PR20CA0015.outlook.office365.com (2603:10b6:208:e8::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.31 via Frontend Transport; Wed, 24 Apr 2024 03:35:00 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by MN1PEPF0000ECDB.mail.protection.outlook.com (10.167.242.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7519.19 via Frontend Transport; Wed, 24 Apr 2024 03:35:00 +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.35; Tue, 23 Apr 2024 22:35:00 -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.35; Tue, 23 Apr 2024 20:34:59 -0700 Received: from henry-MS-7D54.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Tue, 23 Apr 2024 22:34:56 -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: a2c7f7d7-01eb-11ef-b4bb-af5377834399 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fg3ahqCV3rveQ+wJD5cgRjWa9VjEjxPsvWqjFZTTPMWlNdIkIyGwX10jNxEv3qx9vkXPJEvBGYf+vLRhpPmEO3wwPO/qS7n6VtXIq+0kZXRynXcyHtO/r4tMiU2JkSp6UFbtK5RvDXSlWqq1faz3XJZXUZF3BAXf4redcHYyVcAMA0uKb3p9FvFyvJA+G7Mi92ELhMBjZezrnFq9ob/iVsdYlYGZScIJYXXcEvNlvFom6uuF/62UlttRnJiji11qQqlGzyxBnI6BeMzdSLayJ/7+aT7034HKXBNhtfs9NHqNS0ysfd4wB2fTHmppjNXngevvzqdKwl0vcw/OBBrMmQ== 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=i8xiVSK43JcuQ2nthoi/16vjOz+ZRWIMT3UJle6ixKY=; b=jPGyE1+6Y1ZkNe1YepJU1VzXoQBe3lvC6MYIZhB6UI92S3KaAJO3qWhifa/BuH7zvuC49JSEtIrI0hD7rgk1GmsQSAsREF/MYAyAuQBjEF2RAMZTZwKsLSBRvg6zR0IcfYFb62MNuWOUhJCGUWKdL/0po5JPRXR/sRe/gcUbGvENcYtJPFJ9fQBmvIrpSBFTpOcty9NJsnOIahFHy0v3iJ0d/qUBs1NsD84mzEiO+JVrEAoyAmi1pbZKnxCR17e9gI+hhfeFi59bkWDSfrFxV2c1xRk0iiE+WqcGS6cpvK6+ws7Bm88/391hTtJ+GWsO86KN2cY95O11E0zUIaQDEA== 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 (0) 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=i8xiVSK43JcuQ2nthoi/16vjOz+ZRWIMT3UJle6ixKY=; b=pqqbba8rBWwPSfbnA2K5pAJwJn1QjNGBcHXI6DKQ9LQfuQU6DRxCk9alArlFhOvUE2ZjRDq4Y+oHEs9tbNGFhUX3NOQ8w7tC5AviKiya4gB+zS3Nbo9aHRLgngIeaGMnUGOMWaTuLWmjp34pjPwN+eb1wWtK/GDtPGwdNBBk9do= 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: Henry Wang To: CC: Henry Wang , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" , Anthony PERARD , Juergen Gross , Andrew Cooper , George Dunlap , "Jan Beulich" Subject: [PATCH 00/15] Remaining patches for dynamic node programming using overlay dtbo Date: Wed, 24 Apr 2024 11:34:34 +0800 Message-ID: <20240424033449.168398-1-xin.wang2@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECDB:EE_|SN7PR12MB6931:EE_ X-MS-Office365-Filtering-Correlation-Id: 5007a93b-7ff4-4aef-6e36-08dc640f8576 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Y/fg4vtXc2UemWhpdpCzD+ssy4r+B3J?= =?utf-8?q?BGjr1yURkIUZ0kaY5tOOy4s81nCB4DRqOnV34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5XaULOUp/6SHEIvCs364/msZPJ7dfa1/aaefDJeiIv5?= =?utf-8?q?w/9VNULY7/UzRm08JDKP4l7l34xgsbClM66HEmgsEBdhjM/i9j0dU2OSRw+F5npJ6?= =?utf-8?q?ao6WvcJy/rM2vxXs2QvVbjRPTsfebJ1DR+c62gEAKj9lK1FyVt/JXherrrZ9c55d0?= =?utf-8?q?J431+wk6150Y2Y2PVb5s7NYa6Qur1yc/PCYFFh/si5GBSQqPZOuhL+SQiwWfj6mG8?= =?utf-8?q?LUYpvLhx144n+OIf0oS7+UmNH2VWth5aqqFhIWPmPDL9I+9Fgqo/8Tj8kDbn3bKzX?= =?utf-8?q?0PoA/erVBLTmqf6FRYeRe40TPRiulxIOjRiPod2vfhuG9kZSUl7o9XYzkayoZTEUD?= =?utf-8?q?Y0VanNQNgOLm6b3CYibepe0wB9YCS3GRnBLxkoW0OQQbZIUtxY5XRrdNT2+cG0lwq?= =?utf-8?q?xNmxJbAv8lcQ?= 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)(7416005)(1800799015)(82310400014)(376005)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2024 03:35:00.5717 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5007a93b-7ff4-4aef-6e36-08dc640f8576 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: MN1PEPF0000ECDB.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6931 Hi all, This is the remaining series for the full functional "dynamic node programming using overlay dtbo" feature. The first part [1] has already been merged. Quoting from the original series, the first part has already made Xen aware of new device tree node which means updating the dt_host with overlay node information, and in this series, the goal is to map IRQ and IOMMU during runtime, where we will do the actual IOMMU and IRQ mapping to a running domain and will call unmap_mmio_regions() to remove the mapping. Also, documentation of the "dynamic node programming using overlay dtbo" feature is added. Patch 1 is a fix of [1] which is noticed during my local test, details please see the commit message. Gitlab CI for this series can be found in [2]. [1] https://lore.kernel.org/xen-devel/20230906011631.30310-1-vikram.garhwal@amd.com/ [2] https://gitlab.com/xen-project/people/henryw/xen/-/pipelines/1265297506 Henry Wang (1): xen/commom/dt-overlay: Fix missing lock when remove the device Vikram Garhwal (14): xen/arm/gic: Enable interrupt assignment to running VM xen/arm: Always enable IOMMU tools/libs/light: Always enable IOMMU tools/libs/light: Increase nr_spi to 160 rangeset: Move struct range and struct rangeset to headerfile xen/overlay: Enable device tree overlay assignment to running domains tools: Add domain_id and expert mode for overlay operations tools/libs/light: Modify dtbo to domU linux dtbo format tools/xl: Share overlay with domU tools/helpers: Add get_overlay get_overlay: remove domU overlay xl/overlay: add remove operation to xenstore add a domU script to fetch overlays and applying them to linux docs: add device tree overlay documentation docs/misc/arm/overlay.txt | 172 +++++++++ tools/helpers/Makefile | 8 + tools/helpers/get_overlay.c | 507 ++++++++++++++++++++++++++ tools/helpers/get_overlay.sh | 81 +++++ tools/include/libxl.h | 8 +- tools/include/xenctrl.h | 5 +- tools/libs/ctrl/xc_dt_overlay.c | 7 +- tools/libs/light/libxl_arm.c | 9 +- tools/libs/light/libxl_dt_overlay.c | 90 ++++- tools/xl/Makefile | 2 +- tools/xl/xl_cmdtable.c | 2 +- tools/xl/xl_vmcontrol.c | 539 +++++++++++++++++++++++++++- xen/arch/arm/device.c | 8 +- xen/arch/arm/dom0less-build.c | 3 +- xen/arch/arm/domain_build.c | 2 +- xen/arch/arm/gic.c | 4 + xen/arch/arm/include/asm/setup.h | 3 +- xen/common/dt-overlay.c | 223 ++++++++++-- xen/common/rangeset.c | 31 +- xen/include/public/sysctl.h | 4 +- xen/include/xen/rangeset.h | 32 +- 21 files changed, 1654 insertions(+), 86 deletions(-) create mode 100644 docs/misc/arm/overlay.txt create mode 100644 tools/helpers/get_overlay.c create mode 100755 tools/helpers/get_overlay.sh