aha/arch
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
..
alpha [PATCH] Don't attempt to power off if power off is not implemented 2006-01-08 20:14:00 -08:00
arm [PATCH] remove gcc-2 checks 2006-01-08 20:14:02 -08:00
arm26 [PATCH] remove gcc-2 checks 2006-01-08 20:14:02 -08:00
cris [PATCH] cris: kgdb: remove double_this() 2006-01-06 08:33:45 -08:00
frv [PATCH] frv: miscellaneous changes 2006-01-08 20:13:38 -08:00
h8300 [PATCH] sched: disable preempt in idle tasks 2005-11-09 07:56:33 -08:00
i386 [PATCH] remove gcc-2 checks 2006-01-08 20:14:02 -08:00
ia64 [PATCH] /dev/mem: validate mmap requests 2006-01-08 20:14:02 -08:00
m32r [PATCH] Don't attempt to power off if power off is not implemented 2006-01-08 20:14:00 -08:00
m68k [PATCH] m68k: convert thread flags to use bit fields 2005-11-13 18:14:14 -08:00
m68knommu [PATCH] m68knommu: enable_irq/disable_irq 2006-01-06 08:33:44 -08:00
mips [PATCH] use ptrace_get_task_struct in various places 2006-01-08 20:13:51 -08:00
parisc [PARISC] Remove unused variable in signal.c 2005-11-17 16:43:52 -05:00
powerpc [PATCH] use ptrace_get_task_struct in various places 2006-01-08 20:13:51 -08:00
ppc [PATCH] ppc32: Re-add embed_config.c to ml300/ep405 2006-01-06 08:33:31 -08:00
s390 [PATCH] use ptrace_get_task_struct in various places 2006-01-08 20:13:51 -08:00
sh [PATCH] sched: resched and cpu_idle rework 2005-11-09 07:56:33 -08:00
sh64 [PATCH] move rtc_interrupt() prototype to rtc.h 2006-01-08 20:13:47 -08:00
sparc [PATCH] use ptrace_get_task_struct in various places 2006-01-08 20:13:51 -08:00
sparc64 [PATCH] use ptrace_get_task_struct in various places 2006-01-08 20:13:51 -08:00
um [PATCH] Don't attempt to power off if power off is not implemented 2006-01-08 20:14:00 -08:00
v850 [PATCH] v850: use generic hardirq code 2005-11-15 08:59:20 -08:00
x86_64 [PATCH] use ptrace_get_task_struct in various places 2006-01-08 20:13:51 -08:00
xtensa Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel 2005-11-11 09:24:26 -08:00