On 23/04/20 17:43, Paolo Bonzini wrote: >> > Ah no, it's a bug in Cathy's patch and it's a weird one. > > The problem is that on AMD you exit guest mode with the NMI latched and > GIF=0. So check_nested_events should enable the NMI window in addition > to causing a vmexit. > > So why does it work? Because on AMD we don't have (yet) > nested_run_pending, so we just check if we already have a vmexit > scheduled and if so return -EBUSY. The second call causes > inject_pending_event to return -EBUSY and thus go through KVM_REQ_EVENT > again, which enables the NMI window. ... and this means that suddenly your event handling series has become twice as large so I'm taking it over. Paolo