summaryrefslogtreecommitdiffstats
path: root/sys/arm64
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2017-01-18 19:38:53 +0000
committerjhb <jhb@FreeBSD.org>2017-01-18 19:38:53 +0000
commit408517410d34e87f7bbc6d985b7b49d60ae40e1d (patch)
treee17792e86cde13f5e919550b89e0e1ab25a0c94a /sys/arm64
parent4d4bfe27534638421ca344bba7e3ed69a6008615 (diff)
downloadFreeBSD-src-408517410d34e87f7bbc6d985b7b49d60ae40e1d.zip
FreeBSD-src-408517410d34e87f7bbc6d985b7b49d60ae40e1d.tar.gz
MFC 307332,312086: Drop support for using mmap() with /dev/kmem.
307332: Drop support for using mmap() with /dev/kmem. Using the device pager with /dev/kmem is not stable since KVA mappings are transient, but the device pager caches the PA associated with a given offset forever. Interestingly, mips' implementation of memmap() already refused requests for /dev/kmem. Note that kvm_read/kvm_write do not use mmap, but use read and write on /dev/kmem, so this should not affect libkvm users. 312086: Trim a few comments on platforms that did not implement mmap of /dev/kmem. After r307332, no platforms implement mmap for /dev/kmem, so the lack of it for these platforms is no longer unique.
Diffstat (limited to 'sys/arm64')
-rw-r--r--sys/arm64/arm64/mem.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/arm64/arm64/mem.c b/sys/arm64/arm64/mem.c
index 9044fb3..e0ea488 100644
--- a/sys/arm64/arm64/mem.c
+++ b/sys/arm64/arm64/mem.c
@@ -123,10 +123,9 @@ int
memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr,
int prot __unused, vm_memattr_t *memattr __unused)
{
- if (dev2unit(dev) == CDEV_MINOR_MEM)
+ if (dev2unit(dev) == CDEV_MINOR_MEM) {
*paddr = offset;
- else if (dev2unit(dev) == CDEV_MINOR_KMEM)
- *paddr = vtophys(offset);
- /* else panic! */
- return (0);
+ return (0);
+ }
+ return (-1);
}
OpenPOWER on IntegriCloud