Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153172505
D32873.id98140.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D32873.id98140.diff
View Options
Index: sys/kern/subr_physmem.c
===================================================================
--- sys/kern/subr_physmem.c
+++ sys/kern/subr_physmem.c
@@ -63,9 +63,14 @@
#endif
#if defined(__arm__)
+/*
+ * arm's MAX_PHYS_ADDR is defined to be just below KERNBASE, which isn't quite
+ * what we want. What we really want isn't established until a little later in
+ * the boot process, so we fudge it here.
+ */
#define MAX_PHYS_ADDR 0xFFFFFFFFull
-#elif defined(__aarch64__) || defined(__riscv)
-#define MAX_PHYS_ADDR 0xFFFFFFFFFFFFFFFFull
+#else
+#define MAX_PHYS_ADDR VM_MAX_ADDRESS
#endif
struct region {
@@ -166,8 +171,9 @@
availsz = 0;
acnt = 0;
for (hwi = 0, hwp = hwregions; hwi < hwcnt; ++hwi, ++hwp) {
- start = hwp->addr;
- end = hwp->size + start;
+ /* Operate on page boundaries. Partial pages aren't usable. */
+ start = round_page(hwp->addr);
+ end = trunc_page(hwp->size + start);
totalmem += atop((vm_offset_t)(end - start));
for (exi = 0, exp = exregions; exi < excnt; ++exi, ++exp) {
/*
@@ -176,8 +182,9 @@
*/
if ((exp->flags & exflags) == 0)
continue;
- xstart = exp->addr;
- xend = exp->size + xstart;
+ /* Whole page is excluded. */
+ xstart = trunc_page(exp->addr);
+ xend = round_page(exp->size + xstart);
/*
* If the excluded region ends before this hw region,
* continue checking with the next excluded region.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 20, 2:34 PM (15 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31845718
Default Alt Text
D32873.id98140.diff (1 KB)
Attached To
Mode
D32873: kern: physmem: operate on whole page boundaries for *_avail
Attached
Detach File
Event Timeline
Log In to Comment