LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>,
	"Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	mingo@elte.hu, hpa@zytor.com, tglx@linutronix.de
Subject: Re: x86info results ioremap.c:226 __ioremap_caller+0xf2/0x2d6() WARNINGs
Date: Thu, 23 Oct 2008 13:56:29 -0700	[thread overview]
Message-ID: <20081023205629.GD18919@linux-os.sc.intel.com> (raw)
In-Reply-To: <20081021083615.GA4658@basil.nowhere.org>

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

  reply	other threads:[~2008-10-23 20:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21  8:36 Andi Kleen
2008-10-23 20:56 ` Suresh Siddha [this message]
2008-10-28 18:45   ` Suresh Siddha
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=20081023205629.GD18919@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 \
    --subject='Re: x86info results ioremap.c:226 __ioremap_caller+0xf2/0x2d6() WARNINGs' \
    /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

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