From patchwork Fri Oct 4 12:22:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Orzel X-Patchwork-Id: 13822225 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 43285CFA775 for ; Fri, 4 Oct 2024 12:23:02 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.810340.1223027 (Exim 4.92) (envelope-from ) id 1swhKU-00069T-GM; Fri, 04 Oct 2024 12:22:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 810340.1223027; Fri, 04 Oct 2024 12:22:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1swhKU-00069L-DD; Fri, 04 Oct 2024 12:22:42 +0000 Received: by outflank-mailman (input) for mailman id 810340; Fri, 04 Oct 2024 12:22:40 +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 1swhKS-00068r-Ol for xen-devel@lists.xenproject.org; Fri, 04 Oct 2024 12:22:40 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20625.outbound.protection.outlook.com [2a01:111:f403:2412::625]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 57873b07-824b-11ef-99a2-01e77a169b0f; Fri, 04 Oct 2024 14:22:38 +0200 (CEST) Received: from BYAPR02CA0069.namprd02.prod.outlook.com (2603:10b6:a03:54::46) by CH2PR12MB4261.namprd12.prod.outlook.com (2603:10b6:610:a9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.19; Fri, 4 Oct 2024 12:22:33 +0000 Received: from SJ5PEPF000001F0.namprd05.prod.outlook.com (2603:10b6:a03:54:cafe::81) by BYAPR02CA0069.outlook.office365.com (2603:10b6:a03:54::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.18 via Frontend Transport; Fri, 4 Oct 2024 12:22:33 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001F0.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8026.11 via Frontend Transport; Fri, 4 Oct 2024 12:22:33 +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, 4 Oct 2024 07:22:31 -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, 4 Oct 2024 07:22:31 -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; Fri, 4 Oct 2024 07:22:30 -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: 57873b07-824b-11ef-99a2-01e77a169b0f ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ESM/LCG1VZAqsN8asJu9yydd/nyGBVpU/1Yt2+Fkpv7v+x9Kvmts9RgxRDrwLyWTXznOAZB10RPCbgh9sZokVgSVJ5FgRZfJDC/ejp6CRPh20mvwNGgmeYdHLbL4xcs60nYB2CgNvqX+AD0Uq9PR7katoZu29th0awKdVroZD83zYpk7TRsP5T8Ht3siTJNS0R4NMLs39C3QWl6SGxdhem25C0lSTR0BJGBYcYXxyV+0kM9eLH1W1KERJQGIsctGLfIG7E6iZZ7yLXX5/DpxhglwYRZG6h5AzZfpxdbrog3yvDjTqg9rX8nQogjMiJhV1rDfOxolXDoBj+yDxOC4vQ== 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=5Yxzb8QUee8LL/UwpSrq/bczqcgMTL0/++EpgLvvFVQ=; b=t/RKvrz1KoLaks/J/RfhK0I9bkyJWyYUJexVDs/UHo+LFlYhBIl62my35tn7GjHrAGpegEvSZR7ZZhgL9xiiC+XDyq+yz7tcht0T5mrB+3fuMDj3sJ9ZlPixyy56QTrOoKDqah78EfGphnsKOsWOXAroMMiN94fuD+9RGk1AWj/gPGulFvFI7LXXXoDn1vGB+uzaoLIUWm/Wlid1JXYxzurajPVAzCz262J2lohalFIY+uUhZQ2wJueSBH2COMDmv2LZrxqbxRnQvxKct755bb7z6WW1y6n8ErdbHZfcqOG0f0B52SnD+4yVT9WdlKBXP7A/eAxL90eWMqEV1W2q4g== 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=5Yxzb8QUee8LL/UwpSrq/bczqcgMTL0/++EpgLvvFVQ=; b=Jq642LNZhyCw/mz/0KadPhLuS49zrQpepT33gzmBtxhLtRN6sMfbCdKlKKyZ0asy7xvnXP0KdSNytH/98GthyRBNlh9lE2NrTr5Fq7ElxA7lZBYVOTiLxfxmSPKK0KFg46TnRm1AT4jcIpsK9S3qjHfiLdNtKHivf1YTyTQNB74= 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: Michal Orzel To: CC: Michal Orzel , Stefano Stabellini , Julien Grall , Bertrand Marquis Subject: [PATCH v2 2/6] device-tree: Remove __init from unflatten_dt_alloc() Date: Fri, 4 Oct 2024 14:22:16 +0200 Message-ID: <20241004122220.234817-3-michal.orzel@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241004122220.234817-1-michal.orzel@amd.com> References: <20241004122220.234817-1-michal.orzel@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F0:EE_|CH2PR12MB4261:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a9c3f55-3d46-44c7-9ce2-08dce46f395f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: ISqzX7YezNUIGeoauTHyZTrIPy5+wvGB6PnRoiwbddtSXoQUi2ECBnKqlLwLIAMXvYntld0yo7NAQEBoyH8rfhdYnsNZ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b5zXw0U8VoFEoHaY37EkvRp7c6vyq5ys6c0KppuSoYo0dSkJOf9JzvTyePPalSsXQUIuAwK7q6wymeJ7c34RrVz5f016DXGGgqDPvj1P0UAbmZ3K8sHyimUPeuMwPE4kR20XANbLMrnahzcc06GZJE0q+fEW+Axmei11r8b+uFWCr0Vh6YXLinkEcv9H91kFkET4z01QxoNmFrbITeL4IEF0LDxjY3q9nWGuGo+dYpNDIjsciC 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)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2024 12:22:33.3431 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5a9c3f55-3d46-44c7-9ce2-08dce46f395f 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: SJ5PEPF000001F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4261 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 --- Changes in v2: - Add Rb --- 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;