Index: kernel/arch/amd64/src/userspace.c
===================================================================
--- kernel/arch/amd64/src/userspace.c	(revision 23cdc9219330c1832d25748a76fa077ccf9e773b)
+++ kernel/arch/amd64/src/userspace.c	(revision 5719f6ddbbd629f7eb5c571fcbcbd7a87a3565c7)
@@ -62,4 +62,6 @@
 			  "pushq %4\n"
 			  "movq %5, %%rax\n"
+			  /* %rdi is defined to hold pcb_ptr - set it to 0 */
+			  "xorq %%rdi, %%rdi\n"
 			  "iretq\n"
 			  : : 
