Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp698331pxb; Tue, 2 Feb 2021 15:59:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxG1iErasf3P/W5uHPxrcQQ3GNtJ+RwDm/d4JzbaAY1tRW4SP7fjTpZJTH+YKrK0fH65c0k X-Received: by 2002:a17:906:1d51:: with SMTP id o17mr452597ejh.85.1612310356946; Tue, 02 Feb 2021 15:59:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612310356; cv=none; d=google.com; s=arc-20160816; b=jEcp7JPXuwbctsh06hoszGlhDM344Q1oC97nTtqgl1xAysA79k3JCFLAEBMT4Fkj2q bKC8RwFvhS5sMhU5KR//2b8RmGVBePN3shtGYrVW2moCQ1GdTZ6tHCKRoY+elJsAzwie V6UBhoY2RTFiY7jkk4HCDjfFILzOCTlXAjcJjg/T/hmYONns9+C33Tjnt4pSNxzbblOd bbkkCXBLXo7YJdAMQh8oP2kY6tavuEEKAn0SLS47VnZ02srDqB63WNkpUynTF5eWbm/r Ka8KwD8/aLJiPlkMET1rtz/3hkhAjYq8iXcOyRf5xicH0axedCtBh7eYCdhbwW57vJtQ u1Rw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sXEDoCbpqnPzLdBAmem1rGvsI/H8juywGVzImtjw1dc=; b=C7J778BFYTMAHF1iUH9g8XYm1AXBUcagWY8mnGkg+o/+1b9ydfZC0WIuEMK0yzkH0S UvoNJiv/apuY8jKbk4ySJ0cypwxTmaHjpgPW2DBkgiCawzPgdGjF9tDsnrGOcDod988t p6Dm41uTQY0qf4jCHcwRQrjzcYxaMnemyTxil3rSb52s7745aT5uPAYHj3n9XQbeXWZ0 X1dsMksLXpGxCoropbpJvmb6Ju9YNIIeFtU3QhNmu27SPGqUE/SosahPnRRVu6/2uxAX NkkkAeMPt8G6qorFgqIu13JYW9vPR4g445LLOB5KTXNZXuHmEjuF9+MZt3jvUW9T9ovU oB0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kjwnTZBx; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si204024edp.196.2021.02.02.15.58.52; Tue, 02 Feb 2021 15:59:16 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kjwnTZBx; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237462AbhBBRk1 (ORCPT + 99 others); Tue, 2 Feb 2021 12:40:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:49502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234018AbhBBOM1 (ORCPT ); Tue, 2 Feb 2021 09:12:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 61FD664FB2; Tue, 2 Feb 2021 13:52:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273935; bh=bKbMna5GuS4eLGTnZRrVFBvIizzKzHKr+gzPRS1GmlY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kjwnTZBxpr0LDRDSNNa1KLNpOgeHNIQf1vTj6b8SIJijYdLlPoWabCLS4w0Uj/xla 0wJ2LLIYOHJPBzV+zKSt3G/wAE/CjhGoaCNoEVxbI0OrWE3HWm8femDy5B3qDeZl8i 8P4ahBufzgBqFl5xsVC2nf50MM+vmAgmLwEOh6vc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Like Xu , Sean Christopherson , Paolo Bonzini Subject: [PATCH 4.14 08/30] KVM: x86/pmu: Fix HW_REF_CPU_CYCLES event pseudo-encoding in intel_arch_events[] Date: Tue, 2 Feb 2021 14:38:49 +0100 Message-Id: <20210202132942.472625445@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132942.138623851@linuxfoundation.org> References: <20210202132942.138623851@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Like Xu commit 98dd2f108e448988d91e296173e773b06fb978b8 upstream. 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 Message-Id: <20201230081916.63417-1-like.xu@linux.intel.com> Reviewed-by: Sean Christopherson Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/pmu_intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kvm/pmu_intel.c +++ b/arch/x86/kvm/pmu_intel.c @@ -29,7 +29,7 @@ static struct kvm_event_hw_type_mapping [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 */