[IA64] fail mmaps that span areas with incompatible attributes
commit6d40fc514c9ea886dc18ddd20043a411816b63d1
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Fri, 30 Mar 2007 16:35:43 +0000 (30 10:35 -0600)
committerTony Luck <tony.luck@intel.com>
Fri, 30 Mar 2007 16:38:25 +0000 (30 09:38 -0700)
tree023271ce661d3b19bbaece0e84b04f855b9d11b3
parent2cb22e23a5fcbcac2de49493aa57c7694028a06a
[IA64] fail mmaps that span areas with incompatible attributes

Example memory map (from HP sx1000 with VGA enabled):
    0x00000 - 0x9FFFF supports only WB (cacheable) access
    0xA0000 - 0xBFFFF supports only UC (uncacheable) access
    0xC0000 - 0xFFFFF supports only WB (cacheable) access

Some versions of X map the entire 0x00000-0xFFFFF area at once.  With the
example above, this mmap must fail because there's no memory attribute that's
safe for the entire area.

Prior to this patch, we performed the mmap with a UC mapping.  When X
accessed the WB memory at 0xC0000, it caused an MCA.  The crash can happen
when mapping 0xC0000 from either /dev/mem or a /sys/.../legacy_mem file.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
arch/ia64/kernel/efi.c