1
0
Fork 0
alistair23-linux/arch/ia64
Lennert Buytenhek 06c67befee [PATCH] make valid_mmap_phys_addr_range() take a pfn
Newer ARMs have a 40 bit physical address space, but mapping physical
memory above 4G needs a special page table format which we (currently?) do
not use for userspace mappings, so what happens instead is that mapping an
address >= 4G will happily discard the upper bits and wrap.

There is a valid_mmap_phys_addr_range() arch hook where we could check for
>= 4G addresses and deny the mapping, but this hook takes an unsigned long
address:

	static inline int valid_mmap_phys_addr_range(unsigned long addr, size_t size);

And drivers/char/mem.c:mmap_mem() calls it like this:

	static int mmap_mem(struct file * file, struct vm_area_struct * vma)
	{
		size_t size = vma->vm_end - vma->vm_start;

		if (!valid_mmap_phys_addr_range(vma->vm_pgoff << PAGE_SHIFT, size))

So that's not much help either.

This patch makes the hook take a pfn instead of a phys address.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 13:24:25 -07:00
..
configs [IA64] tiger_defconfig s/NR_CPUS=4/NR_CPUS=16/ 2006-06-28 09:57:16 -07:00
dig [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
hp [PATCH] irq-flags: IA64: Use the new IRQF_ constants 2006-07-02 13:58:47 -07:00
ia32 [PATCH] audit syscall classes 2006-07-01 07:44:10 -04:00
kernel [PATCH] make valid_mmap_phys_addr_range() take a pfn 2006-07-10 13:24:25 -07:00
lib Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
mm [PATCH] Fix copying of pgdat array on each node for ia64 memory hotplug 2006-07-04 10:24:57 -07:00
oprofile Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
pci [PATCH] make valid_mmap_phys_addr_range() take a pfn 2006-07-10 13:24:25 -07:00
scripts Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
sn [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
Kconfig [PATCH] zoned vm counters: basic ZVC (zoned vm counter) implementation 2006-06-30 11:25:34 -07:00
Kconfig.debug [PATCH] Move Kprobes and Oprofile to "Instrumentation Support" menu 2005-11-07 07:53:35 -08:00
Makefile [IA64] add vmlinuz target 2006-06-21 14:31:07 -07:00
defconfig [IA64] Increase max node count on SN platforms 2006-03-24 13:15:03 -08:00
install.sh Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
module.lds Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00