From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBD20C10F13 for ; Thu, 11 Apr 2019 14:13:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9A262217F4 for ; Thu, 11 Apr 2019 14:13:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726728AbfDKONN (ORCPT ); Thu, 11 Apr 2019 10:13:13 -0400 Received: from mga17.intel.com ([192.55.52.151]:30202 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726564AbfDKONN (ORCPT ); Thu, 11 Apr 2019 10:13:13 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2019 07:13:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,337,1549958400"; d="scan'208";a="335857269" Received: from linux.intel.com ([10.54.29.200]) by fmsmga006.fm.intel.com with ESMTP; 11 Apr 2019 07:13:11 -0700 Received: from [10.254.82.195] (kliang2-mobl.ccr.corp.intel.com [10.254.82.195]) (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 A555858044F; Thu, 11 Apr 2019 07:13:10 -0700 (PDT) Subject: Re: [PATCH V2 2/2] perf/x86/intel: Add Tremont core PMU support To: Peter Zijlstra Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, acme@kernel.org, jolsa@kernel.org, eranian@google.com, alexander.shishkin@linux.intel.com, ak@linux.intel.com References: <1554922629-126287-1-git-send-email-kan.liang@linux.intel.com> <1554922629-126287-3-git-send-email-kan.liang@linux.intel.com> <20190411090658.GD4038@hirez.programming.kicks-ass.net> <9ef797ad-bce6-2883-8245-20bdf0b79142@linux.intel.com> <20190411133331.GE11158@hirez.programming.kicks-ass.net> From: "Liang, Kan" Message-ID: <90b0b5ff-9975-6d36-27fd-d5df997c8a80@linux.intel.com> Date: Thu, 11 Apr 2019 10:13:08 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190411133331.GE11158@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/11/2019 9:33 AM, Peter Zijlstra wrote: > On Thu, Apr 11, 2019 at 09:30:10AM -0400, Liang, Kan wrote: > >>> I changed that like so: >>> >>> --- a/arch/x86/events/intel/core.c >>> +++ b/arch/x86/events/intel/core.c >>> @@ -3508,7 +3508,7 @@ tnt_get_event_constraints(struct cpu_hw_ >>> */ >>> if (event->attr.precise_ip == 3) { >>> /* Force instruction:ppp on PMC0 and Fixed counter 0 */ >>> - if (EVENT_CONFIG(event->hw.config) == X86_CONFIG(.event=0xc0)) >>> + if (constraint_match(&fixed_counter0_constraint, event->hw.config)) >> >> Should be >> if (constraint_match(&fixed0_counter0_constraint, event->hw.config)) > > No, because fixed0_counter0_constraint doesn't set an event. > Right, it will mistakenly allow other events to use fixed0. > The logic as I proposed checks if it fits the fixed0 constraint, and if > so, allows f0-c0, otherwise only c0. It looks good. Thanks, Kan > >>> return &fixed0_counter0_constraint; >>> return &counter0_constraint; >>>