Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp15538pxb; Thu, 7 Jan 2021 17:48:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrrjyXB0R1TfH7gGKYA0oaq7W5C6lBtV0IwukelDQjv8WT5qIQvpGrIH2qB5E1fDrxliZ7 X-Received: by 2002:a17:906:6693:: with SMTP id z19mr1096301ejo.376.1610070485007; Thu, 07 Jan 2021 17:48:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610070485; cv=none; d=google.com; s=arc-20160816; b=s3m6whRSUW+BE5AZQY5l2p2AgaGq0+u6C2dNAXDXGtah/cdg3+YcyQtIL8w6ZkF27+ nHfmF4gXWJZ8b/EnBj2nqds/AOcThBSRJkgVr1tx4oMo89rMdGqj3DWtlZOlxswz+Pi7 nuZGSd/+N0hWSzil/DAqysyck9dR5K6yxqD57IVo2KxrLoEj30G2/0ksYqIm3BmcKkxs AiZ/HmgcJw1F2uBi9koV6CeH3Fk7voq+xI37qeAioUyoy8jmizddgRlrRxyZpyenh9J/ q3lfE8l9R6gb3fN2EOG2Y97ILJwzDp9KXRKiuLW1T1Lxv1WwBrEqARI15QHj4kCP7Umw iCBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=PCX7s9ti2bJCi+rbG9VLsAD2xGyPnlb86nrzPjJxook=; b=0AoyJu0tFlgCIKYUXRygiYNaWgzGzZrk8gQMBKRkteGSNg9A5H8avKaeeoev46eSY2 nzpDpexunznWMaG/W521Xzyt8mUzuxnoViPIdvB56PpHScEBalMyMRaQKdnO3/eChbLK yJclvxul35u5QRsRQkwhC/Cyut5acAKF4+L/VLNQjLqukgKclB4prvPXD+HQGZuUAgzm vgZ0W0COtnfiUHixr5V0ix+oJ8Par4REt7GX/K5OiQ38f2BQrD8wPLvucYfzyHEg0BBd j/+SlPRt+i1BYB9XiiGUoMJF6kI/RhL7SF2VCQfv18A431+cpX4lyDwjYYitvbdsUA2/ MhNw== 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 v1si2917371edy.108.2021.01.07.17.47.39; Thu, 07 Jan 2021 17:48:04 -0800 (PST) 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 S1729872AbhAHBo4 (ORCPT + 99 others); Thu, 7 Jan 2021 20:44:56 -0500 Received: from mga09.intel.com ([134.134.136.24]:28000 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727634AbhAHBo4 (ORCPT ); Thu, 7 Jan 2021 20:44:56 -0500 IronPort-SDR: gezU8Bg7z5lJouakynAtjOYUjvV7M0MX4F/z1h4PCCmva7TdY2Hm02J5P/i8HWBlezYo94MjcN Cn7OWI+jXTZw== X-IronPort-AV: E=McAfee;i="6000,8403,9857"; a="177672382" X-IronPort-AV: E=Sophos;i="5.79,330,1602572400"; d="scan'208";a="177672382" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2021 17:43:10 -0800 IronPort-SDR: TleXBY4Q+h7S5GQQZ64EWYJEh4MdbfmmU77MRXl3RYguG7R5seBQAshzujRnbLbg6nFEofFsW7 6mRLD7CBC0HQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,330,1602572400"; d="scan'208";a="379938037" Received: from clx-ap-likexu.sh.intel.com ([10.239.48.108]) by orsmga008.jf.intel.com with ESMTP; 07 Jan 2021 17:43:06 -0800 From: Like Xu To: Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel Cc: Ingo Molnar , Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , ak@linux.intel.com, wei.w.wang@intel.com, kan.liang@intel.com, x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND v13 02/10] KVM: x86/vmx: Make vmx_set_intercept_for_msr() non-static Date: Fri, 8 Jan 2021 09:36:56 +0800 Message-Id: <20210108013704.134985-3-like.xu@linux.intel.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210108013704.134985-1-like.xu@linux.intel.com> References: <20210108013704.134985-1-like.xu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To make code responsibilities clear, we may resue and invoke the vmx_set_intercept_for_msr() in other vmx-specific files (e.g. pmu_intel.c), so expose it to passthrough LBR msrs later. Signed-off-by: Like Xu Reviewed-by: Andi Kleen --- arch/x86/kvm/vmx/vmx.c | 2 +- arch/x86/kvm/vmx/vmx.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 23b46327527e..035bd6d279a4 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -3787,7 +3787,7 @@ static __always_inline void vmx_enable_intercept_for_msr(struct kvm_vcpu *vcpu, vmx_set_msr_bitmap_write(msr_bitmap, msr); } -static __always_inline void vmx_set_intercept_for_msr(struct kvm_vcpu *vcpu, +void vmx_set_intercept_for_msr(struct kvm_vcpu *vcpu, u32 msr, int type, bool value) { if (value) diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h index 9d3a557949ac..adc40d36909c 100644 --- a/arch/x86/kvm/vmx/vmx.h +++ b/arch/x86/kvm/vmx/vmx.h @@ -341,6 +341,8 @@ void pt_update_intercept_for_msr(struct kvm_vcpu *vcpu); void vmx_update_host_rsp(struct vcpu_vmx *vmx, unsigned long host_rsp); int vmx_find_loadstore_msr_slot(struct vmx_msrs *m, u32 msr); void vmx_ept_load_pdptrs(struct kvm_vcpu *vcpu); +void vmx_set_intercept_for_msr(struct kvm_vcpu *vcpu, + u32 msr, int type, bool value); static inline u8 vmx_get_rvi(void) { -- 2.29.2