CVS commit: src/share/wscons/keymaps

2024-05-16 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu May 16 14:11:42 UTC 2024

Modified Files:
src/share/wscons/keymaps: pckbd.sv.svascii

Log Message:
Fix typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/wscons/keymaps/pckbd.sv.svascii

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



CVS commit: src/share/wscons/keymaps

2024-05-16 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu May 16 14:11:42 UTC 2024

Modified Files:
src/share/wscons/keymaps: pckbd.sv.svascii

Log Message:
Fix typo in comment


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/wscons/keymaps/pckbd.sv.svascii

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

Modified files:

Index: src/share/wscons/keymaps/pckbd.sv.svascii
diff -u src/share/wscons/keymaps/pckbd.sv.svascii:1.1 src/share/wscons/keymaps/pckbd.sv.svascii:1.2
--- src/share/wscons/keymaps/pckbd.sv.svascii:1.1	Wed May  2 15:08:35 2001
+++ src/share/wscons/keymaps/pckbd.sv.svascii	Thu May 16 14:11:42 2024
@@ -1,7 +1,7 @@
-# $NetBSD: pckbd.sv.svascii,v 1.1 2001/05/02 15:08:35 drochner Exp $
+# $NetBSD: pckbd.sv.svascii,v 1.2 2024/05/16 14:11:42 gson Exp $
 #
 # This is an overlay to the swedish keymap which maps
-# the natinal characters to their ASCII counterparts.
+# the national characters to their ASCII counterparts.
 # From Michael Eriksson per PR kern/8456.
 
 keycode 5 = 4 dollar currency



CVS commit: src/tests/lib/libc/stdio

2024-05-01 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed May  1 11:40:25 UTC 2024

Modified Files:
src/tests/lib/libc/stdio: t_intr.sh

Log Message:
Increase the estimate of disk space required for the test, as the old
estimate recently proved too optimistic on the amd64 testbed on b4.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/stdio/t_intr.sh

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

Modified files:

Index: src/tests/lib/libc/stdio/t_intr.sh
diff -u src/tests/lib/libc/stdio/t_intr.sh:1.6 src/tests/lib/libc/stdio/t_intr.sh:1.7
--- src/tests/lib/libc/stdio/t_intr.sh:1.6	Sun Oct 31 11:36:26 2021
+++ src/tests/lib/libc/stdio/t_intr.sh	Wed May  1 11:40:25 2024
@@ -1,4 +1,4 @@
-# $NetBSD: t_intr.sh,v 1.6 2021/10/31 11:36:26 gson Exp $
+# $NetBSD: t_intr.sh,v 1.7 2024/05/01 11:40:25 gson Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -37,7 +37,10 @@ TMOUT=20
 
 h_test() {
 	local avail=$( df -m . | awk '{if (int($4) > 0) print $4}' )
-	local need=$(( 2 * $MAX * 8 / 100 ))
+	# The test data are stored in triplicate: numbers.in, numbers.out,
+	# and a temporary "stdout" file created by ATF.  Each line consists
+	# of up to 7 digits and a newline for a total of 8 bytes.
+	local need=$(( 3 * $MAX * 8 / 100 ))
 	if [ $avail -lt $need ]; then
 		atf_skip "not enough free space in working directory"
 	fi



CVS commit: src/tests/lib/libc/stdio

2024-05-01 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed May  1 11:40:25 UTC 2024

Modified Files:
src/tests/lib/libc/stdio: t_intr.sh

Log Message:
Increase the estimate of disk space required for the test, as the old
estimate recently proved too optimistic on the amd64 testbed on b4.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/stdio/t_intr.sh

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



CVS commit: src/tests/lib/libc/sys

2024-04-12 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Apr 12 07:16:50 UTC 2024

Modified Files:
src/tests/lib/libc/sys: t_getrusage.c

Log Message:
Require at least 64 MB RAM to run the getrusage_maxrss test case as it
allocates 40 MB and we should leave some for the system, too.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libc/sys/t_getrusage.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_getrusage.c
diff -u src/tests/lib/libc/sys/t_getrusage.c:1.8 src/tests/lib/libc/sys/t_getrusage.c:1.9
--- src/tests/lib/libc/sys/t_getrusage.c:1.8	Wed May  9 08:45:03 2018
+++ src/tests/lib/libc/sys/t_getrusage.c	Fri Apr 12 07:16:50 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: t_getrusage.c,v 1.8 2018/05/09 08:45:03 mrg Exp $ */
+/* $NetBSD: t_getrusage.c,v 1.9 2024/04/12 07:16:50 gson Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_getrusage.c,v 1.8 2018/05/09 08:45:03 mrg Exp $");
+__RCSID("$NetBSD: t_getrusage.c,v 1.9 2024/04/12 07:16:50 gson Exp $");
 
 #include 
 #include 
@@ -126,6 +126,7 @@ ATF_TC(getrusage_maxrss);
 ATF_TC_HEAD(getrusage_maxrss, tc)
 {
 	atf_tc_set_md_var(tc, "descr", "Test maxrss growing with getrusage(2)");
+	atf_tc_set_md_var(tc, "require.memory", "64M");
 }
 
 ATF_TC_BODY(getrusage_maxrss, tc)



CVS commit: src/tests/lib/libc/sys

2024-04-12 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Apr 12 07:16:50 UTC 2024

Modified Files:
src/tests/lib/libc/sys: t_getrusage.c

Log Message:
Require at least 64 MB RAM to run the getrusage_maxrss test case as it
allocates 40 MB and we should leave some for the system, too.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libc/sys/t_getrusage.c

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



CVS commit: src/usr.bin/audio/common

2024-02-27 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Feb 27 21:05:34 UTC 2024

Modified Files:
src/usr.bin/audio/common: audio.c decode.c sun.c wav.c

Log Message:
Clean up lines containing only tabs.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/audio/common/audio.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/audio/common/decode.c
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/audio/common/sun.c
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/audio/common/wav.c

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

Modified files:

Index: src/usr.bin/audio/common/audio.c
diff -u src/usr.bin/audio/common/audio.c:1.26 src/usr.bin/audio/common/audio.c:1.27
--- src/usr.bin/audio/common/audio.c:1.26	Sat Nov  9 12:46:44 2019
+++ src/usr.bin/audio/common/audio.c	Tue Feb 27 21:05:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.26 2019/11/09 12:46:44 mrg Exp $	*/
+/*	$NetBSD: audio.c,v 1.27 2024/02/27 21:05:34 gson Exp $	*/
 
 /*
  * Copyright (c) 1999, 2013, 2015, 2019 Matthew R. Green
@@ -32,7 +32,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: audio.c,v 1.26 2019/11/09 12:46:44 mrg Exp $");
+__RCSID("$NetBSD: audio.c,v 1.27 2024/02/27 21:05:34 gson Exp $");
 #endif
 
 
@@ -205,7 +205,7 @@ write_header(struct track_info *ti)
 
 	veclen = 0;
 	tlen = 0;
-		
+
 	if (hdrlen != 0) {
 		iv[veclen].iov_base = hdr;
 		iv[veclen].iov_len = hdrlen;

Index: src/usr.bin/audio/common/decode.c
diff -u src/usr.bin/audio/common/decode.c:1.1 src/usr.bin/audio/common/decode.c:1.2
--- src/usr.bin/audio/common/decode.c:1.1	Sun Jun 21 06:06:01 2015
+++ src/usr.bin/audio/common/decode.c	Tue Feb 27 21:05:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: decode.c,v 1.1 2015/06/21 06:06:01 mrg Exp $	*/
+/*	$NetBSD: decode.c,v 1.2 2024/02/27 21:05:34 gson Exp $	*/
 
 /*
  * Copyright (c) 1999 Matthew R. Green
@@ -29,7 +29,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: decode.c,v 1.1 2015/06/21 06:06:01 mrg Exp $");
+__RCSID("$NetBSD: decode.c,v 1.2 2024/02/27 21:05:34 gson Exp $");
 #endif
 
 #include 
@@ -85,7 +85,7 @@ decode_time(const char *arg, struct time
 
 	tvp->tv_sec = tvp->tv_usec = 0;
 	s = copy;
-	
+
 	/* handle [hh:]mm:ss.dd */
 	if ((colon = strchr(s, ':')) != NULL) {
 		*colon++ = '\0';

Index: src/usr.bin/audio/common/sun.c
diff -u src/usr.bin/audio/common/sun.c:1.10 src/usr.bin/audio/common/sun.c:1.11
--- src/usr.bin/audio/common/sun.c:1.10	Sat Nov  9 12:46:44 2019
+++ src/usr.bin/audio/common/sun.c	Tue Feb 27 21:05:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sun.c,v 1.10 2019/11/09 12:46:44 mrg Exp $	*/
+/*	$NetBSD: sun.c,v 1.11 2024/02/27 21:05:34 gson Exp $	*/
 
 /*
  * Copyright (c) 2002, 2013, 2015 Matthew R. Green
@@ -32,7 +32,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: sun.c,v 1.10 2019/11/09 12:46:44 mrg Exp $");
+__RCSID("$NetBSD: sun.c,v 1.11 2024/02/27 21:05:34 gson Exp $");
 #endif
 
 
@@ -149,7 +149,7 @@ sun_prepare_header(struct track_info *ti
 		break;
 #endif
 	}
-	
+
 	/* if we can't express this as a Sun header, don't write any */
 	if (audio_encoding_to_sun(ti->encoding, ti->precision, &sunenc) != 0) {
 		if (!ti->qflag && !warned) {

Index: src/usr.bin/audio/common/wav.c
diff -u src/usr.bin/audio/common/wav.c:1.17 src/usr.bin/audio/common/wav.c:1.18
--- src/usr.bin/audio/common/wav.c:1.17	Tue Feb 27 20:40:29 2024
+++ src/usr.bin/audio/common/wav.c	Tue Feb 27 21:05:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: wav.c,v 1.17 2024/02/27 20:40:29 gson Exp $	*/
+/*	$NetBSD: wav.c,v 1.18 2024/02/27 21:05:34 gson Exp $	*/
 
 /*
  * Copyright (c) 2002, 2009, 2013, 2015, 2019 Matthew R. Green
@@ -33,7 +33,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: wav.c,v 1.17 2024/02/27 20:40:29 gson Exp $");
+__RCSID("$NetBSD: wav.c,v 1.18 2024/02/27 21:05:34 gson Exp $");
 #endif
 
 
@@ -374,7 +374,7 @@ wav_prepare_header(struct track_info *ti
 	abps = (double)align*ti->sample_rate / (double)1 + 0.5;
 
 	nsample = (datalen / ti->precision) / ti->sample_rate;
-	
+
 	/*
 	 * now we've calculated the info, write it out!
 	 */



CVS commit: src/usr.bin/audio/common

2024-02-27 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Feb 27 21:05:34 UTC 2024

Modified Files:
src/usr.bin/audio/common: audio.c decode.c sun.c wav.c

Log Message:
Clean up lines containing only tabs.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/audio/common/audio.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/audio/common/decode.c
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/audio/common/sun.c
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/audio/common/wav.c

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



CVS commit: src/usr.bin/audio

2024-02-27 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Feb 27 20:40:30 UTC 2024

Modified Files:
src/usr.bin/audio/common: wav.c
src/usr.bin/audio/record: record.c

Log Message:
Clean up lines containing only spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/audio/common/wav.c
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/audio/record/record.c

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

Modified files:

Index: src/usr.bin/audio/common/wav.c
diff -u src/usr.bin/audio/common/wav.c:1.16 src/usr.bin/audio/common/wav.c:1.17
--- src/usr.bin/audio/common/wav.c:1.16	Sat Apr 15 12:39:44 2023
+++ src/usr.bin/audio/common/wav.c	Tue Feb 27 20:40:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: wav.c,v 1.16 2023/04/15 12:39:44 mlelstv Exp $	*/
+/*	$NetBSD: wav.c,v 1.17 2024/02/27 20:40:29 gson Exp $	*/
 
 /*
  * Copyright (c) 2002, 2009, 2013, 2015, 2019 Matthew R. Green
@@ -33,7 +33,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: wav.c,v 1.16 2023/04/15 12:39:44 mlelstv Exp $");
+__RCSID("$NetBSD: wav.c,v 1.17 2024/02/27 20:40:29 gson Exp $");
 #endif
 
 
@@ -108,7 +108,7 @@ audio_wav_parse_hdr(void *hdr, size_t sz
 	strRIFF[4] = "RIFF",
 	strWAVE[4] = "WAVE",
 	strdata[4] = "data";
-		
+
 	if (sz < 32)
 		return (AUDIO_ENOENT);
 

Index: src/usr.bin/audio/record/record.c
diff -u src/usr.bin/audio/record/record.c:1.57 src/usr.bin/audio/record/record.c:1.58
--- src/usr.bin/audio/record/record.c:1.57	Sat Apr 15 12:39:44 2023
+++ src/usr.bin/audio/record/record.c	Tue Feb 27 20:40:30 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: record.c,v 1.57 2023/04/15 12:39:44 mlelstv Exp $	*/
+/*	$NetBSD: record.c,v 1.58 2024/02/27 20:40:30 gson Exp $	*/
 
 /*
  * Copyright (c) 1999, 2002, 2003, 2005, 2010 Matthew R. Green
@@ -32,7 +32,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: record.c,v 1.57 2023/04/15 12:39:44 mlelstv Exp $");
+__RCSID("$NetBSD: record.c,v 1.58 2024/02/27 20:40:30 gson Exp $");
 #endif
 
 
@@ -332,7 +332,7 @@ main(int argc, char *argv[])
 			s = "change sign (big-endian, 32 bit)";
 		else if (conv_func == change_sign32_swap_bytes_le)
 			s = "change sign & swap bytes (little-endian, 32 bit)";
-		
+
 		if (s)
 			fprintf(stderr, "%s: converting, using function: %s\n",
 			getprogname(), s);



CVS commit: src/usr.bin/audio

2024-02-27 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Feb 27 20:40:30 UTC 2024

Modified Files:
src/usr.bin/audio/common: wav.c
src/usr.bin/audio/record: record.c

Log Message:
Clean up lines containing only spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/audio/common/wav.c
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/audio/record/record.c

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



CVS commit: src/usr.sbin/sysinst/arch/i386

2024-01-16 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Jan 16 21:04:26 UTC 2024

Modified Files:
src/usr.sbin/sysinst/arch/i386: msg.md.en

Log Message:
The serial bootblocks use the selected serial port, not the first serial port.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/arch/i386/msg.md.en

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

Modified files:

Index: src/usr.sbin/sysinst/arch/i386/msg.md.en
diff -u src/usr.sbin/sysinst/arch/i386/msg.md.en:1.4 src/usr.sbin/sysinst/arch/i386/msg.md.en:1.5
--- src/usr.sbin/sysinst/arch/i386/msg.md.en:1.4	Sat Nov 16 21:25:14 2019
+++ src/usr.sbin/sysinst/arch/i386/msg.md.en	Tue Jan 16 21:04:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.md.en,v 1.4 2019/11/16 21:25:14 martin Exp $	*/
+/*	$NetBSD: msg.md.en,v 1.5 2024/01/16 21:04:26 gson Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -53,7 +53,7 @@ message getboottype
 {Would you like to install the normal set of bootblocks or serial bootblocks?
 
 Normal bootblocks use the BIOS console device as the console
-(usually the monitor and keyboard). Serial bootblocks use the first
+(usually the monitor and keyboard). Serial bootblocks use the selected
 serial port as the console.
 
 Selected bootblock: }



CVS commit: src/usr.sbin/sysinst/arch/i386

2024-01-16 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Jan 16 21:04:26 UTC 2024

Modified Files:
src/usr.sbin/sysinst/arch/i386: msg.md.en

Log Message:
The serial bootblocks use the selected serial port, not the first serial port.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/sysinst/arch/i386/msg.md.en

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



CVS commit: src/tests/net/carp

2023-09-19 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Sep 19 11:55:14 UTC 2023

Modified Files:
src/tests/net/carp: t_basic.sh

Log Message:
Don't expect the net/carp/t_basic/carp_handover_ipv6_halt_nocarpdevip
and carp_handover_ipv6_ifdown_nocarpdevip test cases to fail.  At
least on the TNF i386 and amd64 testbeds, they pass more often than
not since the commit of src/sys/netinet/ip_carp.c 1.119 by mlelstv on
2023.04.07.06.44.08.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/net/carp/t_basic.sh

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



CVS commit: src/tests/net/carp

2023-09-19 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Sep 19 11:55:14 UTC 2023

Modified Files:
src/tests/net/carp: t_basic.sh

Log Message:
Don't expect the net/carp/t_basic/carp_handover_ipv6_halt_nocarpdevip
and carp_handover_ipv6_ifdown_nocarpdevip test cases to fail.  At
least on the TNF i386 and amd64 testbeds, they pass more often than
not since the commit of src/sys/netinet/ip_carp.c 1.119 by mlelstv on
2023.04.07.06.44.08.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/net/carp/t_basic.sh

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

Modified files:

Index: src/tests/net/carp/t_basic.sh
diff -u src/tests/net/carp/t_basic.sh:1.8 src/tests/net/carp/t_basic.sh:1.9
--- src/tests/net/carp/t_basic.sh:1.8	Mon Aug 19 03:22:05 2019
+++ src/tests/net/carp/t_basic.sh	Tue Sep 19 11:55:14 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: t_basic.sh,v 1.8 2019/08/19 03:22:05 ozaki-r Exp $
+#	$NetBSD: t_basic.sh,v 1.9 2023/09/19 11:55:14 gson Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -328,9 +328,6 @@ add_test_case()
 		name="${name}_nocarpdevip"
 		desc="$desc without carpdev IP"
 	fi
-	if [ $ipproto = ipv6 -a $carpdevip = no ]; then
-		expected_failure_code="atf_expect_fail 'nd6 needs to be fixed';"
-	fi
 
 	atf_test_case ${name} cleanup
 	eval "



CVS commit: src/tests/lib/libc/sys

2022-04-06 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed Apr  6 10:02:55 UTC 2022

Modified Files:
src/tests/lib/libc/sys: Makefile t_mmap.c

Log Message:
Add a regression test for PR kern/52239, "Changing protections of
already mmap'ed region can fail", based on the test program in the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libc/sys/t_mmap.c

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

Modified files:

Index: src/tests/lib/libc/sys/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.70 src/tests/lib/libc/sys/Makefile:1.71
--- src/tests/lib/libc/sys/Makefile:1.70	Mon Nov  1 14:33:41 2021
+++ src/tests/lib/libc/sys/Makefile	Wed Apr  6 10:02:55 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.70 2021/11/01 14:33:41 hannken Exp $
+# $NetBSD: Makefile,v 1.71 2022/04/06 10:02:55 gson Exp $
 
 MKMAN=	no
 
@@ -97,6 +97,7 @@ SRCS.t_mprotect=	t_mprotect.c ${SRCS_EXE
 
 LDADD.t_eventfd+=	-lpthread
 LDADD.t_getpid+=	-lpthread
+LDADD.t_mmap+=		-lpthread
 LDADD.t_timerfd+=	-lpthread
 
 LDADD.t_ptrace_sigchld+=	-pthread -lm

Index: src/tests/lib/libc/sys/t_mmap.c
diff -u src/tests/lib/libc/sys/t_mmap.c:1.16 src/tests/lib/libc/sys/t_mmap.c:1.17
--- src/tests/lib/libc/sys/t_mmap.c:1.16	Tue Apr  5 15:59:22 2022
+++ src/tests/lib/libc/sys/t_mmap.c	Wed Apr  6 10:02:55 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mmap.c,v 1.16 2022/04/05 15:59:22 gson Exp $ */
+/* $NetBSD: t_mmap.c,v 1.17 2022/04/06 10:02:55 gson Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_mmap.c,v 1.16 2022/04/05 15:59:22 gson Exp $");
+__RCSID("$NetBSD: t_mmap.c,v 1.17 2022/04/06 10:02:55 gson Exp $");
 
 #include 
 #include 
@@ -74,6 +74,7 @@ __RCSID("$NetBSD: t_mmap.c,v 1.16 2022/0
 #include 
 #include 
 #include 
+#include 
 
 static long	page = 0;
 static char	path[] = "mmap";
@@ -413,6 +414,65 @@ ATF_TC_CLEANUP(mmap_prot_3, tc)
 	(void)unlink(path);
 }
 
+ATF_TC(mmap_reprotect_race);
+
+ATF_TC_HEAD(mmap_reprotect_race, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Test for the race condition of PR 52239");
+}
+
+const int mmap_reprotect_race_npages = 13;
+const int mmap_reprotect_iterations = 100;
+
+static void *
+mmap_reprotect_race_thread(void *arg)
+{
+	int i, r;
+	void *p;
+
+	for (i = 0; i < mmap_reprotect_iterations; i++) {
+		/* Get some unrelated memory */
+		p = mmap(0, mmap_reprotect_race_npages * page,
+			 PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0);
+		ATF_REQUIRE(p);
+		r = munmap(p, mmap_reprotect_race_npages * page);
+		ATF_REQUIRE(r == 0);
+	}
+	return 0;
+}
+
+ATF_TC_BODY(mmap_reprotect_race, tc)
+{
+	pthread_t thread;
+	void *p, *q;
+	int i, r;
+
+	r = pthread_create(&thread, 0, mmap_reprotect_race_thread, 0);
+	ATF_REQUIRE(r == 0);
+
+	for (i = 0; i < mmap_reprotect_iterations; i++) {
+		/* Get a placeholder region */
+		p = mmap(0, mmap_reprotect_race_npages * page,
+			 PROT_NONE, MAP_ANON|MAP_PRIVATE, -1, 0);
+		if (p == MAP_FAILED)
+			atf_tc_fail("mmap: %s", strerror(errno));
+
+		/* Upgrade placeholder to read/write access */
+		q = mmap(p, mmap_reprotect_race_npages * page,
+			 PROT_READ|PROT_WRITE,
+			 MAP_ANON|MAP_PRIVATE|MAP_FIXED, -1, 0);
+		if (q == MAP_FAILED)
+			atf_tc_fail("update mmap: %s", strerror(errno));
+		ATF_REQUIRE(q == p);
+
+		/* Free it */
+		r = munmap(q, mmap_reprotect_race_npages * page);
+		if (r != 0)
+			atf_tc_fail("munmap: %s", strerror(errno));
+	}
+	pthread_join(thread, NULL);
+}
+
 ATF_TC_WITH_CLEANUP(mmap_truncate);
 ATF_TC_HEAD(mmap_truncate, tc)
 {
@@ -570,6 +630,7 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC(tp, mmap_prot_1);
 	ATF_TP_ADD_TC(tp, mmap_prot_2);
 	ATF_TP_ADD_TC(tp, mmap_prot_3);
+	ATF_TP_ADD_TC(tp, mmap_reprotect_race);
 	ATF_TP_ADD_TC(tp, mmap_truncate);
 	ATF_TP_ADD_TC(tp, mmap_truncate_signal);
 	ATF_TP_ADD_TC(tp, mmap_va0);



CVS commit: src/tests/lib/libc/sys

2022-04-06 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed Apr  6 10:02:55 UTC 2022

Modified Files:
src/tests/lib/libc/sys: Makefile t_mmap.c

Log Message:
Add a regression test for PR kern/52239, "Changing protections of
already mmap'ed region can fail", based on the test program in the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libc/sys/t_mmap.c

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



CVS commit: src/tests/lib/libc/sys

2022-04-05 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Apr  5 15:59:22 UTC 2022

Modified Files:
src/tests/lib/libc/sys: t_mmap.c

Log Message:
In the mmap_err test case, mmap the address, not the address of the address.
Should fix PR kern/56780.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libc/sys/t_mmap.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_mmap.c
diff -u src/tests/lib/libc/sys/t_mmap.c:1.15 src/tests/lib/libc/sys/t_mmap.c:1.16
--- src/tests/lib/libc/sys/t_mmap.c:1.15	Tue Apr  5 13:09:54 2022
+++ src/tests/lib/libc/sys/t_mmap.c	Tue Apr  5 15:59:22 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mmap.c,v 1.15 2022/04/05 13:09:54 gson Exp $ */
+/* $NetBSD: t_mmap.c,v 1.16 2022/04/05 15:59:22 gson Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_mmap.c,v 1.15 2022/04/05 13:09:54 gson Exp $");
+__RCSID("$NetBSD: t_mmap.c,v 1.16 2022/04/05 15:59:22 gson Exp $");
 
 #include 
 #include 
@@ -215,7 +215,7 @@ ATF_TC_HEAD(mmap_err, tc)
 
 ATF_TC_BODY(mmap_err, tc)
 {
-	size_t addr = SIZE_MAX;
+	void *addr = (void *)-1;
 	void *map;
 
 	errno = 0;
@@ -225,7 +225,7 @@ ATF_TC_BODY(mmap_err, tc)
 	ATF_REQUIRE(errno == EBADF);
 
 	errno = 0;
-	map = mmap(&addr, page, PROT_READ, MAP_FIXED|MAP_PRIVATE, -1, 0);
+	map = mmap(addr, page, PROT_READ, MAP_FIXED|MAP_PRIVATE, -1, 0);
 
 	ATF_REQUIRE(map == MAP_FAILED);
 	ATF_REQUIRE_MSG(errno == EINVAL, "errno %d != EINVAL", errno);



CVS commit: src/tests/lib/libc/sys

2022-04-05 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Apr  5 15:59:22 UTC 2022

Modified Files:
src/tests/lib/libc/sys: t_mmap.c

Log Message:
In the mmap_err test case, mmap the address, not the address of the address.
Should fix PR kern/56780.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/lib/libc/sys/t_mmap.c

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



CVS commit: src/tests/lib/libc/sys

2022-04-05 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Apr  5 13:09:54 UTC 2022

Modified Files:
src/tests/lib/libc/sys: t_mmap.c

Log Message:
When the t_mmap:mmap_err test fails due to errno not having the expected
value of EINVAL, print the actual value.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libc/sys/t_mmap.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_mmap.c
diff -u src/tests/lib/libc/sys/t_mmap.c:1.14 src/tests/lib/libc/sys/t_mmap.c:1.15
--- src/tests/lib/libc/sys/t_mmap.c:1.14	Fri Jun 26 07:50:11 2020
+++ src/tests/lib/libc/sys/t_mmap.c	Tue Apr  5 13:09:54 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mmap.c,v 1.14 2020/06/26 07:50:11 jruoho Exp $ */
+/* $NetBSD: t_mmap.c,v 1.15 2022/04/05 13:09:54 gson Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_mmap.c,v 1.14 2020/06/26 07:50:11 jruoho Exp $");
+__RCSID("$NetBSD: t_mmap.c,v 1.15 2022/04/05 13:09:54 gson Exp $");
 
 #include 
 #include 
@@ -228,7 +228,7 @@ ATF_TC_BODY(mmap_err, tc)
 	map = mmap(&addr, page, PROT_READ, MAP_FIXED|MAP_PRIVATE, -1, 0);
 
 	ATF_REQUIRE(map == MAP_FAILED);
-	ATF_REQUIRE(errno == EINVAL);
+	ATF_REQUIRE_MSG(errno == EINVAL, "errno %d != EINVAL", errno);
 
 	errno = 0;
 	map = mmap(NULL, page, PROT_READ, MAP_ANON|MAP_PRIVATE, INT_MAX, 0);



CVS commit: src/tests/lib/libc/sys

2022-04-05 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Apr  5 13:09:54 UTC 2022

Modified Files:
src/tests/lib/libc/sys: t_mmap.c

Log Message:
When the t_mmap:mmap_err test fails due to errno not having the expected
value of EINVAL, print the actual value.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/lib/libc/sys/t_mmap.c

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



CVS commit: src/tests/sys/rc

2022-02-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Feb 26 16:21:59 UTC 2022

Modified Files:
src/tests/sys/rc: t_rc_d_cli.sh

Log Message:
Mark randomly failing test cases as expected failures with a reference
to PR bin/56506.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/sys/rc/t_rc_d_cli.sh

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

Modified files:

Index: src/tests/sys/rc/t_rc_d_cli.sh
diff -u src/tests/sys/rc/t_rc_d_cli.sh:1.4 src/tests/sys/rc/t_rc_d_cli.sh:1.5
--- src/tests/sys/rc/t_rc_d_cli.sh:1.4	Sun Nov  7 17:51:21 2010
+++ src/tests/sys/rc/t_rc_d_cli.sh	Sat Feb 26 16:21:59 2022
@@ -1,4 +1,4 @@
-# $NetBSD: t_rc_d_cli.sh,v 1.4 2010/11/07 17:51:21 jmmv Exp $
+# $NetBSD: t_rc_d_cli.sh,v 1.5 2022/02/26 16:21:59 gson Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -48,8 +48,10 @@ default_start_no_args_body() {
 	export h_simple=YES
 	rc_helper=$(atf_get_srcdir)/h_simple
 
+	atf_expect_fail "PR bin/56506"
 	atf_check -s eq:0 -o ignore -e empty ${rc_helper} start
 	${rc_helper} forcestop
+	atf_fail "random failure did not happen this time"
 }
 
 atf_test_case default_start_with_args
@@ -77,8 +79,10 @@ default_stop_no_args_body() {
 	export h_simple=YES
 	rc_helper=$(atf_get_srcdir)/h_simple
 
+	atf_expect_fail "PR bin/56506"
 	${rc_helper} start
 	atf_check -s eq:0 -o ignore -e empty ${rc_helper} stop
+	atf_fail "random failure did not happen this time"
 }
 
 atf_test_case default_stop_with_args
@@ -108,9 +112,11 @@ default_restart_no_args_body() {
 	export h_simple=YES
 	rc_helper=$(atf_get_srcdir)/h_simple
 
+	atf_expect_fail "PR bin/56506"
 	${rc_helper} start
 	atf_check -s eq:0 -o ignore -e empty ${rc_helper} restart
 	${rc_helper} forcestop
+	atf_fail "random failure did not happen this time"
 }
 
 atf_test_case default_restart_with_args



CVS commit: src/tests/sys/rc

2022-02-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Feb 26 16:21:59 UTC 2022

Modified Files:
src/tests/sys/rc: t_rc_d_cli.sh

Log Message:
Mark randomly failing test cases as expected failures with a reference
to PR bin/56506.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/sys/rc/t_rc_d_cli.sh

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



CVS commit: src/tests/lib/libc/gen

2021-12-15 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed Dec 15 09:19:28 UTC 2021

Modified Files:
src/tests/lib/libc/gen: isqemu.h

Log Message:
When running the tests under "qemu -accel kvm" on a Linux host,
isQEMU_TCG() should return false.  Fixes multiple test cases that were
failing with "Test case was expecting a failure but none were raised"
on that platform.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/gen/isqemu.h

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

Modified files:

Index: src/tests/lib/libc/gen/isqemu.h
diff -u src/tests/lib/libc/gen/isqemu.h:1.5 src/tests/lib/libc/gen/isqemu.h:1.6
--- src/tests/lib/libc/gen/isqemu.h:1.5	Sun Aug 23 11:00:18 2020
+++ src/tests/lib/libc/gen/isqemu.h	Wed Dec 15 09:19:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: isqemu.h,v 1.5 2020/08/23 11:00:18 gson Exp $	*/
+/*	$NetBSD: isqemu.h,v 1.6 2021/12/15 09:19:28 gson Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -72,10 +72,18 @@ isQEMU_TCG(void) {
 			return false;
 		err(EXIT_FAILURE, "sysctl");
 	}
-	return strstr(name, "QEMU") != NULL;
-#else
-	return false;
+	if (strstr(name, "QEMU") == NULL)
+		return false;
+	if (sysctlbyname("machdep.hypervisor", name, &len, NULL, 0) == -1) {
+		if (errno == ENOENT)
+			return true;
+		err(EXIT_FAILURE, "sysctl");
+	}
+	if (strcmp(name, "KVM") == 0)
+		return false;
+	return true;
 #endif
+	return false;
 }
 
 #ifdef TEST



CVS commit: src/tests/lib/libc/gen

2021-12-15 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed Dec 15 09:19:28 UTC 2021

Modified Files:
src/tests/lib/libc/gen: isqemu.h

Log Message:
When running the tests under "qemu -accel kvm" on a Linux host,
isQEMU_TCG() should return false.  Fixes multiple test cases that were
failing with "Test case was expecting a failure but none were raised"
on that platform.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/gen/isqemu.h

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



CVS commit: src/lib/librumpuser

2021-12-07 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Dec  7 10:39:33 UTC 2021

Modified Files:
src/lib/librumpuser: sp_common.c

Log Message:
In unix_parse(), always allocate memory for the entire struct sockaddr_un
and not just the part used by the present pathname, because the entire
struct will be passed to bind() and an EFAULT can result if not all of
it is a valid allocation.  Fixes PR kern/56533.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/lib/librumpuser/sp_common.c

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

Modified files:

Index: src/lib/librumpuser/sp_common.c
diff -u src/lib/librumpuser/sp_common.c:1.42 src/lib/librumpuser/sp_common.c:1.43
--- src/lib/librumpuser/sp_common.c:1.42	Sat Jun 13 16:51:59 2020
+++ src/lib/librumpuser/sp_common.c	Tue Dec  7 10:39:33 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: sp_common.c,v 1.42 2020/06/13 16:51:59 kamil Exp $	*/
+/*  $NetBSD: sp_common.c,v 1.43 2021/12/07 10:39:33 gson Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 Antti Kantee.  All Rights Reserved.
@@ -670,12 +670,10 @@ unix_parse(const char *addr, struct sock
 		}
 	}
 	strcat(s_un.sun_path, addr);
-#if defined(__linux__) || defined(__sun__) || defined(__CYGWIN__)
-	slen = sizeof(s_un);
-#else
+#if !(defined(__linux__) || defined(__sun__) || defined(__CYGWIN__))
 	s_un.sun_len = SUN_LEN(&s_un);
-	slen = s_un.sun_len+1; /* get the 0 too */
 #endif
+	slen = sizeof(s_un);
 
 	if (savepath && *parsedurl == '\0') {
 		snprintf(parsedurl, sizeof(parsedurl),



CVS commit: src/lib/librumpuser

2021-12-07 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Dec  7 10:39:33 UTC 2021

Modified Files:
src/lib/librumpuser: sp_common.c

Log Message:
In unix_parse(), always allocate memory for the entire struct sockaddr_un
and not just the part used by the present pathname, because the entire
struct will be passed to bind() and an EFAULT can result if not all of
it is a valid allocation.  Fixes PR kern/56533.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/lib/librumpuser/sp_common.c

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



CVS commit: src/sys/kern

2021-12-03 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Dec  3 08:33:30 UTC 2021

Modified Files:
src/sys/kern: kern_hook.c

Log Message:
Only one space after comma


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/kern/kern_hook.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/kern/kern_hook.c
diff -u src/sys/kern/kern_hook.c:1.11 src/sys/kern/kern_hook.c:1.12
--- src/sys/kern/kern_hook.c:1.11	Thu Sep 30 07:15:02 2021
+++ src/sys/kern/kern_hook.c	Fri Dec  3 08:33:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_hook.c,v 1.11 2021/09/30 07:15:02 skrll Exp $	*/
+/*	$NetBSD: kern_hook.c,v 1.12 2021/12/03 08:33:30 gson Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_hook.c,v 1.11 2021/09/30 07:15:02 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_hook.c,v 1.12 2021/12/03 08:33:30 gson Exp $");
 
 #include 
 #include 
@@ -524,7 +524,7 @@ simplehook_dohooks(khook_list_t *l)
 }
 
 khook_t *
-simplehook_establish(khook_list_t *l,  void (*fn)(void *), void *arg)
+simplehook_establish(khook_list_t *l, void (*fn)(void *), void *arg)
 {
 	struct hook_desc *hd;
 



CVS commit: src/sys/kern

2021-12-03 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Dec  3 08:33:30 UTC 2021

Modified Files:
src/sys/kern: kern_hook.c

Log Message:
Only one space after comma


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/kern/kern_hook.c

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



CVS commit: src/tests/fs/vfs

2021-11-27 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Nov 27 15:23:33 UTC 2021

Modified Files:
src/tests/fs/vfs: t_renamerace.c

Log Message:
Force failure of the nfs_renamerace_cycle, p2k_ffs_renamerace_cycle,
and puffs_renamerace_cycle test cases as they fail only randomly or
only on some systems.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/tests/fs/vfs/t_renamerace.c

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

Modified files:

Index: src/tests/fs/vfs/t_renamerace.c
diff -u src/tests/fs/vfs/t_renamerace.c:1.42 src/tests/fs/vfs/t_renamerace.c:1.43
--- src/tests/fs/vfs/t_renamerace.c:1.42	Sat Oct 23 17:43:08 2021
+++ src/tests/fs/vfs/t_renamerace.c	Sat Nov 27 15:23:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_renamerace.c,v 1.42 2021/10/23 17:43:08 hannken Exp $	*/
+/*	$NetBSD: t_renamerace.c,v 1.43 2021/11/27 15:23:33 gson Exp $	*/
 
 /*
  * Modified for rump and atf from a program supplied
@@ -253,6 +253,12 @@ renamerace_cycle(const atf_tc_t *tc, con
 
 	if (FSTYPE_UDF(tc))
 		atf_tc_fail("PR kern/56253 did not trigger this time");
+	if (FSTYPE_P2K_FFS(tc))
+		atf_tc_fail("did not fail this time");
+	if (FSTYPE_PUFFS(tc))
+		atf_tc_fail("did not fail this time");
+	if (FSTYPE_NFS(tc))
+		atf_tc_fail("did not fail this time");
 }
 
 ATF_TC_FSAPPLY(renamerace, "rename(2) race with file unlinked mid-operation");



CVS commit: src/tests/fs/vfs

2021-11-27 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Nov 27 15:23:33 UTC 2021

Modified Files:
src/tests/fs/vfs: t_renamerace.c

Log Message:
Force failure of the nfs_renamerace_cycle, p2k_ffs_renamerace_cycle,
and puffs_renamerace_cycle test cases as they fail only randomly or
only on some systems.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/tests/fs/vfs/t_renamerace.c

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



CVS commit: src/tests/net/if_wg

2021-11-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Nov 26 20:02:35 UTC 2021

Modified Files:
src/tests/net/if_wg: t_misc.sh

Log Message:
The wg_handshake_timeout test case was failing because it contained
atf_fail "failed to trigger PR kern/56252" without a corresponding
atf_expect_fail "PR kern/56252", which makes no sense.  Since the
test case does occasionally fail on real hardware, fix this by adding
the atf_expect_fail rather than by removing the atf_fail.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/net/if_wg/t_misc.sh

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

Modified files:

Index: src/tests/net/if_wg/t_misc.sh
diff -u src/tests/net/if_wg/t_misc.sh:1.10 src/tests/net/if_wg/t_misc.sh:1.11
--- src/tests/net/if_wg/t_misc.sh:1.10	Thu Jun 17 12:45:58 2021
+++ src/tests/net/if_wg/t_misc.sh	Fri Nov 26 20:02:35 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: t_misc.sh,v 1.10 2021/06/17 12:45:58 riastradh Exp $
+#	$NetBSD: t_misc.sh,v 1.11 2021/11/26 20:02:35 gson Exp $
 #
 # Copyright (c) 2018 Ryota Ozaki 
 # All rights reserved.
@@ -198,6 +198,8 @@ wg_handshake_timeout_body()
 
 	n=$(grep "$ip_local.$port > $ip_peer.$port" $outfile |wc -l)
 
+	atf_expect_fail "PR kern/56252"
+
 	# Give up handshaking after three attempts
 	atf_check_equal $n 3
 



CVS commit: src/tests/net/if_wg

2021-11-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Nov 26 20:02:35 UTC 2021

Modified Files:
src/tests/net/if_wg: t_misc.sh

Log Message:
The wg_handshake_timeout test case was failing because it contained
atf_fail "failed to trigger PR kern/56252" without a corresponding
atf_expect_fail "PR kern/56252", which makes no sense.  Since the
test case does occasionally fail on real hardware, fix this by adding
the atf_expect_fail rather than by removing the atf_fail.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/net/if_wg/t_misc.sh

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



CVS commit: src/tests/net/if

2021-11-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Nov 26 15:45:52 UTC 2021

Modified Files:
src/tests/net/if: t_compat.c

Log Message:
Delete trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/net/if/t_compat.c

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

Modified files:

Index: src/tests/net/if/t_compat.c
diff -u src/tests/net/if/t_compat.c:1.4 src/tests/net/if/t_compat.c:1.5
--- src/tests/net/if/t_compat.c:1.4	Sat Nov 12 15:12:59 2016
+++ src/tests/net/if/t_compat.c	Fri Nov 26 15:45:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_compat.c,v 1.4 2016/11/12 15:12:59 kre Exp $	*/
+/*	$NetBSD: t_compat.c,v 1.5 2021/11/26 15:45:52 gson Exp $	*/
 
 #include 
 #include 
@@ -25,9 +25,9 @@ struct oifreq {
 struct  sockaddr ifru_addr;
 struct  sockaddr ifru_dstaddr;
 struct  sockaddr ifru_broadaddr;
-short   ifru_flags;  
+short   ifru_flags;
 int ifru_metric;
-int ifru_mtu; 
+int ifru_mtu;
 int ifru_dlt;
 u_int   ifru_value;
 void *  ifru_data;
@@ -36,7 +36,7 @@ struct oifreq {
 void*b_buf;
 } ifru_b;
 } ifr_ifru;
-};  
+};
 #define OOSIOCGIFBRDADDR _IOWR('i', 18, struct oifreq)
 
 ATF_TC(OOSIOCGIFBRDADDR);



CVS commit: src/tests/net/if

2021-11-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Nov 26 15:45:52 UTC 2021

Modified Files:
src/tests/net/if: t_compat.c

Log Message:
Delete trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/net/if/t_compat.c

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



CVS commit: src/tests/lib/librumphijack

2021-11-10 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Nov 11 07:38:21 UTC 2021

Modified Files:
src/tests/lib/librumphijack: t_tcpip.sh

Log Message:
The nfs_autoload test case has now been broken for more than four years.
Mark it as an expected failure with a reference to PR kern/54184.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/tests/lib/librumphijack/t_tcpip.sh

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

Modified files:

Index: src/tests/lib/librumphijack/t_tcpip.sh
diff -u src/tests/lib/librumphijack/t_tcpip.sh:1.20 src/tests/lib/librumphijack/t_tcpip.sh:1.21
--- src/tests/lib/librumphijack/t_tcpip.sh:1.20	Fri Sep 10 21:21:35 2021
+++ src/tests/lib/librumphijack/t_tcpip.sh	Thu Nov 11 07:38:21 2021
@@ -1,4 +1,4 @@
-#   $NetBSD: t_tcpip.sh,v 1.20 2021/09/10 21:21:35 christos Exp $
+#   $NetBSD: t_tcpip.sh,v 1.21 2021/11/11 07:38:21 gson Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -254,6 +254,7 @@ nfs_autoload_head()
 nfs_autoload_body()
 {
 	[ `uname -m` = "i386" ] || atf_skip "test currently valid only on i386"
+	atf_expect_fail "PR lib/54184"
 	test_nfs -lrumpvfs -lrumpdev -lrumpnet -lrumpnet_net		\
 	-lrumpnet_netinet -lrumpnet_local -lrumpnet_shmif		\
 	-lrumpdev_disk -d key=/dk,hostpath=ffs.img,size=host



CVS commit: src/tests/lib/librumphijack

2021-11-10 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Nov 11 07:38:21 UTC 2021

Modified Files:
src/tests/lib/librumphijack: t_tcpip.sh

Log Message:
The nfs_autoload test case has now been broken for more than four years.
Mark it as an expected failure with a reference to PR kern/54184.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/tests/lib/librumphijack/t_tcpip.sh

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



CVS commit: src/tests/lib/libc/stdio

2021-10-31 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Oct 31 11:36:26 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: t_intr.sh

Log Message:
Skip the test when there is insufficient disk space.  Fixes PR misc/56324.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/stdio/t_intr.sh

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



CVS commit: src/tests/lib/libc/stdio

2021-10-31 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Oct 31 11:36:26 UTC 2021

Modified Files:
src/tests/lib/libc/stdio: t_intr.sh

Log Message:
Skip the test when there is insufficient disk space.  Fixes PR misc/56324.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/stdio/t_intr.sh

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

Modified files:

Index: src/tests/lib/libc/stdio/t_intr.sh
diff -u src/tests/lib/libc/stdio/t_intr.sh:1.5 src/tests/lib/libc/stdio/t_intr.sh:1.6
--- src/tests/lib/libc/stdio/t_intr.sh:1.5	Thu Sep  9 21:47:47 2021
+++ src/tests/lib/libc/stdio/t_intr.sh	Sun Oct 31 11:36:26 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_intr.sh,v 1.5 2021/09/09 21:47:47 rillig Exp $
+# $NetBSD: t_intr.sh,v 1.6 2021/10/31 11:36:26 gson Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -36,6 +36,12 @@ SSIZE=256000
 TMOUT=20
 
 h_test() {
+	local avail=$( df -m . | awk '{if (int($4) > 0) print $4}' )
+	local need=$(( 2 * $MAX * 8 / 100 ))
+	if [ $avail -lt $need ]; then
+		atf_skip "not enough free space in working directory"
+	fi
+
 	"${DIR}/h_makenumbers" "$1" > numbers.in
 	"${DIR}/h_intr" \
 	-p "$2" -a ${SSIZE} -b ${BSIZE} -t ${TMOUT} \



CVS commit: src/tests/sbin/resize_ffs

2021-10-30 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Oct 30 13:50:12 UTC 2021

Modified Files:
src/tests/sbin/resize_ffs: common.sh

Log Message:
Delete trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/tests/sbin/resize_ffs/common.sh

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

Modified files:

Index: src/tests/sbin/resize_ffs/common.sh
diff -u src/tests/sbin/resize_ffs/common.sh:1.17 src/tests/sbin/resize_ffs/common.sh:1.18
--- src/tests/sbin/resize_ffs/common.sh:1.17	Sun Mar 15 11:17:59 2020
+++ src/tests/sbin/resize_ffs/common.sh	Sat Oct 30 13:50:12 2021
@@ -1,6 +1,6 @@
 
 # Common settings and functions for the various resize_ffs tests.
-# 
+#
 
 # called from atf_init_test_cases
 setupvars()



CVS commit: src/tests/sbin/resize_ffs

2021-10-30 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Oct 30 13:50:12 UTC 2021

Modified Files:
src/tests/sbin/resize_ffs: common.sh

Log Message:
Delete trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/tests/sbin/resize_ffs/common.sh

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



CVS commit: src/tests/lib/libc/sys

2021-10-21 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Oct 21 17:02:38 UTC 2021

Modified Files:
src/tests/lib/libc/sys: t_ptrace_syscall_wait.h

Log Message:
Skip the lib/libc/sys/t_ptrace_waitid:syscall_signal_on_sce test case
with a reference to PR lib/55087.  Marking it as an expected failure
would be more appropriate, but that doesn't work for test cases that
fail by timing out.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_ptrace_syscall_wait.h

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_syscall_wait.h
diff -u src/tests/lib/libc/sys/t_ptrace_syscall_wait.h:1.1 src/tests/lib/libc/sys/t_ptrace_syscall_wait.h:1.2
--- src/tests/lib/libc/sys/t_ptrace_syscall_wait.h:1.1	Mon May  4 21:21:30 2020
+++ src/tests/lib/libc/sys/t_ptrace_syscall_wait.h	Thu Oct 21 17:02:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_syscall_wait.h,v 1.1 2020/05/04 21:21:30 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_syscall_wait.h,v 1.2 2021/10/21 17:02:37 gson Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019, 2020 The NetBSD Foundation, Inc.
@@ -55,11 +55,13 @@ syscall_body(const char *op)
 
 	memset(&info, 0, sizeof(info));
 
-#if defined(TWAIT_HAVE_STATUS)
 	if (strstr(op, "signal") != NULL) {
+#if defined(TWAIT_HAVE_STATUS)
 		atf_tc_expect_fail("XXX: behavior under investigation");
-	}
+#else
+		atf_tc_skip("PR lib/55087");
 #endif
+	}
 
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = fork()) != -1);



CVS commit: src/tests/lib/libc/sys

2021-10-21 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Oct 21 17:02:38 UTC 2021

Modified Files:
src/tests/lib/libc/sys: t_ptrace_syscall_wait.h

Log Message:
Skip the lib/libc/sys/t_ptrace_waitid:syscall_signal_on_sce test case
with a reference to PR lib/55087.  Marking it as an expected failure
would be more appropriate, but that doesn't work for test cases that
fail by timing out.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/sys/t_ptrace_syscall_wait.h

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



CVS commit: src/tests/lib/libc/sys

2021-10-14 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Oct 14 13:50:36 UTC 2021

Modified Files:
src/tests/lib/libc/sys: t_ptrace_register_wait.h

Log Message:
Remove trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_ptrace_register_wait.h

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_register_wait.h
diff -u src/tests/lib/libc/sys/t_ptrace_register_wait.h:1.3 src/tests/lib/libc/sys/t_ptrace_register_wait.h:1.4
--- src/tests/lib/libc/sys/t_ptrace_register_wait.h:1.3	Mon May 11 12:17:57 2020
+++ src/tests/lib/libc/sys/t_ptrace_register_wait.h	Thu Oct 14 13:50:36 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: t_ptrace_register_wait.h,v 1.3 2020/05/11 12:17:57 kamil Exp $   */
+/*  $NetBSD: t_ptrace_register_wait.h,v 1.4 2021/10/14 13:50:36 gson Exp $   */
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019, 2020 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@ access_regs(const char *regset, const ch
 #if defined(HAVE_FPREGS)
 	struct fpreg fpr;
 #endif
-	
+
 #if !defined(HAVE_GPREGS)
 	if (strcmp(regset, "regs") == 0)
 		atf_tc_fail("Impossible test scenario!");



CVS commit: src/tests/lib/libc/sys

2021-10-14 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Oct 14 13:50:36 UTC 2021

Modified Files:
src/tests/lib/libc/sys: t_ptrace_register_wait.h

Log Message:
Remove trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_ptrace_register_wait.h

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



Re: CVS commit: src/crypto/external/bsd/openssl

2020-10-05 Thread Andreas Gustafsson
Christos Zoulas committed:
> Module Name:src
> Committed By:   christos
> Date:   Sun Oct  4 19:32:48 UTC 2020
> 
> Modified Files:
> src/crypto/external/bsd/openssl/dist/crypto/bn: bn_print.c
> src/crypto/external/bsd/openssl/dist/include/openssl: bn.h
> src/crypto/external/bsd/openssl/lib/libcrypto: crypto.map
> 
> Log Message:
> Add BN_oct2bn(3) for factor(6)
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.1.1.10 -r1.2 \
> src/crypto/external/bsd/openssl/dist/crypto/bn/bn_print.c
> cvs rdiff -u -r1.1.1.3 -r1.2 \
> src/crypto/external/bsd/openssl/dist/include/openssl/bn.h
> cvs rdiff -u -r1.8 -r1.9 \
> src/crypto/external/bsd/openssl/lib/libcrypto/crypto.map

I was going to ask for this to be reverted, but I see that it
has already been done - thank you.

I will nonetheless state my reasons for wanting it reverted, to keep
everyone vigilant in case someone tries something like this again.

Although it's not stated in the commit message, this commit also
changes the behavior of BN_asc2bn() to interpret numbers with a
leading zero as octal rather than decimal.

This raises a huge red flag.  OpenSSL is security critical code, and
BN_asc2bn() is likely used for parsing numbers in text representations
of security critical data.  This change makes is possible to
deliberately construct a text representation that will be interpreted
differently on NetBSD vs. other systems, or when parsed using OpenSSL
vs. another parser.  For example, if an RSA key modulus is stored in a
file in text form and parsed using BN_asc2bn(), it is likely possible
to construct a key file that results in a secure key on another
system, but a trivially factorable one on NetBSD.

A large number of vulnerabilities have been caused by similar minor
differences between implementations of parsers for Unicode, HTTP,
SMTP, and JSON.  We should not introduce another one in OpenSSL.

Also, the behavior of BN_asc2bn() after the change is different from
that specified in the man page.
-- 
Andreas Gustafsson, g...@gson.org


Re: CVS commit: src/external/bsd/libarchive/dist/libarchive

2020-02-25 Thread Andreas Gustafsson
Earlier, I wrote:
> > cvs rdiff -u -r1.1.1.4 -r1.2 \
> > src/external/bsd/libarchive/dist/libarchive/archive_read.c
> 
> What kind of sorcery is this?  Why is the diff not relative to 1.1?

To answer my own question, "vendor branch sorcery".  What confused me
about this in the first place was that if you look at the history of
this file in cvsweb, at

  
http://cvsweb.netbsd.org/bsdweb.cgi/src/external/bsd/libarchive/dist/libarchive/archive_read.c?only_with_tag=MAIN

it says "Diff to previous 1.1 (colored)", and if you click on that,
you see a diff that's much larger than the upstream patch at

  
https://github.com/libarchive/libarchive/commit/ec5b86b48e99c5501374b01606f1ccdae6a8a93e.patch

Bug in cvsweb?
-- 
Andreas Gustafsson, g...@gson.org


Re: CVS commit: src/external/bsd/libarchive/dist/libarchive

2020-02-25 Thread Andreas Gustafsson
Kamil Rytarowski wrote:
> To generate a diff of this commit:
> cvs rdiff -u -r1.1.1.4 -r1.2 \
> src/external/bsd/libarchive/dist/libarchive/archive_read.c

What kind of sorcery is this?  Why is the diff not relative to 1.1?
-- 
Andreas Gustafsson, g...@gson.org


CVS commit: src/sys/dev/usb

2019-11-29 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Nov 29 14:15:42 UTC 2019

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

Log Message:
Preserve the toggleCarry bit in the Endpoint Descriptor in
ohci_abort_xfer().  Fixes the OHCI part of PR kern/50278.


To generate a diff of this commit:
cvs rdiff -u -r1.291 -r1.292 src/sys/dev/usb/ohci.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

2019-11-29 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Nov 29 14:15:42 UTC 2019

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

Log Message:
Preserve the toggleCarry bit in the Endpoint Descriptor in
ohci_abort_xfer().  Fixes the OHCI part of PR kern/50278.


To generate a diff of this commit:
cvs rdiff -u -r1.291 -r1.292 src/sys/dev/usb/ohci.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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.291 src/sys/dev/usb/ohci.c:1.292
--- src/sys/dev/usb/ohci.c:1.291	Fri Nov 29 14:13:04 2019
+++ src/sys/dev/usb/ohci.c	Fri Nov 29 14:15:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.291 2019/11/29 14:13:04 gson Exp $	*/
+/*	$NetBSD: ohci.c,v 1.292 2019/11/29 14:15:41 gson Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.291 2019/11/29 14:13:04 gson Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.292 2019/11/29 14:15:41 gson Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2349,7 +2349,9 @@ ohci_abort_xfer(struct usbd_xfer *xfer, 
 	if (hit) {
 		DPRINTFN(1, "set hd=0x%08jx, tl=0x%08jx",  (int)p->physaddr,
 		(int)O32TOH(sed->ed.ed_tailp), 0, 0);
-		sed->ed.ed_headp = HTOO32(p->physaddr); /* unlink TDs */
+		/* unlink TDs, preserving toggle carry */
+		sed->ed.ed_headp = HTOO32(p->physaddr |
+		(O32TOH(sed->ed.ed_headp) & OHCI_TOGGLECARRY));
 		usb_syncmem(&sed->dma,
 		sed->offs + offsetof(ohci_ed_t, ed_headp),
 		sizeof(sed->ed.ed_headp),



CVS commit: src/sys/dev/usb

2019-11-29 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Nov 29 14:13:04 UTC 2019

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

Log Message:
Preserve the toggleCarry bit in the Endpoint Descriptor when handling
a DataUnderrun condition.  Fixes PR kern/54070.


To generate a diff of this commit:
cvs rdiff -u -r1.290 -r1.291 src/sys/dev/usb/ohci.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

2019-11-29 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Nov 29 14:13:04 UTC 2019

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

Log Message:
Preserve the toggleCarry bit in the Endpoint Descriptor when handling
a DataUnderrun condition.  Fixes PR kern/54070.


To generate a diff of this commit:
cvs rdiff -u -r1.290 -r1.291 src/sys/dev/usb/ohci.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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.290 src/sys/dev/usb/ohci.c:1.291
--- src/sys/dev/usb/ohci.c:1.290	Sun Aug 11 22:55:03 2019
+++ src/sys/dev/usb/ohci.c	Fri Nov 29 14:13:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.290 2019/08/11 22:55:03 mrg Exp $	*/
+/*	$NetBSD: ohci.c,v 1.291 2019/11/29 14:13:04 gson Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.290 2019/08/11 22:55:03 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.291 2019/11/29 14:13:04 gson Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1515,8 +1515,9 @@ ohci_softintr(void *v)
 
 			ohci_soft_ed_t *sed = opipe->sed;
 
-			/* clear halt and TD chain */
-			sed->ed.ed_headp = HTOO32(p->physaddr);
+			/* clear halt and TD chain, preserving toggle carry */
+			sed->ed.ed_headp = HTOO32(p->physaddr |
+			(O32TOH(sed->ed.ed_headp) & OHCI_TOGGLECARRY));
 			usb_syncmem(&sed->dma,
 			sed->offs + offsetof(ohci_ed_t, ed_headp),
 			sizeof(sed->ed.ed_headp),



CVS commit: src/sys/dev/usb

2019-11-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Nov 26 10:34:16 UTC 2019

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

Log Message:
Change 0x%jx -> %#jx as suggested by christos.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/usb/if_urtwn.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

2019-11-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Nov 26 10:34:16 UTC 2019

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

Log Message:
Change 0x%jx -> %#jx as suggested by christos.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/usb/if_urtwn.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/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.74 src/sys/dev/usb/if_urtwn.c:1.75
--- src/sys/dev/usb/if_urtwn.c:1.74	Tue Nov 26 10:24:17 2019
+++ src/sys/dev/usb/if_urtwn.c	Tue Nov 26 10:34:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.74 2019/11/26 10:24:17 gson Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.75 2019/11/26 10:34:16 gson Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.74 2019/11/26 10:24:17 gson Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.75 2019/11/26 10:34:16 gson Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -954,7 +954,7 @@ urtwn_write_region_1(struct urtwn_softc 
 	USETW(req.wLength, len);
 	error = usbd_do_request(sc->sc_udev, &req, buf);
 	if (error != USBD_NORMAL_COMPLETION) {
-		DPRINTFN(DBG_REG, "error=%jd: addr=0x%jx, len=%jd",
+		DPRINTFN(DBG_REG, "error=%jd: addr=%#jx, len=%jd",
 		error, addr, len, 0);
 	}
 	return error;
@@ -965,7 +965,7 @@ urtwn_write_1(struct urtwn_softc *sc, ui
 {
 
 	URTWNHIST_FUNC(); URTWNHIST_CALLED();
-	DPRINTFN(DBG_REG, "addr=0x%jx, val=0x%jx", addr, val, 0, 0);
+	DPRINTFN(DBG_REG, "addr=%#jx, val=%#jx", addr, val, 0, 0);
 
 	urtwn_write_region_1(sc, addr, &val, 1);
 }
@@ -976,7 +976,7 @@ urtwn_write_2(struct urtwn_softc *sc, ui
 	uint8_t buf[2];
 
 	URTWNHIST_FUNC(); URTWNHIST_CALLED();
-	DPRINTFN(DBG_REG, "addr=0x%jx, val=0x%jx", addr, val, 0, 0);
+	DPRINTFN(DBG_REG, "addr=%#jx, val=%#jx", addr, val, 0, 0);
 
 	buf[0] = (uint8_t)val;
 	buf[1] = (uint8_t)(val >> 8);
@@ -989,7 +989,7 @@ urtwn_write_4(struct urtwn_softc *sc, ui
 	uint8_t buf[4];
 
 	URTWNHIST_FUNC(); URTWNHIST_CALLED();
-	DPRINTFN(DBG_REG, "addr=0x%jx, val=0x%jx", addr, val, 0, 0);
+	DPRINTFN(DBG_REG, "addr=%#jx, val=%#jx", addr, val, 0, 0);
 
 	buf[0] = (uint8_t)val;
 	buf[1] = (uint8_t)(val >> 8);
@@ -1003,7 +1003,7 @@ urtwn_write_region(struct urtwn_softc *s
 {
 
 	URTWNHIST_FUNC();
-	URTWNHIST_CALLARGS("addr=0x%jx, len=0x%jx", addr, len, 0, 0);
+	URTWNHIST_CALLARGS("addr=%#jx, len=%#jx", addr, len, 0, 0);
 
 	return urtwn_write_region_1(sc, addr, buf, len);
 }
@@ -1024,7 +1024,7 @@ urtwn_read_region_1(struct urtwn_softc *
 	USETW(req.wLength, len);
 	error = usbd_do_request(sc->sc_udev, &req, buf);
 	if (error != USBD_NORMAL_COMPLETION) {
-		DPRINTFN(DBG_REG, "error=%jd: addr=0x%jx, len=%jd",
+		DPRINTFN(DBG_REG, "error=%jd: addr=%#jx, len=%jd",
 		error, addr, len, 0);
 	}
 	return error;
@@ -1040,7 +1040,7 @@ urtwn_read_1(struct urtwn_softc *sc, uin
 	if (urtwn_read_region_1(sc, addr, &val, 1) != USBD_NORMAL_COMPLETION)
 		return 0xff;
 
-	DPRINTFN(DBG_REG, "addr=0x%jx, val=0x%jx", addr, val, 0, 0);
+	DPRINTFN(DBG_REG, "addr=%#jx, val=%#jx", addr, val, 0, 0);
 	return val;
 }
 
@@ -1056,7 +1056,7 @@ urtwn_read_2(struct urtwn_softc *sc, uin
 		return 0x;
 
 	val = LE_READ_2(&buf[0]);
-	DPRINTFN(DBG_REG, "addr=0x%jx, val=0x%jx", addr, val, 0, 0);
+	DPRINTFN(DBG_REG, "addr=%#jx, val=%#jx", addr, val, 0, 0);
 	return val;
 }
 
@@ -1072,7 +1072,7 @@ urtwn_read_4(struct urtwn_softc *sc, uin
 		return 0x;
 
 	val = LE_READ_4(&buf[0]);
-	DPRINTFN(DBG_REG, "addr=0x%jx, val=0x%jx", addr, val, 0, 0);
+	DPRINTFN(DBG_REG, "addr=%#jx, val=%#jx", addr, val, 0, 0);
 	return val;
 }
 
@@ -1452,7 +1452,7 @@ urtwn_read_rom(struct urtwn_softc *sc)
 	sc->regulatory = MS(rom->rf_opt1, R92C_ROM_RF1_REGULATORY);
 
 	DPRINTFN(DBG_INIT,
-	"PA setting=0x%jx, board=0x%jx, regulatory=%jd",
+	"PA setting=%#jx, board=%#jx, regulatory=%jd",
 	sc->pa_setting, sc->board_type, sc->regulatory, 0);
 
 	IEEE80211_ADDR_COPY(ic->ic_myaddr, rom->macaddr);
@@ -1610,8 +1610,8 @@ urtwn_ra_init(struct urtwn_softc *sc)
 	} else {
 		mode = R92C_RAID_11BG;
 	}
-	DPRINTFN(DBG_INIT, "mode=0x%jx", mode, 0, 0, 0);
-	DPRINTFN(DBG_INIT, "rates=0x%jx, basicrates=0x%jx, "
+	DPRINTFN(DBG_INIT, "mode=%#jx", mode, 0, 0, 0);
+	DPRINTFN(DBG_INIT, "rates=%#jx, basicrates=%#jx, "
 	"maxrate=%jx, maxbasicrate=%jx",
 	rates, basicrates, maxrate, maxbasicrate);
 
@@ -3571,7 +3571,7 @@ urtwn_r92c_dma_init(struct urtwn_softc *
 	/* Get Tx queues to USB endpoints mapping. */
 	hashq = hasnq = haslq = 0;
 	reg = urtwn_read_2(sc, R92C_USB_EP + 1);
-	DPRINTFN(DBG_INIT, "USB endpoints mapping 0x%jx", reg, 0, 0, 0);
+	DPRINTFN(DBG_INIT, "USB endpoints mapping %#jx", reg, 0, 0, 0);
 	if (MS(reg, R92C_USB_EP_HQ) != 0)
 		hashq = 1;
 	if (MS(reg, R92C_USB_EP_NQ) != 0)



CVS commit: src/sys/dev/usb

2019-11-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Nov 26 10:24:17 UTC 2019

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

Log Message:
Convert debug printfs to usbhist.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/usb/if_urtwn.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

2019-11-26 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Nov 26 10:24:17 UTC 2019

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

Log Message:
Convert debug printfs to usbhist.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/usb/if_urtwn.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/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.73 src/sys/dev/usb/if_urtwn.c:1.74
--- src/sys/dev/usb/if_urtwn.c:1.73	Thu Oct 10 23:30:02 2019
+++ src/sys/dev/usb/if_urtwn.c	Tue Nov 26 10:24:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.73 2019/10/10 23:30:02 bad Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.74 2019/11/26 10:24:17 gson Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.73 2019/10/10 23:30:02 bad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.74 2019/11/26 10:24:17 gson Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -73,6 +73,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -95,10 +96,27 @@ __KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v
 #define	DBG_REG		__BIT(6)
 #define	DBG_ALL		0xU
 u_int urtwn_debug = 0;
-#define DPRINTFN(n, s)	\
-	do { if (urtwn_debug & (n)) printf s; } while (/*CONSTCOND*/0)
+#define DPRINTFN(n, fmt, a, b, c, d) do {			\
+	if (urtwn_debug & (n)) {\
+		KERNHIST_LOG(usbhist, fmt, a, b, c, d);		\
+	}			\
+} while (/*CONSTCOND*/0)
+#define URTWNHIST_FUNC() USBHIST_FUNC()
+#define URTWNHIST_CALLED() do {	\
+	if (urtwn_debug & DBG_FN) {\
+		KERNHIST_CALLED(usbhist);			\
+	}			\
+} while(/*CONSTCOND*/0)
+#define URTWNHIST_CALLARGS(fmt, a, b, c, d) do {		\
+	if (urtwn_debug & DBG_FN) {\
+		KERNHIST_CALLARGS(usbhist, fmt, a, b, c, d);	\
+	}			\
+} while(/*CONSTCOND*/0)
 #else
-#define DPRINTFN(n, s)
+#define DPRINTFN(n, fmt, a, b, c, d)
+#define URTWNHIST_FUNC()
+#define URTWNHIST_CALLED()
+#define URTWNHIST_CALLARGS(fmt, a, b, c, d)
 #endif
 
 #define URTWN_DEV(v,p)	{ { USB_VENDOR_##v, USB_PRODUCT_##v##_##p }, 0 }
@@ -350,6 +368,8 @@ urtwn_attach(device_t parent, device_t s
 	size_t i;
 	int error;
 
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
+
 	sc->sc_dev = self;
 	sc->sc_udev = uaa->uaa_device;
 
@@ -363,8 +383,6 @@ urtwn_attach(device_t parent, device_t s
 	aprint_naive("\n");
 	aprint_normal("\n");
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
-
 	devinfop = usbd_devinfo_alloc(sc->sc_udev, 0);
 	aprint_normal_dev(self, "%s\n", devinfop);
 	usbd_devinfo_free(devinfop);
@@ -539,7 +557,7 @@ urtwn_detach(device_t self, int flags)
 	struct ifnet *ifp = &sc->sc_if;
 	int s;
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 
 	pmf_device_deregister(self);
 
@@ -589,7 +607,7 @@ urtwn_activate(device_t self, enum devac
 {
 	struct urtwn_softc *sc = device_private(self);
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 
 	switch (act) {
 	case DVACT_DEACTIVATE:
@@ -611,7 +629,7 @@ urtwn_open_pipes(struct urtwn_softc *sc)
 	size_t i, ntx = 0, nrx = 0;
 	int error;
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 
 	/* Determine the number of bulk-out pipes. */
 	id = usbd_get_interface_descriptor(sc->sc_iface);
@@ -641,8 +659,8 @@ urtwn_open_pipes(struct urtwn_softc *sc)
 		"%zd: invalid number of Tx bulk pipes\n", ntx);
 		return EIO;
 	}
-	DPRINTFN(DBG_INIT, ("%s: %s: found %zd/%zd bulk-in/out pipes\n",
-	device_xname(sc->sc_dev), __func__, nrx, ntx));
+	DPRINTFN(DBG_INIT, "found %jd/%jd bulk-in/out pipes",
+	nrx, ntx, 0, 0);
 	sc->rx_npipe = nrx;
 	sc->tx_npipe = ntx;
 
@@ -688,7 +706,7 @@ urtwn_close_pipes(struct urtwn_softc *sc
 	struct usbd_pipe *pipe;
 	size_t i;
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 
 	/* Close Rx pipes. */
 	CTASSERT(sizeof(pipe) == sizeof(void *));
@@ -715,7 +733,7 @@ urtwn_alloc_rx_list(struct urtwn_softc *
 	size_t i;
 	int error = 0;
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 
 	for (size_t j = 0; j < sc->rx_npipe; j++) {
 		TAILQ_INIT(&sc->rx_free_list[j]);
@@ -747,7 +765,7 @@ urtwn_free_rx_list(struct urtwn_softc *s
 	struct usbd_xfer *xfer;
 	size_t i;
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED();
 
 	/* NB: Caller must abort pipe first. */
 	for (size_t j = 0; j < sc->rx_npipe; j++) {
@@ -767,7 +785,7 @@ urtwn_alloc_tx_list(struct urtwn_softc *
 	size_t i;
 	int error = 0;
 
-	DPRINTFN(DBG_FN, ("%s: %s\n", device_xname(sc->sc_dev), __func__));
+	URTWNHIST_FUNC(); URTWNHIST_CALLED

CVS commit: src/sys/arch/i386/stand/pxeboot

2019-09-27 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Sep 27 08:57:10 UTC 2019

Modified Files:
src/sys/arch/i386/stand/pxeboot: Makefile start_pxe.S

Log Message:
Incrase pxeboot code size limit from 64k to 128k.  Fixes PR kern/54560.
The start_pxe.S part was suggested by mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/i386/stand/pxeboot/Makefile
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/pxeboot/start_pxe.S

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



CVS commit: src/sys/arch/i386/stand/pxeboot

2019-09-27 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Sep 27 08:57:10 UTC 2019

Modified Files:
src/sys/arch/i386/stand/pxeboot: Makefile start_pxe.S

Log Message:
Incrase pxeboot code size limit from 64k to 128k.  Fixes PR kern/54560.
The start_pxe.S part was suggested by mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/i386/stand/pxeboot/Makefile
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/pxeboot/start_pxe.S

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

Modified files:

Index: src/sys/arch/i386/stand/pxeboot/Makefile
diff -u src/sys/arch/i386/stand/pxeboot/Makefile:1.27 src/sys/arch/i386/stand/pxeboot/Makefile:1.28
--- src/sys/arch/i386/stand/pxeboot/Makefile:1.27	Mon Sep 23 13:42:37 2019
+++ src/sys/arch/i386/stand/pxeboot/Makefile	Fri Sep 27 08:57:10 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.27 2019/09/23 13:42:37 christos Exp $
+#	$NetBSD: Makefile,v 1.28 2019/09/27 08:57:10 gson Exp $
 
 S=	${.CURDIR}/../../../..
 
@@ -66,7 +66,7 @@ CPPFLAGS+= -DBOOTPARAM_DEFFLAGS=0x0c
 #CFLAGS= -O2 -fomit-frame-pointer -fno-defer-pop
 CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-main
 
-SAMISCCPPFLAGS+= -DHEAP_START=0x1 -DHEAP_LIMIT=0x3
+SAMISCCPPFLAGS+= -DHEAP_START=0x2 -DHEAP_LIMIT=0x4
 SAMISCMAKEFLAGS+= SA_USE_CREAD=yes	# Read compressed kernels
 
 CPPFLAGS+= -DPASS_BIOSGEOM

Index: src/sys/arch/i386/stand/pxeboot/start_pxe.S
diff -u src/sys/arch/i386/stand/pxeboot/start_pxe.S:1.6 src/sys/arch/i386/stand/pxeboot/start_pxe.S:1.7
--- src/sys/arch/i386/stand/pxeboot/start_pxe.S:1.6	Fri Mar 18 17:46:26 2011
+++ src/sys/arch/i386/stand/pxeboot/start_pxe.S	Fri Sep 27 08:57:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: start_pxe.S,v 1.6 2011/03/18 17:46:26 jakllsch Exp $	*/
+/*	$NetBSD: start_pxe.S,v 1.7 2019/09/27 08:57:10 gson Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -69,7 +69,7 @@ _C_LABEL(boot_params):
 	# set up %ss and %sp
 	movl	$_end, %eax		/* top of bss */
 	shrl	$4, %eax		/* as a segment */
-	addw	$0x1001, %ax		/* and + 64k */
+	addw	$0x2001, %ax		/* and + 128k */
 	movw	%ax, %ss		/* for stack */
 	movw	$0xfffc, %sp		/* %sp at top of it */
 



CVS commit: src/etc

2019-09-22 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Sep 22 13:08:10 UTC 2019

Modified Files:
src/etc: Makefile

Log Message:
Don't mix tabs and spaces


To generate a diff of this commit:
cvs rdiff -u -r1.439 -r1.440 src/etc/Makefile

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



CVS commit: src/etc

2019-09-22 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Sep 22 13:08:10 UTC 2019

Modified Files:
src/etc: Makefile

Log Message:
Don't mix tabs and spaces


To generate a diff of this commit:
cvs rdiff -u -r1.439 -r1.440 src/etc/Makefile

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

Modified files:

Index: src/etc/Makefile
diff -u src/etc/Makefile:1.439 src/etc/Makefile:1.440
--- src/etc/Makefile:1.439	Wed Jul 31 18:35:58 2019
+++ src/etc/Makefile	Sun Sep 22 13:08:10 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.439 2019/07/31 18:35:58 martin Exp $
+#	$NetBSD: Makefile,v 1.440 2019/09/22 13:08:10 gson Exp $
 #	from: @(#)Makefile	8.7 (Berkeley) 5/25/95
 
 # Environment variables without default values:
@@ -343,7 +343,7 @@ install-etc-files: .PHONY .MAKE check_DE
 	${_MKMSG_INSTALL} ${DESTDIR}${file}
 	if [ ! -e ${DESTDIR}${file} -o -s ${DESTDIR}${file} ]; then \
 		${ETC_INSTALL_FILE} -o ${owner} -g ${group} -m ${mode} \
-			/dev/null ${DESTDIR}${file}; \
+			/dev/null ${DESTDIR}${file}; \
 	else true; fi
 .endfor
 .for subdir in . defaults autofs bluetooth iscsi mtree namedb pam.d powerd rc.d root skel ssh



re: CVS commit: src/usr.sbin/usbdevs

2019-09-22 Thread Andreas Gustafsson
Matthew,

On further thought, I think your patch won't work correctly in cases
where USB controllers are detached.  For example, if you attach usb0
and usb1, and then detach usb0, getusbcount_device() will return 1,
and usbdevs will try to list devices only on the detached usb0, and
not on the still attached usb1.
-- 
Andreas Gustafsson, g...@netbsd.org


re: CVS commit: src/usr.sbin/usbdevs

2019-09-22 Thread Andreas Gustafsson
Hi mrg

You wrote:
> > Look for up to 16 USB controllers, to match the number of device nodes
> > now created by MAKEDEV.
> 
> thanks for doing this.  you inspired me to get usbdevs to get the
> count from drvctl(8) if available, so next time we don't have to
> patch it again.  based upon the code in drvctl(8).
> 
> what do you think?
> 
>https://www.netbsd.org/~mrg/usbdevs.anycount.diff

Thanks for improving on my commit.  Your patch looks correct as far
as I can see, but rather complicated for what it does.  Couldn't we
get the same end result simply by looping until opening /dev/usbN
yields ENOENT?

Or alternatively, if we do spend the effort to walk the device tree,
we should use the information gained from that to full advantage by
issuing warnings about missing /dev/usbN device nodes rather than just
silently ignoring the affected controllers.
-- 
Andreas Gustafsson, g...@netbsd.org


CVS commit: src/usr.sbin/usbdevs

2019-09-21 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Sep 21 16:22:25 UTC 2019

Modified Files:
src/usr.sbin/usbdevs: usbdevs.c

Log Message:
Look for up to 16 USB controllers, to match the number of device nodes
now created by MAKEDEV.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/usbdevs/usbdevs.c

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



CVS commit: src/usr.sbin/usbdevs

2019-09-21 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Sep 21 16:22:25 UTC 2019

Modified Files:
src/usr.sbin/usbdevs: usbdevs.c

Log Message:
Look for up to 16 USB controllers, to match the number of device nodes
now created by MAKEDEV.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/usbdevs/usbdevs.c

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

Modified files:

Index: src/usr.sbin/usbdevs/usbdevs.c
diff -u src/usr.sbin/usbdevs/usbdevs.c:1.36 src/usr.sbin/usbdevs/usbdevs.c:1.37
--- src/usr.sbin/usbdevs/usbdevs.c:1.36	Thu Jul  5 19:46:58 2018
+++ src/usr.sbin/usbdevs/usbdevs.c	Sat Sep 21 16:22:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdevs.c,v 1.36 2018/07/05 19:46:58 jmcneill Exp $	*/
+/*	$NetBSD: usbdevs.c,v 1.37 2019/09/21 16:22:25 gson Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: usbdevs.c,v 1.36 2018/07/05 19:46:58 jmcneill Exp $");
+__RCSID("$NetBSD: usbdevs.c,v 1.37 2019/09/21 16:22:25 gson Exp $");
 #endif
 
 #include 
@@ -347,7 +347,7 @@ main(int argc, char **argv)
 	argv += optind;
 
 	if (dev == NULL) {
-		for (ncont = 0, i = 0; i < 10; i++) {
+		for (ncont = 0, i = 0; i < 16; i++) {
 			snprintf(buf, sizeof(buf), "%s%d", USBDEV, i);
 			f = open(buf, O_RDONLY);
 			if (f >= 0) {



CVS commit: src/share/man/man5

2019-09-16 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Mon Sep 16 12:57:10 UTC 2019

Modified Files:
src/share/man/man5: mk.conf.5

Log Message:
MKZFS is no longer the default on i386; it was disabled in 2015 in
bsd.own.mk 1.846.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/share/man/man5/mk.conf.5

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/man5/mk.conf.5
diff -u src/share/man/man5/mk.conf.5:1.78 src/share/man/man5/mk.conf.5:1.79
--- src/share/man/man5/mk.conf.5:1.78	Wed Feb 20 17:48:31 2019
+++ src/share/man/man5/mk.conf.5	Mon Sep 16 12:57:10 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: mk.conf.5,v 1.78 2019/02/20 17:48:31 wiz Exp $
+.\"	$NetBSD: mk.conf.5,v 1.79 2019/09/16 12:57:10 gson Exp $
 .\"
 .\"  Copyright (c) 1999-2003 The NetBSD Foundation, Inc.
 .\"  All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 19, 2019
+.Dd September 16, 2019
 .Dt MK.CONF 5
 .Os
 .\" turn off hyphenation
@@ -852,7 +852,7 @@ Indicates whether the YP (NIS) infrastru
 Indicates whether the ZFS kernel module and the utilities and
 libraries used to manage the ZFS system are to be built.
 .DFLTy
-on i386 and amd64,
+on amd64,
 .Dq no
 on other architectures.
 .



CVS commit: src/share/man/man5

2019-09-16 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Mon Sep 16 12:57:10 UTC 2019

Modified Files:
src/share/man/man5: mk.conf.5

Log Message:
MKZFS is no longer the default on i386; it was disabled in 2015 in
bsd.own.mk 1.846.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/share/man/man5/mk.conf.5

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



CVS commit: src/share/man/man4

2019-08-20 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Aug 20 14:03:56 UTC 2019

Modified Files:
src/share/man/man4: options.4

Log Message:
Don't say that makeoptions DEBUG="-g" also turns on options DEBUG,
because it does not.  Fixes PR kern/54438.


To generate a diff of this commit:
cvs rdiff -u -r1.506 -r1.507 src/share/man/man4/options.4

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



CVS commit: src/share/man/man4

2019-08-20 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Aug 20 14:03:56 UTC 2019

Modified Files:
src/share/man/man4: options.4

Log Message:
Don't say that makeoptions DEBUG="-g" also turns on options DEBUG,
because it does not.  Fixes PR kern/54438.


To generate a diff of this commit:
cvs rdiff -u -r1.506 -r1.507 src/share/man/man4/options.4

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.506 src/share/man/man4/options.4:1.507
--- src/share/man/man4/options.4:1.506	Wed May 22 15:17:48 2019
+++ src/share/man/man4/options.4	Tue Aug 20 14:03:55 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.506 2019/05/22 15:17:48 wiz Exp $
+.\"	$NetBSD: options.4,v 1.507 2019/08/20 14:03:55 gson Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -30,7 +30,7 @@
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\"
-.Dd May 21, 2019
+.Dd August 20, 2019
 .Dt OPTIONS 4
 .Os
 .Sh NAME
@@ -604,9 +604,6 @@ is useful for debugging kernel crash dum
 See
 .Xr gdb 1
 for details.
-This also turns on
-.Em options DEBUG
-(which see).
 .It Cd options DEBUG
 Turns on miscellaneous kernel debugging.
 Since options are turned into preprocessor defines (see above),



CVS commit: src/tests/fs/vfs

2019-08-17 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Aug 17 09:44:02 UTC 2019

Modified Files:
src/tests/fs/vfs: t_renamerace.c

Log Message:
The udf_renamerace test case no longer fails due to PR kern/49046, but
it does fail due to PR kern/53865 on real hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/tests/fs/vfs/t_renamerace.c

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



CVS commit: src/tests/fs/vfs

2019-08-17 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Aug 17 09:44:02 UTC 2019

Modified Files:
src/tests/fs/vfs: t_renamerace.c

Log Message:
The udf_renamerace test case no longer fails due to PR kern/49046, but
it does fail due to PR kern/53865 on real hardware.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/tests/fs/vfs/t_renamerace.c

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

Modified files:

Index: src/tests/fs/vfs/t_renamerace.c
diff -u src/tests/fs/vfs/t_renamerace.c:1.35 src/tests/fs/vfs/t_renamerace.c:1.36
--- src/tests/fs/vfs/t_renamerace.c:1.35	Sun Jan 13 14:35:00 2019
+++ src/tests/fs/vfs/t_renamerace.c	Sat Aug 17 09:44:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_renamerace.c,v 1.35 2019/01/13 14:35:00 gson Exp $	*/
+/*	$NetBSD: t_renamerace.c,v 1.36 2019/08/17 09:44:01 gson Exp $	*/
 
 /*
  * Modified for rump and atf from a program supplied
@@ -102,7 +102,7 @@ renamerace(const atf_tc_t *tc, const cha
 	if (FSTYPE_RUMPFS(tc))
 		atf_tc_skip("rename not supported by file system");
 	if (FSTYPE_UDF(tc))
-		atf_tc_expect_fail("PR kern/49046");
+		atf_tc_expect_fail("PR kern/53865");
 
 	RZ(rump_pub_lwproc_rfork(RUMP_RFCFDG));
 	RL(wrkpid = rump_sys_getpid());



CVS commit: src/sys/dev/ata

2019-08-15 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Aug 15 09:00:23 UTC 2019

Modified Files:
src/sys/dev/ata: satafis_subr.c

Log Message:
Set the ATAPI "BYTE COUNT LIMIT" field in the SATA case like we
already do in the ATA case, to make NetBSD work with the virtual
SATA CD-ROM of "qemu-system-i386 -machine q35".  Fixes PR kern/54389.
OK mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ata/satafis_subr.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/ata/satafis_subr.c
diff -u src/sys/dev/ata/satafis_subr.c:1.8 src/sys/dev/ata/satafis_subr.c:1.9
--- src/sys/dev/ata/satafis_subr.c:1.8	Sat Oct  7 16:05:32 2017
+++ src/sys/dev/ata/satafis_subr.c	Thu Aug 15 09:00:23 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: satafis_subr.c,v 1.8 2017/10/07 16:05:32 jdolecek Exp $ */
+/* $NetBSD: satafis_subr.c,v 1.9 2019/08/15 09:00:23 gson Exp $ */
 
 /*-
  * Copyright (c) 2009 Jonathan A. Kollasch.
@@ -51,7 +51,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: satafis_subr.c,v 1.8 2017/10/07 16:05:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: satafis_subr.c,v 1.9 2019/08/15 09:00:23 gson Exp $");
 
 #include 
 #include 
@@ -149,12 +149,16 @@ satafis_rhd_construct_bio(struct ata_xfe
 void
 satafis_rhd_construct_atapi(struct ata_xfer *xfer, uint8_t *fis)
 {
+	int bcount16;
 
 	memset(fis, 0, RHD_FISLEN);
 
 	fis[fis_type] = RHD_FISTYPE;
 	fis[rhd_c] = RHD_C;
 	fis[rhd_command] = ATAPI_PKT_CMD;
+	bcount16 = xfer->c_bcount <= 0x ? xfer->c_bcount : 0x;
+	fis[rhd_lba1] = (bcount16 >> 0) & 0xff;
+	fis[rhd_lba2] = (bcount16 >> 8) & 0xff;
 	fis[rhd_features0] = (xfer->c_flags & C_DMA) ?
 	ATAPI_PKT_CMD_FTRE_DMA : 0;
 }



CVS commit: src/sys/dev/ata

2019-08-15 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Aug 15 09:00:23 UTC 2019

Modified Files:
src/sys/dev/ata: satafis_subr.c

Log Message:
Set the ATAPI "BYTE COUNT LIMIT" field in the SATA case like we
already do in the ATA case, to make NetBSD work with the virtual
SATA CD-ROM of "qemu-system-i386 -machine q35".  Fixes PR kern/54389.
OK mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ata/satafis_subr.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/liveimage/emuimage

2019-08-11 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Aug 11 11:00:30 UTC 2019

Modified Files:
src/distrib/amd64/liveimage/emuimage: Makefile

Log Message:
Live images built with MKDEBUG=yes fit in 2 GB since installing _pic.a
libraries was disabled in src/share/mk/bsd.own.mk 1.1150.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/amd64/liveimage/emuimage/Makefile

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/liveimage/emuimage/Makefile
diff -u src/distrib/amd64/liveimage/emuimage/Makefile:1.6 src/distrib/amd64/liveimage/emuimage/Makefile:1.7
--- src/distrib/amd64/liveimage/emuimage/Makefile:1.6	Wed Aug  7 07:59:35 2019
+++ src/distrib/amd64/liveimage/emuimage/Makefile	Sun Aug 11 11:00:30 2019
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile,v 1.6 2019/08/07 07:59:35 gson Exp $
+#	$NetBSD: Makefile,v 1.7 2019/08/11 11:00:30 gson Exp $
 
 LIVEIMGBASE=	NetBSD-${DISTRIBVER}-amd64-live	# gives ${IMGBASE}.img
 
-EMUIMAGEMB?=	3725	# 4GB USB flash memories aren't 4GiB
+EMUIMAGEMB?=	1907	# 2GB USB flash memories aren't 2GiB
 LIVEIMAGEMB=	${EMUIMAGEMB}
 
 .include "${.CURDIR}/../Makefile.liveimage"



CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-11 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Aug 11 11:00:30 UTC 2019

Modified Files:
src/distrib/amd64/liveimage/emuimage: Makefile

Log Message:
Live images built with MKDEBUG=yes fit in 2 GB since installing _pic.a
libraries was disabled in src/share/mk/bsd.own.mk 1.1150.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/amd64/liveimage/emuimage/Makefile

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



Re: CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-09 Thread Andreas Gustafsson
Martin Husemann wrote:
> However - the whole idea boils down to:
> 
>  - what purpose do others use the USB install images for?

What others use the USB *install* image for is hardly relevant to
the present discussion.  The install image and the live image (aka
"emuimage") are two separate things, and the commit being discussed
affects only the latter:

  NetBSD-9.99.4-amd64-install.img1.4G
  NetBSD-9.99.4-amd64-live.img   3.6G

I'm guessing almost no one uses the amd64 live image presently, simply
because it is not included in the official binary releases - you have
to build it yourself.  But I think there is a clear trend away from
the 1980's concept of "installing" an operating system towards simply
running images - that's what ARM SBC users do, that's what you do on
Amazon EC2, etc.  Many other open source OSes distribute fully
functional live images for amd64, and I think NetBSD should, too.
-- 
Andreas Gustafsson, g...@netbsd.org


Re: CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-08 Thread Andreas Gustafsson
Martin Husemann wrote:
> How about: remove all *.a files from those images?
> Is there a tool to strip CTF from binaries?

I really don't like the general idea of introducing differences
between images and systems installed through sysinst.  It's confusing
for users, and also means that testing of one is less likely to apply
to the other.

I see that libstdc++_pic.a is much larger than the other versions of
the same library:

   # cd /usr/lib
   # ls -al libstdc*
   -r--r--r--  1 root  wheel   4539634 Aug  8 14:00 libstdc++.a
   lrwxr-xr-x  1 root  wheel16 Aug  8 14:00 libstdc++.so -> 
libstdc++.so.9.0
   lrwxr-xr-x  1 root  wheel16 Aug  8 14:00 libstdc++.so.9 -> 
libstdc++.so.9.0
   -r--r--r--  1 root  wheel   2030136 Aug  8 14:00 libstdc++.so.9.0
   -r--r--r--  1 root  wheel   4787754 Aug  8 14:00 libstdc++_p.a
   -r--r--r--  1 root  wheel  28835160 Aug  8 14:00 libstdc++_pic.a

and that it contains .debug_info sections, which the others don't:

  # size -A -d libstdc++_pic.a | fgrep .debug_info | wc -l
   173
  # size -A -d libstdc++.a | fgrep .debug_info | wc -l
 0

Other libraries also have _pic.a files that are much larger than the
others versions.  Is there a bug that causes them not to be CTF-converted,
or is this deliberate?
-- 
Andreas Gustafsson, g...@netbsd.org


Re: CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-08 Thread Andreas Gustafsson
Martin Husemann wrote:
> I would like to see this images created w/o /usr/libdata/debug/ (as we
> do for ISO images, some of which we even strip more), but I have not
> yet found an easy way to hack that into the image creation process.

The image already has an empty /usr/libdata/debug.  The increase in
size when MKDEBUG is enabled is spread out over various other
directories, notably /usr/lib.  For example,

  /usr/lib  405182 kB -> 866276 kB
  /usr/bin   53426 kB ->  63140 kB

The largest file in /usr/lib is libstdc++_pic.a, which grows from
4.3 MB to 27 MB.

The largest file in /usr/bin is gdb, which grows from 7.8M to 12M.
"size -A -d" shows most of the growth is CTF.  Is there a corresponding
tool to look at the sizes of sections in a ".a" library?

In any case, the kernel has only grown from 23M to 26M, so this growth
looks like it's mostly a userland issue and unrelated to the removal of
"-U DEBUG" from etc/Makefile.
-- 
Andreas Gustafsson, g...@netbsd.org


CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-07 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed Aug  7 07:59:36 UTC 2019

Modified Files:
src/distrib/amd64/liveimage/emuimage: Makefile

Log Message:
The amd64 live image no longer fits in 2 GB when built with with
MKDEBUG, as releases are.  Bump the size to just under 4 GB (as in
4*10^9, not 4*2^30), the next larger common USB thumb drive size.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/amd64/liveimage/emuimage/Makefile

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/liveimage/emuimage/Makefile
diff -u src/distrib/amd64/liveimage/emuimage/Makefile:1.5 src/distrib/amd64/liveimage/emuimage/Makefile:1.6
--- src/distrib/amd64/liveimage/emuimage/Makefile:1.5	Sun Dec 16 08:58:21 2018
+++ src/distrib/amd64/liveimage/emuimage/Makefile	Wed Aug  7 07:59:35 2019
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile,v 1.5 2018/12/16 08:58:21 gson Exp $
+#	$NetBSD: Makefile,v 1.6 2019/08/07 07:59:35 gson Exp $
 
 LIVEIMGBASE=	NetBSD-${DISTRIBVER}-amd64-live	# gives ${IMGBASE}.img
 
-EMUIMAGEMB?=	1536	# 2GB USB flash memories aren't 2GiB
+EMUIMAGEMB?=	3725	# 4GB USB flash memories aren't 4GiB
 LIVEIMAGEMB=	${EMUIMAGEMB}
 
 .include "${.CURDIR}/../Makefile.liveimage"



CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-07 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed Aug  7 07:59:36 UTC 2019

Modified Files:
src/distrib/amd64/liveimage/emuimage: Makefile

Log Message:
The amd64 live image no longer fits in 2 GB when built with with
MKDEBUG, as releases are.  Bump the size to just under 4 GB (as in
4*10^9, not 4*2^30), the next larger common USB thumb drive size.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/amd64/liveimage/emuimage/Makefile

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



CVS commit: src/tests/lib/libc/sys

2019-07-13 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Jul 13 12:44:02 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_getitimer.c

Log Message:
In the setitimer_old test case, allow for time passing between the two
setitimer() calls.  Should fix PR kern/54370.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_getitimer.c

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



CVS commit: src/tests/lib/libc/sys

2019-07-13 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sat Jul 13 12:44:02 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_getitimer.c

Log Message:
In the setitimer_old test case, allow for time passing between the two
setitimer() calls.  Should fix PR kern/54370.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_getitimer.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_getitimer.c
diff -u src/tests/lib/libc/sys/t_getitimer.c:1.2 src/tests/lib/libc/sys/t_getitimer.c:1.3
--- src/tests/lib/libc/sys/t_getitimer.c:1.2	Thu Mar 22 18:20:46 2012
+++ src/tests/lib/libc/sys/t_getitimer.c	Sat Jul 13 12:44:02 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: t_getitimer.c,v 1.2 2012/03/22 18:20:46 christos Exp $ */
+/* $NetBSD: t_getitimer.c,v 1.3 2019/07/13 12:44:02 gson Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_getitimer.c,v 1.2 2012/03/22 18:20:46 christos Exp $");
+__RCSID("$NetBSD: t_getitimer.c,v 1.3 2019/07/13 12:44:02 gson Exp $");
 
 #include 
 
@@ -175,11 +175,13 @@ ATF_TC_BODY(setitimer_old, tc)
 	struct itimerval it, ot;
 
 	/*
-	 * Make two calls; the second one
-	 * should store the old values.
+	 * Make two calls; the second one should store the old
+	 * timer value which should be the same as that set in
+	 * the first call, or slightly less due to time passing
+	 * between the two calls.
 	 */
 	it.it_value.tv_sec = 4;
-	it.it_value.tv_usec = 3;
+	it.it_value.tv_usec = 99;
 
 	it.it_interval.tv_sec = 0;
 	it.it_interval.tv_usec = 0;
@@ -194,7 +196,8 @@ ATF_TC_BODY(setitimer_old, tc)
 
 	ATF_REQUIRE(setitimer(ITIMER_REAL, &it, &ot) == 0);
 
-	if (ot.it_value.tv_sec != 4 || ot.it_value.tv_usec != 3)
+	/* Check seconds only as microseconds may have decremented */
+	if (ot.it_value.tv_sec != 4)
 		atf_tc_fail("setitimer(2) did not store old values");
 }
 



CVS commit: src/tests/lib/libc/regex

2019-07-09 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Jul  9 13:59:25 UTC 2019

Modified Files:
src/tests/lib/libc/regex: t_exhaust.c

Log Message:
Update require.memory to match the increased rlimit.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libc/regex/t_exhaust.c

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

Modified files:

Index: src/tests/lib/libc/regex/t_exhaust.c
diff -u src/tests/lib/libc/regex/t_exhaust.c:1.9 src/tests/lib/libc/regex/t_exhaust.c:1.10
--- src/tests/lib/libc/regex/t_exhaust.c:1.9	Sat Mar 16 21:57:15 2019
+++ src/tests/lib/libc/regex/t_exhaust.c	Tue Jul  9 13:59:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_exhaust.c,v 1.9 2019/03/16 21:57:15 christos Exp $	*/
+/*	$NetBSD: t_exhaust.c,v 1.10 2019/07/09 13:59:25 gson Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_exhaust.c,v 1.9 2019/03/16 21:57:15 christos Exp $");
+__RCSID("$NetBSD: t_exhaust.c,v 1.10 2019/07/09 13:59:25 gson Exp $");
 
 #include 
 #include 
@@ -177,7 +177,7 @@ ATF_TC_HEAD(regcomp_too_big, tc)
 	" crash, but return a proper error code");
 	// libtre needs it.
 	atf_tc_set_md_var(tc, "timeout", "600");
-	atf_tc_set_md_var(tc, "require.memory", "64M");
+	atf_tc_set_md_var(tc, "require.memory", "256M");
 }
 
 ATF_TC_BODY(regcomp_too_big, tc)



CVS commit: src/tests/lib/libc/regex

2019-07-09 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Jul  9 13:59:25 UTC 2019

Modified Files:
src/tests/lib/libc/regex: t_exhaust.c

Log Message:
Update require.memory to match the increased rlimit.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libc/regex/t_exhaust.c

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



CVS commit: src/tests/crypto/libcrypto

2019-06-16 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Jun 16 10:45:50 UTC 2019

Modified Files:
src/tests/crypto/libcrypto: t_pubkey.sh

Log Message:
The runtime of the ecdsa test case increased approximately sixfold
with the openssl update on 2019-06-09, and it is now timing out on
sparc.  Increase the timeout by roughly the same factor.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/crypto/libcrypto/t_pubkey.sh

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



CVS commit: src/tests/crypto/libcrypto

2019-06-16 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Sun Jun 16 10:45:50 UTC 2019

Modified Files:
src/tests/crypto/libcrypto: t_pubkey.sh

Log Message:
The runtime of the ecdsa test case increased approximately sixfold
with the openssl update on 2019-06-09, and it is now timing out on
sparc.  Increase the timeout by roughly the same factor.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/crypto/libcrypto/t_pubkey.sh

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

Modified files:

Index: src/tests/crypto/libcrypto/t_pubkey.sh
diff -u src/tests/crypto/libcrypto/t_pubkey.sh:1.5 src/tests/crypto/libcrypto/t_pubkey.sh:1.6
--- src/tests/crypto/libcrypto/t_pubkey.sh:1.5	Sat Sep 29 10:54:35 2018
+++ src/tests/crypto/libcrypto/t_pubkey.sh	Sun Jun 16 10:45:50 2019
@@ -1,4 +1,4 @@
-# $NetBSD: t_pubkey.sh,v 1.5 2018/09/29 10:54:35 gson Exp $
+# $NetBSD: t_pubkey.sh,v 1.6 2019/06/16 10:45:50 gson Exp $
 #
 # Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -81,7 +81,7 @@ atf_test_case ecdsa
 ecdsa_head()
 {
 	atf_set "descr" "Checks ECDSA algorithm"
-	atf_set "timeout" "480"
+	atf_set "timeout" "3000"
 }
 ecdsa_body()
 {



CVS commit: src/tests/net/icmp

2019-06-11 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Jun 11 08:34:01 UTC 2019

Modified Files:
src/tests/net/icmp: t_ping.c

Log Message:
In the "got %d/%d" message printed at the end of the pingsize test,
make the latter number show the actual number of ICMP packets the test
attempted to send.  Thus, the two numbers can now be meaningfully
compared, and their difference indicates the number of packets lost.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/tests/net/icmp/t_ping.c

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



CVS commit: src/tests/net/icmp

2019-06-11 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue Jun 11 08:34:01 UTC 2019

Modified Files:
src/tests/net/icmp: t_ping.c

Log Message:
In the "got %d/%d" message printed at the end of the pingsize test,
make the latter number show the actual number of ICMP packets the test
attempted to send.  Thus, the two numbers can now be meaningfully
compared, and their difference indicates the number of packets lost.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/tests/net/icmp/t_ping.c

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

Modified files:

Index: src/tests/net/icmp/t_ping.c
diff -u src/tests/net/icmp/t_ping.c:1.23 src/tests/net/icmp/t_ping.c:1.24
--- src/tests/net/icmp/t_ping.c:1.23	Mon Mar 26 09:11:15 2018
+++ src/tests/net/icmp/t_ping.c	Tue Jun 11 08:34:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ping.c,v 1.23 2018/03/26 09:11:15 roy Exp $	*/
+/*	$NetBSD: t_ping.c,v 1.24 2019/06/11 08:34:01 gson Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: t_ping.c,v 1.23 2018/03/26 09:11:15 roy Exp $");
+__RCSID("$NetBSD: t_ping.c,v 1.24 2019/06/11 08:34:01 gson Exp $");
 #endif /* not lint */
 
 #include 
@@ -280,7 +280,7 @@ ATF_TC_BODY(pingsize, tc)
 {
 	char ifname[IFNAMSIZ];
 	pid_t cpid;
-	int succ, i;
+	int sent, succ, i;
 
 	cpid = fork();
 	rump_init();
@@ -299,21 +299,27 @@ ATF_TC_BODY(pingsize, tc)
 
 	netcfg_rump_if(ifname, "1.1.1.20", "255.255.255.0");
 
-	succ = 0;
+	succ = sent = 0;
 
 	/* small sizes */
-	for (i = 0 ; i < IP_MAXPACKET - 6; i++)
+	for (i = 0 ; i < IP_MAXPACKET - 6; i++) {
+		sent++;
 		succ += doping("1.1.1.10", 1, i);
+	}
 
 	/* medium sizes */
-	for (i = IP_MAXPACKET - 6; i < IP_MAXPACKET - 100; i += 1000)
+	for (i = IP_MAXPACKET - 6; i < IP_MAXPACKET - 100; i += 1000) {
+		sent++;
 		succ += doping("1.1.1.10", 1, i);
+	}
 
 	/* big sizes */
-	for (i = IP_MAXPACKET - 100; i < IP_MAXPACKET; i += 10)
+	for (i = IP_MAXPACKET - 100; i < IP_MAXPACKET; i += 10) {
+		sent++;
 		succ += doping("1.1.1.10", 1, i);
+	}
 
-	printf("got %d/%d\n", succ, IP_MAXPACKET);
+	printf("got %d/%d\n", succ, sent);
 	kill(cpid, SIGKILL);
 }
 



CVS commit: src/tests/usr.bin/gdb

2019-06-07 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Jun  7 19:05:15 UTC 2019

Modified Files:
src/tests/usr.bin/gdb: t_regress.sh

Log Message:
Add a regression test for PR bin/54154, or in other words, make sure
we get notified in a timely manner if gdb's XML support disappears
again.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/gdb/t_regress.sh

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



CVS commit: src/tests/usr.bin/gdb

2019-06-07 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri Jun  7 19:05:15 UTC 2019

Modified Files:
src/tests/usr.bin/gdb: t_regress.sh

Log Message:
Add a regression test for PR bin/54154, or in other words, make sure
we get notified in a timely manner if gdb's XML support disappears
again.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/gdb/t_regress.sh

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

Modified files:

Index: src/tests/usr.bin/gdb/t_regress.sh
diff -u src/tests/usr.bin/gdb/t_regress.sh:1.1 src/tests/usr.bin/gdb/t_regress.sh:1.2
--- src/tests/usr.bin/gdb/t_regress.sh:1.1	Fri Apr  8 10:09:16 2016
+++ src/tests/usr.bin/gdb/t_regress.sh	Fri Jun  7 19:05:15 2019
@@ -1,4 +1,4 @@
-# $NetBSD: t_regress.sh,v 1.1 2016/04/08 10:09:16 gson Exp $
+# $NetBSD: t_regress.sh,v 1.2 2019/06/07 19:05:15 gson Exp $
 #
 # Copyright (c) 2016 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -71,7 +71,28 @@ EOF
 	atf_check -s exit:1 -o ignore -e ignore grep "annot access memory" gdb.out
 }
 
+# PR 54154
+
+atf_test_case xml
+xml_head() {
+	atf_set "descr" "Test that gdb was built with XML support"
+	atf_set "require.progs" "gdb"
+}
+xml_body() {
+	cat <<\EOF >target.xml
+
+  i386:x86-64
+
+EOF
+	cat gdb.out 2>&1
+	atf_check -s exit:1 -o ignore -e ignore grep "Can not parse XML" gdb.out
+}
+
 atf_init_test_cases() {
 	atf_add_test_case threads
 	atf_add_test_case pie
+	atf_add_test_case xml
 }



CVS commit: src/tests/net/if_bridge

2019-05-31 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri May 31 15:36:10 UTC 2019

Modified Files:
src/tests/net/if_bridge: t_rtable.sh

Log Message:
Increase the timeout for the manyaddrs test case; the default is often
insufficient under qemu.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/net/if_bridge/t_rtable.sh

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



CVS commit: src/tests/net/if_bridge

2019-05-31 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Fri May 31 15:36:10 UTC 2019

Modified Files:
src/tests/net/if_bridge: t_rtable.sh

Log Message:
Increase the timeout for the manyaddrs test case; the default is often
insufficient under qemu.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/net/if_bridge/t_rtable.sh

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

Modified files:

Index: src/tests/net/if_bridge/t_rtable.sh
diff -u src/tests/net/if_bridge/t_rtable.sh:1.4 src/tests/net/if_bridge/t_rtable.sh:1.5
--- src/tests/net/if_bridge/t_rtable.sh:1.4	Fri Nov  9 06:45:03 2018
+++ src/tests/net/if_bridge/t_rtable.sh	Fri May 31 15:36:10 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: t_rtable.sh,v 1.4 2018/11/09 06:45:03 ozaki-r Exp $
+#	$NetBSD: t_rtable.sh,v 1.5 2019/05/31 15:36:10 gson Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -447,6 +447,7 @@ bridge_rtable_manyaddrs_head()
 
 	atf_set "descr" "Tests brconfig addr under many MAC addresses"
 	atf_set "require.progs" "rump_server"
+	atf_set "timeout" "1200"
 }
 
 bridge_rtable_manyaddrs_body()



Re: audio2

2019-05-29 Thread Andreas Gustafsson
Valery Ushakov wrote:
> Now, you omit the most critical bit: what would you name the thing? :)
> From "the proper way to do audio scaling" I infer that AUDIO_SCALEDOWN
> (or however that was spelled) should be ok, shouldn't it?

I'm not fussy about the naming, just about the math :)  AUDIO_SCALEDOWN
works for me, but I'm open to alternatives.
-- 
Andreas Gustafsson, g...@gson.org


Re: audio2

2019-05-28 Thread Andreas Gustafsson
On May 23, Valery Ushakov wrote:
> This feels inverted.  The mathematically correct operation required
> here is symmetric division (that rounds towards zero). 

Rounding towards zero is absolutely the wrong thing to do for audio,
because it introduces a discontinuity, which in turn causes
unnecessary distortion of the audio.

For example, if your original signal is a linear ramp

  ... -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5 ...

and you divide it by two rounding towards zero, you get

  ... -2, -2, -1, -1, 0, 0, 0, 1, 1, 2, 2 ...

where every value is repeated twice, except that the value zero occurs
three times, so the ramp is no longer linear - it now has a visible
and audible kink in the middle.  And this kink is in the worst
possible place of the amplitude scale, at zero where it will affect
even the weakest signals, distorting every zero crossing.

The proper way to do audio scaling is using dither, but failing that,
at least the values should be consistently rounded either up or down,
which will at worst introduce a small DC offset which you can't hear,
but no crossover distortion.
-- 
Andreas Gustafsson, g...@gson.org


CVS commit: src/usr.sbin/sysinst/arch/hppa

2019-05-28 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue May 28 13:24:25 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/hppa: md.c

Log Message:
Clear the screen after running installboot.  If we don't, there will
be a leftover line saying "Status: Finished" at the top of subsequent
screens, and the message "Hit enter to continue" will be redrawn after
the set selection is complete, which confuses literal-minded robotic
users such as anita.  Fix copied from landisk.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/arch/hppa/md.c

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

Modified files:

Index: src/usr.sbin/sysinst/arch/hppa/md.c
diff -u src/usr.sbin/sysinst/arch/hppa/md.c:1.3 src/usr.sbin/sysinst/arch/hppa/md.c:1.4
--- src/usr.sbin/sysinst/arch/hppa/md.c:1.3	Fri May 18 12:23:22 2018
+++ src/usr.sbin/sysinst/arch/hppa/md.c	Tue May 28 13:24:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: md.c,v 1.3 2018/05/18 12:23:22 joerg Exp $	*/
+/*	$NetBSD: md.c,v 1.4 2019/05/28 13:24:25 gson Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -184,7 +184,7 @@ md_post_newfs(void)
 
 	/* boot blocks ... */
 	msg_display(MSG_dobootblks, pm->diskdev);
-	if (run_program(RUN_DISPLAY | RUN_NO_CLEAR,
+	if (run_program(RUN_DISPLAY,
 	"/usr/sbin/installboot -v /dev/r%sc /usr/mdec/xxboot",
 	pm->diskdev))
 		process_menu(MENU_ok,



CVS commit: src/usr.sbin/sysinst/arch/hppa

2019-05-28 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Tue May 28 13:24:25 UTC 2019

Modified Files:
src/usr.sbin/sysinst/arch/hppa: md.c

Log Message:
Clear the screen after running installboot.  If we don't, there will
be a leftover line saying "Status: Finished" at the top of subsequent
screens, and the message "Hit enter to continue" will be redrawn after
the set selection is complete, which confuses literal-minded robotic
users such as anita.  Fix copied from landisk.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/sysinst/arch/hppa/md.c

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



Re: CVS commit: src/lib/libwrap

2019-01-11 Thread Andreas Gustafsson
Christos,

I think libwrap/diag.c 1.15 will read random memory if either the tag
or tcpd_context.file contains "%s".  It's similar to 1.9 but lacks the
code in 1.9 to escape the percent signs (using fixed-length
buffers...).  Kludgy as it was, 1.13 seems like the least bad version
so far.
-- 
Andreas Gustafsson, g...@netbsd.org


Re: CVS commit: src/external/cddl/osnet/usr.sbin/dtrace

2016-02-05 Thread Andreas Gustafsson
Roy,

You committed:
> Log Message:
> dtrace needs Wno-format-security for clang it seems.
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.6 -r1.7 src/external/cddl/osnet/usr.sbin/dtrace/Makefile

This looks wrong to me - the warnings are pointing out actual bugs
that need to be fixed instead of just silencing the warnings.  For
example, here:

/tmp/bracket/build/2016.02.04.20.05.53-i386/src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c:822:2:
 error: format not a string literal and no format arguments 
[-Werror=format-security]
  error(data->dteda_msg);
  ^

if the error message in data->dteda_msg happens to contain a percent
sign followed by the letter "s", there will be a segfault.

The following works for me (building with gcc):

Index: dist/cmd/dtrace/dtrace.c
===
RCS file: /bracket/repo/src/external/cddl/osnet/dist/cmd/dtrace/dtrace.c,v
retrieving revision 1.6
diff -u -r1.6 dtrace.c
--- dist/cmd/dtrace/dtrace.c4 Feb 2016 20:05:53 -   1.6
+++ dist/cmd/dtrace/dtrace.c5 Feb 2016 08:29:14 -
@@ -819,7 +819,7 @@
 static int
 errhandler(const dtrace_errdata_t *data, void *arg)
 {
-   error(data->dteda_msg);
+   error("%s", data->dteda_msg);
return (DTRACE_HANDLE_OK);
 }
 
@@ -827,7 +827,7 @@
 static int
 drophandler(const dtrace_dropdata_t *data, void *arg)
 {
-   error(data->dtdda_msg);
+   error("%s", data->dtdda_msg);
return (DTRACE_HANDLE_OK);
 }
 
Index: usr.sbin/dtrace/Makefile
===
RCS file: /bracket/repo/src/external/cddl/osnet/usr.sbin/dtrace/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- usr.sbin/dtrace/Makefile4 Feb 2016 21:26:48 -   1.8
+++ usr.sbin/dtrace/Makefile5 Feb 2016 08:30:07 -
@@ -30,8 +30,6 @@
 
 COPTS.dtrace.c += -Wno-stack-protector
 COPTS.dtrace.c += -Wno-format-extra-args
-COPTS.dtrace.c += -Wno-format-nonliteral
-COPTS.dtrace.c += -Wno-format-security
 
 LDFLAGS+=  -pthread
 
-- 
Andreas Gustafsson, g...@gson.org


Re: CVS commit: src/sys/kern

2014-03-05 Thread Andreas Gustafsson
Earlier today, I wrote:
> 1. I object to the earlier change of the following sysctl variables

Jeff Rizzo asked me to take this to tech-kern.  Follow-ups there, please.
-- 
Andreas Gustafsson, g...@netbsd.org


Re: CVS commit: src/sys/kern

2014-03-05 Thread Andreas Gustafsson
On Feb 27, David Laight said:
> Module Name:  src
> Committed By: dsl
> Date: Thu Feb 27 22:50:52 UTC 2014
> 
> Modified Files:
>   src/sys/kern: kern_sysctl.c
> 
> Log Message:
> Allow CTLTYPE_INT and CTLTYPE_QUAD to be read and written as either 4 or 8
>   byte values regardless of the type.
> 64bit writes to 32bit variables must be valid (signed) values.
> 32bit reads of large values return -1.
> Amongst other things this should fix libm's code that reads machdep.sse
>   as a 32bit int, but I'd changed it to 64bit (to common up some code).
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.246 -r1.247 src/sys/kern/kern_sysctl.c

In private correspondence with David, I have objected to this commit
as well as his earlier change to the type of the machdep.sse
sysctl variable.

Regrettably, David and I have not been able to reach an agreement, and
he has requested that I ask for opinions on a public list.  So...

1. I object to the earlier change of the following sysctl variables
from type CTLTYPE_INT to type CTLTYPE_QUAD:

machdep.fpu_present
machdep.osfxsr
machdep.sse
machdep.sse2
machdep.biosbasemem
machdep.biosextmem

My understanding of David's rationale for changing them is that it
facilitated sharing code with the machdep.xsave_features variable
which actually needs to be of type CTLTYPE_QUAD.  By my reckoning, 
the savings from this code sharing amount to eight lines of code.

Changing the types of existing sysctl variables breaks both source 
and binary compatibility and should not be done lightly; that's
why we have both both hw.physmem and hw.physmem64, for example.
Now, the types of multiple variables have been incompatibly changed
for no reason other than saving a few lines of code.

I believe the harm caused by the incompatible type change far
outweighs the cost of a few added lines of code, and would like 
the original types to be restored.  I am attaching a patch to do so;
it also changes the newly added variables machdep.fpu_save and
machdep.fpu_save_size to CTLTYPE_INT, but if David really thinks
those should be CTLTYPE_QUAD, I will not argue that point.


2. I also object to the change of kern_syctl.c 1.247.

This change attempts to work around the problems caused by the changes
to the variable types by making sysctl() return different types
depending on the value of the *oldlenp argument.

IMO, this is a bad idea.  The *oldlenp argument does *not* specify the
size of the data type expected by the caller, but rather the size of a
buffer.  The sysctl() API allows the caller to pass a buffer larger
than the variable being read, and conversely, guarantees that passing
a buffer that is too small results in ENOMEM.

Both of these aspects of the API are now broken: reading a 4-byte
CTLTYPE_INT variable now works for any buffer size >= 4 *except* 8,
and attempting to read an 8-byte CTLTYPE_QUAD variable into a buffer
of less than 8 bytes is now guaranteed to yield ENOMEM *except* if the
buffer size happens to be 4.  IMO, this behavior violates both the
letter of the sysctl() man page and the principle of least astonishment.

Also, the work-around is ineffective in the case of a caller that
allocates the buffer dynamically using the size given by an initial
sysctl() call with oldp = NULL.

If the original types of the sysctl variables are restored, this
work-around will no longer serve a purpose, and I'm asking for it
to be removed.

Opinions?
-- 
Andreas Gustafsson, g...@netbsd.org

Index: x86_machdep.c
===
RCS file: /cvsroot/src/sys/arch/x86/x86/x86_machdep.c,v
retrieving revision 1.63
diff -u -r1.63 x86_machdep.c
--- x86_machdep.c   23 Feb 2014 22:38:40 -  1.63
+++ x86_machdep.c   3 Mar 2014 18:41:06 -
@@ -1056,7 +1056,17 @@
 }
 
 static void
-const_sysctl(struct sysctllog **clog, const char *name, u_quad_t value, int 
tag)
+const_sysctl_int(struct sysctllog **clog, const char *name, int value, int tag)
+{
+   sysctl_createv(clog, 0, NULL, NULL,
+  CTLFLAG_PERMANENT | CTLFLAG_IMMEDIATE,
+  CTLTYPE_INT, name, NULL,
+  NULL, (u_quad_t)value, NULL, 0,
+  CTL_MACHDEP, tag, CTL_EOL);
+}
+
+static void
+const_sysctl_quad(struct sysctllog **clog, const char *name, u_quad_t value, 
int tag)
 {
sysctl_createv(clog, 0, NULL, NULL,
   CTLFLAG_PERMANENT | CTLFLAG_IMMEDIATE,
@@ -1115,17 +1125,17 @@
   CTL_MACHDEP, CTL_CREATE, CTL_EOL);
 
/* None of these can ever change once the system has booted */
-   const_sysctl(clog, "fpu_present", i386_fpu_present, CPU_FPU_PRESENT);
-   const_sysctl(clog, "osfxsr", i386_use_fxsave, CPU_OSFXSR);
-   const_sysctl(clog, "sse", i386_has_sse, CPU_SSE);
-   const_

Re: CVS commit: src

2014-01-06 Thread Andreas Gustafsson
Jukka Ruohonen wrote:
> +/* XXX the daemon2_* functions should be in a library */
> +
> +int __deamon2_detach_pipe[2];
> +
> [...]
> 
> Why not daemon(3)?

I'm working on a replacement for daemon(3) as a way of fixing PR
48282, and this seemed like a good way to give the code a workout
before giving it wider exposure in a place like libc.

This particular daemon is simple enough that it probably could have
used daemon(3) without problems, but I'm aiming for a general solution
that will work even for daemons that use threads or kqueues.  Those
cause problems with daemon(3) because they aren't inherited across a
fork, which forces you to daemonize early, which in turn leads to race
conditions as the parent process continues before the daemon is ready
to provide service.
-- 
Andreas Gustafsson, g...@netbsd.org


Re: Usermode commit broke i386 build

2012-07-04 Thread Andreas Gustafsson
Paul Goyette wrote:
> My test-bed does not run any i386 builds.  I do only amd64-on-amd64-host

Right, but the TNF testbed also does amd64-on-amd64-host builds,
and unlike yours, they are failing.
-- 
Andreas Gustafsson, g...@gson.org


  1   2   >