Messages in this thread | | | Date | Fri, 27 Jan 2023 18:25:08 +0100 | From | Joerg Roedel <> | Subject | Re: [Question PATCH kernel] x86/amd/sev/nmi+vc: Fix stack handling (why is this happening?) |
| |
On Fri, Jan 27, 2023 at 10:56:26PM +1100, Alexey Kardashevskiy wrote: > https://github.com/aik/linux/commit/d0d6bbb58fcd927ddd1f8e9d42ab121920c7eafc
Okay, I reproduced the problem here and the root cause turned out to be that the compiler moved the DR7 read instruction before the 5-byte NOP which becomes the call to sev_es_ist_enter() in SEV-ES guests. This is guaranteed to cause #VC exception stack recursion if the NMI was triggered on the #VC stack, and that leads to all kinds of undefined behavior.
Regards,
Joerg
| |