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 EDC2EC433FE for ; Wed, 24 Nov 2021 13:16:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348937AbhKXNSJ (ORCPT ); Wed, 24 Nov 2021 08:18:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:36408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347388AbhKXNPp (ORCPT ); Wed, 24 Nov 2021 08:15:45 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3C7B561AAC; Wed, 24 Nov 2021 12:44:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637757864; bh=8EFpFTKCczu3xIZyQb7hfHEQ8EuGqU1WjZvK7o+mepw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=luLP57zS6o90cYybNSzMv87FD+H2kMxT8d3CI1IPFmeg9I7AMwqPxGPMJR3ctKBw0 OVdWMRBurLqh6/6nxkL+su2/8czXzw7Yf/734hhmgrw7g0hH14OTkNcs3Sf/blr1Jq wnXPAWyrepjKhm+afF2NrOwkK8qy0iPm/WGHY8FY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Antonov , "Peter Zijlstra (Intel)" , Kan Liang , Sasha Levin Subject: [PATCH 4.19 302/323] perf/x86/intel/uncore: Fix filter_tid mask for CHA events on Skylake Server Date: Wed, 24 Nov 2021 12:58:12 +0100 Message-Id: <20211124115729.112272297@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115718.822024889@linuxfoundation.org> References: <20211124115718.822024889@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: Alexander Antonov [ Upstream commit e324234e0aa881b7841c7c713306403e12b069ff ] According Uncore Reference Manual: any of the CHA events may be filtered by Thread/Core-ID by using tid modifier in CHA Filter 0 Register. Update skx_cha_hw_config() to follow Uncore Guide. Fixes: cd34cd97b7b4 ("perf/x86/intel/uncore: Add Skylake server uncore support") Signed-off-by: Alexander Antonov Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kan Liang Link: https://lore.kernel.org/r/20211115090334.3789-2-alexander.antonov@linux.intel.com Signed-off-by: Sasha Levin --- arch/x86/events/intel/uncore_snbep.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c index c06074b847fa6..f6f5641c6299a 100644 --- a/arch/x86/events/intel/uncore_snbep.c +++ b/arch/x86/events/intel/uncore_snbep.c @@ -3416,6 +3416,9 @@ static int skx_cha_hw_config(struct intel_uncore_box *box, struct perf_event *ev struct hw_perf_event_extra *reg1 = &event->hw.extra_reg; struct extra_reg *er; int idx = 0; + /* Any of the CHA events may be filtered by Thread/Core-ID.*/ + if (event->hw.config & SNBEP_CBO_PMON_CTL_TID_EN) + idx = SKX_CHA_MSR_PMON_BOX_FILTER_TID; for (er = skx_uncore_cha_extra_regs; er->msr; er++) { if (er->event != (event->hw.config & er->config_mask)) -- 2.33.0