This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch releases/12.7
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit bbea8dcefe3e68e9c844be0a91610da5797b42a4
Author: p-szafonimateusz <[email protected]>
AuthorDate: Fri Aug 30 11:36:32 2024 +0200

    arch/x86_64/intel64/intel64_head.S: move initial RSP for AP cores below 
regs area
    
    move initial RSP for AP cores below regs area.
    otherwise IDLE thread for AP cores can be corrupted
    
    XCP region now match regs allocation in up_initial_state()
    
    Signed-off-by: p-szafonimateusz <[email protected]>
---
 arch/x86_64/src/intel64/intel64_head.S | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86_64/src/intel64/intel64_head.S 
b/arch/x86_64/src/intel64/intel64_head.S
index 5792067c2c..764b8c3ca9 100644
--- a/arch/x86_64/src/intel64/intel64_head.S
+++ b/arch/x86_64/src/intel64/intel64_head.S
@@ -364,6 +364,10 @@ ap_start:
        add     %rax, %rbx
        mov     (%rbx),   %rsp
 
+       /* Move initial RSP below IDLE TCB regs */
+       sub     $XCPTCONTEXT_SIZE, %rsp
+       and     $(~XCPTCONTEXT_SIZE), %rsp
+
        /* Jump to ap_start routine */
        movabs  $x86_64_ap_boot,   %rbx
        jmp     *%rbx

Reply via email to