kernel-ark/arch/ia64/kernel
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
..
cpufreq
acpi-ext.c
acpi.c
asm-offsets.c
brl_emu.c
cyclone.c
efi_stub.S
efi.c [PATCH] /dev/mem: validate mmap requests 2006-01-08 20:14:02 -08:00
entry.h
entry.S
fsys.S
gate-data.S
gate.lds.S
gate.S
head.S
ia64_ksyms.c
init_task.c
iosapic.c
irq_ia64.c
irq_lsapic.c
irq.c
ivt.S
jprobes.S
kprobes.c
machvec.c
Makefile
mca_asm.S
mca_drv_asm.S
mca_drv.c
mca_drv.h
mca.c
minstate.h
module.c
numa.c
pal.S
palinfo.c
patch.c
perfmon_default_smpl.c
perfmon_generic.h
perfmon_itanium.h
perfmon_mckinley.h
perfmon.c
process.c
ptrace.c
sal.c
salinfo.c
semaphore.c
setup.c
sigframe.h
signal.c
smp.c
smpboot.c
sys_ia64.c
time.c
topology.c
traps.c
unaligned.c
uncached.c
unwind_decoder.c
unwind_i.h
unwind.c
vmlinux.lds.S