From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20409 invoked from network); 9 Dec 2020 23:23:22 -0000 Received: from ewsd.inri.net (107.191.116.128) by inbox.vuxu.org with ESMTPUTF8; 9 Dec 2020 23:23:22 -0000 Received: from duke.felloff.net ([216.126.196.34]) by ewsd; Wed Dec 9 18:18:32 -0500 2020 Message-ID: <2F4DB0285C490E5CDC4666AE1ACB6597@felloff.net> Date: Thu, 10 Dec 2020 00:18:21 +0100 From: cinap_lenrek@felloff.net To: 9front@9front.org In-Reply-To: <56070930-805D-4028-9A02-912B7AF7C562@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: lifecycle AJAX over HTML just-in-time-aware metadata realtime-java frontend Subject: Re: [9front] kernel crash in bhyve Reply-To: 9front@9front.org Precedence: bulk The following diff should fix it. -- cinap diff -r dcd57f411618 sys/src/9/pc/memory.c --- a/sys/src/9/pc/memory.c Wed Dec 09 01:05:14 2020 +0100 +++ b/sys/src/9/pc/memory.c Thu Dec 10 00:16:49 2020 +0100 @@ -383,8 +383,16 @@ } } - /* RAM needs to be writeback */ - mtrrexclude(MemRAM, "wb"); + /* + * Make sure RAM is set to writeback, + * but do a sanity check first checking + * that the kernel text is writeback. + * This is needed as some emulators (bhyve) + * set everything to uncached. + */ + s = mtrrattr(KTZERO, nil); + if(s != nil && strcmp(s, "wb") == 0) + mtrrexclude(MemRAM, "wb"); for(base = memmapnext(-1, MemRAM); base != -1; base = memmapnext(base, MemRAM)){ size = memmapsize(base, BY2PG) & ~(BY2PG-1);