From 6cc52efa13ed180c35232b833d38cf288679b2db Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 1 Feb 2023 13:54:09 -0800 Subject: [PATCH] arm_smcc_1_2_*: Don't trash SP and X19 if no return value structure. Jumping direct to ret was not restoring the saved value of x19 and was also not adjusting sp to discard the two saved registers. Reviewed by: andrew Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D37922 --- sys/dev/psci/smccc_arm64.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/psci/smccc_arm64.S b/sys/dev/psci/smccc_arm64.S index 41e602563222..1d05855acdf3 100644 --- a/sys/dev/psci/smccc_arm64.S +++ b/sys/dev/psci/smccc_arm64.S @@ -77,8 +77,8 @@ ENTRY(arm_smccc_1_2_\insn) stp x12, x13, [x19, #16 * 6] stp x14, x15, [x19, #16 * 7] stp x16, x17, [x19, #16 * 8] - ldp xzr, x19, [sp], #16 -1: ret +1: ldp xzr, x19, [sp], #16 + ret END(arm_smccc_1_2\insn) .endm /* int arm_smccc_1_2_*(const struct arm_smccc_1_2_regs *args,