PowerBook 5xx instability fix.

Nathanial Sloss <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Organization The NetBSD Foundation Inc.
Message-ID <[email protected]>
Hi,

I've found that the PowerBook 5xx would crash randomly in pmap functions.  It 
seems as though PTEs were referenced beyond the end of ram.

Unless there is a better way to handle this I'd like to commit the attached 
patch.

I found the fix while limiting the available ram in the Booter.  Making the ram 
smaller in the Booter the PowerBook never crashed.  But to lose 1MB ram is 
wasteful so with the patch at least I only lose 48k.

Thoughts?


Best regards,

Nat
pwrbookpte.diff (text/x-patch, 584 B)
diff -r 7e5131a731a0 sys/arch/mac68k/mac68k/pmap_bootstrap.c
--- a/sys/arch/mac68k/mac68k/pmap_bootstrap.c	Wed Oct 23 12:47:39 2024 +0000
+++ b/sys/arch/mac68k/mac68k/pmap_bootstrap.c	Sun Oct 27 08:05:27 2024 +1100
@@ -163,6 +163,11 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f
 	 * pages for that size.
 	 */
 	mem_size = 0;
+
+	/* Hack for instabilty on the PowerBook 5xx. */
+	if (mac68k_machine.machineid == MACH_MACPB500)
+		high[numranges - 1] -= 48 * 1024;
+
 	for (i = 0; i < numranges; i++)
 		mem_size += high[i] - low[i];
 	nptpages += howmany(m68k_btop(mem_size), NPTEPG);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.