linux/arch/ia64
Bjorn Helgaas 80851ef2a5 [PATCH] /dev/mem: validate mmap requests
Add a hook so architectures can validate /dev/mem mmap requests.

This is analogous to validation we already perform in the read/write
paths.

The identity mapping scheme used on ia64 requires that each 16MB or
64MB granule be accessed with exactly one attribute (write-back or
uncacheable).  This avoids "attribute aliasing", which can cause a
machine check.

Sample problem scenario:
  - Machine supports VGA, so it has uncacheable (UC) MMIO at 640K-768K
  - efi_memmap_init() discards any write-back (WB) memory in the first granule
  - Application (e.g., "hwinfo") mmaps /dev/mem, offset 0
  - hwinfo receives UC mapping (the default, since memmap says "no WB here")
  - Machine check abort (on chipsets that don't support UC access to WB
    memory, e.g., sx1000)

In the scenario above, the only choices are
  - Use WB for hwinfo mmap.  Can't do this because it causes attribute
    aliasing with the UC mapping for the VGA MMIO space.
  - Use UC for hwinfo mmap.  Can't do this because the chipset may not
    support UC for that region.
  - Disallow the hwinfo mmap with -EINVAL.  That's what this patch does.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-08 20:14:02 -08:00
..
configs [IA64-SGI] change default_sn2 to NR_CPUS==1024 2005-12-16 10:51:29 -08:00
dig Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
hp [PATCH] ia64: fix-up schedule_timeout() usage 2005-11-07 07:53:56 -08:00
ia32 [PATCH] use ptrace_get_task_struct in various places 2006-01-08 20:13:51 -08:00
kernel [PATCH] /dev/mem: validate mmap requests 2006-01-08 20:14:02 -08:00
lib Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2005-10-28 21:09:26 -07:00
mm [IA64] Limit the maximum NODEDATA_ALIGN() offset 2005-12-06 09:10:37 -08:00
oprofile [PATCH] remove gcc-2 checks 2006-01-08 20:14:02 -08:00
pci [IA64] incorrect return from ia64_pci_legacy_write() 2006-01-03 11:16:17 -08:00
scripts Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sn [PATCH] driver kill hotplug word from sn and others fix 2006-01-04 16:18:08 -08:00
defconfig [IA64] 4-level page tables 2005-11-11 09:37:29 -08:00
install.sh Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Kconfig [PATCH] Fix Kconfig of DMA32 for ia64 2005-12-12 08:57:45 -08:00
Kconfig.debug [PATCH] Move Kprobes and Oprofile to "Instrumentation Support" menu 2005-11-07 07:53:35 -08:00
Makefile [PATCH] remove gcc-2 checks 2006-01-08 20:14:02 -08:00
module.lds Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00