|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH 2/3] lib/uksched: use posix_memalign to allocate stack
uk_thread_current indentifies the current stack using STACK_MASK_TOP. As a
consequence the stack should be aligned at STACK_SIZE. However the stack is
allocated using palloc which only guarantees page alignment.
Allocate the stack using posix_memalign, explicitely requesting an
alignment at STACK_SIZE.
Signed-off-by: Hugo Lefeuvre <hugo.lefeuvre@xxxxxxxxx>
diff --git a/lib/uksched/sched.c b/lib/uksched/sched.c
index a250547..75ad0b8 100644
--- a/lib/uksched/sched.c
+++ b/lib/uksched/sched.c
@@ -141,7 +141,7 @@ static void *create_stack(struct uk_alloc *allocator)
{
void *stack;
- stack = uk_palloc(allocator, STACK_SIZE_PAGE_ORDER);
+ uk_posix_memalign(allocator, &stack, STACK_SIZE, STACK_SIZE_PAGE_ORDER);
if (stack == NULL) {
uk_pr_warn("Error allocating thread stack.");
return NULL;
--
2.7.4
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |