public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: "'kan.liang@linux.intel.com'" <kan.liang@linux.intel.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "ak@linux.intel.com" <ak@linux.intel.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH] perf/x86/intel/uncore: Fix oops when counting IMC uncore events on some TGL
Date: Wed, 27 May 2020 12:59:35 +0000	[thread overview]
Message-ID: <869fafc80da84d188678c1cbb0267a0b@AcuMS.aculab.com> (raw)
In-Reply-To: <1590582647-90675-1-git-send-email-kan.liang@linux.intel.com>

From: kan.liang@linux.intel.com
> Sent: 27 May 2020 13:31
> 
> From: Kan Liang <kan.liang@linux.intel.com>
> 
> 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 for some TGL machines is
> larger than 0x6000, e.g. 0xd8a0.
> 
> Enlarge the IMC MAP SIZE for TGL to 0xe000.

Replacing one 'random' constant with a different one
doesn't seem like a proper fix.

Surely the actual bounds of the 'memory' area are properly
defined somewhere.
Or at least should come from a table.

You also need to verify that the offsets are within the mapped area.
An unexpected offset shouldn't try to access an invalid address.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2020-05-27 12:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 12:30 [PATCH] perf/x86/intel/uncore: Fix oops when counting IMC uncore events on some TGL kan.liang
2020-05-27 12:59 ` David Laight [this message]
2020-05-27 14:46   ` Liang, Kan
2020-05-27 14:51     ` David Laight
2020-05-27 15:01       ` Liang, Kan
2020-05-27 15:17         ` David Laight
2020-05-27 16:02           ` Liang, Kan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=869fafc80da84d188678c1cbb0267a0b@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=ak@linux.intel.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox