- SWITCH_KERNEL_CR3_NO_STACK
+ /*
+ * percpu variables are mapped with user CR3, so no need
+ * to switch CR3 here.
+ */
cld
movq %rsp, %rdx
movq PER_CPU_VAR(kernel_stack), %rsp
is problematic, as the patchset actually never user-maps kernel_stack
percpu variable, and therefore crashes on NMIs.
The patch below is needed to make NMIs work properly.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>