From: Sergiu Moga Date: Mon, 28 Apr 2025 16:21:33 +0000 (+0300) Subject: lib/syscall_shim/arch/x86: Properly fetch `curr_fp` in execenv entry X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3a92f1ee3f933b269768102eb36622f2665726d6;p=unikraft%2Funikraft.git lib/syscall_shim/arch/x86: Properly fetch `curr_fp` in execenv entry Somehow, when commit c716bcca4822 ("{lib,arch,plat}: Redo syscall ctx's and `swapgs` logic") introduced the auxiliary stack pointer control block it updated fetching of current frame pointer into the auxiliary stack space for ARM64 on both binary syscall entry and execenv entries but for x86 it only did so for the binary syscall entry, completely forgeting about doing the same for the execenv entry. Fix this by updating the execenv entry to also properly fetch the current frame pointer from the auxiliary stack pointer control block. Checkpatch-Ignore: COMMIT_LOG_LONG_LINE Signed-off-by: Sergiu Moga Reviewed-by: Michalis Pappas Approved-by: Michalis Pappas GitHub-Closes: #1635 --- diff --git a/lib/syscall_shim/arch/x86_64/include/arch/syscall_prologue.h b/lib/syscall_shim/arch/x86_64/include/arch/syscall_prologue.h index a2dbb7101..d10361d4d 100644 --- a/lib/syscall_shim/arch/x86_64/include/arch/syscall_prologue.h +++ b/lib/syscall_shim/arch/x86_64/include/arch/syscall_prologue.h @@ -40,6 +40,9 @@ " */\n\t" \ "movq %rsp, %r11\n\t" \ "movq %gs:(" STRINGIFY(LCPU_AUXSP_OFFSET) "), %rsp\n\t"\ + "subq $(" STRINGIFY(UKARCH_AUXSPCB_SIZE) "), %rsp\n\t"\ + "movq " STRINGIFY(UKARCH_AUXSPCB_OFFSETOF_CURR_FP) \ + "(%rsp), %rsp\n\t" \ "/* Auxiliary stack is already ECTX aligned */\n\t" \ "/* Make room for `struct UKARCH_EXECENV` */\n\t" \ "subq $(" STRINGIFY(UKARCH_EXECENV_SIZE - \