Please sign in to comment.
x86/nmi/64: Switch stacks on userspace NMI entry
Returning to userspace is tricky: IRET can fail, and ESPFIX can rearrange the stack prior to IRET. The NMI nesting fixup relies on a precise stack layout and atomic IRET. Rather than trying to teach the NMI nesting fixup to handle ESPFIX and failed IRET, punt: run NMIs that came from user mode on the normal kernel stack. This will make some nested NMIs visible to C code, but the C code is okay with that. As a side effect, this should speed up perf: it eliminates an RDMSR when NMIs come from user mode. Signed-off-by: Andy Lutomirski <email@example.com> Reviewed-by: Steven Rostedt <firstname.lastname@example.org> Reviewed-by: Borislav Petkov <email@example.com> Cc: Linus Torvalds <firstname.lastname@example.org> Cc: Peter Zijlstra <email@example.com> Cc: Thomas Gleixner <firstname.lastname@example.org> Cc: email@example.com Signed-off-by: Ingo Molnar <firstname.lastname@example.org>
- Loading branch information...