All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: linux-kernel@vger.kernel.org
Cc: Andi Kleen <andi@firstfloor.org>,
	"Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>,
	"mingo@elte.hu" <mingo@elte.hu>, "hpa@zytor.com" <hpa@zytor.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: x86info results ioremap.c:226 __ioremap_caller+0xf2/0x2d6() WARNINGs
Date: Tue, 28 Oct 2008 11:45:42 -0700	[thread overview]
Message-ID: <20081028184542.GI30573@linux-os.sc.intel.com> (raw)
In-Reply-To: <20081023205629.GD18919@linux-os.sc.intel.com>

On Thu, Oct 23, 2008 at 01:56:29PM -0700, Siddha, Suresh B wrote:
> From: Suresh Siddha <suresh.b.siddha@intel.com>
> Subject: fix x86info ioremap sanity check warnings
> 
> Andi Kleen reported:
> > When running x86info on a 2.6.27-git8 system I get
> >
> > resource map sanity check conflict: 0x9e000 0x9efff 0x10000 0x9e7ff System RAM
> > ------------[ cut here ]------------
> > WARNING: at /home/lsrc/linux/arch/x86/mm/ioremap.c:226 __ioremap_caller+0xf2/0x2d6()
> > ...
> 
> Some of the pages below the 1MB ISA addresses will be shared typically by both
> BIOS and system usable RAM. For example:
> 	BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
> 	BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
> 
> x86info reads the low physical address using /dev/mem, which internally
> uses ioremap() for accessing non RAM pages. ioremap() of such low
> pages conflicts with multiple resource entities leading to the
> above warning.
> 
> Fix the warning by skipping the map conflict checks for low addresses
> below 1MB. No PCI BAR's reside in this region anyway.

More cleaner patch(which fixes the issue in a generic fashion) for this
is appended. Ingo, please consider this for inclusion instead.

thanks,
suresh
---

From: Suresh Siddha <suresh.b.siddha@intel.com>
Subject: fix x86info ioremap sanity check warnings

Andi Kleen reported:
> When running x86info on a 2.6.27-git8 system I get
>
> resource map sanity check conflict: 0x9e000 0x9efff 0x10000 0x9e7ff System RAM
> ------------[ cut here ]------------
> WARNING: at /home/lsrc/linux/arch/x86/mm/ioremap.c:226 __ioremap_caller+0xf2/0x2d6()
> ...

Some of the pages below the 1MB ISA addresses will be shared typically by both
BIOS and system usable RAM. For example:
	BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
	BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)

x86info reads the low physical address using /dev/mem, which internally
uses ioremap() for accessing non RAM pages. ioremap() of such low
pages conflicts with multiple resource entities leading to the
above warning.

Change the iomem_map_sanity_check() to allow mapping a page spanning multiple
resource entities (minimum granularity that one can map is a page anyhow).

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---

diff --git a/kernel/resource.c b/kernel/resource.c
index 4089d12..bee50d7 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -17,6 +17,7 @@
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/device.h>
+#include <linux/pfn.h>
 #include <asm/io.h>
 
 
@@ -849,7 +850,8 @@ int iomem_map_sanity_check(resource_size_t addr, unsigned long size)
 			continue;
 		if (p->end < addr)
 			continue;
-		if (p->start <= addr && (p->end >= addr + size - 1))
+		if (PFN_DOWN(p->start) <= PFN_DOWN(addr) &&
+		    PFN_DOWN(p->end) >= PFN_DOWN(addr + size - 1))
 			continue;
 		printk(KERN_WARNING "resource map sanity check conflict: "
 		       "0x%llx 0x%llx 0x%llx 0x%llx %s\n",

  reply	other threads:[~2008-10-28 18:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21  8:36 x86info results ioremap.c:226 __ioremap_caller+0xf2/0x2d6() WARNINGs Andi Kleen
2008-10-23 20:56 ` Suresh Siddha
2008-10-28 18:45   ` Suresh Siddha [this message]
2008-10-28 18:56     ` Ingo Molnar

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=20081028184542.GI30573@linux-os.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=andi@firstfloor.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=venkatesh.pallipadi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.