Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp914956pxb; Tue, 14 Sep 2021 11:26:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzEopdYwtH3MqwXlRSAy3gsQ3k4B49J9vaTB7+4/25Wgi2jcAEGt11xEwuQd4ysvKtYYIK X-Received: by 2002:a05:6512:1101:: with SMTP id l1mr346294lfg.30.1631643960345; Tue, 14 Sep 2021 11:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631643960; cv=none; d=google.com; s=arc-20160816; b=JESFWiH3p24pbW7RiRY106VkOn2ag872XghBidTTMIntsUW3j4ehNfQpSKuY7rZtDg f5n+mypaJ57bbPPandFuy+AEsSSsCpyJ+nyCI7lXC+g/ZkECrBGKd9el28HoDAcx+Aeg BXbi7J9GRtLgiOEbMT3dNERM2geszau4+KceKEv4J6KQZt4o4d0HUiFps7xHk+TnRjau wHunHqF0DUlc+4fmP6qyDMPYzlbeR57CU7Xg5t8bavjz17NsJkKE9XAhlOKm2K4ELU2O evr2pfl1O4ETVAD64zc6XvJZMdIW9PRglPeivVUrJmIIwaHRR+7WyWz1BcDS3Kr23XGR VNSw== 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=4jzp8OKj2Xv2/B05TOcjrNaEFn3wjFQegBk9b8sTmts=; b=u0z/qL9BbjJ3dOoK483oRhHArM/5JOa9Y4sw5JGuo8WcTKkYacah9BEaRIvgqxd8gY Ka/xxIoYraPlqUZ/BJp1VKXZNH7w7M1d3K7KC24HBsYZ5MVqgBVIFtmWI1T8ssTR24lR Ok3wAXqoz8e+GyLKS6mAE+toEW5vOhuEOh4P7Q+5wLPIO6nO8+CVRTh8WbVNTOOjRlzh LgLR/hSdP6GFNZ61iqkjssiPuwpQZ0mvNlXeBrQEvXLWQrpy5qN91zf7AuzX23oA3p0V YIDG/KK8fk50gyP1mWrEA3O7IkUoCnjJ6OOsIRMVRhoiDy4QQ5I+rZhldtjCS4kGpK69 r+nA== 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 bu7si15098301lfb.338.2021.09.14.11.25.31; Tue, 14 Sep 2021 11:26:00 -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 S231202AbhINSZN (ORCPT + 99 others); Tue, 14 Sep 2021 14:25:13 -0400 Received: from mga06.intel.com ([134.134.136.31]:52821 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230332AbhINSZL (ORCPT ); Tue, 14 Sep 2021 14:25:11 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10107"; a="283094760" X-IronPort-AV: E=Sophos;i="5.85,292,1624345200"; d="scan'208";a="283094760" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2021 11:23:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,292,1624345200"; d="scan'208";a="470309634" Received: from nntpdsd52-165.inn.intel.com ([10.125.52.165]) by fmsmga007.fm.intel.com with ESMTP; 14 Sep 2021 11:23:52 -0700 From: alexander.antonov@linux.intel.com To: peterz@infradead.org, linux-kernel@vger.kernel.org Cc: kan.liang@linux.intel.com, ak@linux.intel.com, alexey.v.bayduraev@linux.intel.com, alexander.antonov@linux.intel.com Subject: [PATCH 1/3] Fix filter_tid mask for CHA events on Skylake Server Date: Tue, 14 Sep 2021 21:23:47 +0300 Message-Id: <20210914182349.36186-2-alexander.antonov@linux.intel.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20210914182349.36186-1-alexander.antonov@linux.intel.com> References: <20210914182349.36186-1-alexander.antonov@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Antonov 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 --- arch/x86/events/intel/uncore_snbep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c index 5ddc0f30db6f..9cc65a4194ce 100644 --- a/arch/x86/events/intel/uncore_snbep.c +++ b/arch/x86/events/intel/uncore_snbep.c @@ -3607,7 +3607,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.*/ + int idx = !!(event->hw.config & SNBEP_CBO_PMON_CTL_TID_EN) ? + SKX_CHA_MSR_PMON_BOX_FILTER_TID : 0; for (er = skx_uncore_cha_extra_regs; er->msr; er++) { if (er->event != (event->hw.config & er->config_mask)) -- 2.21.3