From nobody Thu Nov 21 21:22:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1728681642; cv=pass; d=zohomail.com; s=zohoarc; b=ApCkB82XOZVK2IP40RBilzfu69Lj11SSDNFowaAKGeQLTHY00AOzTLF1ldi1Mvj3J7RLphu1iukZKlMNxnhFUzfj1daCpcgge6vXoAQeeljXkoAfIC6JY2xpdJXvl1KZLYjeGZVIXJ0vVZZiEK1mvHwmA6n6LAa8k3jYmFrjiWQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728681642; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vY3yq9h5CtR2y/1Tci7pEa0GcD7LcLoRuyzXb6JpApI=; b=DpjKriCMnsN4GrakhUXPiWExhD/OlSkQ0XVGf9lktBy2s4wzjNi5kQFiHz3R9e0BnKt5xOuKcWf8UFfajzAYjhtnhXIG5VbqS1lpFI+rmsmSh9PZjxzvbDbOpmED3SqIKq1pLHEzc/VTaYz3MEgBDfFRxZX5Yz74CCSMIUEBzzI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1728681642276510.714942712385; Fri, 11 Oct 2024 14:20:42 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.817380.1231408 (Exim 4.92) (envelope-from ) id 1szN3R-0002bD-F4; Fri, 11 Oct 2024 21:20:09 +0000 Received: by outflank-mailman (output) from mailman id 817380.1231408; Fri, 11 Oct 2024 21:20: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 1szN3R-0002b6-CX; Fri, 11 Oct 2024 21:20:09 +0000 Received: by outflank-mailman (input) for mailman id 817380; Fri, 11 Oct 2024 21:20:08 +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 1szN3P-0002b0-UN for xen-devel@lists.xenproject.org; Fri, 11 Oct 2024 21:20:07 +0000 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2062e.outbound.protection.outlook.com [2a01:111:f403:2407::62e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 9534c99b-8816-11ef-99a2-01e77a169b0f; Fri, 11 Oct 2024 23:20:05 +0200 (CEST) Received: from CH2PR17CA0002.namprd17.prod.outlook.com (2603:10b6:610:53::12) by CY8PR12MB7265.namprd12.prod.outlook.com (2603:10b6:930:57::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.19; Fri, 11 Oct 2024 21:20:01 +0000 Received: from CH3PEPF0000000D.namprd04.prod.outlook.com (2603:10b6:610:53:cafe::41) by CH2PR17CA0002.outlook.office365.com (2603:10b6:610:53::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.20 via Frontend Transport; Fri, 11 Oct 2024 21:20:01 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CH3PEPF0000000D.mail.protection.outlook.com (10.167.244.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8048.13 via Frontend Transport; Fri, 11 Oct 2024 21:20:01 +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.39; Fri, 11 Oct 2024 16:20:00 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) 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.39; Fri, 11 Oct 2024 16:20:00 -0500 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.39 via Frontend Transport; Fri, 11 Oct 2024 16:19:58 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 9534c99b-8816-11ef-99a2-01e77a169b0f ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=th6PUN7uPDLZw2SOnzfSZl6fph7+g1qYcNvKD9nP2vp6dpKk3OmyUuXK0dNueS0bZJmsfdAOXCg6eyTxuXTxpOb3w1OJvPICqPTc0iINJ+CQvgE3FSAHbS52ZkRSqAIJtK6MoZcpA4J5o0lTyzWpt/IRU1yaRVCb9gSpwmlpRtAA+vYXiI5nwSzODSldO5rFTyeCOue94SF0oxGm2uQpEFCH2DG6YDS686VeWmX8MvvrMnxaBw+w0oW+u4G4o0bMedJr631XHQYVfzy2LIwEWyKAP24y1Z/mhzYB5BK/nKlRmTKWdYgq9WIKXyfThxD9f6kMizuxrf00x11qiSrKBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=vY3yq9h5CtR2y/1Tci7pEa0GcD7LcLoRuyzXb6JpApI=; b=VfyWyC3XALpM1nrzwos89ZWFPmzK1AVAqWtnrqlLZxTFG7rebdMmyLGcBDMc78n9+RR5s2IxrpmyIpa/0xPiFUhxsAabJ2ziSatNhdk0CVHwao/zva92Op1eCiE8Vtiry2BvaU5U2o0XljMQ4iASs1ZDTnIh64D8sy2dDKZi0JAi7NbeK1ez+90u63i1AU/eJiFiHfp83QekHY7c/zkwG+UY+zsHlsJh+9J/CWu1RVlplulLJfVoVuqGO1VdKDqVYFC+ssj9ETxbsQrsVOHhBglNLrJnBuc5kpBVecEVKtlBWOKJZCIfCDBF4zgbDu7Nl5GQgUirNxj6lNP0EiEP4g== 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=vY3yq9h5CtR2y/1Tci7pEa0GcD7LcLoRuyzXb6JpApI=; b=cKHkGKfxEjXWrvmsm3gLoEi/HdCObdJdqXBxA16pjtd1TdmB0G1tMYwrPZhTLZjOJrD2TXCng3MtQVJdGYTP+9+0JnQv+1b06V+c9/gM4ksbMUzVLJbSA0isCcfUynMMqTi5zNpug4rZzVcG9Mo2PExSEw/OCM5Dmp1+Gusx3Vw= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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 , Michal Orzel , "Volodymyr Babchuk" Subject: [PATCH] xen/arm: dom0less: cope with missing /gic phandle Date: Fri, 11 Oct 2024 17:19:56 -0400 Message-ID: <20241011211957.447290-1-stewart.hildebrand@amd.com> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF0000000D:EE_|CY8PR12MB7265:EE_ X-MS-Office365-Filtering-Correlation-Id: c5cdf08c-1349-45ca-f329-08dcea3a775b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?WZ/tHk7zrabOfx0OvBgw0ndmWyubnhx+f0ixHbmfYEyATPG+cZ+cKqoHHqIL?= =?us-ascii?Q?b8CfeTRVIKsxMZsDWVd0Ed/WLI9ARdyBnBFjzzodpkZR+ZniN2tR6yPO7ReX?= =?us-ascii?Q?M3LwzyQQFAbFwysleJJEhlw6QWUm01XzQrRQcQC7+GWOZH2maAFfVrnR5mlh?= =?us-ascii?Q?NW7OhIWBAlmnojXNXD9QA59BPZfv/0olV7aRCy1Fwj2sUubfrOPOiZKmMuHJ?= =?us-ascii?Q?8GJr0/v5z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-ascii?Q?UDn2XYJVzZpPT64pSChOdUB0CoWE7nlpUykD6A0vJpzB9AHV2NXAetwKvYC1?= =?us-ascii?Q?ZqeSAB7su8/KgVC575UuyKC9nn35+txHnO3h2zn9taFpHvO8NbS/MSfVKNBn?= =?us-ascii?Q?V7anV2TUsV419XZO+ohXIgOSsdmnxeuHgcUweAUIMpi/cl84f6NFsTKFvcwD?= =?us-ascii?Q?1Nj24gkDqo38CaLX6t4yP85deiztiUr4+22jO4yC2QRUOZTum3ssob3AETBQ?= =?us-ascii?Q?IZjhGjg=3D?= 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:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 21:20:01.0504 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5cdf08c-1349-45ca-f329-08dcea3a775b 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: CH3PEPF0000000D.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7265 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1728681644199116600 Content-Type: text/plain; charset="utf-8" If a partial DT has a /gic node, but no references to it, dtc may omit the phandle property. With the phandle property missing, fdt_get_phandle() returns 0, leading Xen to generate a malformed domU dtb due to invalid interrupt-parent phandle references. 0 is an invalid phandle value. Add a zero check, and fall back to GUEST_PHANDLE_GIC. Signed-off-by: Stewart Hildebrand Reviewed-by: Stefano Stabellini --- xen/arch/arm/dom0less-build.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c index 09b65e44aed3..f328a044e9d3 100644 --- a/xen/arch/arm/dom0less-build.c +++ b/xen/arch/arm/dom0less-build.c @@ -554,7 +554,10 @@ static int __init domain_handle_dtb_bootmodule(struct = domain *d, */ if ( dt_node_cmp(name, "gic") =3D=3D 0 ) { - kinfo->phandle_gic =3D fdt_get_phandle(pfdt, node_next); + uint32_t phandle_gic =3D fdt_get_phandle(pfdt, node_next); + + if ( phandle_gic !=3D 0 ) + kinfo->phandle_gic =3D phandle_gic; continue; } =20 base-commit: 76a54badf890f56ff72644593c0fbc72138e13aa --=20 2.47.0