Re: [PATCH 1/1] Disable GUEST_INTR_STATE_STI flag before injecting NMI to guest on VMX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avi Kivity wrote:
>   On 08/27/2010 02:06 PM, Jan Kiszka wrote:
>> Avi Kivity wrote:
>>>    On 08/27/2010 11:39 AM, Jan Kiszka wrote:
>>>> AMD does not differentiate between MOV-SS and STI interrupt shadows.
>>>>
>>>> But AMD has its own NMI problems as it does not allow to trap after
>>>> IRET-from-NMI and requires magic dances which are partly broken in KVM.
>>>> I'm leaning towards NMI window emulation via the workaround we use for
>>>> older Intel CPUs without NMI window trapping as well.
>>> Can you elaborate?
>> Basically the issues you found regarding our single-step-based
>> workaround.
> 
> I forgot them already.  What was that, exception during IRET?

Exception during IRET or any instruction under the interrupt shadow will
push the TF we set to step over this issue on the guest stack. We do not
intercept all the possible exceptions, so we can leak TF. Moreover,
multiplexing TF users is currently imperfect on AMD but, before fixing
that, we have to think about the approach in general.

> 
>> Moreover, we cannot easily prevent that TF set by the NMI
>> code leaks onto the guest's stack.
>>
>> Jörg and I stuck heads together about this during LinuxCon. We came to
>> the conclusion that we either have to emulate the instruction that
>> delays NMIs (ie. _every_ possible instruction for the interrupt shadow
>> case) or fall back to the VMX workaround based on interrupt window
>> trapping and an emergency timeout (much simpler, but not really correct).
> 
> I'd really like to avoid the timer.  But I forgot all the details around 
> this, I'll have to re-learn them so I can actually compare the two options.
> 

Hope the above helps you to get on track, otherwise drop more questions.
Also putting Joerg on CC (in the futile hope that the longer the CC list
is, the lesser the pain becomes for each individual).

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux