Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3481837pxk; Mon, 28 Sep 2020 20:16:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTKZRNRGol1yI4uTLV6eqq7J0hVgSccOe38KnzMVfp83Bw6xLKNnr4NopW+q6HOdEMUeG2 X-Received: by 2002:a05:6402:1697:: with SMTP id a23mr1051591edv.195.1601349375766; Mon, 28 Sep 2020 20:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601349375; cv=none; d=google.com; s=arc-20160816; b=GJBIhf1aQuc9wt3x0HhgR9tlOgxGObEb9aZMoUPDkOdIG7PKp2C9Gek6F1D/GFyGwo XNF+IgzcwVof9Lb9Kbn+Clzs+V1kpFfuvhJtnDKAfpTazN9Uvhg+h+T5wokGF0KeWVUU DjJ4xKRXlwOf3z337Zjj4e/mIx7PwAeDZFmarM3MyFyh0FvZc+1MonRVr+GFBemTrEE0 LfxteRBqzcfW9lq2VUAdOWjJxjz5X0xneSrHiNAJs8Q9v1iNkqm4uf98j7cfuMMKxUJq 09fuAFEvR/XSf5KeZ1NL8mLgiMzds+2EnMUtrjEkJb6u3KnDMUlrHx1MM045g4VWxAxL /aug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=fo9HKDozYxHuVIWN3PrYb+Yt8AAXlayVAY2KOUGBSjM=; b=tA9eJYl00QQeEQcLm5QI+IF5CexxUyb00Uyhnap+UgBu8IH2jXaG9KuMBh08YwYQ5m vi9uUIrzKeUtsmGHfCjBCjOxNqvUOJNLz/KEvHlg+YKaXDy2rqrop6gj0c0S7rWsgxJL EB0H11T5loHzsbigQpvUyvMV/G7Ned24wtMgxDXJvNxVpZm2BkLm0IJ8aqDUBQPCceD9 KmkkOxV3IhTUGrvGmq5W/bbEWHGkPAy0nTnD9ioKM2lwKClkvHTQHclFPRjBEcCoo9xQ vvAGaARehC3t55oje2urdGyTJgXmK7gVUJH2tyf+T6cB4KH1wg6DEZnaNqw+8sI5hjaR 2nrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si1878460ejj.664.2020.09.28.20.15.46; Mon, 28 Sep 2020 20:16:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727375AbgI2DNo (ORCPT + 99 others); Mon, 28 Sep 2020 23:13:44 -0400 Received: from mga01.intel.com ([192.55.52.88]:48888 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726064AbgI2DNn (ORCPT ); Mon, 28 Sep 2020 23:13:43 -0400 IronPort-SDR: ZAXWmCA/aiYj1IZQlVLtBznq5qO3dKxtbtpMpOGfq4uS5qsrsxCyO1vnlNhED+2RqrApHVX23e cv5u6l40nRdw== X-IronPort-AV: E=McAfee;i="6000,8403,9758"; a="180260932" X-IronPort-AV: E=Sophos;i="5.77,316,1596524400"; d="scan'208";a="180260932" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 20:13:43 -0700 IronPort-SDR: oqJKntNQQ7OsFrbWSvU0KKwvEI/MzZEgbi7ox6mn0kQs960dmSYL8CFbzDgm0jBfAGVcgX0ZYs /hPV2Dy1X9gA== X-IronPort-AV: E=Sophos;i="5.77,316,1596524400"; d="scan'208";a="488869172" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.160]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2020 20:13:43 -0700 Date: Mon, 28 Sep 2020 20:13:42 -0700 From: Sean Christopherson To: Like Xu Cc: Paolo Bonzini , Vitaly Kuznetsov , Jim Mattson , kvm@vger.kernel.org, Wanpeng Li , Joerg Roedel , linux-kernel@vger.kernel.org Subject: Re: [PATCH v13 02/10] KVM: x86/vmx: Make vmx_set_intercept_for_msr() non-static and expose it Message-ID: <20200929031342.GD31514@linux.intel.com> References: <20200726153229.27149-1-like.xu@linux.intel.com> <20200726153229.27149-4-like.xu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200726153229.27149-4-like.xu@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 26, 2020 at 11:32:21PM +0800, Like Xu wrote: > It's reasonable to call vmx_set_intercept_for_msr() in other vmx-specific > files (e.g. pmu_intel.c), so expose it without semantic changes hopefully. I suppose it's reasonable, but you still need to state what is actually going to use it. > Signed-off-by: Like Xu > --- > arch/x86/kvm/vmx/vmx.c | 4 ++-- > arch/x86/kvm/vmx/vmx.h | 2 ++ > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > index dcde73a230c6..162c668d58f5 100644 > --- a/arch/x86/kvm/vmx/vmx.c > +++ b/arch/x86/kvm/vmx/vmx.c > @@ -3772,8 +3772,8 @@ static __always_inline void vmx_enable_intercept_for_msr(unsigned long *msr_bitm > } > } > > -static __always_inline void vmx_set_intercept_for_msr(unsigned long *msr_bitmap, > - u32 msr, int type, bool value) > +__always_inline void vmx_set_intercept_for_msr(unsigned long *msr_bitmap, > + u32 msr, int type, bool value) > { > if (value) > vmx_enable_intercept_for_msr(msr_bitmap, msr, type); > diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h > index 0d06951e607c..08c850596cfc 100644 > --- a/arch/x86/kvm/vmx/vmx.h > +++ b/arch/x86/kvm/vmx/vmx.h > @@ -356,6 +356,8 @@ void vmx_update_host_rsp(struct vcpu_vmx *vmx, unsigned long host_rsp); > int vmx_find_msr_index(struct vmx_msrs *m, u32 msr); > int vmx_handle_memory_failure(struct kvm_vcpu *vcpu, int r, > struct x86_exception *e); > +void vmx_set_intercept_for_msr(unsigned long *msr_bitmap, > + u32 msr, int type, bool value); This completely defeats the purpose of __always_inline. > > #define POSTED_INTR_ON 0 > #define POSTED_INTR_SN 1 > -- > 2.21.3 >