On Tue, Dec 14, 2021, Aaron Lewis wrote: > Setting the stack to PAGE_SIZE - 1 sets the stack to being 1-byte > aligned, which fails in usermode with alignment checks enabled (ie: with > flags cr0.am set and eflags.ac set). This was causing an #AC in > usermode.c when preparing to call the callback in run_in_user(). > Aligning the stack fixes the issue. > > For the purposes of fixing the #AC in usermode.c the stack has to be > aligned to at least an 8-byte boundary. Setting it to a page aligned > boundary ensures any stack alignment requirements are met as x86_64 > stacks generally want to be 16-byte aligned. > > Signed-off-by: Aaron Lewis <aaronlewis@xxxxxxxxxx> > --- Reviewed-by: Sean Christopherson <seanjc@xxxxxxxxxx>