From patchwork Fri Nov 25 04:05:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Weijiang" X-Patchwork-Id: 13055548 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 7D8C3C433FE for ; Fri, 25 Nov 2022 06:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229731AbiKYGKQ (ORCPT ); Fri, 25 Nov 2022 01:10:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbiKYGKK (ORCPT ); Fri, 25 Nov 2022 01:10:10 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 982EA218BD; Thu, 24 Nov 2022 22:10:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669356609; x=1700892609; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=M4kb7p5+X7+i5pIzuPmnOCjVzb90Vg8h9Ud5SArkn+Y=; b=IU8LTg3zcksBkIC8YWLnK6Kt2j4JHgqpRiD1zMu2DuGoCgQ0U8l3Ch2N r3R4iYcMLCJ7UPsbQDthZMTCuw7ObWO9ADsWccjnH90BlMhSIoqNhtps+ N7L3l13DMbB7w79++tvMgSHJW0uGlm4tPPpIArsiT0jOy/sl7ogEGaSl+ F74gh2dx2RPCwS1MzRvTNAuBdKbeX69tPsd46OmMwrspLfeEGBLc813nG RrPbvD71SOIHKzKd6ELzb/kwNRbMNNZzRHLU5mqGwGynfuH2RPJtVSTS9 aBOjavzNF0nFfJA+2YQ0pKos93pcBwKNrTT1KSE81rbUL0CIeIscbEgMf Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10541"; a="313116816" X-IronPort-AV: E=Sophos;i="5.96,192,1665471600"; d="scan'208";a="313116816" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2022 22:10:05 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10541"; a="784838482" X-IronPort-AV: E=Sophos;i="5.96,192,1665471600"; d="scan'208";a="784838482" Received: from embargo.jf.intel.com ([10.165.9.183]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2022 22:10:04 -0800 From: Yang Weijiang To: seanjc@google.com, pbonzini@redhat.com, jmattson@google.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: like.xu.linux@gmail.com, kan.liang@linux.intel.com, wei.w.wang@intel.com, weijiang.yang@intel.com Subject: [PATCH v2 07/15] KVM: VMX: Support passthrough of architectural LBRs Date: Thu, 24 Nov 2022 23:05:56 -0500 Message-Id: <20221125040604.5051-8-weijiang.yang@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20221125040604.5051-1-weijiang.yang@intel.com> References: <20221125040604.5051-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 Signed-off-by: Yang Weijiang --- 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 1ae2efc29546..9bd52ad3bbf4 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; }