Received: by 10.223.164.221 with SMTP id h29csp2586467wrb; Thu, 2 Nov 2017 13:34:55 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RvQjIVmBqi1YFmdb1nDeoVB2epmYBTrCnhqO/EydedsGLLOEooW4vVi5n5ahzFALQkIpma X-Received: by 10.99.173.8 with SMTP id g8mr4686491pgf.87.1509654895341; Thu, 02 Nov 2017 13:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509654895; cv=none; d=google.com; s=arc-20160816; b=FAPsu4vg25HHH6crvtR+Rwa5DhMHBoYh2ROCYopfspebBmAVde9IUQkOSklFkW4q+D p3uN5d5JonlrndGaFj+iHnzOnPzH8o8A0qNYUSHb7mPVAUt5yMT1F1NF9vOncuvuc7rI 2Jhw1KDV7TFvdPa+Jz8bGyoUe+W1zyNWUhEQoEOp1qRigRuFNTHnQrMACkrmqzVnyKv+ hUtqVKFZBZOb8su1Qkdt6TkOFZTgs9TeE3eEmIYLOvu2rQAvcryvPsLRlixztfpwTvip qYcb0B8AAI0cI9dtsjh8jVZwqT3f2zXH/zDqu0vu+5VSSM2inVewonjc6Akt8Cg6mviU 45KA== 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=Z9xJIGCNcUmWJkUD/WSTS0prQWiMt/5/IUyz6wfEGBo=; b=xt3OneU0X1ZAbGazgvX6YaM/x/5/fHDYfmMFym4Y7Pco/Zai73rqZFgZNZPFseqJlE TFsemblW8xkcuqSf6NLxT46AjTzL4sIn0e3ubIeyoptidQodrIjdAL/Jvp87iq/9Thpf kQhQKGLqHAjPpeYPX5CS0VZ0HOwFQOqk89mQiprDYMJCLUWIqdNu45MM5cVp/QAJgipo BREDlsPmfoNPbEJgC0Oiys7he0nN3cBsKr/KgTzq04uHR1UtWA+UCQ1OLpb8/1i0l4+t Mgi8uQdkhw8RftJRiL73WtNblxA//Y2d6O666DPGhTxOw1QVvReZZ7bArpx1GLa/cJHt JwwA== 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 e187si4468532pfg.268.2017.11.02.13.34.41; Thu, 02 Nov 2017 13:34:55 -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 S934566AbdKBUdD (ORCPT + 99 others); Thu, 2 Nov 2017 16:33:03 -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 S964781AbdKBUaX (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="145287040" 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 3/8] perf/x86/intel/uncore: correct fixed counter index check in generic code Date: Thu, 2 Nov 2017 13:29:48 -0700 Message-Id: <1509654593-4446-3-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 There is no index which is bigger than UNCORE_PMC_IDX_FIXED. The only exception is client IMC uncore. It has customized function to deal with the 'UNCORE_PMC_IDX_FIXED + 1' case. It does not touch the generic code. For generic code, 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: - Split the patch for generic change arch/x86/events/intel/uncore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c index 1c5390f..3b8cd88 100644 --- a/arch/x86/events/intel/uncore.c +++ b/arch/x86/events/intel/uncore.c @@ -218,7 +218,7 @@ void uncore_perf_event_update(struct intel_uncore_box *box, struct perf_event *e u64 prev_count, new_count, delta; int shift; - if (event->hw.idx >= UNCORE_PMC_IDX_FIXED) + if (event->hw.idx == UNCORE_PMC_IDX_FIXED) shift = 64 - uncore_fixed_ctr_bits(box); else shift = 64 - uncore_perf_ctr_bits(box); -- 2.7.4 From 1582959905814810827@xxx Thu Nov 02 13:10:06 +0000 2017 X-GM-THRID: 1582959905814810827 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread