From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751900AbcF2UuG (ORCPT ); Wed, 29 Jun 2016 16:50:06 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:35140 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751372AbcF2Ut6 (ORCPT ); Wed, 29 Jun 2016 16:49:58 -0400 Subject: Re: [PATCH v2 2/2] KVM: x86: fix underflow in TSC deadline calculation To: yunhong jiang , Wanpeng Li References: <1467199437-3102-1-git-send-email-wanpeng.li@hotmail.com> <1467199437-3102-2-git-send-email-wanpeng.li@hotmail.com> <20160629101655.1b1b1b7a@jnakajim-build> Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Wanpeng Li , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Yunhong Jiang From: Paolo Bonzini Message-ID: Date: Wed, 29 Jun 2016 22:49:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160629101655.1b1b1b7a@jnakajim-build> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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