Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2660572pxa; Mon, 17 Aug 2020 15:49:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXJOVRa3BahUu/mQ07BDI7yF+0sgUuOzg6dEKAnBV8oL/X+h78doGl8wpnBpOdxkciL60U X-Received: by 2002:a17:906:b6d5:: with SMTP id ec21mr16752461ejb.396.1597704568977; Mon, 17 Aug 2020 15:49:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704568; cv=none; d=google.com; s=arc-20160816; b=bM7VS0MfI3QW0BGBRpw/ZTQA7L/RG5gz24OJLlU32UMRjeGdEnEefKHknPR9HV8CAO LSQxvGNKxfvzLxvMBVFqhg0npqK99ruSM7+KrABsKtR6q3MkCQDrQAwxk7hX94mAJWx2 bqmGufBkWN0r4GvwKiKWnKK+O4jbFsb0x5f8pozCsbUj9X6BHLIckl1mwGtVPoLci6cd kiLNS5n0jFlPJFPJxYZezIa4ot1h/UhFKHF/cU621BMCPL0iUtR8hr5tXdlu6x6C4YvP NB8tJ6LQ82atd0KZB4asyxgGiUmy97JmL9e+3ewxLV8EAN+ha3/Nq7qYbsGYaRx4ObmJ oi/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nZh4QzapcL7ycvoCt4tuQjr2BWQm914hubt4SMRY0TQ=; b=LjJxiraFGQs/fMNMtTdL0m1NyNJKULzudvdOL2Nxu731+5YXxEhZsN+lyly+EWtPYc WKEtkKDuJuRQbeWmzRFWtNJl8pIMGhwnCXFccXSRthRthzSCrD6ZJIo8gBiYg2XDzspv m8wnxf7sbD8duwtSRkQKHGqbQz8BwkG6VsUm7V70gNR9FyCTZ9UFwa0LRClroo21Io4i QSl9RNwFFXAOVgFnZluUsVSa0iQAOEkmN6uiwdYDksmypei0Av6Ka3qtdp59k4rR/Us7 pi1NI5oAqSZIIyloHxM6N0sotC1mTgBMMmyK3XJE4HOHSYvBzBiFGBkfNHUKNKnr8IeK ZQlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GUkreXvE; 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 m13si12063229edr.37.2020.08.17.15.49.04; Mon, 17 Aug 2020 15:49:28 -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=GUkreXvE; 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 S2404141AbgHQTKt (ORCPT + 99 others); Mon, 17 Aug 2020 15:10:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:51236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730750AbgHQPlf (ORCPT ); Mon, 17 Aug 2020 11:41:35 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 2720220760; Mon, 17 Aug 2020 15:41:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678892; bh=F592JwkZMMRW6U976eGgKBJ9UP2MyAhBL78uU1iPJ+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GUkreXvEIo1Ufl2tZbKVq4kSGe/ztOtBi6x7TETQaEPsFnr0JjoORqGOutH8VW/kL snp1qagZRCmvzpytMLm771jQWJ3mwbdRZmXbZRbSg4oHo8IaEjIh1GwunaAs1X2oYx xcS2AbOUheFhhR97bPZnHWjUAazDt5ncX7nt+UL8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ammy Yi , Kan Liang , "Peter Zijlstra (Intel)" , Chao Qin , Sasha Levin Subject: [PATCH 5.7 007/393] perf/x86/intel/uncore: Fix oops when counting IMC uncore events on some TGL Date: Mon, 17 Aug 2020 17:10:57 +0200 Message-Id: <20200817143819.947028640@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang [ Upstream commit 2af834f1faab3f1e218fcbcab70a399121620d62 ] When counting IMC uncore events on some TGL machines, an oops will be triggered. [ 393.101262] BUG: unable to handle page fault for address: ffffb45200e15858 [ 393.101269] #PF: supervisor read access in kernel mode [ 393.101271] #PF: error_code(0x0000) - not-present page Current perf uncore driver still use the IMC MAP SIZE inherited from SNB, which is 0x6000. However, the offset of IMC uncore counters is larger than 0x6000, e.g. 0xd8a0. Enlarge the IMC MAP SIZE for TGL to 0xe000. Fixes: fdb64822443e ("perf/x86: Add Intel Tiger Lake uncore support") Reported-by: Ammy Yi Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Tested-by: Ammy Yi Tested-by: Chao Qin Link: https://lkml.kernel.org/r/1590679169-61823-1-git-send-email-kan.liang@linux.intel.com Signed-off-by: Sasha Levin --- arch/x86/events/intel/uncore_snb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/events/intel/uncore_snb.c b/arch/x86/events/intel/uncore_snb.c index 3de1065eefc44..1038e9f1e3542 100644 --- a/arch/x86/events/intel/uncore_snb.c +++ b/arch/x86/events/intel/uncore_snb.c @@ -1085,6 +1085,7 @@ static struct pci_dev *tgl_uncore_get_mc_dev(void) } #define TGL_UNCORE_MMIO_IMC_MEM_OFFSET 0x10000 +#define TGL_UNCORE_PCI_IMC_MAP_SIZE 0xe000 static void tgl_uncore_imc_freerunning_init_box(struct intel_uncore_box *box) { @@ -1112,7 +1113,7 @@ static void tgl_uncore_imc_freerunning_init_box(struct intel_uncore_box *box) addr |= ((resource_size_t)mch_bar << 32); #endif - box->io_addr = ioremap(addr, SNB_UNCORE_PCI_IMC_MAP_SIZE); + box->io_addr = ioremap(addr, TGL_UNCORE_PCI_IMC_MAP_SIZE); } static struct intel_uncore_ops tgl_uncore_imc_freerunning_ops = { -- 2.25.1