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

[xen staging] device-tree: Remove __init from unflatten_dt_alloc()



commit 656ac422c40b358fdcd8729b2d1ee17d423955cd
Author:     Michal Orzel <michal.orzel@xxxxxxx>
AuthorDate: Fri Oct 4 14:22:16 2024 +0200
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Thu Oct 10 16:18:56 2024 +0100

    device-tree: Remove __init from unflatten_dt_alloc()
    
    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>
---
 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 8d1017a49d..d0528c5825 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;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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