Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 While reserving memory at boot time via uvm...



details:   https://anonhg.NetBSD.org/src/rev/d6393c1002fd
branches:  trunk
changeset: 820464:d6393c1002fd
user:      cherry <cherry%NetBSD.org@localhost>
date:      Tue Jan 10 09:48:22 2017 +0000

description:
While reserving memory at boot time via uvm_physseg_unplug(9),
in the case of a disappearing segment (due to a segment sized msgbuf)
make sure segment offsets are read off before the segment disappears.

This should fix some of the recent boot time hard resets reported on
i386 recently.

Thanks to kre@ for pointing this out to me.


CVS: ----------------------------------------------------------------------
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?

diffstat:

 sys/arch/x86/x86/x86_machdep.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (34 lines):

diff -r 6173cba93dd6 -r d6393c1002fd sys/arch/x86/x86/x86_machdep.c
--- a/sys/arch/x86/x86/x86_machdep.c    Tue Jan 10 09:32:01 2017 +0000
+++ b/sys/arch/x86/x86/x86_machdep.c    Tue Jan 10 09:48:22 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: x86_machdep.c,v 1.80 2016/12/26 17:54:07 cherry Exp $  */
+/*     $NetBSD: x86_machdep.c,v 1.81 2017/01/10 09:48:22 cherry Exp $  */
 
 /*-
  * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.80 2016/12/26 17:54:07 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.81 2017/01/10 09:48:22 cherry Exp $");
 
 #include "opt_modular.h"
 #include "opt_physmem.h"
@@ -933,12 +933,12 @@
        if (uvm_physseg_get_avail_end(x) - uvm_physseg_get_avail_start(x) < atop(sz))
                sz = ctob(uvm_physseg_get_avail_end(x) - uvm_physseg_get_avail_start(x));
 
+       msgbuf_p_seg[msgbuf_p_cnt].sz = sz;
+       msgbuf_p_seg[msgbuf_p_cnt++].paddr = ctob(uvm_physseg_get_avail_end(x)) - sz;
        uvm_physseg_unplug(uvm_physseg_get_end(x) - atop(sz), atop(sz));
-       msgbuf_p_seg[msgbuf_p_cnt].sz = sz;
-        msgbuf_p_seg[msgbuf_p_cnt++].paddr = ctob(uvm_physseg_get_avail_end(x));
 
        /* Now find where the new avail_end is. */
-       avail_end = ctob(uvm_physseg_get_avail_end(x));
+       avail_end = ctob(uvm_physseg_get_highest_frame());
 
        if (sz == reqsz)
                return;



Home | Main Index | Thread Index | Old Index