From patchwork Thu Sep 19 10:42:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Orzel X-Patchwork-Id: 13807631 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 132A1CE8D79 for ; Thu, 19 Sep 2024 10:45:43 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.800599.1210549 (Exim 4.92) (envelope-from ) id 1srEfE-0004HV-GN; Thu, 19 Sep 2024 10:45:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 800599.1210549; Thu, 19 Sep 2024 10:45:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1srEfE-0004HM-CP; Thu, 19 Sep 2024 10:45:32 +0000 Received: by outflank-mailman (input) for mailman id 800599; Thu, 19 Sep 2024 10:45:30 +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 1srEfC-00043V-Sf for xen-devel@lists.xenproject.org; Thu, 19 Sep 2024 10:45:30 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2061d.outbound.protection.outlook.com [2a01:111:f403:200a::61d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 48ee939a-7674-11ef-99a2-01e77a169b0f; Thu, 19 Sep 2024 12:45:28 +0200 (CEST) Received: from MW4PR03CA0345.namprd03.prod.outlook.com (2603:10b6:303:dc::20) by CH3PR12MB8877.namprd12.prod.outlook.com (2603:10b6:610:170::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.21; Thu, 19 Sep 2024 10:45:23 +0000 Received: from SJ5PEPF000001EE.namprd05.prod.outlook.com (2603:10b6:303:dc:cafe::ea) by MW4PR03CA0345.outlook.office365.com (2603:10b6:303:dc::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Thu, 19 Sep 2024 10:45:23 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by SJ5PEPF000001EE.mail.protection.outlook.com (10.167.242.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Thu, 19 Sep 2024 10:45:23 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 19 Sep 2024 05:45:22 -0500 Received: from XIR-MICHALO-L1.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 19 Sep 2024 05:45:21 -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: 48ee939a-7674-11ef-99a2-01e77a169b0f ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UVKZMbu0d4kxDPoLiPDirlr79T+vjcV8r8GWaHR0S0WczbBejICVB8TT4VGXBG3svNM9wcfUNpTitp2Kn9yo3tH+WMoDrP8VtAfu/RuWS8I4CmdfjWBInF98bBAM7Nl6ypHzzB17fuIWzjcoN1yWNn5+01c3Zt2Dj6G4hwHqFHtiipz/jyxNbl4Is23bGOCOKnfCzKjYDuhzd0BjOE2n3o3xPhmxBUEKWH0e3VqDgBdo1GneV5fhOf7QmUPwx9/A29pzps0b494v2OXi3BwaHP2/Y5YCMrmPQREiLGiyyo1PPnQ/jloWe8Kd6rd8N/K2xLxjfyq0H0jLRJ+7BPQyTA== 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=5a8d8Dmwmijg24rkMyGYaLxqRaF0Hxcf7ag2CMKmCKk=; b=Uer9SpeXdmutUf2Wo9TwEx0opDpxSOJoKWL/nSoWQP4pZu/oHYLwQ5bfdMx0OFKBVst5Zj5yt7DpfJMDji2k6H74seZSZK5YlPAo9bANDwxHZ8qNXMSFXf0770pESYzo6tUuOrgE7vplXbaZ1tHCGr0Fz/6A/cb29u9Rhs9GOqmZQA3/7Yj5cXxHYsDIU9wClGep+J+Wpj3SCYVukpLfKwWlka4WZwO7bk/3U4IebdCtvbRsCPLNpD0pSwYWpR8TgH9PbJnlWUH3mJ9HBGjIep0+fIGeApAPAAWTQO+W3L0H+wKzTQLhbruqFCmSdLz01So6EKSOVCSTG2JB14WMfg== 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=5a8d8Dmwmijg24rkMyGYaLxqRaF0Hxcf7ag2CMKmCKk=; b=mCLRoTMOXs7b/8TvNgJ9UP4BdB6GXSCBlCn7OL+1nAf+maq0SSYo0/962661oWMCXp89PZRw4adtQ/0J6A2WNAIYEVwTqlog4LWx9PZGWr/MTP76vU+iHdE6JOn7nOFmxnLZkpjBNFVsVbi8DKxdX0i36DH+mhmg9S3ZTTFjVXg= 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=SATLEXMB03.amd.com; pr=C From: Michal Orzel To: CC: Michal Orzel , Stefano Stabellini , Julien Grall , Bertrand Marquis Subject: [PATCH 2/4] device-tree: Remove __init from unflatten_dt_alloc() Date: Thu, 19 Sep 2024 12:42:36 +0200 Message-ID: <20240919104238.232704-3-michal.orzel@amd.com> X-Mailer: git-send-email 2.37.6 In-Reply-To: <20240919104238.232704-1-michal.orzel@amd.com> References: <20240919104238.232704-1-michal.orzel@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: michal.orzel@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001EE:EE_|CH3PR12MB8877:EE_ X-MS-Office365-Filtering-Correlation-Id: 75d06a8f-ba17-4984-4760-08dcd8982a2e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: aDgpht7bjY6vIERjxIgsV5GedP5BOMFbMM4eKxqm1LoSbMNi4faVG4ya08BnZtF8cUsTbuIM0mnTne2hRoXDkDV1sXYJqA8+LhFNQvv4nDFN7AJGdV6y/t+ZXr/VXFeoBL13ce0EUSkIfS2zoq/b/ZFk/2DRGllaWROq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49/7OtjB04RIqTfDE/b7CrSPIWEE7Slsg2mTm/lMZSyCdDkkeqsLqRbKFRwRyzkCJ4fJhTPgm0r1wOcyyXdAwYpFwSrw6nG78CeBJcDWJapqqTE/MT54K4xkkxoWQjI8modh5m7FvT1vjxWUBAswTu6Luk4DTeMRHR6leyL2BvJ5utwWLG28CH2bGzVE1b3k9vAXGf6aByYN07K9TPKkXAVdCGnlLlPPCl7V85 X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 10:45:23.2509 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 75d06a8f-ba17-4984-4760-08dcd8982a2e 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001EE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8877 With CONFIG_OVERLAY_DTB=y, unflatten_dt_alloc() is used as part of unflatten_dt_node() used during runtime. In case of a binary compiled such as unflatten_dt_alloc() does not get inlined (e.g. using -Og), attempt to add an overlay to Xen (xl dt-overlay add) results in a crash. (XEN) Instruction Abort Trap. Syndrome=0x7 (XEN) Walking Hypervisor VA 0xa00002c8cc0 on CPU2 via TTBR 0x0000000040340000 (XEN) 0TH[0x014] = 0x4033ff7f (XEN) 1ST[0x000] = 0x4033ef7f (XEN) 2ND[0x001] = 0x4000004033af7f (XEN) 3RD[0x0c8] = 0x0 (XEN) CPU2: Unexpected Trap: Instruction Abort (XEN) ----[ Xen-4.20-unstable arm64 debug=y Not tainted ]---- ... (XEN) Xen call trace: (XEN) [<00000a00002c8cc0>] 00000a00002c8cc0 (PC) (XEN) [<00000a0000202410>] device-tree.c#unflatten_dt_node+0xd0/0x504 (LR) (XEN) [<00000a0000204484>] unflatten_device_tree+0x54/0x1a0 (XEN) [<00000a000020800c>] dt-overlay.c#handle_add_overlay_nodes+0x290/0x3d4 (XEN) [<00000a0000208360>] dt_overlay_sysctl+0x8c/0x110 (XEN) [<00000a000027714c>] arch_do_sysctl+0x1c/0x2c Fixes: 9e9d2c079dc4 ("xen/arm/device: Remove __init from function type") Signed-off-by: Michal Orzel Reviewed-by: Stefano Stabellini --- xen/common/device-tree/device-tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/device-tree/device-tree.c b/xen/common/device-tree/device-tree.c index 8d1017a49d80..d0528c582565 100644 --- a/xen/common/device-tree/device-tree.c +++ b/xen/common/device-tree/device-tree.c @@ -120,8 +120,8 @@ void dt_child_set_range(__be32 **cellp, int addrcells, int sizecells, dt_set_cell(cellp, sizecells, size); } -static void __init *unflatten_dt_alloc(unsigned long *mem, unsigned long size, - unsigned long align) +static void *unflatten_dt_alloc(unsigned long *mem, unsigned long size, + unsigned long align) { void *res;