Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp415222ybg; Sun, 26 Jul 2020 08:35:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeIk8Gh6zlu50kz5E6b0HnXhHsMEi45tTDydggEM2XxuG87shjmJ2r5gEC7ZWTRwN4xSZ/ X-Received: by 2002:a05:6402:318d:: with SMTP id di13mr18412903edb.172.1595777729814; Sun, 26 Jul 2020 08:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595777729; cv=none; d=google.com; s=arc-20160816; b=0g+8RFHPpTm5ts+UAb1YAiJoo7y7JlkRFyC0OaKxNG9mnmTz/OJC0gg9W6qmAyZ6Rq uwFaFoWMw5X6BeCX+w9jtBZ5gRRMmTZQjVpJn3LFHHJdHiwzRQEXMMK9A9htQQ4GFU6V kpOAUTiSmTnvEF42FJP3jwf+vQdQYRqCb0FzLMG2c64gWM7t9HaVw8ibeu6AWvuni/7p fXIfzhAW3i8/seek9PUvw3u+rXeyqrjOJFleyGt0FrDUWBAzWLycr7QN/zXHdJtJvvsy cduqY8Gj4is4Gl6UeswYCHd7jOCvW1+CZNCQap4kaUecRKLGq2pSq6Xw3cvULcQvZVRh NQ2Q== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=REmCrYavKw9nKCIH+5zMajWDl16vf4hDNLfI1N6jPu0=; b=Gdb00HFlMJvlN6qZOq+SZZn8AI1DKMFVZa3KljnYBr1Aki3I2R/W5amhfJnkjVh5Te baAvSoTIZD2dvUKbVv4uqehKHDPBEioZT2yZkietXAznslhwJOh/F6yyTDF+XIbNp+xz hWMrULdd6LfrrmtuFMOt0T7Nv9cidB0Q8D+gEsoeR1d1bbLLKZJwijAi0TyF6+jbF5f9 5Wd5R8+vbtPQAsBzzrBPxywUJ/9X+YgrqpkX03sU6WQ0da+2h0xTITZZJCV1Agu0R5qa rTr5hWEXms6b0CORJm04A9cZEY+/im9GqbD2cMF3EhU4u5tMG/JrIr6cyCkIL2/wiNyj zaXA== 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 p8si3928852ejf.352.2020.07.26.08.35.08; Sun, 26 Jul 2020 08:35:29 -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 S1726998AbgGZPeu (ORCPT + 99 others); Sun, 26 Jul 2020 11:34:50 -0400 Received: from mga03.intel.com ([134.134.136.65]:17603 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726982AbgGZPet (ORCPT ); Sun, 26 Jul 2020 11:34:49 -0400 IronPort-SDR: AOgtFdQFnzlP9Oc0sUQO8RYuoU9sY6kzxAZSinp1MU/AjLpq3iUyeNbctem3R/6EIpPXw+61Ec 5G7Nr4AwJRzQ== X-IronPort-AV: E=McAfee;i="6000,8403,9694"; a="150890967" X-IronPort-AV: E=Sophos;i="5.75,399,1589266800"; d="scan'208";a="150890967" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2020 08:34:49 -0700 IronPort-SDR: NXrOWjH1RLcaiExj4XpLnh36TaRO56/eefdj2tClDV0JCwKXUooP2R3loK+MmcN+3HKW4aE0nY 77lEbFvRgMNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,399,1589266800"; d="scan'208";a="303177534" Received: from sqa-gate.sh.intel.com (HELO clx-ap-likexu.tsp.org) ([10.239.48.212]) by orsmga002.jf.intel.com with ESMTP; 26 Jul 2020 08:34:47 -0700 From: Like Xu To: Paolo Bonzini , Vitaly Kuznetsov , Jim Mattson , kvm@vger.kernel.org Cc: Sean Christopherson , Wanpeng Li , Joerg Roedel , linux-kernel@vger.kernel.org, Like Xu Subject: [PATCH v13 02/10] KVM: x86/vmx: Make vmx_set_intercept_for_msr() non-static and expose it Date: Sun, 26 Jul 2020 23:32:21 +0800 Message-Id: <20200726153229.27149-4-like.xu@linux.intel.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200726153229.27149-1-like.xu@linux.intel.com> References: <20200726153229.27149-1-like.xu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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); #define POSTED_INTR_ON 0 #define POSTED_INTR_SN 1 -- 2.21.3