Re: [bug] mapping multiple BARs

From: Borislav Petkov
Date: Tue Apr 05 2016 - 02:09:36 EST


On Thu, Mar 24, 2016 at 02:36:56PM +0100, Jiri Olsa wrote:
> On Thu, Mar 24, 2016 at 11:15:06AM +0100, Borislav Petkov wrote:
> > 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
> >
> > And as we talked on IRC, it looked like the quirk gets applied on my
> > machine and not on yours. I.e., I see:
> >
> > [ 0.669351] pnp 00:01: [Firmware Bug]: PNP resource [mem 0xfed10000-0xfed13fff] covers only part of 0000:00:00.0 Intel MCH; extending to [mem 0xfed10000-0xfed17fff]
> >
> > and you don't.
> >
> > Can you add some debug printks to quirk_intel_mch() to find out why?
>
> seems like this function did not find any quirk
> (patch for the output attached)
>
> [root@intel-chiefriver-04 ~]# dmesg | grep quirk_intel_mch
> quirk_intel_mch dev WDT0
> quirk_intel_mch region start ffff880244617778, end fed10000
> quirk_intel_mch mch start fed10000, end fed17fff
> quirk_intel_mch res start 6a4, end 6a4
> quirk_intel_mch res start 6a0, end 6a0
> quirk_intel_mch dev LDRC
> quirk_intel_mch region start ffff880244617378, end fed10000
> quirk_intel_mch mch start fed10000, end fed17fff
> quirk_intel_mch res start 2e, end 2f
> quirk_intel_mch res start 4e, end 4f
> quirk_intel_mch res start 61, end 61
> quirk_intel_mch res start 63, end 63
> quirk_intel_mch res start 65, end 65
> quirk_intel_mch res start 67, end 67
> quirk_intel_mch res start 70, end 70
> quirk_intel_mch res start 80, end 80
> quirk_intel_mch res start 92, end 92
> quirk_intel_mch res start b2, end b3
> quirk_intel_mch res start 680, end 69f
> quirk_intel_mch res start 1004, end 1013
> quirk_intel_mch res start ffff, end ffff
> quirk_intel_mch res start ffff, end ffff
> quirk_intel_mch res start 400, end 453
> quirk_intel_mch res start 458, end 47f
> quirk_intel_mch res start 500, end 57f
> quirk_intel_mch res start 164e, end 164f
> quirk_intel_mch dev CWDT
> quirk_intel_mch region start ffff8802446b8b78, end fed10000
> quirk_intel_mch mch start fed10000, end fed17fff
> quirk_intel_mch res start 454, end 457
> quirk_intel_mch dev PDRC
> quirk_intel_mch region start ffff8802446bcb78, end fed10000
> quirk_intel_mch mch start fed10000, end fed17fff
> quirk_intel_mch res start fed1c000, end fed1ffff
> quirk_intel_mch res start fed10000, end fed17fff

Here's an exact match.

> quirk_intel_mch res start fed18000, end fed18fff
> quirk_intel_mch res start fed19000, end fed19fff
> quirk_intel_mch res start f8000000, end fbffffff
> quirk_intel_mch res start fed20000, end fed3ffff
> quirk_intel_mch res start fed90000, end fed93fff
> quirk_intel_mch res start fed45000, end fed8ffff
> quirk_intel_mch res start ff000000, end ffffffff
> quirk_intel_mch res start fee00000, end feefffff
> quirk_intel_mch res start b15b0000, end b15b0fff
>
>
> but AFAICS the following dmesg output:
>
> 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
>
> is related to checking of iomem_resource, which I haven't
> found connected to the pnp_dev resources from the quirk code

Hmm, so mine says:

[ 0.643771] pnp 00:01: [Firmware Bug]: PNP resource [mem 0xfed10000-0xfed13fff] covers only part of 0000:00:00.0 Intel MCH; extending to [mem 0xfed10000-0xfed17fff]

which, AFAIR, means, the PNP resource needs to be extended. And which
the quirk does.

In your case, snb_uncore_imc_init_box() requests bigger resource than
what is reserved, AFAICT.

And your e820 map has those ranges too:

BIOS-e820: [mem 0x00000000fed10000-0x00000000fed13fff] reserved
BIOS-e820: [mem 0x00000000fed18000-0x00000000fed19fff] reserved

There's also

system 00:07: [mem 0xfed10000-0xfed17fff] could not be reserved

in your dmesg.

This all looks like a funny BIOS to me. And pretty old at that:

DMI: Intel Corporation 2012 Client Platform/Emerald Lake 2, BIOS ACRVMBY1.86C.0078.P00.1201161002 01/16/2012

Can you get an update or so?

Bjorn, can you make any sense of this?

Thanks.

--
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix ImendÃrffer, Jane Smithard, Graham Norton, HRB 21284 (AG NÃrnberg)
--