Commit 90edaac6 authored by Ingo Molnar's avatar Ingo Molnar

Revert "x86/mm: Limit mmap() of /dev/mem to valid physical addresses"

This reverts commit ce56a86e.

There's unanticipated interaction with some boot parameters like 'mem=',
which now cause the new checks via valid_mmap_phys_addr_range() to be too
restrictive, crashing a Qemu bootup in fact, as reported by Fengguang Wu.

So while the motivation of the change is still entirely valid, we
need a few more rounds of testing to get it right - it's way too late
after -rc6, so revert it for now.
Reported-by: default avatarFengguang Wu <>
Signed-off-by: default avatarIngo Molnar <>
Acked-by: default avatarCraig Bergstrom <>
Cc: Andrew Morton <>
Cc: Andy Lutomirski <>
Cc: Borislav Petkov <>
Cc: Brian Gerst <>
Cc: Denys Vlasenko <>
Cc: H. Peter Anvin <>
Cc: Josh Poimboeuf <>
Cc: Linus Torvalds <>
Cc: Luis R. Rodriguez <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>
Cc: Toshi Kani <>
Signed-off-by: default avatarIngo Molnar <>
parent 58c3862b
......@@ -110,10 +110,6 @@ build_mmio_write(__writeq, "q", unsigned long, "r", )
extern int valid_phys_addr_range(phys_addr_t addr, size_t size);
extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
* virt_to_phys - map virtual addresses to physical
* @address: address to remap
......@@ -174,15 +174,3 @@ const char *arch_vma_name(struct vm_area_struct *vma)
return "[mpx]";
return NULL;
int valid_phys_addr_range(phys_addr_t addr, size_t count)
return addr + count <= __pa(high_memory);
int valid_mmap_phys_addr_range(unsigned long pfn, size_t count)
phys_addr_t addr = (phys_addr_t)pfn << PAGE_SHIFT;
return valid_phys_addr_range(addr, count);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment