Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3566992pxb; Sun, 31 Jan 2021 21:22:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJymYmQNKNNIqZj3E4cMcc72NhHeU/zkpaz2pW8vE2B+7fKyO36ri1uSXh5Wn6fwnqDMZ1EN X-Received: by 2002:a17:907:20aa:: with SMTP id pw10mr16022542ejb.314.1612156954552; Sun, 31 Jan 2021 21:22:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612156954; cv=none; d=google.com; s=arc-20160816; b=dSp16XC4VTQNJvpCllRRUgp6Smk4gBgMDcn3zhireMKK7y9JoLMphmFHhvyaicjD+T sbchYX6J+T3xeFJ2/QKWQqzRAkjMZxJ7Q92PiGl/nIQQKxdbULa767nlZd7i2RLlrBE7 lYHhBmYyr8G6HTSeJaFEH4yAbDD7gJlFUICpCIyRm/nkt/qrcsLzfkJeNN8v5t/9vyoA obM1ixyZ5K3BWeItxlMzAO99Rf/v4uCcxX2aFR1KfocjacTeiUyw3I3yuixhzG9EVqKD PqCf8hKykPAzNSGryZ62BjYrCY47MTMaEZPrTOUSB2PjiDNYrpK4jDffOl3jOMC+paXq NlLQ== 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=bUtzqJOcjaDkdEthnT6lZ4+FqRqJnatVoQULJAHkHUQ=; b=Uxl4SFBHYACCSfUQGcrugl8rAJLy8eYnaqY2XcQJvlOJAkYuDfdtMJZGphLy/3J0tz S19pO+6zsl4a5KA4J9Bnk386R/y1aIuF5ooUI4XLvooMoRNWcOKRvU7+zFexBeSqtODo 1lpQi0LTpf37KfrfnWf5WTwJ8nUdITQnhJy75H3bvscXA4ZWFc0sWhzeKzBa4b231pYy u3WjU0VOzsniZRSFOdrW3B/kl4sgYW8dYzeeqRZmVE/JqJDrKoFqo+2O6qpAJ/5k+U6X CaVTWor/f76v/TbcBeCD8hg8S7SLzTTLs7xTTwds9gJbLcsNajwF1qkTxtsl8+GJtje0 L38g== 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 ca8si10183163edb.365.2021.01.31.21.22.10; Sun, 31 Jan 2021 21:22:34 -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 S229633AbhBAFTC (ORCPT + 99 others); Mon, 1 Feb 2021 00:19:02 -0500 Received: from mga17.intel.com ([192.55.52.151]:9254 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229557AbhBAFS4 (ORCPT ); Mon, 1 Feb 2021 00:18:56 -0500 IronPort-SDR: QUkfAx+HIcWOgSAvuPuauGtXmMgTpS5v308jxX8LPQKmVgPXHlO/50NjUL8aQQkr54dNtr0OZh vuy1ielIzL0w== X-IronPort-AV: E=McAfee;i="6000,8403,9881"; a="160401827" X-IronPort-AV: E=Sophos;i="5.79,391,1602572400"; d="scan'208";a="160401827" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2021 21:17:11 -0800 IronPort-SDR: 0hlxxwExa63tdWHjRkLRb8aR41/Iswwcm3TstTtVQpxu90IQlSP3P9yQ91Q1OjLswhrvNE1yGs CLmfyjxIInvw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,391,1602572400"; d="scan'208";a="390694260" Received: from clx-ap-likexu.sh.intel.com ([10.239.48.108]) by orsmga008.jf.intel.com with ESMTP; 31 Jan 2021 21:17:08 -0800 From: Like Xu To: Paolo Bonzini , Sean Christopherson Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , ak@linux.intel.com, wei.w.wang@intel.com, kan.liang@intel.com, alex.shi@linux.alibaba.com, kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v14 01/11] KVM: x86/vmx: Make vmx_set_intercept_for_msr() non-static Date: Mon, 1 Feb 2021 13:10:29 +0800 Message-Id: <20210201051039.255478-2-like.xu@linux.intel.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210201051039.255478-1-like.xu@linux.intel.com> References: <20210201051039.255478-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 6f94620fd0db..4aa378c20986 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