public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Stephane Eranian <eranian@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andi Kleen <ak@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	"mingo@elte.hu" <mingo@elte.hu>, Borislav Petkov <bp@suse.de>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Zhang Rui <rui.zhang@intel.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: [bug] mapping multiple BARs
Date: Wed, 13 Apr 2016 14:40:58 -0500	[thread overview]
Message-ID: <20160413194058.GA5569@localhost> (raw)
In-Reply-To: <20160324094441.GA8893@krava.brq.redhat.com>

Hi Jiri and Boris,

On Thu, Mar 24, 2016 at 10:44:41AM +0100, Jiri Olsa wrote:
> hi,
> I'm hitting following lines in dmesg:
>   resource sanity check: requesting [mem 0xfed10000-0xfed15fff], which spans more than reserved [mem 0xfed10000-0xfed13fff]
>   caller snb_uncore_imc_init_box+0x7c/0xa0 mapping multiple BARs
> 
> I'm on IvyBridge model 58
>   vendor_id       : GenuineIntel
>   cpu family      : 6
>   model           : 58
>   model name      : Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
>   stepping        : 9
>   microcode       : 0x1c
> 
> I've read following threads:
>   http://marc.info/?w=2&r=1&s=mapping+multiple+BARs&q=t
> 
> and it seems this is supposed to be already fixed by:
>   cb171f7abb9a PNP: Work around BIOS defects in Intel MCH area reporting

The case fixed by cb171f7abb9a was this (taken from a dmesg from Dave
Jones at http://marc.info/?l=linux-kernel&m=139769397501891&w=2):

  BIOS-e820: [mem 0x00000000fed10000-0x00000000fed19fff] reserved
  pci 0000:00:00.0: [8086:0154] type 00 class 0x060000
  system 00:01: [mem 0xfed10000-0xfed13fff] has been reserved
  resource map sanity check conflict: 0xfed10000 0xfed15fff 0xfed10000 0xfed13fff pnp 00:01   

In that case, the resource tree looked like this:

  fed10000-fed19fff : reserved
    fed10000-fed13fff : system 00:01

The E820 map reservation is fine, but the system 00:01 reservation is
too small.  We complain because snb_uncore_imc_init_box() wanted to
reserve [mem 0xfed10000-0xfed15fff], which extended past the end of
the 00:01 reservation.

Here we have the same IvyBridge device but a slightly different problem:

> BIOS-e820: [mem 0x00000000fed10000-0x00000000fed13fff] reserved
> pci 0000:00:00.0: [8086:0154] type 00 class 0x060000
> system 00:07: [mem 0xfed10000-0xfed17fff] could not be reserved
> resource sanity check: requesting [mem 0xfed10000-0xfed15fff], which spans more than reserved [mem 0xfed10000-0xfed13fff]
> caller snb_uncore_imc_init_box+0x7c/0xa0 mapping multiple BARs

In this case, the resource tree looks like this:

  fed10000-fed13fff : reserved

The E820 map reservation is too small, but it happens first and
succeeds.  The system 00:07 reservation is larger but fails because it
extends past the end of the E820 reservation.  And the
snb_uncore_imc_init_box() reservation failed similarly.

This is another case where we are getting burned by assuming
hierarchical relationships that do not necessarily exist between
E820 and ACPI resources.  If we could just take the union of those
reservations, and say "anything reserved by E820 *or* ACPI devices is
in use", these problems wouldn't occur.  But the resource tree
enforces these hierarchical relationships that are not required by
specs and often not actually present in the information from BIOS.

Bjorn

      parent reply	other threads:[~2016-04-13 19:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24  9:44 [bug] mapping multiple BARs Jiri Olsa
2016-03-24 10:15 ` Borislav Petkov
2016-03-24 13:36   ` Jiri Olsa
2016-04-02  0:19     ` Jiri Olsa
2016-04-05  6:09     ` Borislav Petkov
2016-04-13 19:40 ` Bjorn Helgaas [this message]

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=20160413194058.GA5569@localhost \
    --to=helgaas@kernel.org \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=bp@suse.de \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    /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