Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10374797pxu; Wed, 30 Dec 2020 00:27:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYF2SgovY/L5WT7nzXKt3neur8UUUFBSxLnBTjEpVbMB+GXhe9Nm8B6KBTcE5XFiy+V5z5 X-Received: by 2002:a17:906:d62:: with SMTP id s2mr48706834ejh.61.1609316852453; Wed, 30 Dec 2020 00:27:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609316852; cv=none; d=google.com; s=arc-20160816; b=dFE7Y59islaZdyvUWoZ543OJ0DGLQYjHP5FWMpm2eFks8/JcMu+P8hgCeZTWwTOT61 sfd071YsSqHz9a6jMfoNHHdngUcctVaeNCUac9Alu8iZgwPkcgQ9qouZxucu0n242Ucn 7dXPine1Ctpzf/yt51Y613nPiOE6qwO7lCZiE1F23AAhudSDwHBbX96/Ubj1SG0MEBjO P3Yo0N43SQpAGRA5Lb0G8Y8iwNdjPsR7p8bWP/I67Xwsr2Vs8fPQpJtYBeLsbeGQke3X nowTwOYHbUpdPzBpkEenYoeMK4j55Jlf3JuOiZc7lh2cShxD5J3JsgJCLH5vzGrR+QOL 8yUw== 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 :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=Lb2fAAoy+SKRAqYfPazpWGXg6hosL/1D83DlPB6qvFk=; b=kxvj+vDoCDZjYpAlaRsbsGdMCZx6bKujC9PMRO9rLg7MGrMA7OQbGmcWoQhgDFF9ze aX1xUzrG5M3Vefd26e7m3oQuA0kMXoDr4xsR/CER3ZqSIneIXgmR8zeaPc3sPsD/EGl1 UxTBBe7GL58oDAI87px5VX4HWSmRZvIUsuBHdmLiXdAqiUMYmcncTMBMjAVbYmnPTck6 8vOUJOjBD4rMJpwZcD0NscRWS1nPAv1ayCN3WTQOPk6GWc5wJ/kSKBYoNN2HymBA6d/M L4P0VclNzIyPSdSNU0fITaU2sElgdLI83jG1gtOolvRCRFnFfsK8I3iMIg1l5a3VyPjY 7QJg== 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 88si16141138ede.335.2020.12.30.00.27.10; Wed, 30 Dec 2020 00:27:32 -0800 (PST) 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 S1726242AbgL3I0n (ORCPT + 99 others); Wed, 30 Dec 2020 03:26:43 -0500 Received: from mga12.intel.com ([192.55.52.136]:11883 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725814AbgL3I0n (ORCPT ); Wed, 30 Dec 2020 03:26:43 -0500 IronPort-SDR: oUOqEKSaMeS0M8wIMgSA5J7J0WO3QDXyDxrFsQ6y+AlaMxBQ2JZPDISJyJFSdIhPlOz1zzBMIu aLfzl/M1Lbqg== X-IronPort-AV: E=McAfee;i="6000,8403,9849"; a="155782236" X-IronPort-AV: E=Sophos;i="5.78,460,1599548400"; d="scan'208";a="155782236" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Dec 2020 00:24:58 -0800 IronPort-SDR: 3cU/plrV2HX4s6TlKqR1Lmqk3u84t/8rXSTA4+icQciHKVp2rYTKyOUMF+ijnjkyY0de0lKngw eqMB6hhPAYig== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,460,1599548400"; d="scan'208";a="347693944" Received: from clx-ap-likexu.sh.intel.com ([10.239.48.108]) by fmsmga008.fm.intel.com with ESMTP; 30 Dec 2020 00:24:56 -0800 From: Like Xu To: Paolo Bonzini , Stephane Eranian Cc: Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] KVM: x86/pmu: Fix HW_REF_CPU_CYCLES event pseudo-encoding in intel_arch_events[] Date: Wed, 30 Dec 2020 16:19:16 +0800 Message-Id: <20201230081916.63417-1-like.xu@linux.intel.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The HW_REF_CPU_CYCLES event on the fixed counter 2 is pseudo-encoded as 0x0300 in the intel_perfmon_event_map[]. Correct its usage. Fixes: 62079d8a4312 ("KVM: PMU: add proper support for fixed counter 2") Signed-off-by: Like Xu --- 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 a886a47daebd..013e8d253dfa 100644 --- a/arch/x86/kvm/vmx/pmu_intel.c +++ b/arch/x86/kvm/vmx/pmu_intel.c @@ -29,7 +29,7 @@ static struct kvm_event_hw_type_mapping intel_arch_events[] = { [4] = { 0x2e, 0x41, PERF_COUNT_HW_CACHE_MISSES }, [5] = { 0xc4, 0x00, PERF_COUNT_HW_BRANCH_INSTRUCTIONS }, [6] = { 0xc5, 0x00, PERF_COUNT_HW_BRANCH_MISSES }, - [7] = { 0x00, 0x30, PERF_COUNT_HW_REF_CPU_CYCLES }, + [7] = { 0x00, 0x03, PERF_COUNT_HW_REF_CPU_CYCLES }, }; /* mapping between fixed pmc index and intel_arch_events array */ -- 2.29.2