You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/03 13:07:26 UTC
(nuttx) branch master updated (026e1b4b5e -> ce61347ddf)
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
from 026e1b4b5e arch/intel64: colorize IDLE stack for AP cores
new 6b8d0c6a16 arch/x86_64/intel64/intel64_head.S: move initial RSP for AP cores below regs area
new ed4acb20cc arch/x86_64/intel64/intel64_cpuidlestack.c: stack_alloc should point to stack base not stack top
new ce61347ddf arch/x86_64/intel64/intel64_schedulesigaction.c: properly align signal handler stack for vector operations
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
arch/x86_64/src/intel64/intel64_cpuidlestack.c | 3 ++-
arch/x86_64/src/intel64/intel64_head.S | 4 ++++
arch/x86_64/src/intel64/intel64_schedulesigaction.c | 9 ++++++++-
3 files changed, 14 insertions(+), 2 deletions(-)
(nuttx) 02/03: arch/x86_64/intel64/intel64_cpuidlestack.c: stack_alloc should point to stack base not stack top
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit ed4acb20cc133be12dc6ab9baf390813521f29ef
Author: p-szafonimateusz <p-...@xiaomi.com>
AuthorDate: Fri Aug 30 11:38:08 2024 +0200
arch/x86_64/intel64/intel64_cpuidlestack.c: stack_alloc should point to stack base not stack top
stack_alloc should point to stack base not stack top
Signed-off-by: p-szafonimateusz <p-...@xiaomi.com>
---
arch/x86_64/src/intel64/intel64_cpuidlestack.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86_64/src/intel64/intel64_cpuidlestack.c b/arch/x86_64/src/intel64/intel64_cpuidlestack.c
index 05d8771b43..e9aec20395 100644
--- a/arch/x86_64/src/intel64/intel64_cpuidlestack.c
+++ b/arch/x86_64/src/intel64/intel64_cpuidlestack.c
@@ -88,7 +88,8 @@ int up_cpu_idlestack(int cpu, struct tcb_s *tcb, size_t stack_size)
/* Get the top of the stack */
- stack_alloc = (uintptr_t)g_idle_topstack[cpu];
+ stack_alloc = (uintptr_t)g_idle_topstack[cpu] -
+ CONFIG_IDLETHREAD_STACKSIZE;
tcb->adj_stack_size = stack_size - 8;
tcb->stack_alloc_ptr = (void *)stack_alloc;
tcb->stack_base_ptr = tcb->stack_alloc_ptr;
(nuttx) 03/03: arch/x86_64/intel64/intel64_schedulesigaction.c: properly align signal handler stack for vector operations
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit ce61347ddfff47ac1781cbaaa20945a1c82d0b1f
Author: p-szafonimateusz <p-...@xiaomi.com>
AuthorDate: Thu Aug 22 10:36:05 2024 +0200
arch/x86_64/intel64/intel64_schedulesigaction.c: properly align signal handler stack for vector operations
signal handler stack must be properly aligned, otherwise vector instructions doesn't work in signal handler
Signed-off-by: p-szafonimateusz <p-...@xiaomi.com>
---
arch/x86_64/src/intel64/intel64_schedulesigaction.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/x86_64/src/intel64/intel64_schedulesigaction.c b/arch/x86_64/src/intel64/intel64_schedulesigaction.c
index 0763b2cab5..d846ed3798 100644
--- a/arch/x86_64/src/intel64/intel64_schedulesigaction.c
+++ b/arch/x86_64/src/intel64/intel64_schedulesigaction.c
@@ -130,6 +130,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
*/
up_current_regs()[REG_RIP] = (uint64_t)x86_64_sigdeliver;
+ up_current_regs()[REG_RSP] = up_current_regs()[REG_RSP] - 8;
up_current_regs()[REG_RFLAGS] = 0;
/* And make sure that the saved context in the TCB
@@ -162,6 +163,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
*/
tcb->xcp.regs[REG_RIP] = (uint64_t)x86_64_sigdeliver;
+ tcb->xcp.regs[REG_RSP] = tcb->xcp.regs[REG_RSP] - 8;
tcb->xcp.regs[REG_RFLAGS] = 0;
}
}
@@ -242,6 +244,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
*/
tcb->xcp.regs[REG_RIP] = (uint64_t)x86_64_sigdeliver;
+ tcb->xcp.regs[REG_RSP] = tcb->xcp.regs[REG_RSP] - 8;
tcb->xcp.regs[REG_RFLAGS] = 0;
}
else
@@ -261,7 +264,10 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
* disabled
*/
- up_current_regs()[REG_RIP] = (uint64_t)x86_64_sigdeliver;
+ up_current_regs()[REG_RIP] =
+ (uint64_t)x86_64_sigdeliver;
+ up_current_regs()[REG_RSP] =
+ up_current_regs()[REG_RSP] - 8;
up_current_regs()[REG_RFLAGS] = 0;
/* And make sure that the saved context in the TCB
@@ -308,6 +314,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
*/
tcb->xcp.regs[REG_RIP] = (uint64_t)x86_64_sigdeliver;
+ tcb->xcp.regs[REG_RSP] = tcb->xcp.regs[REG_RSP] - 8;
tcb->xcp.regs[REG_RFLAGS] = 0;
}
}
(nuttx) 01/03: arch/x86_64/intel64/intel64_head.S: move initial RSP for AP cores below regs area
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 6b8d0c6a1650e978bc6af1ad1b729b237cbb2433
Author: p-szafonimateusz <p-...@xiaomi.com>
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 <p-...@xiaomi.com>
---
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 9b0cf93705..488f487fa6 100644
--- a/arch/x86_64/src/intel64/intel64_head.S
+++ b/arch/x86_64/src/intel64/intel64_head.S
@@ -392,6 +392,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