Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp783257ybg; Wed, 3 Jun 2020 13:35:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUVLDW0GBi9MjAqkVsMpLO98H66I8946bKxg9Ya9c9Zar8Ecec9KSOjx6a7Xlb/sV4qr7u X-Received: by 2002:aa7:d698:: with SMTP id d24mr1266279edr.56.1591216517197; Wed, 03 Jun 2020 13:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591216517; cv=none; d=google.com; s=arc-20160816; b=pnHZRB/O1K+2SBnPDatznKfJrpbTJ/9d83vWduzKSGtvhaMZbyanE5TYuMUdYRnlXe TCpcOtdmWFn2Edkw8XxxlnvTG3cwGG62V5cPeKs+I3KHd3iePNhYanSpftC4VYmyCsTn i1hWhqO1MpBRDugvAhTAY9AGheUzQcM73w3p9Y+UHhTeKjtoZoQX/u81mY0KssBh9w+V bQStcKsF8cFgGA38I/HJfwEDthhesHhT3nDdQnKkdFMPE65aXsLKvXw+Gzj4WLoKdKOq Xvo4wSSZismRAYzk8JEmtt9JFCYICvM/HhimZkYDITs9P9dFz+ENtzGM24vIeZVswDaH wuFQ== 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 :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=EiCb1j+EQ3l188juJlaC+HgYJEBXbG8BoFJk4CwNGVs=; b=VVOY+1Trqx+gMp0vlRSNGttwBg3VHyRVXcqHgjEWFd84wD66ANVfwgeamvt67DP9VQ P6+eY3VonabUpgBkNokACbf7Az6K5Xi9HlJNGAWl++v7GCJD3Kdd9EqD9R+lVjQPQYHI RvH5x8Yvyds9rDrXApWAg9VEtGqYcVIw29cfIbRaYfJ0lkim1kPzKrDo1bu+v+fgHz/i nvouAwuCbg5Cfy9jUhr7EYvPlkFCoRgjUHKPihK3Qh0CwQckJCnaEV/I5solQFu/nPpI TVqyAfiKVwVk3bLngVd2Uu/N69N1t499BpfUVi1NrGCEPt/naLk3+O6TG/v+9kgfb223 MV5Q== 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 h6si363612edn.503.2020.06.03.13.34.54; Wed, 03 Jun 2020 13:35:17 -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 S1726181AbgFCUdF (ORCPT + 99 others); Wed, 3 Jun 2020 16:33:05 -0400 Received: from mga05.intel.com ([192.55.52.43]:45491 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbgFCUdF (ORCPT ); Wed, 3 Jun 2020 16:33:05 -0400 IronPort-SDR: ixakrZKy0djqqq32V61yBwYyAG9Dg7sZzmGTqJfn2y78xnocC3EQva11s3FpGzeh0V2syX2yJr ZwlerNkunJyg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 13:33:05 -0700 IronPort-SDR: uN5rqF5/QSJRCFmpf7SBwVkazagR2ifEkLz+T4mDp01oqNHwiB3THuValIjq/o8IgvJsb4poP5 VlclBhG3n8fw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,469,1583222400"; d="scan'208";a="416679395" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.152]) by orsmga004.jf.intel.com with ESMTP; 03 Jun 2020 13:33:04 -0700 From: Sean Christopherson To: Paolo Bonzini Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Like Xu Subject: [PATCH] KVM: VMX: Always treat MSR_IA32_PERF_CAPABILITIES as a valid PMU MSR Date: Wed, 3 Jun 2020 13:33:03 -0700 Message-Id: <20200603203303.28545-1-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.26.0 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 Unconditionally return true when querying the validity of MSR_IA32_PERF_CAPABILITIES so as to defer the validity check to intel_pmu_{get,set}_msr(), which can properly give the MSR a pass when the access is initiated from host userspace. The MSR is emulated so there is no underlying hardware dependency to worry about. Fixes: 27461da31089a ("KVM: x86/pmu: Support full width counting") Cc: Like Xu Signed-off-by: Sean Christopherson --- KVM selftests are completely hosed for me, everything fails on KVM_GET_MSRS. arch/x86/kvm/vmx/pmu_intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx/pmu_intel.c b/arch/x86/kvm/vmx/pmu_intel.c index d33d890b605f..bdcce65c7a1d 100644 --- a/arch/x86/kvm/vmx/pmu_intel.c +++ b/arch/x86/kvm/vmx/pmu_intel.c @@ -181,7 +181,7 @@ static bool intel_is_valid_msr(struct kvm_vcpu *vcpu, u32 msr) ret = pmu->version > 1; break; case MSR_IA32_PERF_CAPABILITIES: - ret = guest_cpuid_has(vcpu, X86_FEATURE_PDCM); + ret = 1; break; default: ret = get_gp_pmc(pmu, msr, MSR_IA32_PERFCTR0) || -- 2.26.0