From 8530aa75400bd62e8a9df3f311617e3caadd20ad Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Fri, 6 Sep 2024 19:51:37 +0200 Subject: [PATCH] lx_emul/start: move lx_emul_setup_arch behind kmem_cache_init Call lx_emul_setup arch after kmem_cache_init, because unflatten_device_tree requires 'memblock_alloc' which does not work when using native slub.c/memblock.c on ARM platforms. issue #5264 --- repos/dde_linux/src/lib/lx_emul/start.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/repos/dde_linux/src/lib/lx_emul/start.c b/repos/dde_linux/src/lib/lx_emul/start.c index e64b6732f0..aad3ba6a19 100644 --- a/repos/dde_linux/src/lib/lx_emul/start.c +++ b/repos/dde_linux/src/lib/lx_emul/start.c @@ -132,8 +132,6 @@ int lx_emul_init_task_function(void * dtb) * Here we do the minimum normally done start_kernel() of init/main.c */ - lx_emul_setup_arch(dtb); - jump_label_init(); kmem_cache_init(); wait_bit_init(); @@ -143,6 +141,12 @@ int lx_emul_init_task_function(void * dtb) maple_tree_init(); #endif + /* + * unflatten_device tree requires memblock, so kmem_cache_init has to be + * called before lx_emul_setup_arch on ARM platforms + */ + lx_emul_setup_arch(dtb); + workqueue_init_early(); skb_init();