#include <uk/config.h>
#include <uk/reloc.h>
+/* Prefer using in-image stack, to avoid conflicts when unmapping is done by
+ * paging_init (it invalidates our stack)
+ */
+.section .bss
+.space 4096
+lcpu_bootstack:
+
/*
* The registers used by _libkvmplat_start:
* x0 - FDT pointer
ENTRY(_libkvmplat_entry)
ur_ldr x25, _dtb
- ur_ldr x26, _end
-
#ifdef CONFIG_FPSIMD
/* Enable fp/simd support */
ldr x0, =(3 << 20)
* just need to invalidate what we are going to use:
* DTB, TEXT, DATA, BSS, and bootstack.
*/
- ur_ldr x0, _start_ram_addr
-
- add x27, x26, #__STACK_SIZE
- sub x1, x27, x25
+ ur_ldr x0, _start_ram_addr
+ ur_ldr x1, _end
bl clean_and_invalidate_dcache_range
/* Disable the MMU and D-Cache. */
isb
/* Set the boot stack */
- mov sp, x27
+ ur_ldr x26, lcpu_bootstack
+ mov sp, x26
/* Set the context id */
msr contextidr_el1, xzr