Re: [PATCH v2 2/2] KVM: x86: fix underflow in TSC deadline calculation

From: Paolo Bonzini
Date: Wed Jun 29 2016 - 16:50:11 EST




On 29/06/2016 19:16, yunhong jiang wrote:
>> > + start_sw_tscdeadline(apic);
> IMHO, it's not good to start_sw_tscdeadline() on the start_hv_tscdeadline()
> function. I think it's expected that the sw_timer is stopped when
> start_hv_tscdeadline() returns successsfully, or sw_timer is not impacted if
> start_hv_tscdeadline() fails. But it's not expected that start_hv_tscdeadline()
> returns successfully while in fact it's the sw_timer started instead :)
>
> Would it be better to simply return failure here, and the caller then
> starts the sw_timer?

I agree with Yunhong.

Paolo