Index: kernel/generic/src/cpu/cpu.c
===================================================================
--- kernel/generic/src/cpu/cpu.c	(revision a6e55886e5b1f65fd811c2f746803ba53f061518)
+++ kernel/generic/src/cpu/cpu.c	(revision d1da1ff2de1cccc51856404f676142f7deb1cf54)
@@ -72,4 +72,6 @@
 		memsetb(cpus, sizeof(cpu_t) * config.cpu_count, 0);
 
+		// XXX: All kernel stacks must be aligned to STACK_SIZE,
+		//      see get_current().
 		size_t i;
 		for (i = 0; i < config.cpu_count; i++) {
Index: kernel/generic/src/main/main.c
===================================================================
--- kernel/generic/src/main/main.c	(revision a6e55886e5b1f65fd811c2f746803ba53f061518)
+++ kernel/generic/src/main/main.c	(revision d1da1ff2de1cccc51856404f676142f7deb1cf54)
@@ -173,6 +173,10 @@
 	    ALIGN_UP((uintptr_t) kdata_end - config.base, PAGE_SIZE);
 
+	// XXX: All kernel stacks must be aligned to STACK_SIZE,
+	//      see get_current().
+
 	/* Place the stack after the kernel, init and ballocs. */
-	config.stack_base = config.base + config.kernel_size;
+	config.stack_base =
+	    ALIGN_UP(config.base + config.kernel_size, STACK_SIZE);
 	config.stack_size = STACK_SIZE;
 
@@ -181,5 +185,5 @@
 	for (i = 0; i < init.cnt; i++) {
 		uintptr_t p = init.tasks[i].paddr + init.tasks[i].size;
-		uintptr_t bottom = PA2KA(ALIGN_UP(p, PAGE_SIZE));
+		uintptr_t bottom = PA2KA(ALIGN_UP(p, STACK_SIZE));
 
 		if (config.stack_base < bottom)
@@ -190,5 +194,5 @@
 	if (ballocs.size) {
 		uintptr_t bottom =
-		    ALIGN_UP(ballocs.base + ballocs.size, PAGE_SIZE);
+		    ALIGN_UP(ballocs.base + ballocs.size, STACK_SIZE);
 		if (config.stack_base < bottom)
 			config.stack_base = bottom;
@@ -196,5 +200,5 @@
 
 	if (config.stack_base < stack_safe)
-		config.stack_base = ALIGN_UP(stack_safe, PAGE_SIZE);
+		config.stack_base = ALIGN_UP(stack_safe, STACK_SIZE);
 
 	context_save(&ctx);
Index: kernel/generic/src/proc/thread.c
===================================================================
--- kernel/generic/src/proc/thread.c	(revision a6e55886e5b1f65fd811c2f746803ba53f061518)
+++ kernel/generic/src/proc/thread.c	(revision d1da1ff2de1cccc51856404f676142f7deb1cf54)
@@ -194,4 +194,7 @@
 	kmflags &= ~FRAME_HIGHMEM;
 
+	// XXX: All kernel stacks must be aligned to STACK_SIZE,
+	//      see get_current().
+
 	uintptr_t stack_phys =
 	    frame_alloc(STACK_FRAMES, kmflags, STACK_SIZE - 1);
