Re: [PATCH -resend 1/1] HPET: unmap unused I/O space

From: Andrew Morton
Date: Fri Sep 03 2010 - 16:19:55 EST


On Fri, 3 Sep 2010 10:27:54 +0200
Jiri Slaby <jslaby@xxxxxxx> wrote:

> When the initialization code in hpet founds a memory resource and does
> not found IRQ, it does not unmap the memory resource previously
> mapped.
>
> There are buggy BIOSes which report resources exactly like this and
> what is worse the memory region bases point to normal RAM. This
> normally would not matter since the space is not touched. But when PAT
> is turned on, ioremap causes the page to be uncached and sets this bit
> in page->flags.
>
> Then when the page is about to be used by the allocator, it is
> reported as:
> BUG: Bad page state in process md5sum pfn:3ed00
> page:ffffea0000dbd800 count:0 mapcount:0 mapping:(null) index:0x0
> page flags: 0x20000001000000(uncached)
> Pid: 7956, comm: md5sum Not tainted 2.6.34-12-desktop #1
> Call Trace:
> [<ffffffff810df851>] bad_page+0xb1/0x100
> [<ffffffff810dfa45>] prep_new_page+0x1a5/0x1c0
> [<ffffffff810dfe01>] get_page_from_freelist+0x3a1/0x640
> [<ffffffff810e01af>] __alloc_pages_nodemask+0x10f/0x6b0

Well damn, good detective work. I wonder how many of those nasty
random bad-page-state bug reports just got fixed. I dub thee
September's "Hero of the Linux kernel"!

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/