GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing cgit.freebsd.org — md: Map preloaded images with pmap_mapdev_attr() - src - FreeBSD source tree

cgit logo index : src
FreeBSD source tree
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Cochard <[email protected]>2026-11-08 22:25:56 +0000
committerOlivier Cochard <[email protected]>2026-11-12 09:41:40 +0000
commit75734a4b6d0b89820ca17a10991edcea86867102 (patch)
tree2139e22c48860d13dda9be3ab912ad55c1b23e97
parenta2adf568cdfe83d8aca49f9eb9ba7891e88ff3cd (diff)
md: Map preloaded images with pmap_mapdev_attr()HEADmain
pmap_map() only works for memory the kernel already maps. A ram disk the loader places in reserved memory may lie outside the direct map, and some platforms have no direct map. Reviewed by: imp Approved by: imp Sponsored by: Netflix Differential Revision: https://ron-dev.freebsd.org/FreeBSD/src/pulls/101
Diffstat
-rw-r--r--sys/dev/md/md.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index 5fec3181aaff..f29490d12b85 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -2131,7 +2131,12 @@ g_md_init(struct g_class *mp __unused)
(long *) &paddr) != 0 ||
resource_int_value("md", i, "len", &len) != 0)
break;
- ptr = pmap_map(NULL, paddr, paddr + len, VM_PROT_READ);
+ /*
+ * Map the memory into the kernel pmap, if not already present.
+ * Some RamDisks reside in reserved memory without mappings, so
+ * a simple pmap_map() won't always work.
+ */
+ ptr = pmap_mapdev_attr(paddr, len, VM_MEMATTR_DEFAULT);
if (ptr != NULL && len != 0) {
sprintf(scratch, "preload%d 0x%016jx", i,
(uintmax_t)paddr);
generated by cgit v1.3 (git 2.53.0) at 2026-11-12 09:50:48 +0000
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.