x64: Enable sleeping in fault context
In preparation for enabling demand paging, enable sleeping in fault context by using a per-thread exception stack for normal faults and per-CPU exception stack for nested faults. Avi Kivity explains: Before [demand paging] can even hope to work, we need to enable sleeping in fault context. Right now each cpu has its own exception stack, which leads immediately to stack corruption: thread 1 faults enters exception stack tries to take mutex scheduler switches to thread 2 thread 2 faults enters same exception stack So we need to switch stacks. This can be done in the same way as for interrupt stacks (see thread::switch_to()). Signed-off-by:Pekka Enberg <penberg@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
Loading
Please register or sign in to comment