mirror of
https://github.com/torvalds/linux.git
synced 2026-07-18 19:47:46 +02:00
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>
|
||
|---|---|---|
| .. | ||
| sn | ||
| a.out.h | ||
| acpi-ext.h | ||
| acpi.h | ||
| agp.h | ||
| asmmacro.h | ||
| atomic.h | ||
| auxvec.h | ||
| bitops.h | ||
| break.h | ||
| bug.h | ||
| bugs.h | ||
| byteorder.h | ||
| cache.h | ||
| cacheflush.h | ||
| checksum.h | ||
| compat.h | ||
| cpu.h | ||
| cputime.h | ||
| current.h | ||
| cyclone.h | ||
| delay.h | ||
| div64.h | ||
| dma-mapping.h | ||
| dma.h | ||
| elf.h | ||
| emergency-restart.h | ||
| errno.h | ||
| fcntl.h | ||
| fpswa.h | ||
| fpu.h | ||
| futex.h | ||
| gcc_intrin.h | ||
| hardirq.h | ||
| hw_irq.h | ||
| ia32.h | ||
| ia64regs.h | ||
| ide.h | ||
| intel_intrin.h | ||
| intrinsics.h | ||
| io.h | ||
| ioctl.h | ||
| ioctls.h | ||
| iosapic.h | ||
| ipcbuf.h | ||
| irq.h | ||
| kdebug.h | ||
| kmap_types.h | ||
| kprobes.h | ||
| kregs.h | ||
| linkage.h | ||
| local.h | ||
| machvec_dig.h | ||
| machvec_hpsim.h | ||
| machvec_hpzx1_swiotlb.h | ||
| machvec_hpzx1.h | ||
| machvec_init.h | ||
| machvec_sn2.h | ||
| machvec.h | ||
| mc146818rtc.h | ||
| mca_asm.h | ||
| mca.h | ||
| meminit.h | ||
| mman.h | ||
| mmu_context.h | ||
| mmu.h | ||
| mmzone.h | ||
| module.h | ||
| msgbuf.h | ||
| msi.h | ||
| namei.h | ||
| nodedata.h | ||
| numa.h | ||
| numnodes.h | ||
| page.h | ||
| pal.h | ||
| param.h | ||
| parport.h | ||
| patch.h | ||
| pci.h | ||
| percpu.h | ||
| perfmon_default_smpl.h | ||
| perfmon.h | ||
| pgalloc.h | ||
| pgtable.h | ||
| poll.h | ||
| posix_types.h | ||
| processor.h | ||
| ptrace_offsets.h | ||
| ptrace.h | ||
| resource.h | ||
| rse.h | ||
| rwsem.h | ||
| sal.h | ||
| scatterlist.h | ||
| sections.h | ||
| segment.h | ||
| semaphore.h | ||
| sembuf.h | ||
| serial.h | ||
| setup.h | ||
| shmbuf.h | ||
| shmparam.h | ||
| sigcontext.h | ||
| siginfo.h | ||
| signal.h | ||
| smp.h | ||
| socket.h | ||
| sockios.h | ||
| sparsemem.h | ||
| spinlock_types.h | ||
| spinlock.h | ||
| stat.h | ||
| statfs.h | ||
| string.h | ||
| suspend.h | ||
| system.h | ||
| termbits.h | ||
| termios.h | ||
| thread_info.h | ||
| timex.h | ||
| tlb.h | ||
| tlbflush.h | ||
| topology.h | ||
| types.h | ||
| uaccess.h | ||
| ucontext.h | ||
| unaligned.h | ||
| uncached.h | ||
| unistd.h | ||
| unwind.h | ||
| user.h | ||
| ustack.h | ||
| vga.h | ||
| xor.h | ||