From patchwork Tue May 7 08:23:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henry Wang X-Patchwork-Id: 13656396 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 50667C10F1A for ; Tue, 7 May 2024 08:24:38 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.717918.1120423 (Exim 4.92) (envelope-from ) id 1s4G7U-0003zO-5T; Tue, 07 May 2024 08:24:16 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 717918.1120423; Tue, 07 May 2024 08:24:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s4G7U-0003zH-1P; Tue, 07 May 2024 08:24:16 +0000 Received: by outflank-mailman (input) for mailman id 717918; Tue, 07 May 2024 08:24:14 +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 1s4G7S-0003kv-NM for xen-devel@lists.xenproject.org; Tue, 07 May 2024 08:24:14 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20600.outbound.protection.outlook.com [2a01:111:f403:2009::600]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2ee27881-0c4b-11ef-b4bb-af5377834399; Tue, 07 May 2024 10:24:13 +0200 (CEST) Received: from BY5PR17CA0004.namprd17.prod.outlook.com (2603:10b6:a03:1b8::17) by DS7PR12MB6046.namprd12.prod.outlook.com (2603:10b6:8:85::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.42; Tue, 7 May 2024 08:24:09 +0000 Received: from CO1PEPF000066ED.namprd05.prod.outlook.com (2603:10b6:a03:1b8:cafe::f) by BY5PR17CA0004.outlook.office365.com (2603:10b6:a03:1b8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.39 via Frontend Transport; Tue, 7 May 2024 08:24:09 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1PEPF000066ED.mail.protection.outlook.com (10.167.249.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 7 May 2024 08:24:09 +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.35; Tue, 7 May 2024 03:24:08 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) 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.35; Tue, 7 May 2024 03:24:07 -0500 Received: from henry-MS-7D54.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Tue, 7 May 2024 03:24:06 -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: 2ee27881-0c4b-11ef-b4bb-af5377834399 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DBZ36jiPbkTm799GQponF1AV0KXQ0h8xTCvyihe3HEzrVbM0qHS9kxzYgPqGrrkemqbcLx+N8kaZSks/QQjAD8EETQJ6VH3vi+kyrMG348bTdH7uMT4gsxLH4UFo5rFKhnKIkB7VZIhhxWJOh0oPPn5USPIYROaNO0LSgwltm9iEqhVc4JGCAKGYgbKxZiAzUa+dgar7Ded7yO1WYq3qymwtiOFQC+ECtff2kdXbX0eiN/sE8SMWazrwwBLHZxnROlH3kp1gRe8SrVX7tmlvh+5CQ1L5uZ2bVYUxAfa4p7Blw8wXpG2zYBD+80SNnvOx75lUOo88xV23KKtfQ4N6Mw== 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=wD4Edd/ZUQf6Rvz7ZHLdHdBtw+JBBmdZ+XcaUxuIswo=; b=fJUGebMYw3QKaf8MVhrI4sWQ61lDNyNMFSgqIaht8vkVjoI4msse874aeUjKzWpTGpLUxhbvJrnrKW5Z++FwObtMIHqnBPqjFzLs/6Le6HrHw+w6i3I2QEHg2Yup37bvOdzhyk6U2II1NMfVxNTwap5GDofq3dlpC0PQJzhIoIzVjZnFQP9zK6IdD1T71tDnKUX94GbwFauauo8/k5Ydtnvl+rUrugeeLcvVlYGAq5BFhJquba63CiDKnetnbCgzb1tLMwl44FlUP3Vxz430H+qrRRkkJCpEgomLi/he8iJuBRUzdtCMMLY/etSc00IeWOl+vXhhjloCO911l4rQYg== 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=wD4Edd/ZUQf6Rvz7ZHLdHdBtw+JBBmdZ+XcaUxuIswo=; b=iLT1x5zNabal3zNcpLs2N+k84rObxRzW30yoV6H8RcR9T0WejI779Gp0N062nzsVk3ZZwRo8O+rxeJ6zyQCarVKb18ToYwl+S6XJyaDRnMvC9zlcwteS6ewzVa7b9HdHwLIpn4fsDiKD9qZd7tuPSnlUplOPgrMfueSQ2vBysZk= 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 Subject: [PATCH v2 1/2] xen/common/dt-overlay: Fix missing lock when remove the device Date: Tue, 7 May 2024 16:23:59 +0800 Message-ID: <20240507082400.25146-2-xin.wang2@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240507082400.25146-1-xin.wang2@amd.com> References: <20240507082400.25146-1-xin.wang2@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: xin.wang2@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066ED:EE_|DS7PR12MB6046:EE_ X-MS-Office365-Filtering-Correlation-Id: 4de37103-84ff-4aef-8b8a-08dc6e6f1162 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|36860700004|376005|1800799015|82310400017; X-Microsoft-Antispam-Message-Info: 25w2L+oTI6tJh9+1ACt4/ZjMLfP34T3DdYnO7/+YykwAbXBof3YcS7frECySsv1aIqis/gj4VPNaNHln3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fzLiFVoUzvGPJAzxI8yqOS6qdLh4PpjmkslOG1F14tIIw/mcpu4Y8f5p8ouZJXVY8QwWXDILeBp+hXAYXb4WYt4HDDHqdEVPRMMVCFg/s/VatLAD+v+JltmyerKfBTP+DKKKrtzQEsJeWlh7zctsWNjQLMC6T+WzpwmJBBuhRNRqdQiX+fnIGvfLYsnOXOMBGR/w6o41PczP9EGF7uGww3PqAQL1pScr0DvAsrJwgUurMDs3Sc8sjH9EKv50CrCk 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)(36860700004)(376005)(1800799015)(82310400017);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2024 08:24:09.0145 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4de37103-84ff-4aef-8b8a-08dc6e6f1162 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: CO1PEPF000066ED.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6046 If CONFIG_DEBUG=y, below assertion will be triggered: (XEN) Assertion 'rw_is_locked(&dt_host_lock)' failed at drivers/passthrough/device_tree.c:146 (XEN) ----[ Xen-4.19-unstable arm64 debug=y Not tainted ]---- (XEN) CPU: 0 (XEN) PC: 00000a0000257418 iommu_remove_dt_device+0x8c/0xd4 (XEN) LR: 00000a00002573a0 (XEN) SP: 00008000fff7fb30 (XEN) CPSR: 0000000000000249 MODE:64-bit EL2h (Hypervisor, handler) [...] (XEN) Xen call trace: (XEN) [<00000a0000257418>] iommu_remove_dt_device+0x8c/0xd4 (PC) (XEN) [<00000a00002573a0>] iommu_remove_dt_device+0x14/0xd4 (LR) (XEN) [<00000a000020797c>] dt-overlay.c#remove_node_resources+0x8c/0x90 (XEN) [<00000a0000207f14>] dt-overlay.c#remove_nodes+0x524/0x648 (XEN) [<00000a0000208460>] dt_overlay_sysctl+0x428/0xc68 (XEN) [<00000a00002707f8>] arch_do_sysctl+0x1c/0x2c (XEN) [<00000a0000230b40>] do_sysctl+0x96c/0x9ec (XEN) [<00000a0000271e08>] traps.c#do_trap_hypercall+0x1e8/0x288 (XEN) [<00000a0000273490>] do_trap_guest_sync+0x448/0x63c (XEN) [<00000a000025c480>] entry.o#guest_sync_slowpath+0xa8/0xd8 (XEN) (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) Assertion 'rw_is_locked(&dt_host_lock)' failed at drivers/passthrough/device_tree.c:146 (XEN) **************************************** This is because iommu_remove_dt_device() is called without taking the dt_host_lock. dt_host_lock is meant to ensure that the DT node will not disappear behind back. So fix the issue by taking the lock as soon as getting hold of overlay_node. Fixes: 7e5c4a8b86f1 ("xen/arm: Implement device tree node removal functionalities") Signed-off-by: Henry Wang --- v2: - Take the lock as soon as getting hold of overlay_node. v1.1: - Move the unlock position before the check of rc. --- xen/common/dt-overlay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/dt-overlay.c b/xen/common/dt-overlay.c index 1b197381f6..25d15cbcb1 100644 --- a/xen/common/dt-overlay.c +++ b/xen/common/dt-overlay.c @@ -429,6 +429,8 @@ static int remove_nodes(const struct overlay_track *tracker) if ( overlay_node == NULL ) return -EINVAL; + write_lock(&dt_host_lock); + rc = remove_descendant_nodes_resources(overlay_node); if ( rc ) return rc; @@ -439,8 +441,6 @@ static int remove_nodes(const struct overlay_track *tracker) dt_dprintk("Removing node: %s\n", overlay_node->full_name); - write_lock(&dt_host_lock); - rc = dt_overlay_remove_node(overlay_node); if ( rc ) { From patchwork Tue May 7 08:24:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henry Wang X-Patchwork-Id: 13656397 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 54018C41513 for ; Tue, 7 May 2024 08:24:38 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.717919.1120433 (Exim 4.92) (envelope-from ) id 1s4G7Z-0004G9-CD; Tue, 07 May 2024 08:24:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 717919.1120433; Tue, 07 May 2024 08:24: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 1s4G7Z-0004G2-8x; Tue, 07 May 2024 08:24:21 +0000 Received: by outflank-mailman (input) for mailman id 717919; Tue, 07 May 2024 08:24:19 +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 1s4G7X-0003kv-A7 for xen-devel@lists.xenproject.org; Tue, 07 May 2024 08:24:19 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20601.outbound.protection.outlook.com [2a01:111:f403:2416::601]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 316d029e-0c4b-11ef-b4bb-af5377834399; Tue, 07 May 2024 10:24:17 +0200 (CEST) Received: from BY5PR17CA0010.namprd17.prod.outlook.com (2603:10b6:a03:1b8::23) by SA3PR12MB7877.namprd12.prod.outlook.com (2603:10b6:806:31b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Tue, 7 May 2024 08:24:12 +0000 Received: from CO1PEPF000066EB.namprd05.prod.outlook.com (2603:10b6:a03:1b8:cafe::dc) by BY5PR17CA0010.outlook.office365.com (2603:10b6:a03:1b8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.39 via Frontend Transport; Tue, 7 May 2024 08:24:12 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1PEPF000066EB.mail.protection.outlook.com (10.167.249.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7544.18 via Frontend Transport; Tue, 7 May 2024 08:24:11 +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.35; Tue, 7 May 2024 03:24:10 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) 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.35; Tue, 7 May 2024 03:24:10 -0500 Received: from henry-MS-7D54.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Tue, 7 May 2024 03:24:08 -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: 316d029e-0c4b-11ef-b4bb-af5377834399 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cir1bWtVTDDZiusjo6Y2irTyEaA96THmEn15TBtAcvuTY5AfHv3ZGPbf57uoqAQLfYlMmFNty8QLU3WKyHDiiR+JLk1ElMELPnigFFx62AWMfbgBKO8pL0mUdZujAekwLMDz7PFKN8JaHE3igiPsOEKSQD8j3+pVbx2To8j9MAtZkJgzEqmc8a+WadKj1DoiZCJrSWFZXLrGPC0MMov4GbJdTLi81pQj7BbtSnR9OpDwfXl9Ka4DRiT3rrZJXBO7x5mH0icVXmnkwnuzoRtE0Mrnli5aeEbuNU6Oh4J3Ib5bG5UV8NrpheRPJcOzluAyvaPSrENtgH+2m+onDSsZbA== 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=UCoREhGdiGdJh4nqENuQ2tKLWDW2JKQq7+BvW87Gh/k=; b=fP0JsAyw9MdF+mZ3W/l+XokiHx7jTAavRMKbmi3KZSfcaoOhTp4+Gbr1T+XTSSEv1g94XIkndLag7PKwuibueaUERgL6SMgealrD2ptsdU+/uvUfrU4y2+NB9coIScQ7VeCW/IZkUpxqGmOa/8014q2ilC6aktMF2cgAd/d6NhibUdwRSNgkPdn5YPz2XuTQn3b6vSYbsi+IgwguIuYsV2gAJYYj0gZRtGFOpHm9fd4U6lXApK7beE2KWFV0BRbsGRZjcbxCp3iOT/x1qZt8zOwdpA9MZE107+nHkRdas3cGWk1A8FWgxXSFLbpRsFRSn/TgrXgZG2yR1/63JeaR/Q== 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=UCoREhGdiGdJh4nqENuQ2tKLWDW2JKQq7+BvW87Gh/k=; b=lBmaY/qh33tdt1A44CaQYAPcL5ZpldxmpbgxVLzChrlM322DIA3OlZUI3SS9mPUX84B02i07J0wAVDzwUypaOxdgK3N4X4RrPukpRHQF+jSQSEglwPT51VKIC7MiHBxTfEbBTqt4a/hTxjfyWl0BF0E8JMKrZ+gJcnf9kaNozuM= 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 , Anthony PERARD , Anthony PERARD Subject: [PATCH v2 2/2] tools/xl: Correct the help information and exit code of the dt-overlay command Date: Tue, 7 May 2024 16:24:00 +0800 Message-ID: <20240507082400.25146-3-xin.wang2@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240507082400.25146-1-xin.wang2@amd.com> References: <20240507082400.25146-1-xin.wang2@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: xin.wang2@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066EB:EE_|SA3PR12MB7877:EE_ X-MS-Office365-Filtering-Correlation-Id: 1814a71d-a3d2-44dc-f6f5-08dc6e6f12b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|1800799015|376005|36860700004; X-Microsoft-Antispam-Message-Info: ir3m0+WSeaR40l1L9cg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JbLNAVAabEKjOZ9H1RF+QwT1QdRKzVvU5BUqOUpREmob0ONEEQg1Xzy3IjEB/8ptvivE0Y+2mRHyqQZF0Drw6keAHiIAJoWOYrTqNpExRaDfgkc3rGKRrb+WWggzyotFtoeugwtaejTOBrpuSoE7EonlwrRRS9lY7sHC+NJmuyW+eAXTVZckXdfaxXo1hI3puiKW/Qi4ORQRg1g7JIASmke9KzxhnihpnjC0/M4brDdXTWPH6/bzHCOcMJ1MBUKooih+OBM0TLPPaVvZXWm6MPbLPwtzvdIewL1dM= 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)(82310400017)(1800799015)(376005)(36860700004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2024 08:24:11.2414 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1814a71d-a3d2-44dc-f6f5-08dc6e6f12b3 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: CO1PEPF000066EB.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7877 Fix the name mismatch in the xl dt-overlay command, the command name should be "dt-overlay" instead of "dt_overlay". Fix the exit code of the dt-overlay command, use EXIT_FAILURE instead of ERROR_FAIL. Fixes: 61765a07e3d8 ("tools/xl: Add new xl command overlay for device tree overlay support") Suggested-by: Anthony PERARD Signed-off-by: Henry Wang --- v2: - New patch --- tools/xl/xl_vmcontrol.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c index 98f6bd2e76..02575d5d36 100644 --- a/tools/xl/xl_vmcontrol.c +++ b/tools/xl/xl_vmcontrol.c @@ -1278,7 +1278,7 @@ int main_dt_overlay(int argc, char **argv) const int overlay_remove_op = 2; if (argc < 2) { - help("dt_overlay"); + help("dt-overlay"); return EXIT_FAILURE; } @@ -1302,11 +1302,11 @@ int main_dt_overlay(int argc, char **argv) fprintf(stderr, "failed to read the overlay device tree file %s\n", overlay_config_file); free(overlay_dtb); - return ERROR_FAIL; + return EXIT_FAILURE; } } else { fprintf(stderr, "overlay dtbo file not provided\n"); - return ERROR_FAIL; + return EXIT_FAILURE; } rc = libxl_dt_overlay(ctx, overlay_dtb, overlay_dtb_size, op);