Re: [PATCH] KVM: vmx: fix underflow in TSC deadline calculation

From: Wanpeng Li
Date: Tue Jun 28 2016 - 20:39:53 EST


2016-06-29 6:55 GMT+08:00 Wanpeng Li <kernellwp@xxxxxxxxx>:
> 2016-06-29 4:07 GMT+08:00 Paolo Bonzini <pbonzini@xxxxxxxxxx>:
>>
>>
>> On 28/06/2016 20:34, yunhong jiang wrote:
>>> Paolo, thanks for reply.
>>>
>>> Which race window you are talking about? Is it the
>>> kvm_lapic_switch_to_hv_timer()? If yes, hope we will not forgot it once the
>>> lapic timer is not pinned anymore in future.
>>
>> Yes, it's that one. This is a good point against using
>> local_irq_save/restore.
>>
>> Paolo
>
> How about something like below(untested, just want to know if this is
> what you mean):

It can also fix the bug after my testing, I can send out a formal one
if it looks good to you.

Regards,
Wanpeng Li