You need to save/restore cr2 in addition, otherwise the following hits you
- page fault
- processor writes cr2, enters fault handler
- nmi
- page fault
- cr2 overwritten
I guess you would usually not notice the corruption since you'd just see
a spurious fault on the page the NMI handler touched, but if the first
fault happened in a kvm guest, then we'd corrupt the guest's cr2.
But the whole thing strikes me as overkill. If it's 8k per-cpu, what's
wrong with using a per-cpu pointer to a kmalloc() area?
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
--