LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* x86info results ioremap.c:226 __ioremap_caller+0xf2/0x2d6() WARNINGs
@ 2008-10-21  8:36 Andi Kleen
  2008-10-23 20:56 ` Suresh Siddha
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2008-10-21  8:36 UTC (permalink / raw)
  To: venkatesh.pallipadi, suresh.b.siddha, linux-kernel


When running x86info on a 2.6.27-git8 system I get

(the M taint is harmless in this case, came from other testing)

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()
Modules linked in:
Pid: 8805, comm: x86info Tainted: G   M       2.6.27-git8 #110
Call Trace:
 [<ffffffff80236ba1>] warn_on_slowpath+0x58/0x75
 [<ffffffff8021db80>] ? do_flush_tlb_all+0x0/0x37
 [<ffffffff8023b058>] ? on_each_cpu+0x21/0x2c
 [<ffffffff8023bc80>] ? iomem_map_sanity_check+0x61/0x89
 [<ffffffff8022467b>] __ioremap_caller+0xf2/0x2d6
 [<ffffffff803c0648>] ? read_mem+0x5a/0xca
 [<ffffffff802248e4>] xlate_dev_mem_ptr+0x73/0x9e
 [<ffffffff803c0648>] read_mem+0x5a/0xca
 [<ffffffff8028ed19>] vfs_read+0xab/0x134
 [<ffffffff8028f01e>] sys_read+0x47/0x70
 [<ffffffff8020b27b>] system_call_fastpath+0x16/0x1b
---[ end trace 8262d1d3f66bcc38 ]---
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()
Modules linked in:
Pid: 8805, comm: x86info Tainted: G   M    W  2.6.27-git8 #110
Call Trace:
 [<ffffffff80236ba1>] warn_on_slowpath+0x58/0x75
 [<ffffffff8021db80>] ? do_flush_tlb_all+0x0/0x37
 [<ffffffff8023b058>] ? on_each_cpu+0x21/0x2c
 [<ffffffff8023bc80>] ? iomem_map_sanity_check+0x61/0x89
 [<ffffffff8022467b>] __ioremap_caller+0xf2/0x2d6
 [<ffffffff803c0648>] ? read_mem+0x5a/0xca
 [<ffffffff802248e4>] xlate_dev_mem_ptr+0x73/0x9e
 [<ffffffff803c0648>] read_mem+0x5a/0xca
 [<ffffffff8028ed19>] vfs_read+0xab/0x134
 [<ffffffff8028f01e>] sys_read+0x47/0x70
 [<ffffffff8020b27b>] system_call_fastpath+0x16/0x1b
---[ end trace 8262d1d3f66bcc38 ]---
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()
Modules linked in:
Pid: 9236, comm: x86info Tainted: G   M    W  2.6.27-git8 #110
Call Trace:
 [<ffffffff80236ba1>] warn_on_slowpath+0x58/0x75
 [<ffffffff8021db80>] ? do_flush_tlb_all+0x0/0x37
 [<ffffffff8023b058>] ? on_each_cpu+0x21/0x2c
 [<ffffffff8023bc80>] ? iomem_map_sanity_check+0x61/0x89
 [<ffffffff8022467b>] __ioremap_caller+0xf2/0x2d6
 [<ffffffff803c0648>] ? read_mem+0x5a/0xca
 [<ffffffff802248e4>] xlate_dev_mem_ptr+0x73/0x9e
 [<ffffffff803c0648>] read_mem+0x5a/0xca
 [<ffffffff8028ed19>] vfs_read+0xab/0x134
 [<ffffffff8028f01e>] sys_read+0x47/0x70
 [<ffffffff8020b27b>] system_call_fastpath+0x16/0x1b
---[ end trace 8262d1d3f66bcc38 ]---
resource map sanity check conflict: 0x9e000 0x9efff 0x10000 0x9e7ff System RAM

... more of them ...

-Andi

-- 
ak@linux.intel.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: x86info results ioremap.c:226 __ioremap_caller+0xf2/0x2d6() WARNINGs
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Suresh Siddha @ 2008-10-23 20:56 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Pallipadi, Venkatesh, Siddha, Suresh B, linux-kernel, mingo, hpa, tglx

On Tue, Oct 21, 2008 at 01:36:15AM -0700, Andi Kleen wrote:
> 
> When running x86info on a 2.6.27-git8 system I get
> 
> (the M taint is harmless in this case, came from other testing)
> 
> 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()
> Modules linked in:
> Pid: 8805, comm: x86info Tainted: G   M       2.6.27-git8 #110
> Call Trace:
>  [<ffffffff80236ba1>] warn_on_slowpath+0x58/0x75
>  [<ffffffff8021db80>] ? do_flush_tlb_all+0x0/0x37
>  [<ffffffff8023b058>] ? on_each_cpu+0x21/0x2c
>  [<ffffffff8023bc80>] ? iomem_map_sanity_check+0x61/0x89
>  [<ffffffff8022467b>] __ioremap_caller+0xf2/0x2d6
>  [<ffffffff803c0648>] ? read_mem+0x5a/0xca
>  [<ffffffff802248e4>] xlate_dev_mem_ptr+0x73/0x9e
>  [<ffffffff803c0648>] read_mem+0x5a/0xca
>  [<ffffffff8028ed19>] vfs_read+0xab/0x134
>  [<ffffffff8028f01e>] sys_read+0x47/0x70
>  [<ffffffff8020b27b>] system_call_fastpath+0x16/0x1b
> ---[ end trace 8262d1d3f66bcc38 ]---

Andi, Appended patch fixes this issue. Thanks.

---

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.

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

diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index ae71e11..ed17c9b 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -221,9 +221,15 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,
 
 	/*
 	 * Check if the request spans more than any BAR in the iomem resource
-	 * tree.
+	 * tree. Skip this check for physical addresses below ISA_END_ADDRESS,
+	 * as typically some of the pages below these addresses will be shared
+	 * by both BIOS and system RAM(as reported by e820) and it will
+	 * result in a conflict if some app (through /dev/mem mapping)
+	 * is trying to accesses these pages.
+	 * NO PCI BAR's reside in this region anyway.
 	 */
-	WARN_ON(iomem_map_sanity_check(phys_addr, size));
+	WARN_ON(last_addr >= ISA_END_ADDRESS &&
+		iomem_map_sanity_check(phys_addr, size));
 
 	/*
 	 * Don't allow anybody to remap normal RAM that we're using..

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: x86info results ioremap.c:226 __ioremap_caller+0xf2/0x2d6() WARNINGs
  2008-10-23 20:56 ` Suresh Siddha
@ 2008-10-28 18:45   ` Suresh Siddha
  2008-10-28 18:56     ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Suresh Siddha @ 2008-10-28 18:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Pallipadi, Venkatesh, mingo, hpa, tglx

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",

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: x86info results ioremap.c:226 __ioremap_caller+0xf2/0x2d6() WARNINGs
  2008-10-28 18:45   ` Suresh Siddha
@ 2008-10-28 18:56     ` Ingo Molnar
  0 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2008-10-28 18:56 UTC (permalink / raw)
  To: Suresh Siddha; +Cc: linux-kernel, Andi Kleen, Pallipadi, Venkatesh, hpa, tglx


* Suresh Siddha <suresh.b.siddha@intel.com> wrote:

> > 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.

applied to tip/core/urgent, thanks Suresh!

	Ingo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-10-28 18:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2008-10-28 18:56     ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).