Port-m68k archive

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

Re: NetBSD/virt68k live-image



I wrote:

> It turns out amiga uses own USRSTACK (== VM_MAXUSER_ADDRESS) value
> in src/sys/arch/amiga/include/vmparam.h:
 :
> Actually the panic "enter: out of address space" is triggered by
> lack of L2 page, i.e. it could happen by sparse address mappings
> without full 480MB allocation.
> 
> So it might help other hp300 derived pmap m68k ports to change
> VM_MAXUSER_ADDRESS (and VM_MAX_ADDRESS) in vmparam.h to 0x1E000000
> from current common 0xFFF00000.

With the following changes to virt68k/include/vmparam.h,
"panic: enter: out of address space" is no longer triggered
but still gets "out of memory" errors
>> cc1: out of memory allocating 488 bytes after a total of 82387644 bytes
on building pkgsrc/security/gnutls:

---
diff --git a/sys/arch/virt68k/include/vmparam.h b/sys/arch/virt68k/include/vmparam.h
index d58355f4bd41..8e9f9fc3b40c 100644
--- a/sys/arch/virt68k/include/vmparam.h
+++ b/sys/arch/virt68k/include/vmparam.h
@@ -52,16 +52,8 @@
 
 /*
  * USRSTACK is the top (end) of the user stack.
- *
- * NOTE: the ONLY reason that HIGHPAGES is 0x100 instead of UPAGES (3)
- * is for HPUX compatibility.  Why??  Because HPUX's debuggers
- * have the user's stack hard-wired at FFF00000 for post-mortems,
- * and we must be compatible...
  */
-#define	USRSTACK	(-HIGHPAGES*PAGE_SIZE)	/* Start of user stack */
-#define	BTOPUSRSTACK	(0x100000-HIGHPAGES)	/* btop(USRSTACK) */
-#define	P1PAGES		0x100000
-#define	HIGHPAGES	(0x100000/PAGE_SIZE)
+#define	USRSTACK	VM_MAXUSER_ADDRESS
 
 /*
  * Virtual memory related constants, all in bytes
@@ -73,13 +65,13 @@
 #define	DFLDSIZ		(32*1024*1024)		/* initial data size limit */
 #endif
 #ifndef MAXDSIZ
-#define	MAXDSIZ		(64*1024*1024)		/* max data size */
+#define	MAXDSIZ		(128*1024*1024)		/* max data size */
 #endif
 #ifndef	DFLSSIZ
 #define	DFLSSIZ		(2*1024*1024)		/* initial stack size limit */
 #endif
 #ifndef	MAXSSIZ
-#define	MAXSSIZ		MAXDSIZ			/* max stack size */
+#define	MAXSSIZ		(32*1024*1024)			/* max stack size */
 #endif
 
 /*
@@ -102,8 +94,12 @@
  * room for the Sysmap, because that's where the Hibler pmap puts it).
  */
 #define VM_MIN_ADDRESS		((vaddr_t)0)
+#if 0
 #define VM_MAXUSER_ADDRESS	((vaddr_t)0xFFF00000)
-#define VM_MAX_ADDRESS		((vaddr_t)0xFFF00000)
+#else
+#define VM_MAXUSER_ADDRESS	((vaddr_t)0x1E000000)
+#endif
+#define VM_MAX_ADDRESS		VM_MAXUSER_ADDRESS
 #define VM_MIN_KERNEL_ADDRESS	((vaddr_t)0)
 #define VM_MAX_KERNEL_ADDRESS	((vaddr_t)(0xFF000000-PAGE_SIZE*NPTEPG))
 

---

qemu68k# ulimit -d unlimited
qemu68k# ulimit -a
time          (-t seconds    )    unlimited
file          (-f blocks     )    unlimited
data          (-d kbytes     )       262144
stack         (-s kbytes     )         2048
coredump      (-c blocks     )    unlimited
memory        (-m kbytes     )       491520
locked memory (-l kbytes     )       163840
thread        (-r threads    )         2048
process       (-p processes  )          160
nofiles       (-n descriptors)          128
vmemory       (-v kbytes     )    unlimited
sbsize        (-b bytes      )    unlimited
qemu68k# cd /usr/pkgsrc/security/gnutls
qemu68k# make
=> Bootstrap dependency digest>=20211023: found digest-20220214
===> Skipping vulnerability checks.
WARNING: No /usr/pkg/pkgdb/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/sbin/pkg_admin -K /usr/pkg/pkgdb fetch-pkg-vulnerabilities'.
===> Building for gnutls-3.8.8nb2
/usr/pkg/bin/gmake  all-recursive
gmake[1]: Entering directory '/usr/obj.m68k/pkgsrc/security/gnutls/work.m68k/gnutls-3.8.8'

[snip]

Making all in x509
gmake[4]: Entering directory '/usr/obj.m68k/pkgsrc/security/gnutls/work.m68k/gnutls-3.8.8/lib/x509'
/usr/pkg/bin/gmake  all-am
gmake[5]: Entering directory '/usr/obj.m68k/pkgsrc/security/gnutls/work.m68k/gnutls-3.8.8/lib/x509'
  CC       output.lo
output.c: In function 'print_time':
output.c:465:33: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'time_t' {aka 'long long int'} [-Wformat=]
  465 |   addf(str, "error: gmtime_r (%lu)\n", timestamp);
      |                               ~~^      ~~~~~~~~~
      |                                 |      |
      |                                 |      time_t {aka long long int}
      |                                 long unsigned int
      |                               %llu
output.c:470:33: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'time_t' {aka 'long long int'} [-Wformat=]
  470 |   addf(str, "error: strftime (%lu)\n", timestamp);
      |                               ~~^      ~~~~~~~~~
      |                                 |      |
      |                                 |      time_t {aka long long int}
      |                                 long unsigned int
      |                               %llu

cc1: out of memory allocating 488 bytes after a total of 82387644 bytes
gmake[5]: *** [Makefile:2886: output.lo] Error 1
gmake[5]: Leaving directory '/usr/obj.m68k/pkgsrc/security/gnutls/work.m68k/gnutls-3.8.8/lib/x509'
 :

---

It looks 480MB VA space is not enough for modern cc1 to build gnutls,
though not sure where the above 82,387,644 bytes limit comes from.

Note the same pkgsrc-2024Q4 security/gnutls output.c builds on 68030
(at least virt68k on nono and atari on TT030).

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index