Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1380812pxb; Wed, 20 Oct 2021 04:03:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkFxudxEJz52YK8tNBZdJZsjYwaWhkH9KajtreMhush6Nre87Q66XxR/JhdEUJ5LRqToJ7 X-Received: by 2002:a05:6402:14d5:: with SMTP id f21mr30645134edx.268.1634727838508; Wed, 20 Oct 2021 04:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634727838; cv=none; d=google.com; s=arc-20160816; b=ex0j7wSbNTpp5cKQfbnM8J51mWvOk5IfbiY84pBBSpR/+ADT33bTxCTMqw+OlTn7DZ UZPdwwvF4oYNyVFw5p5J2Qs7j9OAjSwXJDdA5rmR9aM7NT5Wbs6Z6t+n5WmnJsYp446E Irk/28Qm9Gu0MeW1cpSEKV3C1H9jtC4mGEYeMeiyj+DRVU3kA8kx8hE2fcDRurhjaSsh TPnehDY6GFu6zeBPMF+Z8w1v2Hpyp4v4kItNUWDTJjhs84KyRh22lFTUXQqyklu486Nn vJoUjQmlTtMWxMme+vGx61QkuLzoGZMPiahb0FmCDpoGk1t205YedwS4kPYmWXQo3gL7 wggA== 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=H55eE8AfJFBGdplanaqZb79MkX5HepLeM4Y5YO47KZw=; b=AHTIqmf01MMqLit4N/KmXLlkCJgjPHUZR1dpzi7ev1IzAb8YUL900X9T68RQiQ3TDs A7nREhozv/K3NQ/iyzojXYhNIz9GBrNtkP1sXN7zvxwNFnZmlirb5BjdTnwQkFAdiHCV dPUYENFA4mDoMadUaOLq8QXfIGpPMIeRNTshoayZgpwEpimsL8ileGKlKZ3CWAcGvp4D jo0i7KR4AzMI5S7kGxKGpPnORvfhjMySH1uI3QO5P/EJdjHTg5c3nST7anb6sYm3hEbM euUs6toO/tx9Tp8um+DK7aK9UG5V10bkT1Exo0GVdoNYFttT6PzbXPGB7h2WdF+RBcYp aZqA== 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 y11si4507656eda.178.2021.10.20.04.03.34; Wed, 20 Oct 2021 04:03:58 -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 S230186AbhJTLCx (ORCPT + 99 others); Wed, 20 Oct 2021 07:02:53 -0400 Received: from mga02.intel.com ([134.134.136.20]:39330 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230063AbhJTLCq (ORCPT ); Wed, 20 Oct 2021 07:02:46 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10142"; a="215917465" X-IronPort-AV: E=Sophos;i="5.87,166,1631602800"; d="scan'208";a="215917465" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2021 04:00:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,166,1631602800"; d="scan'208";a="444322953" Received: from nntpdsd52-165.inn.intel.com ([10.125.52.165]) by orsmga006.jf.intel.com with ESMTP; 20 Oct 2021 04:00:31 -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: [RESEND PATCH 1/3] Fix filter_tid mask for CHA events on Skylake Server Date: Wed, 20 Oct 2021 14:00:26 +0300 Message-Id: <20211020110028.38781-2-alexander.antonov@linux.intel.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20211020110028.38781-1-alexander.antonov@linux.intel.com> References: <20211020110028.38781-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") Reviewed-by: Kan Liang 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