Properly align vcore stacks on x86
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 24 Mar 2016 16:39:05 +0000 (12:39 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 31 Mar 2016 20:53:42 +0000 (16:53 -0400)
commit801dcd900fad030d818801cbcf5d5d566d16829b
tree2039ab9b5aea8a74739362816817d54a04d440f6
parentf51495a638d0a1fd1e2a8e5c174e0b5a4d48641e
Properly align vcore stacks on x86

Glibc _start expects a 16-byte aligned stack, since it is working in asm.
However, the vcore stacks were also getting a 16-byte aligned stack, but
they were C functions and needed to be odd-8-byte aligned.

This commit creates arch-dependent vcore entry functions.  x86's is in
assembly, where it can restore the odd-8-byte invariant.

Note that we can't have both vcore.S and vcore.c - both will be built as
vcore.o.  I renamed the asm ones with _asm.

Incidentally, this happened on a printf with floats/xmms in vcore context,
and was triggered by the "movaps xmm,rbp" due to the variadic function ABI.
It also shows that we weren't touching xmm's in vcore context, since we
would have GP faulted.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/x86/process64.c
user/parlib/include/parlib/vcore.h
user/parlib/riscv/vcore.S [deleted file]
user/parlib/riscv/vcore.c [new file with mode: 0644]
user/parlib/riscv/vcore_asm.S [new file with mode: 0644]
user/parlib/vcore.c
user/parlib/x86/vcore.c
user/parlib/x86/vcore_asm.S [new file with mode: 0644]