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

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


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Thu, 19 Sep 2024 12:42:36 +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=5a8d8Dmwmijg24rkMyGYaLxqRaF0Hxcf7ag2CMKmCKk=; b=Uer9SpeXdmutUf2Wo9TwEx0opDpxSOJoKWL/nSoWQP4pZu/oHYLwQ5bfdMx0OFKBVst5Zj5yt7DpfJMDji2k6H74seZSZK5YlPAo9bANDwxHZ8qNXMSFXf0770pESYzo6tUuOrgE7vplXbaZ1tHCGr0Fz/6A/cb29u9Rhs9GOqmZQA3/7Yj5cXxHYsDIU9wClGep+J+Wpj3SCYVukpLfKwWlka4WZwO7bk/3U4IebdCtvbRsCPLNpD0pSwYWpR8TgH9PbJnlWUH3mJ9HBGjIep0+fIGeApAPAAWTQO+W3L0H+wKzTQLhbruqFCmSdLz01So6EKSOVCSTG2JB14WMfg==
  • 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==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Thu, 19 Sep 2024 10:45:32 +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>
---
 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.37.6




 


Rackspace

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