[IA64] prevent MCA when performing MMIO mmap to PCI config space
authorAlex Chiang <achiang@hp.com>
Wed, 11 Jul 2007 17:02:15 +0000 (11:02 -0600)
committerTony Luck <tony.luck@intel.com>
Wed, 11 Jul 2007 18:34:49 +0000 (11:34 -0700)
commit012b7105cc816fb797eb1c161cdfc0052b5c3f53
tree084ede189a3284c17f09ea68d0d4573d95e7499f
parent9e121327b37b751ef66e6f57e2d02dd568955148
[IA64] prevent MCA when performing MMIO mmap to PCI config space

Example memory map (HP rx7640 with 'default' acpiconfig setting, VGA disabled):
   0x00000000 - 0x3FFFBFFF  supports only WB (cacheable) access

If a user attempts to perform an MMIO mmap (using the PCIIOC_MMAP_IS_MEM ioctl)
to PCI config space (like mmap'ing and accessing memory at 0xA0000),
we will MCA because the kernel will attempt to use a mapping with the UC
attribute.

So check the memory attribute in kern_mmap and the EFI memmap. If WC is
requested, and WC or UC access is supported for the region, allow it.
Otherwise, use the same attribute the kernel uses.

Updates documentation and test cases as well.

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Documentation/ia64/aliasing-test.c
Documentation/ia64/aliasing.txt
arch/ia64/pci/pci.c