Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3007449ybi; Mon, 17 Jun 2019 14:33:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3HmnvAICD/p40BW/4lEj4pTRMyoY5RmtKZ17A+Y29Hh2RLXZg4H8xat5RAOWSHkk+cc51 X-Received: by 2002:a17:902:9a91:: with SMTP id w17mr13706460plp.126.1560807194206; Mon, 17 Jun 2019 14:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560807194; cv=none; d=google.com; s=arc-20160816; b=j5ZTuimlx9RIru72j/8ws1OBzUwn//63kORqENuHCcptu1Jt4uw15UFQq6t6vQ2vDB QB5aRM8dR7N9e0SWlZM+y3E4p7MFjdTf+mYC99Hu4EaTcjX8+/ov3nbHwSFORl706+TI WWokzfPpL2shA6g352ChT3SaXVM7jdhbmVqPPgYXKOLYA/LqwQtZvxcqVNjvRwN8XWbh S47ielg0OFv5WzTWNm41fldkjYnkBxvpmt4ms5TXwj9wlAZUuErSATweLFW+ShfCnBRk 6uqa6YFd1ZRZYEdDN97zjuJeXS87t+TaY4QPkgVjuAvRbOKQv1Ku0SRKCqXYYkQRea4q 4hmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=6OFuZTkpqkaKn1Mlyud4v4VO1Jb0utsWyk0yUhWwgdQ=; b=TuYFGEQnZQeco5E4bGS0s7uwWDQBrhogTkZ/7edOxZ68DBQltk3dH7bM0rGUd6pUsw f25VSKx3EjflPAadr1+GD2y8T1WOEd/VedOKuvaxEPB7T0rLqmfBoMzGeJPTlro5at2o 1w34eXYvYfc/A4Wmg37mr7zIPAIkhAfbZG22v3xSHod1qvV4y1RpGJdnminS68hNLet+ Ul0j/fARfDsn6K/9NaBjmLvZnCT/+H7gOqrPwa5JoNgwuQo6LviOzy+HrZsCPGRhIS2t 6W4j1m6BgYDlB1cetyfhPmbIZERrLM8c62LchR2RfBd/W7hHWmvDzjZtiGYYHOsk/Udv Y6LA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6si11235049pgq.275.2019.06.17.14.32.59; Mon, 17 Jun 2019 14:33:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729499AbfFQVcI (ORCPT + 99 others); Mon, 17 Jun 2019 17:32:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47264 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728478AbfFQVcE (ORCPT ); Mon, 17 Jun 2019 17:32:04 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6778333BCD; Mon, 17 Jun 2019 21:32:04 +0000 (UTC) Received: from flask (unknown [10.43.2.199]) by smtp.corp.redhat.com (Postfix) with SMTP id 481D178401; Mon, 17 Jun 2019 21:32:02 +0000 (UTC) Received: by flask (sSMTP sendmail emulation); Mon, 17 Jun 2019 23:32:01 +0200 Date: Mon, 17 Jun 2019 23:32:01 +0200 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Wanpeng Li Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Marcelo Tosatti Subject: Re: [PATCH v4 5/5] KVM: LAPIC: add advance timer support to pi_inject_timer Message-ID: <20190617213201.GA26346@flask> References: <1560770687-23227-1-git-send-email-wanpengli@tencent.com> <1560770687-23227-6-git-send-email-wanpengli@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1560770687-23227-6-git-send-email-wanpengli@tencent.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 17 Jun 2019 21:32:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2019-06-17 19:24+0800, Wanpeng Li: > From: Wanpeng Li > > Wait before calling posted-interrupt deliver function directly to add > advance timer support to pi_inject_timer. > > Cc: Paolo Bonzini > Cc: Radim Krčmář > Cc: Marcelo Tosatti > Signed-off-by: Wanpeng Li > --- Please merge this patch with [2/5], so bisection doesn't break. > arch/x86/kvm/lapic.c | 6 ++++-- > arch/x86/kvm/lapic.h | 2 +- > arch/x86/kvm/svm.c | 2 +- > arch/x86/kvm/vmx/vmx.c | 2 +- > 4 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c > index 1a31389..1a31ba5 100644 > --- a/arch/x86/kvm/lapic.c > +++ b/arch/x86/kvm/lapic.c > @@ -1462,6 +1462,8 @@ static void apic_timer_expired(struct kvm_lapic *apic, bool can_pi_inject) > return; > > if (can_pi_inject && posted_interrupt_inject_timer(apic->vcpu)) { > + if (apic->lapic_timer.timer_advance_ns) > + kvm_wait_lapic_expire(vcpu, true); From where does kvm_wait_lapic_expire() take apic->lapic_timer.expired_tscdeadline? (I think it would be best to take the functional core of kvm_wait_lapic_expire() and make it into a function that takes the expired_tscdeadline as an argument.) Thanks.