Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1227037pxx; Tue, 27 Oct 2020 11:12:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCFPZ7IkDnbJPkjmKwbpJE+kj1kzRfAPkMF0UCBJAf5Y0ohgnG8J8An7QgaqgGmGhFza6y X-Received: by 2002:a17:906:3cc:: with SMTP id c12mr3614097eja.210.1603822364394; Tue, 27 Oct 2020 11:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603822364; cv=none; d=google.com; s=arc-20160816; b=jIcyQ+wL63OhgfrPP19Ff7We0H0vao0EGvMxqPCKr25mlGvgfcLzFHpLq01IWANEsg YieqZpBPnSA1ubzrg7heZc+AZG1rVB8h30YAy8C965LF9DgMsWjuA4E27g67XiSR21rh RE+9KQz6oZgrPz2xAr9F16IVISVLXdAHzgXN7M7DwfMUBvQKbQn+n6Lp2d2rnnmAbcBg ryFD5ZuRbjHBMFE/bwVg2tyKihuSdb5jnY16S/1Np7Jz34Pe16tJSBupedojJnp3kOse J8nEWqekBHW6q24CHKC71eUWtYmjsht3o5KbV9YMfABsXprENizyTgLzZdpeRIpOGtGa Ii0A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ycb97l5IjMad9kGARYXScWUkdm8owNtEqNg4ZTw0YPc=; b=hV8r19A80BgvONIhLnI+RGxbRN1LxHUIY/GIPge53xUQMSXsPYorCPfUaOIwXuBy95 Kp8hEfgTn8SmcAjh8cC8Xk6plAQToe46TFRgo9i9uz65YR6zhy9nmg1sU+WJPGjqgaIl leAajb4bJ57yx1bHb5l3r3PJu5auUyBEToy4Qiuz0rMB7wTZi0zcQ513KVC43NCYpqzL pLtT3A8PjydYZl6DX+jrUkj+yLYdgccWdvRIlHRNd7zAlVO4hrEhPFqyLBrLAgUmlgvs YH7DSnH7VpF0wYoZUEnDxF4CPkn/kxyGcdWiCtaELViYXVIjf5xv5q53nsEmtu3M8omw t9Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cIpjR1PM; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si1383720edn.457.2020.10.27.11.12.21; Tue, 27 Oct 2020 11:12:44 -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; dkim=pass header.i=@kernel.org header.s=default header.b=cIpjR1PM; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1821507AbgJ0Roa (ORCPT + 99 others); Tue, 27 Oct 2020 13:44:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:57820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2902158AbgJ0ObI (ORCPT ); Tue, 27 Oct 2020 10:31:08 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 595622222C; Tue, 27 Oct 2020 14:31:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809066; bh=bhr/A7gSqgNphWVM/ryPmakp91u1hjiQa3j7n5+LUxs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cIpjR1PMRLEohhZIdUK06DotolSWCIcmySU8Kq2Mop03OzNICv8mfelN2qbNFXddi nIBNR6YLMp/NncwI+u64FGl/uZPgLl+H4yeT8il22znYqwXN1TLnPbN9Pq2y7Hz5fY 1WFp/pkQixUnByKuKHXFwQh0mZvId5caITu3USsM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kan Liang , "Peter Zijlstra (Intel)" , Sasha Levin Subject: [PATCH 5.4 064/408] perf/x86/intel/uncore: Reduce the number of CBOX counters Date: Tue, 27 Oct 2020 14:50:02 +0100 Message-Id: <20201027135458.030727673@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang [ Upstream commit ee139385432e919f4d1f59b80edbc073cdae1391 ] An oops is triggered by the fuzzy test. [ 327.853081] unchecked MSR access error: RDMSR from 0x70c at rIP: 0xffffffffc082c820 (uncore_msr_read_counter+0x10/0x50 [intel_uncore]) [ 327.853083] Call Trace: [ 327.853085] [ 327.853089] uncore_pmu_event_start+0x85/0x170 [intel_uncore] [ 327.853093] uncore_pmu_event_add+0x1a4/0x410 [intel_uncore] [ 327.853097] ? event_sched_in.isra.118+0xca/0x240 There are 2 GP counters for each CBOX, but the current code claims 4 counters. Accessing the invalid registers triggers the oops. Fixes: 6e394376ee89 ("perf/x86/intel/uncore: Add Intel Icelake uncore support") Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20200925134905.8839-3-kan.liang@linux.intel.com Signed-off-by: Sasha Levin --- arch/x86/events/intel/uncore_snb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/intel/uncore_snb.c b/arch/x86/events/intel/uncore_snb.c index ad9798bd89cf6..aec6e63c6a04a 100644 --- a/arch/x86/events/intel/uncore_snb.c +++ b/arch/x86/events/intel/uncore_snb.c @@ -309,7 +309,7 @@ static struct intel_uncore_ops icl_uncore_msr_ops = { static struct intel_uncore_type icl_uncore_cbox = { .name = "cbox", - .num_counters = 4, + .num_counters = 2, .perf_ctr_bits = 44, .perf_ctr = ICL_UNC_CBO_0_PER_CTR0, .event_ctl = SNB_UNC_CBO_0_PERFEVTSEL0, -- 2.25.1