Re: [PATCH] x86/entry: Read CR2 in asm entry stub to redcue NMI clobbering window

From: Dave Hansen

Date: Thu May 14 2026 - 15:56:57 EST


On 5/14/26 12:49, Andrew Cooper wrote:
> Really, the NMI handler needs to preserve the registers it potentially
> clobbers, and that still requires the NMI handler doing it in assembly
> before entering C.

Yup, totally agree.

It's not rocket science, and it's what we do for CR3 because of PTI, but
it's also no fun. So I didn't want to suggest it.

I mean, we've lived with this behavior _forever_, right? So how bad
could it be?