summaryrefslogtreecommitdiffstats
path: root/arch/arm64/mm
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmerdabbelt@google.com>2020-07-09 21:05:36 +0200
committerPalmer Dabbelt <palmerdabbelt@google.com>2020-12-11 21:28:35 +0100
commit6585bd827407f55ee30a782492208bfaf4f52feb (patch)
treef4e619bfb9695ff72db6fe55cf2e0794d6f641ac /arch/arm64/mm
parentarm: Use the generic devmem_is_allowed() (diff)
downloadlinux-6585bd827407f55ee30a782492208bfaf4f52feb.tar.xz
linux-6585bd827407f55ee30a782492208bfaf4f52feb.zip
arm64: Use the generic devmem_is_allowed()
I recently copied this into lib/ for use by the RISC-V port. Acked-by: Catalin Marinas <catalin.marinas@arm.com> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/arm64/mm')
-rw-r--r--arch/arm64/mm/mmap.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/arch/arm64/mm/mmap.c b/arch/arm64/mm/mmap.c
index 3028bacbc4e9..07937b49cb88 100644
--- a/arch/arm64/mm/mmap.c
+++ b/arch/arm64/mm/mmap.c
@@ -47,24 +47,3 @@ int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
{
return !(((pfn << PAGE_SHIFT) + size) & ~PHYS_MASK);
}
-
-#ifdef CONFIG_STRICT_DEVMEM
-
-#include <linux/ioport.h>
-
-/*
- * devmem_is_allowed() checks to see if /dev/mem access to a certain address
- * is valid. The argument is a physical page number. We mimic x86 here by
- * disallowing access to system RAM as well as device-exclusive MMIO regions.
- * This effectively disable read()/write() on /dev/mem.
- */
-int devmem_is_allowed(unsigned long pfn)
-{
- if (iomem_is_exclusive(pfn << PAGE_SHIFT))
- return 0;
- if (!page_is_ram(pfn))
- return 1;
- return 0;
-}
-
-#endif