From patchwork Wed Aug 31 22:34:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Weijiang" X-Patchwork-Id: 12961650 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76246C0502C for ; Thu, 1 Sep 2022 01:37:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231530AbiIABh0 (ORCPT ); Wed, 31 Aug 2022 21:37:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232710AbiIABhK (ORCPT ); Wed, 31 Aug 2022 21:37:10 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A8C615C34A; Wed, 31 Aug 2022 18:37:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661996227; x=1693532227; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dth9ZWbiqgebUb3AdCr1vdAzve9ZHQAexkY+TrqhTKU=; b=eeSiJvhMbsI+AM6x/NZrTXt45/XaLACCA+i5cGVROvyqh7LzmLnRIUl0 ynkzzEuzkDi7bfL2XwYNCC5p8nwijch0jNIyCMr1s/gSTtD3M8uN5eMW1 6rO4ilKLm2uUYb02fgl6+1rG243IveZEckOPnRcM11QjrAHKwziGQHL/B Ml/P+wP4ZghRRcUOLxSZb2ewvln59Ct9dT8SjGxXAyAex/W+gjnLycejk OI5ax3WtT+tK3C7Pa26dzfFQVRGYlYCqCkvYvvsdyFq/g7XoDOnNUB7PM 5OnwoegNfnlwEgFrtfuNC5v030I7Go9OnGT0jdjFYhw/mYiUw6ML1zvy6 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10456"; a="321735087" X-IronPort-AV: E=Sophos;i="5.93,279,1654585200"; d="scan'208";a="321735087" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 18:37:01 -0700 X-IronPort-AV: E=Sophos;i="5.93,279,1654585200"; d="scan'208";a="754626002" Received: from embargo.jf.intel.com ([10.165.9.183]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2022 18:37:01 -0700 From: Yang Weijiang To: pbonzini@redhat.com, seanjc@google.com, kvm@vger.kernel.org Cc: like.xu.linux@gmail.com, kan.liang@linux.intel.com, wei.w.wang@intel.com, linux-kernel@vger.kernel.org Subject: [PATCH 07/15] KVM: VMX: Support passthrough of architectural LBRs Date: Wed, 31 Aug 2022 18:34:30 -0400 Message-Id: <20220831223438.413090-8-weijiang.yang@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220831223438.413090-1-weijiang.yang@intel.com> References: <20220831223438.413090-1-weijiang.yang@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Paolo Bonzini MSR_ARCH_LBR_* can be pointed to by records->from, records->to and records->info, so list them in is_valid_passthrough_msr. Signed-off-by: Paolo Bonzini --- arch/x86/kvm/vmx/vmx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 020db207215b..77bad663d804 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -638,6 +638,9 @@ static bool is_valid_passthrough_msr(u32 msr) case MSR_LBR_NHM_TO ... MSR_LBR_NHM_TO + 31: case MSR_LBR_CORE_FROM ... MSR_LBR_CORE_FROM + 8: case MSR_LBR_CORE_TO ... MSR_LBR_CORE_TO + 8: + case MSR_ARCH_LBR_FROM_0 ... MSR_ARCH_LBR_FROM_0 + 31: + case MSR_ARCH_LBR_TO_0 ... MSR_ARCH_LBR_TO_0 + 31: + case MSR_ARCH_LBR_INFO_0 ... MSR_ARCH_LBR_INFO_0 + 31: /* LBR MSRs. These are handled in vmx_update_intercept_for_lbr_msrs() */ return true; }