Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp941114pxb; Tue, 14 Sep 2021 12:06:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZkGbn60+HbwJmw0lvrKhILCOIZkKuLXY3NYdDiTd8HFCNEF6NP0G3ThHVO6PGX/AmdB4a X-Received: by 2002:a6b:3ec4:: with SMTP id l187mr15085440ioa.217.1631646381845; Tue, 14 Sep 2021 12:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631646381; cv=none; d=google.com; s=arc-20160816; b=pN/yanmefo4Cpj2uD+mggB49TrbdmNql3qxjOW5pppHxasvPKmvUULFmun5axAEAdd lWbfMSK9I9jKFlIzYO5IicTj5GhRL1OpmqGjIWzr4aootcWNwJ/O3psKI1Q8ArclVO5F BJlZmN9bm2liqfMrXirxdE/LtxNof/zzFwA/tIL9WhU0fjuBz40mbZL03tHeA76tHxcS zIRDRctgAtN3TznV4HVrGhbWz4HzIdA2WPDVCYxqDkasSL/aKkL1XYmi1Ef6WFxG1HJq ZprdmHFOq+B/wNZ7DlkoyTBQwz7aSVceOKbhWr/GBnUK81o+rJw+03sVnDP2PDELMPUq HDHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Mr2ioiXxskMFNfyJE4sl/sNbLWCJFXsJlS+17+KqcmM=; b=zkWL8Nbn1Z3NgyQ+O0bPrmegFaqLL1BApEG/nCOebBIiUobfHUtbqEPrIfY1Jt3SMM jR9I/K+dCh+Oc5Xq390YpclDB+AO3MlrypIqGYOGkAiQFrTes8uNphhADmKPhI22OkAR I2YhRNOvpnfw6cW8oJdfbZMRx9nxuCuFJKiXtsbPB8uj/A8kEkPdWHEUWo5TCido6vKd TuDmsFgYIasP4Mkd+flgSnqQ6dihGKuHAKS0Of2ytiBXY40ul1IY5JMTV63kM2b+ysSN +0fJT1IG8UdEY2JHapflmIIMISeQ+dLzUH25y4ypSoLCed9QZaeuFZQg+fb1lmf/hf48 yoUg== 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 i20si11111118ilj.3.2021.09.14.12.06.08; Tue, 14 Sep 2021 12:06:21 -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 S232470AbhINTEz (ORCPT + 99 others); Tue, 14 Sep 2021 15:04:55 -0400 Received: from mga06.intel.com ([134.134.136.31]:56129 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbhINTEy (ORCPT ); Tue, 14 Sep 2021 15:04:54 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10107"; a="283104302" X-IronPort-AV: E=Sophos;i="5.85,292,1624345200"; d="scan'208";a="283104302" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2021 12:03:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,292,1624345200"; d="scan'208";a="529081215" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP; 14 Sep 2021 12:03:36 -0700 Received: from [10.251.14.198] (kliang2-MOBL.ccr.corp.intel.com [10.251.14.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 5D0785805A1; Tue, 14 Sep 2021 12:03:35 -0700 (PDT) Subject: Re: [PATCH 1/3] Fix filter_tid mask for CHA events on Skylake Server To: alexander.antonov@linux.intel.com, peterz@infradead.org, linux-kernel@vger.kernel.org Cc: ak@linux.intel.com, alexey.v.bayduraev@linux.intel.com References: <20210914182349.36186-1-alexander.antonov@linux.intel.com> <20210914182349.36186-2-alexander.antonov@linux.intel.com> From: "Liang, Kan" Message-ID: Date: Tue, 14 Sep 2021 15:03:33 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210914182349.36186-2-alexander.antonov@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/14/2021 2:23 PM, alexander.antonov@linux.intel.com wrote: > 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 Reviewed-by: Kan Liang Thanks, Kan > --- > 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)) >