summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-11-02 00:41:00 +0000
committerpeter <peter@FreeBSD.org>2001-11-02 00:41:00 +0000
commit81577a9eef9caf93627f01d8ea65137149aa708c (patch)
tree26d35aaacdbbe27e2543d99c2e497b34e507204a
parent5ee838cd4601f1e27d4097100a238ae10e2856cd (diff)
downloadFreeBSD-src-81577a9eef9caf93627f01d8ea65137149aa708c.zip
FreeBSD-src-81577a9eef9caf93627f01d8ea65137149aa708c.tar.gz
"Fix" a problem that got copied from alpha to ia64 and broke there.
When we truncate the msgbuf size because the last chunk is too small, correctly terminate the phys_avail[] array - the VM system tests the *end* for zero, not the start. This leads the VM startup to attempt to recreate a duplicate set of pages for all physical memory. XXX the msgbuf handling is suspiciously different on i386 vs alpha/ia64...
-rw-r--r--sys/alpha/alpha/machdep.c4
-rw-r--r--sys/ia64/ia64/machdep.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c
index d9a5104..e31b2cd 100644
--- a/sys/alpha/alpha/machdep.c
+++ b/sys/alpha/alpha/machdep.c
@@ -879,8 +879,10 @@ alpha_init(pfn, ptb, bim, bip, biv)
msgbufinit(msgbufp, sz);
/* Remove the last segment if it now has no pages. */
- if (phys_avail[i] == phys_avail[i+1])
+ if (phys_avail[i] == phys_avail[i+1]) {
phys_avail[i] = 0;
+ phys_avail[i+1] = 0;
+ }
/* warn if the message buffer had to be shrunk */
if (sz != round_page(MSGBUF_SIZE))
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c
index c0f9409..2faa954 100644
--- a/sys/ia64/ia64/machdep.c
+++ b/sys/ia64/ia64/machdep.c
@@ -748,8 +748,10 @@ ia64_init(u_int64_t arg1, u_int64_t arg2)
msgbufinit(msgbufp, sz);
/* Remove the last segment if it now has no pages. */
- if (phys_avail[i] == phys_avail[i+1])
+ if (phys_avail[i] == phys_avail[i+1]) {
phys_avail[i] = 0;
+ phys_avail[i+] = 0;
+ }
/* warn if the message buffer had to be shrunk */
if (sz != round_page(MSGBUF_SIZE))
OpenPOWER on IntegriCloud