[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 2/6] device-tree: Remove __init from unflatten_dt_alloc()


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Fri, 4 Oct 2024 14:22:16 +0200
  • 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)
  • 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-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==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Fri, 04 Oct 2024 12:22:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 <michal.orzel@xxxxxxx>
Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
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;
 
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.