Re: [PATCH 70/70] x86/sev-es: Add NMI state tracking

From: Joerg Roedel
Date: Fri Mar 20 2020 - 15:48:54 EST


On Thu, Mar 19, 2020 at 02:27:49PM -0700, Andy Lutomirski wrote:
> AIUI the shift-ist stuff is because we aren't very good about the way
> that we handle tracing right now, and that can cause a limited degree
> of recursion. #DB uses IST for historical reasons that don't
> necessarily make sense. Right now, we need it for only one reason:
> the MOV SS issue. IIRC this isn't actually triggerable without
> debugging enabled -- MOV SS with no breakpoint but TF on doesn't seem
> to malfunction quite as badly.

I had a look at the shift_ist stuff today and it looks like a good
solution to the #VC nesting problem when it is turned into a #VC
handler. The devil is in the details, of course, as 3 or 4 stacks for
the #VC handler (per cpu) should only be allocated when actually running
in an SEV-ES guest. Let's see how this works out in practice.

Regards,

Joerg