From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] kernel crash in bhyve
Date: Thu, 10 Dec 2020 00:18:21 +0100 [thread overview]
Message-ID: <2F4DB0285C490E5CDC4666AE1ACB6597@felloff.net> (raw)
In-Reply-To: <56070930-805D-4028-9A02-912B7AF7C562@gmail.com>
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);
next prev parent reply other threads:[~2020-12-09 23:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-09 18:18 Xiao-Yong Jin
2020-12-09 18:26 ` [9front] " Xiao-Yong Jin
2020-12-09 18:44 ` ori
2020-12-09 19:05 ` [9front] " cinap_lenrek
2020-12-09 19:42 ` Xiao-Yong Jin
2020-12-09 20:52 ` cinap_lenrek
2020-12-09 21:22 ` Xiao-Yong Jin
2020-12-09 22:04 ` cinap_lenrek
2020-12-09 22:36 ` Xiao-Yong Jin
2020-12-09 23:18 ` cinap_lenrek [this message]
2020-12-10 0:10 ` Xiao-Yong Jin
2020-12-10 0:45 ` cinap_lenrek
2020-12-10 11:30 ` cinap_lenrek
2020-12-10 20:37 ` Xiao-Yong Jin
2020-12-10 23:12 ` Nick Owens
2020-12-11 4:55 ` Xiao-Yong Jin
2020-12-11 14:27 ` cinap_lenrek
2020-12-11 1:12 ` ori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2F4DB0285C490E5CDC4666AE1ACB6597@felloff.net \
--to=cinap_lenrek@felloff.net \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).