From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752651AbdF2LnU (ORCPT ); Thu, 29 Jun 2017 07:43:20 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33480 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751837AbdF2LnK (ORCPT ); Thu, 29 Jun 2017 07:43:10 -0400 Subject: Re: [PATCH v3] KVM: LAPIC: Fix lapic timer injection delay To: Wanpeng Li Cc: "linux-kernel@vger.kernel.org" , kvm , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Wanpeng Li References: <1498613352-4651-1-git-send-email-wanpeng.li@hotmail.com> <68c0d7f8-683f-c7fa-b328-e90e8dd9a789@redhat.com> <6fc8f133-15b8-3ee2-1483-614642deffa0@redhat.com> <62c6b468-52c0-38c5-e15f-c770483188cd@redhat.com> From: Paolo Bonzini Message-ID: Date: Thu, 29 Jun 2017 13:43:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/06/2017 10:44, Wanpeng Li wrote: >>> You still need to enable the preemption timer even if you return 1, so >>> in lapic.c it becomes >>> >>> if (!apic_lvtt_period(apic)) { >>> if (r) >>> apic_timer_expired(apic); >>> if (atomic_read(&apic->lapic_timer.pending)) >>> need_cancel = true; >>> } >> I think the codes are more clear but the same as above. We didn't >> program preemption timer vmcs field if delta == 0, so how to >> understand "need to enable the preemption timer even if return 1"? > I guess you mean start_hv_timer() should return true, right? vmx.c's set_hv_timer callback should set the preemption timer execution control. Otherwise, kvm_lapic_hv_timer_expired is again not called. Paolo