]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/kvm/arm: Fix bootstack base alignment on arm64
authorMichalis Pappas <michalis@unikraft.io>
Mon, 14 Aug 2023 08:21:36 +0000 (10:21 +0200)
committerUnikraft <monkey@unikraft.io>
Mon, 14 Aug 2023 16:45:02 +0000 (16:45 +0000)
280c69559 introduces a regression to the alignment of the
bootstack. Update __libkvmplat_entry to enforce the correct
alignment before assigning to the sp.

Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #1047

plat/kvm/arm/entry64.S

index 4072debddd46e5b394720e191fa1a25442030300..ea554bad5f5c7c345832a61780cc390c66562032 100644 (file)
@@ -79,8 +79,9 @@ ENTRY(_libkvmplat_entry)
        isb
 
        /* Set the boot stack */
-       ur_ldr x26, lcpu_bootstack
-       mov sp, x26
+       ur_ldr  x26, lcpu_bootstack
+       and     x26, x26, ~(__STACK_ALIGN_SIZE - 1)
+       mov     sp, x26
 
        /* Set the context id */
        msr contextidr_el1, xzr