CVS commit: src/sys/external/bsd/drm2/dist/drm/amd/display/dc/core

2023-08-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 15 05:01:58 UTC 2023

Modified Files:
src/sys/external/bsd/drm2/dist/drm/amd/display/dc/core:
amdgpu_dc_stream.c

Log Message:
avoid a GCC 12 warning.

there's a 1-element long array and a loop conditional that tries to see
if indexes for it are not identical.  as these indexes will always both
be 0, the only valid index, the condition is always false.  GCC 12
triggers a strange warning on this code that can never run (see below),
so simply assert the array size is 1 and comment the rest.

amdgpu_dc_stream.c:470:55: error: array subscript [0, 0] is outside array 
bounds of 'struct dc_writeback_info[1]' [-Werror=array-bounds]
  470 | stream->writeback_info[j] = 
stream->writeback_info[i];


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/amd/display/dc/core/amdgpu_dc_stream.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/external/bsd/drm2/dist/drm/amd/display/dc/core

2023-08-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 15 05:01:58 UTC 2023

Modified Files:
src/sys/external/bsd/drm2/dist/drm/amd/display/dc/core:
amdgpu_dc_stream.c

Log Message:
avoid a GCC 12 warning.

there's a 1-element long array and a loop conditional that tries to see
if indexes for it are not identical.  as these indexes will always both
be 0, the only valid index, the condition is always false.  GCC 12
triggers a strange warning on this code that can never run (see below),
so simply assert the array size is 1 and comment the rest.

amdgpu_dc_stream.c:470:55: error: array subscript [0, 0] is outside array 
bounds of 'struct dc_writeback_info[1]' [-Werror=array-bounds]
  470 | stream->writeback_info[j] = 
stream->writeback_info[i];


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/sys/external/bsd/drm2/dist/drm/amd/display/dc/core/amdgpu_dc_stream.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/amd/display/dc/core/amdgpu_dc_stream.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/display/dc/core/amdgpu_dc_stream.c:1.2 src/sys/external/bsd/drm2/dist/drm/amd/display/dc/core/amdgpu_dc_stream.c:1.3
--- src/sys/external/bsd/drm2/dist/drm/amd/display/dc/core/amdgpu_dc_stream.c:1.2	Sat Dec 18 23:45:02 2021
+++ src/sys/external/bsd/drm2/dist/drm/amd/display/dc/core/amdgpu_dc_stream.c	Tue Aug 15 05:01:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdgpu_dc_stream.c,v 1.2 2021/12/18 23:45:02 riastradh Exp $	*/
+/*	$NetBSD: amdgpu_dc_stream.c,v 1.3 2023/08/15 05:01:57 mrg Exp $	*/
 
 /*
  * Copyright 2012-15 Advanced Micro Devices, Inc.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_dc_stream.c,v 1.2 2021/12/18 23:45:02 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_dc_stream.c,v 1.3 2023/08/15 05:01:57 mrg Exp $");
 
 #include 
 #include 
@@ -465,9 +465,18 @@ bool dc_stream_remove_writeback(struct d
 	/* remove writeback info for disabled writeback pipes from stream */
 	for (i = 0, j = 0; i < stream->num_wb_info; i++) {
 		if (stream->writeback_info[i].wb_enabled) {
+#ifdef __NetBSD__
+			/*
+			 * XXXGCC12
+			 * The array is only 1 entry long, so i and j must
+			 * always be 0 here, so the below test fails.
+			 */
+			CTASSERT(ARRAY_SIZE(stream->writeback_info) == 1);
+#else
 			if (i != j)
 /* trim the array */
 stream->writeback_info[j] = stream->writeback_info[i];
+#endif
 			j++;
 		}
 	}



CVS commit: src/sys/external/bsd/drm2/drm

2023-08-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 15 04:57:36 UTC 2023

Modified Files:
src/sys/external/bsd/drm2/drm: drm_gem_cma_helper.c

Log Message:
avoid uninitialised variable usage in drm_gem_cma_create_internal().

in the case nothing has returned 'error', 'nsegs' and the dma info
are (potentially) uninitialised, so consider this an error.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c
diff -u src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c:1.14 src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c:1.15
--- src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c:1.14	Sat Jul  2 00:26:07 2022
+++ src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c	Tue Aug 15 04:57:36 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_gem_cma_helper.c,v 1.14 2022/07/02 00:26:07 riastradh Exp $ */
+/* $NetBSD: drm_gem_cma_helper.c,v 1.15 2023/08/15 04:57:36 mrg Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_gem_cma_helper.c,v 1.14 2022/07/02 00:26:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_gem_cma_helper.c,v 1.15 2023/08/15 04:57:36 mrg Exp $");
 
 #include 
 
@@ -44,7 +44,7 @@ drm_gem_cma_create_internal(struct drm_d
 struct sg_table *sgt)
 {
 	struct drm_gem_cma_object *obj;
-	int error, nsegs;
+	int error = EINVAL, nsegs;
 
 	obj = kmem_zalloc(sizeof(*obj), KM_SLEEP);
 	obj->dmat = ddev->dmat;



CVS commit: src/sys/external/bsd/drm2/drm

2023-08-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 15 04:57:36 UTC 2023

Modified Files:
src/sys/external/bsd/drm2/drm: drm_gem_cma_helper.c

Log Message:
avoid uninitialised variable usage in drm_gem_cma_create_internal().

in the case nothing has returned 'error', 'nsegs' and the dma info
are (potentially) uninitialised, so consider this an error.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc

2023-08-14 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 15 04:11:53 UTC 2023

Modified Files:
src/external/gpl3/gcc: README.gcc12

Log Message:
README.gcc12: Update for earmv5{,eb}, m68k, sh3el

earmv5{,eb}:
- No new regression for full ATF.

m68k:
- blake2_prov.c needs -fno-stack-protector.
- No new regression for full ATF on amiga.

sh3el:
- In addition to kernel, userland is completely broken.
- No interesting diff with upstream in gcc/config/sh.
- Probably, we need bisectioning for GCC...


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gcc/README.gcc12

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gcc

2023-08-14 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 15 04:11:53 UTC 2023

Modified Files:
src/external/gpl3/gcc: README.gcc12

Log Message:
README.gcc12: Update for earmv5{,eb}, m68k, sh3el

earmv5{,eb}:
- No new regression for full ATF.

m68k:
- blake2_prov.c needs -fno-stack-protector.
- No new regression for full ATF on amiga.

sh3el:
- In addition to kernel, userland is completely broken.
- No interesting diff with upstream in gcc/config/sh.
- Probably, we need bisectioning for GCC...


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gcc/README.gcc12

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/README.gcc12
diff -u src/external/gpl3/gcc/README.gcc12:1.12 src/external/gpl3/gcc/README.gcc12:1.13
--- src/external/gpl3/gcc/README.gcc12:1.12	Fri Aug 11 07:37:48 2023
+++ src/external/gpl3/gcc/README.gcc12	Tue Aug 15 04:11:53 2023
@@ -1,4 +1,4 @@
-$NetBSD: README.gcc12,v 1.12 2023/08/11 07:37:48 mrg Exp $
+$NetBSD: README.gcc12,v 1.13 2023/08/15 04:11:53 rin Exp $
 
 
 new stuff:
@@ -36,8 +36,8 @@ aarch64eb	y	y	y	y	y[17]	y		y	y	?
 alpha		y	y	y	y	b	y		y	y	?
 earmv4		y	b	?	y	?	?		?	?	?
 earmv4eb	y	b	?	y	?	?		?	?	?
-earmv5		y	y	y	y	b	y		y	?	?
-earmv5eb	y	y	y	y	b	y		y	?	?
+earmv5		y	y	y	y	b	y		y	y	?
+earmv5eb	y	y	y	y	b	y		y	y	?
 earmv5hf	y	b	?	y	?	?		?	?	?
 earmv5hfeb	y	b	?	y	?	?		?	?	?
 earmv6		y	b	?	y	?	?		?	?	?
@@ -52,7 +52,7 @@ hppa		y	b	y	y	?	n[5]		?	?	?
 i386		y	y	y	y	n[18]	y		y	n[19]	?
 ia64		y	b	y	y	y	y		y[3]	n	?
 m68000		y	y	y	y	n[11]	n		y[14]	?	?
-m68k		y	y	y	y	b	y		y[14]	p[15]	?
+m68k		y	y	y	y	b	y		y[14]	y[14]	?
 mipseb		y	b	y	y	b	y		?	?	?
 mipsel		y	b	y	y	b	y		?	?	?
 mips64eb	y	b	y	y	b	y		?	?	?
@@ -60,7 +60,7 @@ mips64el	y	b	y	y	b	y		?	?	?
 powerpc		y	y	y	y	?	n[4]		?	?	?
 powerpc64	y	?	?	y	?	?		?	?	?
 sh3eb		y	?	y	y	b	y		?	?	?
-sh3el		y	n[20]	y	y	b	y		?	?	?
+sh3el		y	n[20]	y	y	b	y		n[22]	?	?
 sparc		y	y	y	y	n[21]	y		y	y	?
 sparc64		y	b	y	y	n[16]	y		y	?	?
 vax		y	?	y	y	?	n		?	?	?
@@ -96,8 +96,8 @@ architecture	tools	kernels	libgcc	native
   ==21499==Hint: address points to the zero page.
   ThreadSanitizer:DEADLYSIGNAL
   ThreadSanitizer: nested bug in the same thread, aborting.
-[14]: "dd count=1" and "env LC_CTYPE=en_US.UTF-8 locale" abort. -fno-stack-protector for strsuftoll.c and citrus_module.c works around the problem.
-[15]: No regression observed for tests/lib/libc/{sys,gen}.
+[14]: "dd count=1", "env LC_CTYPE=en_US.UTF-8 locale", and "tests/crypto/libcrypto/h_evp_test evpmd_blake.txt" abort.
+  adding -fno-stack-protector to strsuftoll.c, citrus_module.c, and blake2_prov.c, respectively, works around the problem.
 [16]: sanitizers crash early:
   Program received signal SIGSEGV, Segmentation fault.
   (gdb) bt
@@ -127,6 +127,8 @@ architecture	tools	kernels	libgcc	native
 	U __sync_val_compare_and_swap_1
 	U __sync_val_compare_and_swap_4
   liblsan and libubsan are mssing the _4 and _8 versions, too.
+[22]: single-user shell crashes. if userland is built with DBG=-O1, it boots into multi-user mode.
+  however, at least db(3) is broken, by which files are corrupted when edited by vi(1).
 
 
 CPU vs platform test table (for CPUs with multiple ports).  this is "make release" or just kernels.



CVS commit: src/sys/dev/pci

2023-08-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 15 04:04:10 UTC 2023

Modified Files:
src/sys/dev/pci: amrreg.h

Log Message:
amr(4): fix the size of the the drive format array.

now this is actually 1024 bytes long, like it wants to be.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/amrreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/amrreg.h
diff -u src/sys/dev/pci/amrreg.h:1.5 src/sys/dev/pci/amrreg.h:1.6
--- src/sys/dev/pci/amrreg.h:1.5	Mon Sep  8 23:36:54 2008
+++ src/sys/dev/pci/amrreg.h	Tue Aug 15 04:04:10 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: amrreg.h,v 1.5 2008/09/08 23:36:54 gmcgarry Exp $	*/
+/*	$NetBSD: amrreg.h,v 1.6 2023/08/15 04:04:10 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -313,7 +313,7 @@ struct amr_enquiry3 {
 	u_int8_t	ae_driveprop[AMR_40LD_MAXDRIVES];	/* logical drive properties */
 	u_int8_t	ae_drivestate[AMR_40LD_MAXDRIVES];	/* physical drive state */
 	u_int8_t	ae_pdrivestate[AMR_40LD_MAXPHYSDRIVES]; /* physical drive state */
-	u_int16_t	ae_driveformat[AMR_40LD_MAXPHYSDRIVES];
+	u_int16_t	ae_driveformat[AMR_40LD_MAXPHYSDRIVES / 16];
 	u_int8_t	ae_targxfer[80];			/* physical drive transfer rates */
 
 	u_int8_t	res1[263];		/* pad to 1024 bytes */



CVS commit: src/sys/dev/pci

2023-08-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 15 04:04:10 UTC 2023

Modified Files:
src/sys/dev/pci: amrreg.h

Log Message:
amr(4): fix the size of the the drive format array.

now this is actually 1024 bytes long, like it wants to be.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/amrreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/apache2/mDNSResponder/dist/mDNSPosix

2023-08-14 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Tue Aug 15 00:02:16 UTC 2023

Modified Files:
src/external/apache2/mDNSResponder/dist/mDNSPosix: mDNSPosix.c

Log Message:
mDNSPosix.c: free very large struct on error path


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c
diff -u src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c:1.18 src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c:1.19
--- src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c:1.18	Sun Aug 13 18:57:07 2023
+++ src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c	Tue Aug 15 00:02:16 2023
@@ -1266,6 +1266,8 @@ mDNSlocal mStatus WatchForInterfaceChang
 err = OpenIfNotifySocket(&pChgRec->NotifySD);
 if (err == 0)
 err = mDNSPosixAddFDToEventLoop(pChgRec->NotifySD, InterfaceChangeCallback, pChgRec);
+if (err)
+mDNSPlatformMemFree(pChgRec);
 
 return err;
 }



CVS commit: src/external/apache2/mDNSResponder/dist/mDNSPosix

2023-08-14 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Tue Aug 15 00:02:16 UTC 2023

Modified Files:
src/external/apache2/mDNSResponder/dist/mDNSPosix: mDNSPosix.c

Log Message:
mDNSPosix.c: free very large struct on error path


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/sim/ppc

2023-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 14 22:42:02 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/sim/ppc: hw_sem.c hw_shm.c

Log Message:
fix cross-build host amd64, target ppc


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/gpl3/gdb/dist/sim/ppc/hw_sem.c \
src/external/gpl3/gdb/dist/sim/ppc/hw_shm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/sim/ppc/hw_sem.c
diff -u src/external/gpl3/gdb/dist/sim/ppc/hw_sem.c:1.1.1.3 src/external/gpl3/gdb/dist/sim/ppc/hw_sem.c:1.2
--- src/external/gpl3/gdb/dist/sim/ppc/hw_sem.c:1.1.1.3	Sun Jul 30 18:44:20 2023
+++ src/external/gpl3/gdb/dist/sim/ppc/hw_sem.c	Mon Aug 14 18:42:02 2023
@@ -120,7 +120,7 @@ hw_sem_init_data(device *me)
 error("sem_init_data() required value property is missing\n");
 
   sem->key = (key_t) device_find_integer_property(me, "key");
-  DTRACE(sem, ("semaphore key (%d)\n", sem->key) );
+  DTRACE(sem, ("semaphore key (%jd)\n", (intmax_t)sem->key) );
 
   sem->initial = (int) device_find_integer_property(me, "value");
   DTRACE(sem, ("semaphore initial value (%d)\n", sem->initial) );
Index: src/external/gpl3/gdb/dist/sim/ppc/hw_shm.c
diff -u src/external/gpl3/gdb/dist/sim/ppc/hw_shm.c:1.1.1.3 src/external/gpl3/gdb/dist/sim/ppc/hw_shm.c:1.2
--- src/external/gpl3/gdb/dist/sim/ppc/hw_shm.c:1.1.1.3	Sun Jul 30 18:44:20 2023
+++ src/external/gpl3/gdb/dist/sim/ppc/hw_shm.c	Mon Aug 14 18:42:02 2023
@@ -97,7 +97,7 @@ hw_shm_init_data(device *me)
 error("shm_init_data() required key property is missing\n");
 
   shm->key = (key_t) device_find_integer_property(me, "key");
-  DTRACE(shm, ("shm key (0x%08x)\n", shm->key) );
+  DTRACE(shm, ("shm key (0x%08jx)\n", (intmax_t)shm->key) );
   
   /* Figure out where this memory is in address space and how long it is */
   if ( !device_find_reg_array_property(me, "reg", 0, ®) )



CVS commit: src/external/gpl3/gdb/dist/sim/ppc

2023-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 14 22:42:02 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/sim/ppc: hw_sem.c hw_shm.c

Log Message:
fix cross-build host amd64, target ppc


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/gpl3/gdb/dist/sim/ppc/hw_sem.c \
src/external/gpl3/gdb/dist/sim/ppc/hw_shm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/gdb

2023-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 14 22:41:34 UTC 2023

Modified Files:
src/tools/gdb: Makefile

Log Message:
backout previous; cross build needs native gmp


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/tools/gdb/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/gdb/Makefile
diff -u src/tools/gdb/Makefile:1.44 src/tools/gdb/Makefile:1.45
--- src/tools/gdb/Makefile:1.44	Mon Aug 14 12:45:26 2023
+++ src/tools/gdb/Makefile	Mon Aug 14 18:41:34 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.44 2023/08/14 16:45:26 christos Exp $
+#	$NetBSD: Makefile,v 1.45 2023/08/14 22:41:34 christos Exp $
 
 .include 
 
@@ -10,7 +10,7 @@ FIND_ARGS=	\! \( -type d -name sim -prun
 
 CONFIGURE_ARGS=	--target=${MACHINE_GNU_PLATFORM} --disable-nls \
 		--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
-		--without-mpfr
+		--without-mpfr --with-libgmp-prefix=${TOOLDIR}
 
 MAKE_ARGS=	MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
 
@@ -45,15 +45,12 @@ MKNATIVE_ENV=	${BINENV} ${CONFIGURE_ENV:
 
 MKENV_BUILD_MAKE=${MKNATIVE_ENV} ${BUILD_MAKE}
 
-CCADDFLAGS+= --sysroot=${DESTDIR} -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/include
+CCADDFLAGS+= --sysroot=${DESTDIR} -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include
 LDADDFLAGS+= -L${DESTDIR}/lib -L${DESTDIR}/usr/lib
 CXXADDFLAGS+= -D__STDC_FORMAT_MACROS
 CXXADDFLAGS+= -D__STDC_LIMIT_MACROS
 CXXADDFLAGS+= -D__STDC_CONSTANT_MACROS
 HOST_CXXFLAGS+= ${CXXADDFLAGS}
-# for gmp
-HOST_CPPFLAGS+= -I${.OBJDIR}/.native/include
-HOST_LDFLAGS+= -L${GMPOBJ}
 
 NEWCONFIGDIR?=	${.CURDIR}/../..
 MKNATIVE?=	${.CURDIR}/mknative-gdb
@@ -107,6 +104,9 @@ native-gdb: .native/.configure_done
 		${GDB_MACHINE_ARCH}
 
 .native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
+	mkdir -p ${.OBJDIR}/.native/include
+	# we need to make a copy because ${GMPINC} has a config.h
+	cp -p ${GMPINC}/gmp.h ${.OBJDIR}/.native/include
 	PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
 		(cd ${.OBJDIR}/.native && \
 			${MKNATIVE_ENV} ${HOST_SH} ${GNUHOSTDIST}/configure \
@@ -134,10 +134,3 @@ native-gdb: .native/.configure_done
 clean: clean.native
 clean.native:
 	-rm -r -f .native
-
-.BEGIN: ${.OBJDIR}/.native/include/gmp.h
-
-${.OBJDIR}/.native/include/gmp.h: ${GMPINC}/gmp.h
-	mkdir -p ${.OBJDIR}/.native/include
-	# we need to make a copy because ${GMPINC} has a config.h
-	cp -p ${GMPINC}/gmp.h ${.OBJDIR}/.native/include



CVS commit: src/tools/gdb

2023-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 14 22:41:34 UTC 2023

Modified Files:
src/tools/gdb: Makefile

Log Message:
backout previous; cross build needs native gmp


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/tools/gdb/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/usb

2023-08-14 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Aug 14 21:17:08 UTC 2023

Modified Files:
src/sys/dev/usb: uaudio.c

Log Message:
s/streadming/streaming/ in debug message.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/dev/usb/uaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/usb

2023-08-14 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Aug 14 21:17:08 UTC 2023

Modified Files:
src/sys/dev/usb: uaudio.c

Log Message:
s/streadming/streaming/ in debug message.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/dev/usb/uaudio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/uaudio.c
diff -u src/sys/dev/usb/uaudio.c:1.181 src/sys/dev/usb/uaudio.c:1.182
--- src/sys/dev/usb/uaudio.c:1.181	Sun Apr 30 08:35:52 2023
+++ src/sys/dev/usb/uaudio.c	Mon Aug 14 21:17:08 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaudio.c,v 1.181 2023/04/30 08:35:52 mlelstv Exp $	*/
+/*	$NetBSD: uaudio.c,v 1.182 2023/08/14 21:17:08 andvar Exp $	*/
 
 /*
  * Copyright (c) 1999, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.181 2023/04/30 08:35:52 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.182 2023/08/14 21:17:08 andvar Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2197,7 +2197,7 @@ uaudio_process_as(struct uaudio_softc *s
 if (sed != NULL)
 	goto ignore;
 sed = (const struct usb_audio_streaming_endpoint_descriptor *) desc;
-DPRINTF(" streadming_endpoint: offset=%d bLength=%d\n", *offsp, sed->bLength);
+DPRINTF(" streaming_endpoint: offset=%d bLength=%d\n", *offsp, sed->bLength);
 break;
 			default:
 goto ignore;



CVS commit: src/external/gpl3/gdb

2023-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 14 20:42:28 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb: Makefile.in arm-netbsd-nat.c
configure.host configure.nat configure.tgt i386-netbsd-tdep.c
mips-netbsd-nat.c ppc-netbsd-nat.c ppc-netbsd-tdep.c
sh-netbsd-tdep.c
src/external/gpl3/gdb/lib/libbfd/arch/x86_64: config.h
src/external/gpl3/gdb/lib/libgdb/arch/mips64eb: defs.mk init.c
src/external/gpl3/gdb/lib/libgdb/arch/mips64el: defs.mk init.c
src/external/gpl3/gdb/lib/libgdb/arch/mipseb: defs.mk init.c
src/external/gpl3/gdb/lib/libgdb/arch/mipsel: defs.mk init.c
src/external/gpl3/gdb/lib/libgdb/arch/mipsn64eb: defs.mk init.c
src/external/gpl3/gdb/lib/libgdb/arch/mipsn64el: defs.mk init.c
src/external/gpl3/gdb/lib/libgdb/arch/powerpc: defs.mk init.c
src/external/gpl3/gdb/lib/libgdb/arch/riscv32: defs.mk init.c
src/external/gpl3/gdb/lib/libgdb/arch/riscv64: defs.mk init.c
src/external/gpl3/gdb/lib/libgdb/arch/x86_64: config.h defs.mk
Added Files:
src/external/gpl3/gdb/dist/gdb: aarch64-netbsd-nat.c
aarch64-netbsd-tdep.c aarch64-netbsd-tdep.h ia64-netbsd-tdep.c
riscv-netbsd-nat.c riscv-netbsd-tdep.c riscv-netbsd-tdep.h
Removed Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-nat.c aarch64-nbsd-tdep.c
aarch64-nbsd-tdep.h ia64-nbsd-tdep.c riscv-nbsd-nat.c
riscv-nbsd-tdep.c riscv-nbsd-tdep.h sh-nbsd-tdep.h
sparc-nbsd-tdep.h

Log Message:
- fix the remaining bsd-kvm targets
- remove nbsdelf, everything uses nbsd now
- add missing files
- regen


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/Makefile.in
cvs rdiff -u -r1.6 -r0 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
cvs rdiff -u -r1.9 -r0 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c
cvs rdiff -u -r1.3 -r0 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/aarch64-netbsd-tdep.h \
src/external/gpl3/gdb/dist/gdb/ia64-netbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/riscv-netbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/riscv-netbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/riscv-netbsd-tdep.h
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/arm-netbsd-nat.c
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gdb/dist/gdb/configure.host
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/configure.nat
cvs rdiff -u -r1.29 -r1.30 src/external/gpl3/gdb/dist/gdb/configure.tgt
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/i386-netbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/mips-netbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/ppc-netbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/ppc-netbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/sh-netbsd-tdep.c
cvs rdiff -u -r1.1 -r0 src/external/gpl3/gdb/dist/gdb/ia64-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/riscv-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/riscv-nbsd-tdep.c \
src/external/gpl3/gdb/dist/gdb/riscv-nbsd-tdep.h \
src/external/gpl3/gdb/dist/gdb/sh-nbsd-tdep.h \
src/external/gpl3/gdb/dist/gdb/sparc-nbsd-tdep.h
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gdb/lib/libbfd/arch/x86_64/config.h
cvs rdiff -u -r1.19 -r1.20 \
src/external/gpl3/gdb/lib/libgdb/arch/mips64eb/defs.mk
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gdb/lib/libgdb/arch/mips64eb/init.c
cvs rdiff -u -r1.18 -r1.19 \
src/external/gpl3/gdb/lib/libgdb/arch/mips64el/defs.mk \
src/external/gpl3/gdb/lib/libgdb/arch/mips64el/init.c
cvs rdiff -u -r1.17 -r1.18 \
src/external/gpl3/gdb/lib/libgdb/arch/mipseb/defs.mk
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gdb/lib/libgdb/arch/mipseb/init.c
cvs rdiff -u -r1.18 -r1.19 \
src/external/gpl3/gdb/lib/libgdb/arch/mipsel/defs.mk
cvs rdiff -u -r1.15 -r1.16 \
src/external/gpl3/gdb/lib/libgdb/arch/mipsel/init.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gdb/lib/libgdb/arch/mipsn64eb/defs.mk \
src/external/gpl3/gdb/lib/libgdb/arch/mipsn64eb/init.c
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libgdb/arch/mipsn64el/defs.mk \
src/external/gpl3/gdb/lib/libgdb/arch/mipsn64el/init.c
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gdb/lib/libgdb/arch/powerpc/defs.mk
cvs rdiff -u -r1.17 -r1.18 \
src/external/gpl3/gdb/lib/libgdb/arch/powerpc/init.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gdb/lib/libgdb/arch/riscv32/defs.mk \
src/external/gpl3/gdb/lib/libgdb/arch/riscv32/init.c
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gdb/lib/libgdb/arch/riscv64/defs.mk \
src/external/gpl3/gdb/lib/libgdb/arch/riscv64/init.c
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gdb/lib/libgdb/arch/x86_64/config.h
cvs rdiff -u -r1.23

CVS commit: src/tools/compat

2023-08-14 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Mon Aug 14 18:49:45 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 11.4 (CBE) hosts


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/README
diff -u src/tools/compat/README:1.24 src/tools/compat/README:1.25
--- src/tools/compat/README:1.24	Sun Jul 30 19:03:50 2023
+++ src/tools/compat/README	Mon Aug 14 18:49:45 2023
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.24 2023/07/30 19:03:50 palle Exp $
+$NetBSD: README,v 1.25 2023/08/14 18:49:45 palle Exp $
 
 Special notes for cross-hosting a NetBSD build on certain platforms.  
 Only those platforms which have been tested to complete a "build.sh" run
@@ -122,6 +122,7 @@ Solaris 11:
  * Using gcc-11
  * Set PATH to /usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
  * Set HOST_CC to /usr/bin/gcc
+ * Set HOST_SH to /usr/bin/bash
 
 * Solaris 11.4 (SRU57)
  * POSIX.1-2008, SUSv4 (see standards(7))



CVS commit: src/tools/compat

2023-08-14 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Mon Aug 14 18:49:45 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 11.4 (CBE) hosts


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man

2023-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Aug 14 16:51:52 UTC 2023

Modified Files:
src/share/man/man4: options.4
src/share/man/man7: sysctl.7

Log Message:
options(4), sysctl(7): Document options HEARTBEAT.


To generate a diff of this commit:
cvs rdiff -u -r1.525 -r1.526 src/share/man/man4/options.4
cvs rdiff -u -r1.165 -r1.166 src/share/man/man7/sysctl.7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/share/man

2023-08-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Aug 14 16:51:52 UTC 2023

Modified Files:
src/share/man/man4: options.4
src/share/man/man7: sysctl.7

Log Message:
options(4), sysctl(7): Document options HEARTBEAT.


To generate a diff of this commit:
cvs rdiff -u -r1.525 -r1.526 src/share/man/man4/options.4
cvs rdiff -u -r1.165 -r1.166 src/share/man/man7/sysctl.7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.525 src/share/man/man4/options.4:1.526
--- src/share/man/man4/options.4:1.525	Sun May 14 09:02:05 2023
+++ src/share/man/man4/options.4	Mon Aug 14 16:51:52 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.525 2023/05/14 09:02:05 riastradh Exp $
+.\"	$NetBSD: options.4,v 1.526 2023/08/14 16:51:52 riastradh Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -1343,6 +1343,53 @@ and
 .Em MEMORY_DISK_DYNAMIC .
 It is incompatible with
 .Em MEMORY_DISK_ROOT_SIZE .
+.It Cd options HEARTBEAT
+Turns on heartbeat checks to panic if any CPU in the system or the
+timecounter appears stuck.
+.Pp
+Each CPU will periodically check in hard interrupt context that the
+timecounter has advanced and soft interrupts have run on the current
+CPU, and each CPU will also be periodically checked for progress by
+another CPU.
+.Pp
+If a CPU detects no progress has been made after
+.Dv HEARTBEAT_MAX_PERIOD
+seconds,
+.Nx
+will panic, giving the opportunity to enter ddb or get a crash dump
+even if the system has become totally unresponsive to keyboard input.
+.Pp
+This is different from a hardware watchdog timer
+.Pq Xr wdogctl 8 :
+.Bl -bullet
+.It
+.Cd options HEARTBEAT
+is purely a software mechanism, so if hard interrupts are stuck on all
+CPUs, then
+.Cd options HEARTBEAT
+cannot trigger, but a hardware watchdog timer can.
+.It
+A hardware watchdog timer won't notice if a single CPU is stuck, or if
+the system timecounter is stuck, as long as at least one CPU is not
+stuck and able to run
+.Xr wdogctl 8
+or the kernel watchdog tickle thread.
+In contrast,
+.Cd options HEARTBEAT
+uses hard interrupts on each CPU to cross-check soft interrupt progress
+on another CPU as well as the timecounter, so it can detect when a
+single CPU is unable to make progress when others are able.
+.El
+.It Cd options HEARTBEAT_MAX_PERIOD_DEFAULT=integer
+Time in seconds since the last
+.Cd options HEARTBEAT
+progress check has passed before it will trigger a panic.
+Default: 15.
+.Pp
+Can be changed at runtime via the
+.Li kern.heartbeat.max_period
+.Xr sysctl 7
+knob.
 .It Cd options HZ=integer
 On ports that support it, set the system clock frequency (see
 .Xr hz 9 )

Index: src/share/man/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.165 src/share/man/man7/sysctl.7:1.166
--- src/share/man/man7/sysctl.7:1.165	Sun Jun 18 18:16:40 2023
+++ src/share/man/man7/sysctl.7	Mon Aug 14 16:51:52 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.7,v 1.165 2023/06/18 18:16:40 riastradh Exp $
+.\"	$NetBSD: sysctl.7,v 1.166 2023/08/14 16:51:52 riastradh Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -310,6 +310,7 @@ privilege may change the value.
 .It kern.fscale	integer	no
 .It kern.fsync	integer	no
 .It kern.hardclock_ticks	integer	no
+.It kern.heartbeat.max_period	integer	yes
 .It kern.hostid	integer	yes
 .It kern.hostname	string	yes
 .It kern.iov_max	integer	no
@@ -606,6 +607,12 @@ otherwise\ 0.
 Returns the number of
 .Xr hardclock 9
 ticks.
+.It Li kern.heartbeat.max_period
+Time in seconds since the last
+.Cd options HEARTBEAT
+progress check has passed before it will trigger a panic.
+See
+.Xr options 4 .
 .It Li kern.hist
 This variable contains kernel history data if the kernel was
 configured for any of the options



CVS commit: src/tools/gdb

2023-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 14 16:45:26 UTC 2023

Modified Files:
src/tools/gdb: Makefile

Log Message:
fix cross-gdb


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/tools/gdb/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/gdb/Makefile
diff -u src/tools/gdb/Makefile:1.43 src/tools/gdb/Makefile:1.44
--- src/tools/gdb/Makefile:1.43	Wed Aug  9 14:57:04 2023
+++ src/tools/gdb/Makefile	Mon Aug 14 12:45:26 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.43 2023/08/09 18:57:04 christos Exp $
+#	$NetBSD: Makefile,v 1.44 2023/08/14 16:45:26 christos Exp $
 
 .include 
 
@@ -10,7 +10,7 @@ FIND_ARGS=	\! \( -type d -name sim -prun
 
 CONFIGURE_ARGS=	--target=${MACHINE_GNU_PLATFORM} --disable-nls \
 		--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
-		--without-mpfr --with-libgmp-prefix=${TOOLDIR}
+		--without-mpfr
 
 MAKE_ARGS=	MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
 
@@ -45,12 +45,15 @@ MKNATIVE_ENV=	${BINENV} ${CONFIGURE_ENV:
 
 MKENV_BUILD_MAKE=${MKNATIVE_ENV} ${BUILD_MAKE}
 
-CCADDFLAGS+= --sysroot=${DESTDIR} -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include
+CCADDFLAGS+= --sysroot=${DESTDIR} -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/include
 LDADDFLAGS+= -L${DESTDIR}/lib -L${DESTDIR}/usr/lib
 CXXADDFLAGS+= -D__STDC_FORMAT_MACROS
 CXXADDFLAGS+= -D__STDC_LIMIT_MACROS
 CXXADDFLAGS+= -D__STDC_CONSTANT_MACROS
 HOST_CXXFLAGS+= ${CXXADDFLAGS}
+# for gmp
+HOST_CPPFLAGS+= -I${.OBJDIR}/.native/include
+HOST_LDFLAGS+= -L${GMPOBJ}
 
 NEWCONFIGDIR?=	${.CURDIR}/../..
 MKNATIVE?=	${.CURDIR}/mknative-gdb
@@ -104,9 +107,6 @@ native-gdb: .native/.configure_done
 		${GDB_MACHINE_ARCH}
 
 .native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
-	mkdir -p ${.OBJDIR}/.native/include
-	# we need to make a copy because ${GMPINC} has a config.h
-	cp -p ${GMPINC}/gmp.h ${.OBJDIR}/.native/include
 	PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
 		(cd ${.OBJDIR}/.native && \
 			${MKNATIVE_ENV} ${HOST_SH} ${GNUHOSTDIST}/configure \
@@ -134,3 +134,10 @@ native-gdb: .native/.configure_done
 clean: clean.native
 clean.native:
 	-rm -r -f .native
+
+.BEGIN: ${.OBJDIR}/.native/include/gmp.h
+
+${.OBJDIR}/.native/include/gmp.h: ${GMPINC}/gmp.h
+	mkdir -p ${.OBJDIR}/.native/include
+	# we need to make a copy because ${GMPINC} has a config.h
+	cp -p ${GMPINC}/gmp.h ${.OBJDIR}/.native/include



CVS commit: src/tools/gdb

2023-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 14 16:45:26 UTC 2023

Modified Files:
src/tools/gdb: Makefile

Log Message:
fix cross-gdb


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/tools/gdb/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/gpl3/gdb/dist/gdb

2023-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 14 15:20:37 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb: amd64-netbsd-tdep.c

Log Message:
put back the frame unwinder code lost in the merge (J. Hannken-Illjes)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/amd64-netbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/amd64-netbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/amd64-netbsd-tdep.c:1.1.1.1 src/external/gpl3/gdb/dist/gdb/amd64-netbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/amd64-netbsd-tdep.c:1.1.1.1	Sun Jul 30 18:44:48 2023
+++ src/external/gpl3/gdb/dist/gdb/amd64-netbsd-tdep.c	Mon Aug 14 11:20:37 2023
@@ -28,6 +28,8 @@
 #include "gdbsupport/x86-xstate.h"
 #include "netbsd-tdep.h"
 #include "solib-svr4.h"
+#include "trad-frame.h"
+#include "frame-unwind.h"
 
 /* Support for signal handlers.  */
 
@@ -94,6 +96,196 @@ int amd64nbsd_r_reg_offset[] =
   15 * 8			/* %gs */
 };
 
+/* Kernel debugging support */
+static const int amd64nbsd_tf_reg_offset[] =
+{
+  18 * 8,			/* %rax */
+  17 * 8,			/* %rbx */
+  10 * 8,			/* %rcx */
+  2 * 8,			/* %rdx */
+  1 * 8,			/* %rsi */
+  0 * 8,			/* %rdi */
+  16 * 8,			/* %rbp */
+  28 * 8,			/* %rsp */
+  4 * 8,			/* %r8 .. */
+  5 * 8,			
+  3 * 8,			
+  11 * 8,			
+  12 * 8,			
+  13 * 8,			
+  14 * 8,			
+  15 * 8,			/* ... %r15 */
+  25 * 8,			/* %rip */
+  27 * 8,			/* %eflags */
+  26 * 8,			/* %cs */
+  29 * 8,			/* %ss */
+  22 * 8,			/* %ds */
+  21 * 8,			/* %es */
+  20 * 8,			/* %fs */
+  19 * 8,			/* %gs */
+};
+
+static struct trad_frame_cache *
+amd64nbsd_trapframe_cache(frame_info_ptr this_frame, void **this_cache)
+{
+  struct trad_frame_cache *cache;
+  CORE_ADDR func, sp, addr;
+  ULONGEST cs = 0, rip = 0;
+  const char *name;
+  int i;
+  struct gdbarch *gdbarch = get_frame_arch (this_frame);
+  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+
+  if (*this_cache)
+return (struct trad_frame_cache *)*this_cache;
+
+  cache = trad_frame_cache_zalloc (this_frame);
+  *this_cache = cache;
+
+  func = get_frame_func (this_frame);
+  sp = get_frame_register_unsigned (this_frame, AMD64_RSP_REGNUM);
+
+  find_pc_partial_function (func, &name, NULL, NULL);
+
+  /* There is an extra 'call' in the interrupt sequence - ignore the extra
+   * return address */
+
+  addr = sp;
+  if (name) {
+	if (strncmp (name, "Xintr", 5) == 0
+	 || strncmp (name, "Xhandle", 7) == 0) {
+		addr += 8;		/* It's an interrupt frame.  */
+	}
+  }
+
+#ifdef DEBUG_TRAPFRAME
+  for (i = 0; i < 50; i++) {
+cs = read_memory_unsigned_integer (addr + i * 8, 8, byte_order);
+printf("%s i=%d r=%#jx\n", name, i, (intmax_t)cs);
+  }
+#endif
+
+  for (i = 0; i < ARRAY_SIZE (amd64nbsd_tf_reg_offset); i++)
+if (amd64nbsd_tf_reg_offset[i] != -1)
+  trad_frame_set_reg_addr (cache, i, addr + amd64nbsd_tf_reg_offset[i]);
+
+  /* Read %cs and %rip when we have the addresses to hand */
+  cs = read_memory_unsigned_integer (addr
++ amd64nbsd_tf_reg_offset[AMD64_CS_REGNUM], 8, byte_order);
+  rip = read_memory_unsigned_integer (addr
++ amd64nbsd_tf_reg_offset[AMD64_RIP_REGNUM], 8, byte_order);
+
+#ifdef DEBUG_TRAPFRAME
+  printf("%s cs=%#jx rip=%#jx\n", name, (intmax_t)cs, (intmax_t)rip);
+#endif
+
+  /* The trap frame layout was changed lf the %rip value is less than 2^16 it
+   * is almost certainly the %ss of the old format. */
+  if (rip < (1 << 16))
+{
+
+  for (i = 0; i < ARRAY_SIZE (amd64nbsd_tf_reg_offset); i++)
+{
+
+  if (amd64nbsd_tf_reg_offset[i] == -1)
+continue;
+
+  trad_frame_set_reg_addr (cache, i, addr + amd64nbsd_r_reg_offset[i]);
+
+  /* Read %cs when we have the address to hand */
+  if (i == AMD64_CS_REGNUM)
+	cs = read_memory_unsigned_integer (addr + amd64nbsd_r_reg_offset[i],
+	8, byte_order);
+}
+}
+
+  if ((cs & I386_SEL_RPL) == I386_SEL_UPL ||
+	(name && strncmp(name, "Xsoft", 5) == 0))
+{
+  /* Trap from user space or soft interrupt; terminate backtrace.  */
+  trad_frame_set_id (cache, outer_frame_id);
+}
+  else
+{
+  /* Construct the frame ID using the function start.  */
+  trad_frame_set_id (cache, frame_id_build (sp + 16, func));
+}
+
+  return cache;
+}
+
+static void
+amd64nbsd_trapframe_this_id (frame_info_ptr this_frame,
+			 void **this_cache,
+			 struct frame_id *this_id)
+{
+  struct trad_frame_cache *cache =
+amd64nbsd_trapframe_cache (this_frame, this_cache);
+  
+  trad_frame_get_id (cache, this_id);
+}
+
+static struct value *
+amd64nbsd_trapframe_prev_register (frame_info_ptr this_frame,
+   void **this_cache, int regnum) 
+{
+  struct trad_frame_cache *cache =
+amd64nbsd_trapframe_cache (this_frame, this_cache);
+
+  return trad_frame_get_register (cach

CVS commit: src/external/gpl3/gdb/dist/gdb

2023-08-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 14 15:20:37 UTC 2023

Modified Files:
src/external/gpl3/gdb/dist/gdb: amd64-netbsd-tdep.c

Log Message:
put back the frame unwinder code lost in the merge (J. Hannken-Illjes)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdb/amd64-netbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/amd64/installimage

2023-08-14 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Mon Aug 14 13:54:05 UTC 2023

Modified Files:
src/distrib/amd64/installimage: installimage.mk

Log Message:
amd64 installimage: Reduce non-xz size slightly to fit 4GB flash drives

The installimage sizes were bumped in 2022 because of some growth, and
the case for not-xz sets went to 4000 (MiB).  That's just over what a
lot of "4 GB" flash drives are, but seems obviously intended to fit.
The actual usage of the filesystem, from a current build from earlier
this year (with non-xz sets) is:

/dev/dk1   3.7G   833M   2.7G  23% /mnt

and similar for netbsd-10 built yesterday, so we can afford to shrink
slightly.  Drop to 3800, which is still huge, but will make 4 GB flash
drives work.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/amd64/installimage/installimage.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/amd64/installimage/installimage.mk
diff -u src/distrib/amd64/installimage/installimage.mk:1.3 src/distrib/amd64/installimage/installimage.mk:1.4
--- src/distrib/amd64/installimage/installimage.mk:1.3	Sat Jul 30 00:55:38 2022
+++ src/distrib/amd64/installimage/installimage.mk	Mon Aug 14 13:54:05 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: installimage.mk,v 1.3 2022/07/30 00:55:38 pgoyette Exp $
+#	$NetBSD: installimage.mk,v 1.4 2023/08/14 13:54:05 gdt Exp $
 
 # common code between distrib/amd64/installimage/Makefile and
 # distrib/amd64/installimage-bios/Makefile.
@@ -6,7 +6,7 @@
 .if ${USE_XZ_SETS:Uno} != "no"
 INSTIMAGEMB?=	2500			# for all installation binaries
 .else
-INSTIMAGEMB?=	4000			# for all installation binaries
+INSTIMAGEMB?=	3800			# for all installation binaries
 .endif
 
 PRIMARY_BOOT=		bootxx_ffsv1



CVS commit: src/distrib/amd64/installimage

2023-08-14 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Mon Aug 14 13:54:05 UTC 2023

Modified Files:
src/distrib/amd64/installimage: installimage.mk

Log Message:
amd64 installimage: Reduce non-xz size slightly to fit 4GB flash drives

The installimage sizes were bumped in 2022 because of some growth, and
the case for not-xz sets went to 4000 (MiB).  That's just over what a
lot of "4 GB" flash drives are, but seems obviously intended to fit.
The actual usage of the filesystem, from a current build from earlier
this year (with non-xz sets) is:

/dev/dk1   3.7G   833M   2.7G  23% /mnt

and similar for netbsd-10 built yesterday, so we can afford to shrink
slightly.  Drop to 3800, which is still huge, but will make 4 GB flash
drives work.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/amd64/installimage/installimage.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src

2023-08-14 Thread Andrius V
I would agree with Taylor, it is not tested well enough to be enabled
by default and mainly unmaintained by now. I guess the better solution
would be to attempt to integrate openchrome-drm instead at some point
in the future. I think making viadrmums as kernel module is quite a
good trade off right now for those who need/want to use it and it
saves from kernel compilation. Will do pull-up to netbsd-10 soon for
this change.

I may try to do some additional testing to verify how much it is
utilized right now and were performance makes a difference (and likely
would need to investigate what is wrong with VX900). I believe 3D
acceleration is unsupported.


On Sun, Aug 13, 2023 at 8:05 PM Taylor R Campbell
 wrote:
>
> > Date: Thu, 10 Aug 2023 07:42:53 +1000
> > from: matthew green 
> >
> > > Log Message:
> > > viadrmums(4): build legacy VIA DRM UMS driver module for amd64.
> > >
> > > This driver is not built-in by default, thus loadable module can help 
> > > (un)lucky
> >
> > if it works, why isn't it in GENERIC as well as a module?
>
> Couple reasons:
>
> 1. I never adequately tested it.  I started X a few years ago (and a
>couple drm updates ago) but that's it.  (Also only on 32-bit VIA.)
>Maybe andvar can test it more extensively now, though -- glxgears,
>x11perf, firefox, &c.
>
>Even better if we can get a sampling of code coverage, e.g. maybe
>with dtrace to count function calls at least, to confirm it's
>actually getting exercised.
>
> 2. It's a legacy UMS driver, which is inherently sketchy (display
>configuration requires granting userland direct access to pci and
>device registers) and increasingly unmaintained even upstream.
>
>So I put in some infrastructure to allow UMS drivers to be loaded
>dynamically, so it wouldn't be necessary to have sketchy business
>like that in the kernel by default.
>
>I kind of intended to give the same treatment to the other legacy
>UMS drivers like mga (matrox), r128, sis, tdfx, &c., but it's been
>a very low priority so I haven't gotten a round tuit (and I only
>have hardware for mga and that's in a build server I don't like to
>mess with).