Index: conf/Makefile.sparc =================================================================== RCS file: /cvsroot/src/sys/arch/sparc/conf/Makefile.sparc,v retrieving revision 1.96 diff -p -u -r1.96 Makefile.sparc --- conf/Makefile.sparc 22 Sep 2018 12:24:03 -0000 1.96 +++ conf/Makefile.sparc 9 Dec 2020 10:11:58 -0000 @@ -61,7 +61,7 @@ amd7930intr.o bsd_fdintr.o lock_stubs.o: ## ## (5) link settings ## -TEXTADDR?= F0004000 +TEXTADDR?= E0004000 EXTRA_LINKFLAGS= -X KERNLDSCRIPT?= ${SPARC}/conf/kern.ldscript LINKFORMAT= -n Index: include/param.h =================================================================== RCS file: /cvsroot/src/sys/arch/sparc/include/param.h,v retrieving revision 1.74 diff -p -u -r1.74 param.h --- include/param.h 1 May 2020 08:21:27 -0000 1.74 +++ include/param.h 9 Dec 2020 10:11:58 -0000 @@ -71,8 +71,12 @@ extern int nbpg, pgofset, pgshift; #endif #if !(defined(PROM_AT_F0) || defined(MSIIEP)) +#if 0 #define KERNBASE 0xf0000000 /* start of kernel virtual space */ #else +#define KERNBASE 0xe0000000 /* start of kernel virtual space */ +#endif +#else /* * JS1/OF has prom sitting in f000.0000..f007.ffff, modify kernel VA * layout to work around that. XXX - kernel should live beyound prom on @@ -106,9 +110,15 @@ extern int nbpg, pgofset, pgshift; /* * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized * logical pages. + * + * SPARC KVA is from KERNBASE until 0xfe00.0000 where the PROM normally + * lives. NetBSD originally used KERNBASE of 0xf000.0000 (except for + * systems like Krups, that put the PROM here), but was switched to + * 0xe000.000 for NetBSD 10.0 as it's quite easy to use more than 224MB + * of KVA on a 512MB system (max for sun4m.) */ #define NKMEMPAGES_MIN_DEFAULT ((16 * 1024 * 1024) >> PAGE_SHIFT) -#define NKMEMPAGES_MAX_DEFAULT ((128 * 1024 * 1024) >> PAGE_SHIFT) +#define NKMEMPAGES_MAX_DEFAULT ((320 * 1024 * 1024) >> PAGE_SHIFT) #if defined(_KERNEL) || defined(_STANDALONE) #ifndef _LOCORE Index: sparc/autoconf.c =================================================================== RCS file: /cvsroot/src/sys/arch/sparc/sparc/autoconf.c,v retrieving revision 1.261 diff -p -u -r1.261 autoconf.c --- sparc/autoconf.c 14 Aug 2020 10:34:22 -0000 1.261 +++ sparc/autoconf.c 9 Dec 2020 10:11:58 -0000 @@ -171,6 +171,8 @@ matchbyname(device_t parent, cfdata_t cf /* * Get the number of CPUs in the system and the CPUs' SPARC architecture * version. We need this information early in the boot process. + * + * This also sets cpu_arch to 8 on sun4m and sun4d. */ static int find_cpus(void) Index: stand/boot/boot.c =================================================================== RCS file: /cvsroot/src/sys/arch/sparc/stand/boot/boot.c,v retrieving revision 1.30 diff -p -u -r1.30 boot.c --- stand/boot/boot.c 11 Jun 2016 06:43:16 -0000 1.30 +++ stand/boot/boot.c 9 Dec 2020 10:11:58 -0000 @@ -181,6 +181,7 @@ loadk(char *kernel, u_long *marks) goto out; size = marks[MARK_END] - marks[MARK_START]; +printf("%s:%d: init size = %lu (%lu .. %lu)\n", __func__, __LINE__, size, marks[MARK_START], marks[MARK_END]); /* We want that leading 16K in front of the kernel image */ size += PROM_LOADADDR; @@ -196,6 +197,10 @@ loadk(char *kernel, u_long *marks) if (!compatmode) size += 512 * 1024; +/* XXX MRG */ +size += 512 * 1024; +printf("%s:%d: final size = %lu"\n, __func__, __LINE__, size); + /* Get a physical load address */ pa = getphysmem(size); if (pa == (paddr_t)-1) {