[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH 1/5] lib/uksched: Ensure (%rsp + 8) 16-byte alignment for x86_64 only



As Arm64 just needs stack 16-byte alignment. So this ensure (%rsp + 8)
16-byte alignment is used for x86_64 only.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
Signed-off-by: Jianyong Wu <jianyong.wu@xxxxxxx>
---
 lib/uksched/thread.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/uksched/thread.c b/lib/uksched/thread.c
index 1236b99..0d12fd4 100644
--- a/lib/uksched/thread.c
+++ b/lib/uksched/thread.c
@@ -49,10 +49,12 @@ static void init_sp(unsigned long *sp, char *stack,
 {
        *sp = (unsigned long) stack + STACK_SIZE;
 
+#if defined(__X86_64__)
        /* Must ensure that (%rsp + 8) is 16-byte aligned
         * at the start of thread_starter.
         */
        stack_push(sp, 0);
+#endif
 
        stack_push(sp, (unsigned long) function);
        stack_push(sp, (unsigned long) data);
-- 
2.17.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.