From: Eduard Vintilă Date: Sun, 12 Nov 2023 13:54:34 +0000 (+0200) Subject: plat/common/arm: Zero out `x29` and `x30` before stack switch X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=73fbfadd796ca0bb74ef2ad4686b878e00840414;p=unikraft%2Funikraft.git plat/common/arm: Zero out `x29` and `x30` before stack switch In order to properly mark the end of a stacktrace and avoid undefined behaviour during unwinding, both the frame pointer (`x29`) and the link register (`x30`) should be zeroed out before switching to a new stack. Signed-off-by: Eduard Vintilă --- diff --git a/plat/common/arm/lcpu.c b/plat/common/arm/lcpu.c index 2d4021bd1..d0172494e 100644 --- a/plat/common/arm/lcpu.c +++ b/plat/common/arm/lcpu.c @@ -55,6 +55,8 @@ __lcpuid lcpu_arch_id(void) void __noreturn lcpu_arch_jump_to(void *sp, ukplat_lcpu_entry_t entry) { __asm__ __volatile__ ( + "mov x29, xzr\n" + "mov x30, xzr\n" "mov sp, %0\n" /* set the sp */ "br %1\n" /* branch to the entry function */ :