]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/syscall_shim/arch/x86: Properly fetch `curr_fp` in execenv entry
authorSergiu Moga <sergiu@unikraft.io>
Mon, 28 Apr 2025 16:21:33 +0000 (19:21 +0300)
committerUnikraft Bot <monkey@unikraft.io>
Wed, 30 Apr 2025 10:59:07 +0000 (10:59 +0000)
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 <sergiu@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Michalis Pappas <michalis@unikraft.io>
GitHub-Closes: #1635

lib/syscall_shim/arch/x86_64/include/arch/syscall_prologue.h

index a2dbb710177c13ea77483dc94429796907bc68e6..d10361d4d332f1c1be5569c4920bc7aab4da8867 100644 (file)
@@ -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 -             \