RE: [PATCH v3] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

Dong, Eddie
2010-06-28T07:32:54Z

Avi Kivity wrote:
> On 06/28/2010 09:42 AM, Sheng Yang wrote:
>>>> +static void wbinvd_ipi(void *garbage)
>>>> +{
>>>> + wbinvd();
>>>> +}
>>>>
>>> Like Jan mentioned, this is quite heavy. What about a clflush()
>>> loop instead? That may take more time, but at least it's
>>> preemptible. Of course, it isn't preemptible in an IPI.
>>>
>>
>> I think this kind of behavior happened rarely, and most recent
>> processor should have WBINVD exit which means it's an IPI... So I
>> think it's maybe acceptable here.
>>
>>
>
> Several milliseconds of non-responsiveness may not be acceptable for
> some applications. So I think queue_work_on() and a clflush loop is
> better than an IPI and wbinvd.
>

Probably we should make it configurable. For RT usage models, we do care about responsiveness more than performance, but for typical server useg model, we'd better focus on performance in this issue. WBINVD may perform much much better than CLFLUSH, and a mallicious guest repeatedly issuing wbinvd may greatly impact the system performance.

thx, eddie