Received: by 10.223.164.221 with SMTP id h29csp2584247wrb; Thu, 2 Nov 2017 13:32:23 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Tf75Cih56zcCatD6C8OnB4Xi35n7JGFuuiadHKb027+UQmHhnqKArpzTTpeLCZILPt7TuF X-Received: by 10.84.196.129 with SMTP id l1mr4450858pld.290.1509654743763; Thu, 02 Nov 2017 13:32:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509654743; cv=none; d=google.com; s=arc-20160816; b=wjuXTqn8ctoNGtv3TGw4nbpfMMEcxnaV9j4JSqJQw2+pSf62x5Z2IBZwXD2GsxEV6U Q4z4q9EM+MfrXw6nHmQeC6ERtI04Gm9QFxbvaIQcWmZSAXWrjLo/c4z9cXdaXdV9zC5T GyDGxPMGNcngwarBmQVF/pBCcXfiAPEElk78PXpJ4w1y3AwTimk4BRZ6eZndJYe5i5td QAEle1KXkzOV8vYPm8/QeKYD3oaNy9q94RVcfLtgVXGeopn6YpExRc3qu5fdHtbG/ixn mF9UmA2gnt10IO87G8B8Kz1FUw7uUxoUvgucvHIfDjMDziUKdEuxYARinDvWH6KXW/Ua UShA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=NgKNN+cO6ERwWBCPokPnOt1kTkpirsig7Ow6uP1IULw=; b=C7eGZufWWjPlAL0HzNRZVHdmsWtV5o+SanwygFiK4v1J3BWEcK66PVvHWSay7p1e9P afZ6s8aDotoKgCdG2S752zmHaGU2+hozmRfEEs6aobxjxkr2z4XO0JiRaRFo5HPEjfKQ fWzMONfkIzn2Wn7KpSe5ze8oYq4n/AQBxi/1Xc4axrCX9+A5IN+2Tn+oZn7ADfBcBkVs XE4MMhmkbRmpHG7OGLY+PegcZYhb7DbOEW1xv5JPqUSeeT7fZvW5Ko9+cMbQ3xY/aYb8 dyqaF7gCLqdQWlwxuyak4tQhO3aqViFTV38N7/jAMlJ0pwvhTBEKwD79ycgpEKJOVdI+ u9Xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l30si3001627plg.532.2017.11.02.13.32.10; Thu, 02 Nov 2017 13:32:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964892AbdKBUa0 (ORCPT + 99 others); Thu, 2 Nov 2017 16:30:26 -0400 Received: from mga11.intel.com ([192.55.52.93]:31294 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934221AbdKBUaX (ORCPT ); Thu, 2 Nov 2017 16:30:23 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Nov 2017 13:30:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,335,1505804400"; d="scan'208";a="145287037" Received: from otc-lr-04.jf.intel.com ([10.54.39.138]) by orsmga004.jf.intel.com with ESMTP; 02 Nov 2017 13:30:22 -0700 From: kan.liang@intel.com To: tglx@linutronix.de, peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org Cc: acme@kernel.org, eranian@google.com, ak@linux.intel.com, Kan Liang Subject: [PATCH V4 2/8] perf/x86/intel/uncore: correct fixed counter index check for NHM Date: Thu, 2 Nov 2017 13:29:47 -0700 Message-Id: <1509654593-4446-2-git-send-email-kan.liang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509654593-4446-1-git-send-email-kan.liang@intel.com> References: <1509654593-4446-1-git-send-email-kan.liang@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang For Nehalem and Westmere, there is only one fixed counter for W-Box. There is no index which is bigger than UNCORE_PMC_IDX_FIXED. It is not correct to use >= to check fixed counter. The code quality issue will bring problem when new counter index is introduced. Signed-off-by: Kan Liang --- Changes since V3: - New patch for similar '>=' issue on NHM. arch/x86/events/intel/uncore_nhmex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/intel/uncore_nhmex.c b/arch/x86/events/intel/uncore_nhmex.c index 6a5cbe9..6f0d0da 100644 --- a/arch/x86/events/intel/uncore_nhmex.c +++ b/arch/x86/events/intel/uncore_nhmex.c @@ -245,7 +245,7 @@ static void nhmex_uncore_msr_enable_event(struct intel_uncore_box *box, struct p { struct hw_perf_event *hwc = &event->hw; - if (hwc->idx >= UNCORE_PMC_IDX_FIXED) + if (hwc->idx == UNCORE_PMC_IDX_FIXED) wrmsrl(hwc->config_base, NHMEX_PMON_CTL_EN_BIT0); else if (box->pmu->type->event_mask & NHMEX_PMON_CTL_EN_BIT0) wrmsrl(hwc->config_base, hwc->config | NHMEX_PMON_CTL_EN_BIT22); -- 2.7.4 From 1583357113270324069@xxx Mon Nov 06 22:23:32 +0000 2017 X-GM-THRID: 1583357113270324069 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread