Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2640354pxb; Tue, 24 Aug 2021 04:13:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsYu2mVXTUTRbKvKeE1LI5N5xQfT4e8r8CNlqCeluKXkq2nGR/r1HcPXPn8bye9YSVVRv5 X-Received: by 2002:a50:d088:: with SMTP id v8mr931814edd.387.1629803600650; Tue, 24 Aug 2021 04:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629803600; cv=none; d=google.com; s=arc-20160816; b=gNSu7VWhLFN9WwCLxPQzAc11xAkvpF67KvyfpU4TZRD7QbTgPkD5xivdvCgRW71mBs SRpGnoPhY14TNsnFDJeSM+/VCKxETdoMHxl8zOJouRqni9yiVO6geX5NCdHqxbzkkqb9 sb5B1vLit2UIv0PEIMQz7WKQaedy2X6U6IKLGZSlKFgDEH+ephqKSI1UFNAvaIxpLbWC JspFUYN5bsLpyrKxruXSDdPzM5CVjoNdYSh77RXKAxT0Dw917y1yEg/7WYGJFAKMRNgz +u/ewV2EtoSG47YHK5xa0C6aEXgOJ1/ODmEH+j8DvO976zTmYibHN6B9iyhTgUrqFGPE xX8w== 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; bh=piPEcIUBs7Smrnym9krVX3vtieBMY33EUXGzYDCX4z4=; b=mDrayM+auXEiB5Hd21tOtErjXfoJH+bB/V1uUz5dwmZRawCxVKX1LbAmQKjR33e+BD wCjVD6RBy9sIADFVXNxHPkWi7lllQmsaN0HBdP2C2EoPG1EtlJ8w5AWu8Obrn9NTq+B8 A/GeXz2BnUqXlzvz0WYuHiQ6HwlulHGtKycnNT5dQhiVkcUEZwbmoL9wALz6uGUxuKmp bA5v5SraPA2gjVp2quriD98DtQI98FpXa5S+b6/d7z8HBQ3Z7vi4FP5OxWr5FFxQz2Zg /HcUMMysMKtUNj+/Qd3jPv3+LHjosZ6Pcn8qYlu/nN+12paZK+n81NTykAzBn6fhqZ3v MB4w== 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 cx19si16483375edb.25.2021.08.24.04.12.57; Tue, 24 Aug 2021 04:13:20 -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 S236847AbhHXLJ1 (ORCPT + 99 others); Tue, 24 Aug 2021 07:09:27 -0400 Received: from mga18.intel.com ([134.134.136.126]:3711 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236744AbhHXLJO (ORCPT ); Tue, 24 Aug 2021 07:09:14 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10085"; a="204423849" X-IronPort-AV: E=Sophos;i="5.84,347,1620716400"; d="scan'208";a="204423849" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2021 04:08:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,347,1620716400"; d="scan'208";a="493501658" Received: from lxy-dell.sh.intel.com ([10.239.159.31]) by fmsmga008.fm.intel.com with ESMTP; 24 Aug 2021 04:08:28 -0700 From: Xiaoyao Li To: Paolo Bonzini Cc: Xiaoyao Li , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] KVM: VMX: RTIT_CTL_BRANCH_EN has no dependency on other CPUID bit Date: Tue, 24 Aug 2021 19:07:41 +0800 Message-Id: <20210824110743.531127-4-xiaoyao.li@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210824110743.531127-1-xiaoyao.li@intel.com> References: <20210824110743.531127-1-xiaoyao.li@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Per Intel SDM, RTIT_CTL_BRANCH_EN bit has no dependency on any CPUID leaf 0x14. Signed-off-by: Xiaoyao Li --- arch/x86/kvm/vmx/vmx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 7ed96c460661..4a70a6d2f442 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -7116,7 +7116,8 @@ static void update_intel_pt_cfg(struct kvm_vcpu *vcpu) /* Initialize and clear the no dependency bits */ vmx->pt_desc.ctl_bitmask = ~(RTIT_CTL_TRACEEN | RTIT_CTL_OS | - RTIT_CTL_USR | RTIT_CTL_TSC_EN | RTIT_CTL_DISRETC); + RTIT_CTL_USR | RTIT_CTL_TSC_EN | RTIT_CTL_DISRETC | + RTIT_CTL_BRANCH_EN); /* * If CPUID.(EAX=14H,ECX=0):EBX[0]=1 CR3Filter can be set otherwise @@ -7134,12 +7135,11 @@ static void update_intel_pt_cfg(struct kvm_vcpu *vcpu) RTIT_CTL_CYC_THRESH | RTIT_CTL_PSB_FREQ); /* - * If CPUID.(EAX=14H,ECX=0):EBX[3]=1 MTCEn BranchEn and - * MTCFreq can be set + * If CPUID.(EAX=14H,ECX=0):EBX[3]=1 MTCEn and MTCFreq can be set */ if (intel_pt_validate_cap(vmx->pt_desc.caps, PT_CAP_mtc)) vmx->pt_desc.ctl_bitmask &= ~(RTIT_CTL_MTC_EN | - RTIT_CTL_BRANCH_EN | RTIT_CTL_MTC_RANGE); + RTIT_CTL_MTC_RANGE); /* If CPUID.(EAX=14H,ECX=0):EBX[4]=1 FUPonPTW and PTWEn can be set */ if (intel_pt_validate_cap(vmx->pt_desc.caps, PT_CAP_ptwrite)) -- 2.27.0