Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp421667ybm; Thu, 28 May 2020 06:20:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuAQk7RfYKVnAHxSrhIN8QP//+rgvlhXytOOAaJQRWY6aHBmdT9OWau3/Qv3H2H+bvAIM9 X-Received: by 2002:a17:906:48ce:: with SMTP id d14mr3279920ejt.468.1590672000227; Thu, 28 May 2020 06:20:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590672000; cv=none; d=google.com; s=arc-20160816; b=l2Jhl1xUWhh/4XIP8bT7bkMn8CfPuOqx5sPVyDiEhFsm45AmzgrY4t7GuF+hoV1UNG FzNQfQq67BLH5Is4+04ubnMGztzJOGYDxRWRuRzNhuLu9Cb1Wb8Yds2ibCNZAy5F25CG 7e4mDwsxcLH+V3AYVL4zGODFXKbAQC+gkbkWhEqvv7Co3865ftjrE/pkgd1DrMEqBzHX uO/09mDAG3MEiFwxtoXBJ0qnAP5QpyVQt0qqgPZdK2Np1EqBuOqri2or9kv24a9csDVh C4x/jevIt0OHWJFFu9D3R/LQS0qrhWhkKjM/IuChOCiAQ8eSrK7XQlc64K1TqUjTtpiv 4amA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=AQZc0us65Nq6an2MNfq2gc8LXVg/DDGQ/WDK2+Gmm2I=; b=q93qNgoGxNRCSKZukkH8AADB31OSSeD3tac+Jd5DOY6zXoMPx23hXTH8C/tJf6wsnw J/bts8Tc+0BZuNmMbFk8b8FlGYrvUmlSxbemPZ0etikrgB8Y5pUuOd7+lTwXc9x2Su9l jBgUPqELqCG27Ih0quxhOKWJArCosA4nwrAeGyxUiWbisuKn3eXC+FJtmYIIT4tz55jG ky134FACWSsBNA+xBdE1VmKUxQnGNJ1XAGHw0J0BpvD/euhTtAjLuWYx4vfM4IkH+vQD PTVOd1M/G5U6GQzC+/MtMfBQI91rSuqHDfbQCvhZtdcZEGBgxFGvS+2Y1fevwcdXUEZb DwzA== ARC-Authentication-Results: i=1; mx.google.com; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si3473229edr.375.2020.05.28.06.19.36; Thu, 28 May 2020 06:20:00 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390252AbgE1NRT (ORCPT + 99 others); Thu, 28 May 2020 09:17:19 -0400 Received: from mga05.intel.com ([192.55.52.43]:17063 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390160AbgE1NRQ (ORCPT ); Thu, 28 May 2020 09:17:16 -0400 IronPort-SDR: fZmyhW8uPS84ORRQ4OEiHglRgO8yndCsZp6huf+FcmZKCtLr4M8c/GwJ6mjfP5zH/yJvaV6crr 7j9hg/jo0uwQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2020 06:17:14 -0700 IronPort-SDR: DzQwRNJFgc8Y3UV302d+mwMNXs8InRUd1bNjdC5CB4sCPQ4O+GXseH+dFfXgc+Caxmt5nLHz0h lgQpgrD1Ux6w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,444,1583222400"; d="scan'208";a="256156996" Received: from otc-lr-04.jf.intel.com ([10.54.39.143]) by orsmga007.jf.intel.com with ESMTP; 28 May 2020 06:17:13 -0700 From: kan.liang@linux.intel.com To: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org Cc: ak@linux.intel.com, David.Laight@ACULAB.COM, Kan Liang Subject: [PATCH V2 1/3] perf/x86/intel/uncore: Fix oops when counting IMC uncore events on some TGL Date: Thu, 28 May 2020 06:15:25 -0700 Message-Id: <1590671727-99311-1-git-send-email-kan.liang@linux.intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang 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 Tested-by: Ammy Yi Tested-by: Chao Qin Signed-off-by: Kan Liang --- No change since V1 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 3de1065..1038e9f 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.7.4