Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3377022ybi; Fri, 5 Jul 2019 06:24:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqze2p3SzncURZNLUDqMzMN8nBo3KjVPuIHDNRyt7tEMo0waia22+a5IVdhlOFUwQ31eF1sd X-Received: by 2002:a63:6089:: with SMTP id u131mr5754758pgb.314.1562333045806; Fri, 05 Jul 2019 06:24:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562333045; cv=none; d=google.com; s=arc-20160816; b=oOwXuYANzeELqelYnAIvGlYVi/2upCKZx5VHHQY0nbpRG+RA9W77WFuj+WYMFOohvX Lifu0S8/c26E5Ih38meFCIcDVZTnUgn58PbSuIi6jpD//BDfosCbIss5KkxgCtULuhNS e42K6vhMo2zTIBahNqXZ2JG7DA8zusCr5+kzJhIEh8qialB997yU2gx6A77O0imSxU3C 8qXke1xLhJrEL/hR8TC5j6fFJZlcj3DU1GcF0s/kdBK9V/7RsRO/n1mk588vfm+JUHbC rZgouePeV6snLKuKfym7qvIycARkUU8EIsYcY6WGbRVJDCufQj8IZv1cxEyCCrRFtkD+ HekQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=XMEfTsFYfJMndGqPjo03pluC2RJFLgJPB47NoVMy6DM=; b=W71UDk+gtJRpb0wtaxPGd2Wf1LEp1ajdHhgMjUQR/V5w51T9jmYOh6GQC8UhJckwLl bc8T0MqGRwBx/NwfNuOwbGMpQLLDXmKWw4nMRz5+j6q9uE+NAJVb0RjCHG8p2P0VAENl Fur+/obZ1d8ra9grQniNYUVfAsXUu8I20/IW0PITXQsWi3C37xuD99hQTQ90MSZKepZi Y+0OuWJRC7YoU3NK8RM3+7LXpGnjoUhbDhENUPgrYJ2a0GUipJ06Qp+yfGnIgsdXDxS4 guJc1DKTDzD6E7bvxTJ5VuYBr/eCAqX0EouInk9EVvDVSjooAEYN8iN6c+ReW4jHRAGW V7wQ== 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 f96si8891838plb.339.2019.07.05.06.23.49; Fri, 05 Jul 2019 06:24:05 -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 S1728861AbfGEMhs (ORCPT + 99 others); Fri, 5 Jul 2019 08:37:48 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53560 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726921AbfGEMhr (ORCPT ); Fri, 5 Jul 2019 08:37:47 -0400 Received: by mail-wm1-f66.google.com with SMTP id x15so8714515wmj.3 for ; Fri, 05 Jul 2019 05:37:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XMEfTsFYfJMndGqPjo03pluC2RJFLgJPB47NoVMy6DM=; b=iEDMMBUz51cMfiLmLwvr6sbNBWXm2bMeAGE0aMpbDLnhYOl91WAFpRY92AhRPtLgrw s6/4gmCc8/68siw1kLuws7yjpAr44kL1NZsd9RT72xXGxXK92OCcHWHZCUpOm5Z0iVTC NVI5k7qCtOuwmU4V2+HuA1uHelSlwor+mR/xxvf3Ef5FLSAD0EudURpfKtIlT+F68fIy v9DhiHwi0svceDqiGgEWmKN0k2Q8FOQ4Kb0tnDr0uigQRbTG5PJ2tZWlwlB+QMCAKLYU ZMh4da2s1tzJufhfXCzMSNWuydx5NewOe9lmmI3OlHWc+s5Rsygnc2oSvSlIhQtlcuCN iO2Q== X-Gm-Message-State: APjAAAULwUSVpjHFsiUfmir6F7DsthcQqV+LD1xI1XCuMy7srP8xYv4t 2iVbmsCASiQD5A4OYU922/ew6Q== X-Received: by 2002:a7b:cae2:: with SMTP id t2mr3382337wml.157.1562330265650; Fri, 05 Jul 2019 05:37:45 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:e943:5a4e:e068:244a? ([2001:b07:6468:f312:e943:5a4e:e068:244a]) by smtp.gmail.com with ESMTPSA id l2sm1859000wmj.4.2019.07.05.05.37.44 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jul 2019 05:37:45 -0700 (PDT) Subject: Re: [PATCH v5 2/4] KVM: LAPIC: Inject timer interrupt via posted interrupt To: Wanpeng Li , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Marcelo Tosatti References: <1561110002-4438-1-git-send-email-wanpengli@tencent.com> <1561110002-4438-3-git-send-email-wanpengli@tencent.com> From: Paolo Bonzini Message-ID: <587f329a-4920-fcbf-b2b1-9265a1d6d364@redhat.com> Date: Fri, 5 Jul 2019 14:37:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <1561110002-4438-3-git-send-email-wanpengli@tencent.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/06/19 11:40, Wanpeng Li wrote: > +bool __read_mostly pi_inject_timer = 0; > +module_param(pi_inject_timer, bool, S_IRUGO | S_IWUSR); > + > #define KVM_NR_SHARED_MSRS 16 > > struct kvm_shared_msrs_global { > @@ -7032,6 +7036,7 @@ int kvm_arch_init(void *opaque) > host_xcr0 = xgetbv(XCR_XFEATURE_ENABLED_MASK); > > kvm_lapic_init(); > + pi_inject_timer = housekeeping_enabled(HK_FLAG_TIMER); This overwrites whatever the user specified, so perhaps: u8 __read_mostly pi_inject_timer = -1; module_param(pi_inject_timer, bool, S_IRUGO | S_IWUSR); ... if (pi_inject_timer == -1) pi_inject_timer = housekeeping_enabled(HK_FLAG_TIMER); Also, do you want to disable the preemption timer if pi_inject_timer and enable_apicv are both true? Paolo