CVS commit: src/share/misc

2023-03-31 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Sat Apr  1 00:59:11 UTC 2023

Modified Files:
src/share/misc: acronyms.comp

Log Message:
+PIR (private information retrieval)


To generate a diff of this commit:
cvs rdiff -u -r1.349 -r1.350 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.349 src/share/misc/acronyms.comp:1.350
--- src/share/misc/acronyms.comp:1.349	Thu Mar 23 18:22:15 2023
+++ src/share/misc/acronyms.comp	Sat Apr  1 00:59:10 2023
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.349 2023/03/23 18:22:15 jschauma Exp $
+$NetBSD: acronyms.comp,v 1.350 2023/04/01 00:59:10 jschauma Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -1235,6 +1235,7 @@ PIM	personal information manager
 PIM	platform-independent model
 PIO	programmed input/output
 PIPT	physically indexed, physically tagged
+PIR	private information retrieval
 PIQ	prefetch input queue
 PIT	programmable interrupt timer
 PIV	personal identity verification



CVS commit: src/share/misc

2023-03-31 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Sat Apr  1 00:59:11 UTC 2023

Modified Files:
src/share/misc: acronyms.comp

Log Message:
+PIR (private information retrieval)


To generate a diff of this commit:
cvs rdiff -u -r1.349 -r1.350 src/share/misc/acronyms.comp

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



CVS commit: src/sys/dev/virtio

2023-03-31 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Mar 31 23:34:23 UTC 2023

Modified Files:
src/sys/dev/virtio: virtio_mmio.c

Log Message:
Fix wrong variable names

This fixes build errors in virtio_mmio.c


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/virtio/virtio_mmio.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/virtio/virtio_mmio.c
diff -u src/sys/dev/virtio/virtio_mmio.c:1.8 src/sys/dev/virtio/virtio_mmio.c:1.9
--- src/sys/dev/virtio/virtio_mmio.c:1.8	Fri Mar 31 07:34:26 2023
+++ src/sys/dev/virtio/virtio_mmio.c	Fri Mar 31 23:34:23 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio_mmio.c,v 1.8 2023/03/31 07:34:26 yamaguchi Exp $	*/
+/*	$NetBSD: virtio_mmio.c,v 1.9 2023/03/31 23:34:23 yamaguchi Exp $	*/
 /*	$OpenBSD: virtio_mmio.c,v 1.2 2017/02/24 17:12:31 patrick Exp $	*/
 
 /*
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio_mmio.c,v 1.8 2023/03/31 07:34:26 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_mmio.c,v 1.9 2023/03/31 23:34:23 yamaguchi Exp $");
 
 #include 
 #include 
@@ -213,11 +213,11 @@ virtio_mmio_common_detach(struct virtio_
 	struct virtio_softc *vsc = >sc_sc;
 	int r;
 
-	r = config_detach_children(self, flags);
+	r = config_detach_children(vsc->sc_dev, flags);
 	if (r != 0)
 		return r;
 
-	KASSERT(ISSET(sc->sc_child_flags, VIRTIO_CHILD_DETACHED));
+	KASSERT(ISSET(vsc->sc_child_flags, VIRTIO_CHILD_DETACHED));
 	KASSERT(vsc->sc_vqs == NULL);
 	KASSERT(sc->sc_ih == NULL);
 



CVS commit: src/sys/dev/virtio

2023-03-31 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Mar 31 23:34:23 UTC 2023

Modified Files:
src/sys/dev/virtio: virtio_mmio.c

Log Message:
Fix wrong variable names

This fixes build errors in virtio_mmio.c


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

2023-03-31 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Mar 31 19:22:56 UTC 2023

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

Log Message:
mbuf(9): Sprinkle KASSERTMSG.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 src/sys/kern/uipc_mbuf.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/uipc_mbuf.c
diff -u src/sys/kern/uipc_mbuf.c:1.248 src/sys/kern/uipc_mbuf.c:1.249
--- src/sys/kern/uipc_mbuf.c:1.248	Fri Feb 24 11:02:27 2023
+++ src/sys/kern/uipc_mbuf.c	Fri Mar 31 19:22:56 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.248 2023/02/24 11:02:27 riastradh Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.249 2023/03/31 19:22:56 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1999, 2001, 2018 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.248 2023/02/24 11:02:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.249 2023/03/31 19:22:56 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -539,7 +539,11 @@ m_get(int how, int type)
 	how == M_WAIT ? PR_WAITOK|PR_LIMITFAIL : PR_NOWAIT);
 	if (m == NULL)
 		return NULL;
-	KASSERT(((vaddr_t)m->m_dat & PAGE_MASK) + MLEN <= PAGE_SIZE);
+	KASSERTMSG(((vaddr_t)m->m_dat & PAGE_MASK) + MLEN <= PAGE_SIZE,
+	"m=%p m->m_dat=0x%p"
+	" MLEN=%u PAGE_MASK=0x%x PAGE_SIZE=%u",
+	m, m->m_dat,
+	(unsigned)MLEN, (unsigned)PAGE_MASK, (unsigned)PAGE_SIZE);
 
 	mbstat_type_add(type, 1);
 
@@ -593,8 +597,12 @@ m_clget(struct mbuf *m, int how)
 	if (m->m_ext_storage.ext_buf == NULL)
 		return;
 
-	KASSERT(((vaddr_t)m->m_ext_storage.ext_buf & PAGE_MASK) + mclbytes
-	<= PAGE_SIZE);
+	KASSERTMSGvaddr_t)m->m_ext_storage.ext_buf & PAGE_MASK) + mclbytes
+		<= PAGE_SIZE),
+	"m=%p m->m_ext_storage.ext_buf=0x%p"
+	" mclbytes=%u PAGE_MASK=0x%x PAGE_SIZE=%u",
+	m, m->m_dat,
+	(unsigned)mclbytes, (unsigned)PAGE_MASK, (unsigned)PAGE_SIZE);
 
 	MCLINITREFERENCE(m);
 	m->m_data = m->m_ext.ext_buf;
@@ -691,6 +699,8 @@ m_copylen(int len, int copylen)
 static struct mbuf *
 m_copy_internal(struct mbuf *m, int off0, int len, int wait, bool deep)
 {
+	struct mbuf *m0 __diagused = m;
+	int len0 __diagused = len;
 	struct mbuf *n, **np;
 	int off = off0;
 	struct mbuf *top;
@@ -761,7 +771,9 @@ m_copy_internal(struct mbuf *m, int off0
 			len -= n->m_len;
 		off += n->m_len;
 
-		KASSERT(off <= m->m_len);
+		KASSERTMSG(off <= m->m_len,
+		"m=%p m->m_len=%d off=%d len=%d m0=%p off0=%d len0=%d",
+		m, m->m_len, off, len, m0, off0, len0);
 
 		if (off == m->m_len) {
 			m = m->m_next;
@@ -1117,7 +1129,8 @@ m_pulldown(struct mbuf *m, int off, int 
 			m_freem(m);
 			return NULL;	/* ENOBUFS */
 		}
-		KASSERT(o->m_len >= len);
+		KASSERTMSG(o->m_len >= len, "o=%p o->m_len=%d len=%d",
+		o, o->m_len, len);
 		for (mlast = o; mlast->m_next != NULL; mlast = mlast->m_next)
 			;
 		n->m_len = off;
@@ -1706,7 +1719,9 @@ m_defrag(struct mbuf *m, int how)
 			m0 = m_get(how, MT_DATA);
 			if (m0 == NULL)
 return NULL;
-			KASSERT(m->m_len <= MHLEN);
+			KASSERTMSG(m->m_len <= MHLEN,
+			"m=%p m->m_len=%d MHLEN=%u",
+			m, m->m_len, (unsigned)MHLEN);
 			m_copydata(m, 0, m->m_len, mtod(m0, void *));
 
 			MCLGET(m, how);
@@ -1717,7 +1732,10 @@ m_defrag(struct mbuf *m, int how)
 			memcpy(m->m_data, mtod(m0, void *), m->m_len);
 			m_free(m0);
 		}
-		KASSERT(M_TRAILINGSPACE(m) >= (m->m_pkthdr.len - m->m_len));
+		KASSERTMSG(M_TRAILINGSPACE(m) >= (m->m_pkthdr.len - m->m_len),
+		"m=%p M_TRAILINGSPACE(m)=%zd m->m_pkthdr.len=%d"
+		" m->m_len=%d",
+		m, M_TRAILINGSPACE(m), m->m_pkthdr.len, m->m_len);
 		m_copydata(m->m_next, 0, m->m_pkthdr.len - m->m_len,
 			mtod(m, char *) + m->m_len);
 		m->m_len = m->m_pkthdr.len;
@@ -1820,11 +1838,12 @@ m_align(struct mbuf *m, int len)
 	int buflen, adjust;
 
 	KASSERT(len != M_COPYALL);
-	KASSERT(M_LEADINGSPACE(m) == 0);
+	KASSERTMSG(M_LEADINGSPACE(m) == 0, "m=%p M_LEADINGSPACE(m)=%zd",
+	m, M_LEADINGSPACE(m));
 
 	buflen = M_BUFSIZE(m);
 
-	KASSERT(len <= buflen);
+	KASSERTMSG(len <= buflen, "m=%p len=%d buflen=%d", m, len, buflen);
 	adjust = buflen - len;
 	m->m_data += adjust &~ (sizeof(long)-1);
 }



CVS commit: src/sys/kern

2023-03-31 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Mar 31 19:22:56 UTC 2023

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

Log Message:
mbuf(9): Sprinkle KASSERTMSG.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 src/sys/kern/uipc_mbuf.c

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



CVS commit: src/doc

2023-03-31 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Mar 31 19:10:12 UTC 2023

Modified Files:
src/doc: CHANGES

Log Message:
Correct the previous (change both "2023b" -> "2023c" not just one in the
dup & correct).


To generate a diff of this commit:
cvs rdiff -u -r1.2957 -r1.2958 src/doc/CHANGES

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



CVS commit: src/doc

2023-03-31 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Mar 31 19:10:12 UTC 2023

Modified Files:
src/doc: CHANGES

Log Message:
Correct the previous (change both "2023b" -> "2023c" not just one in the
dup & correct).


To generate a diff of this commit:
cvs rdiff -u -r1.2957 -r1.2958 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2957 src/doc/CHANGES:1.2958
--- src/doc/CHANGES:1.2957	Fri Mar 31 19:09:08 2023
+++ src/doc/CHANGES	Fri Mar 31 19:10:11 2023
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2957 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2958 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -64,4 +64,4 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 		Issue 8 requirements. [kre 20230306]
 	tzdata: updated to 2023a (using the 2023agtz fork) [kre 20230323]
 	tzdata: updated to 2023b (using the 2023bgtz fork) [kre 20230324]
-	tzdata: updated to 2023c (using the 2023bgtz fork) [kre 20230331]
+	tzdata: updated to 2023c (using the 2023cgtz fork) [kre 20230331]



CVS commit: src/doc

2023-03-31 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Mar 31 19:09:08 UTC 2023

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
tzdata updated to 2023c (2023cgtz).


To generate a diff of this commit:
cvs rdiff -u -r1.1918 -r1.1919 src/doc/3RDPARTY
cvs rdiff -u -r1.2956 -r1.2957 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1918 src/doc/3RDPARTY:1.1919
--- src/doc/3RDPARTY:1.1918	Fri Mar 24 12:43:33 2023
+++ src/doc/3RDPARTY	Fri Mar 31 19:09:08 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1918 2023/03/24 12:43:33 kre Exp $
+#	$NetBSD: 3RDPARTY,v 1.1919 2023/03/31 19:09:08 kre Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1424,8 +1424,8 @@ Location:	external/bsd/tradcpp
 Notes:
 
 Package:	tz
-Version:	tzcode2022g / tzdata2023bgtz
-Current Vers:	tzcode2023b / tzdata2023b
+Version:	tzcode2022g / tzdata2023cgtz
+Current Vers:	tzcode2023c / tzdata2023c
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/
 Archive Site:	ftp://munnari.oz.au/pub/oldtz/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2956 src/doc/CHANGES:1.2957
--- src/doc/CHANGES:1.2956	Fri Mar 24 12:43:33 2023
+++ src/doc/CHANGES	Fri Mar 31 19:09:08 2023
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2956 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2957 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -64,3 +64,4 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 		Issue 8 requirements. [kre 20230306]
 	tzdata: updated to 2023a (using the 2023agtz fork) [kre 20230323]
 	tzdata: updated to 2023b (using the 2023bgtz fork) [kre 20230324]
+	tzdata: updated to 2023c (using the 2023bgtz fork) [kre 20230331]



CVS commit: src/doc

2023-03-31 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Mar 31 19:09:08 UTC 2023

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
tzdata updated to 2023c (2023cgtz).


To generate a diff of this commit:
cvs rdiff -u -r1.1918 -r1.1919 src/doc/3RDPARTY
cvs rdiff -u -r1.2956 -r1.2957 src/doc/CHANGES

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



CVS commit: src/external/public-domain/tz/dist

2023-03-31 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Mar 31 19:05:28 UTC 2023

Modified Files:
src/external/public-domain/tz/dist: TZDATA_VERSION asia version

Log Message:
Merge tzdata2023c


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/external/public-domain/tz/dist/TZDATA_VERSION
cvs rdiff -u -r1.9 -r1.10 src/external/public-domain/tz/dist/asia \
src/external/public-domain/tz/dist/version

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

Modified files:

Index: src/external/public-domain/tz/dist/TZDATA_VERSION
diff -u src/external/public-domain/tz/dist/TZDATA_VERSION:1.34 src/external/public-domain/tz/dist/TZDATA_VERSION:1.35
--- src/external/public-domain/tz/dist/TZDATA_VERSION:1.34	Fri Mar 24 12:41:48 2023
+++ src/external/public-domain/tz/dist/TZDATA_VERSION	Fri Mar 31 19:05:28 2023
@@ -1 +1 @@
-tzdata-2023bgtz
+tzdata-2023cgtz

Index: src/external/public-domain/tz/dist/asia
diff -u src/external/public-domain/tz/dist/asia:1.9 src/external/public-domain/tz/dist/asia:1.10
--- src/external/public-domain/tz/dist/asia:1.9	Fri Mar 24 12:46:08 2023
+++ src/external/public-domain/tz/dist/asia	Fri Mar 31 19:05:28 2023
@@ -2729,9 +2729,37 @@ Zone	Asia/Vientiane	6:50:24 -	LMT	1906 J
 # Lebanon
 #
 # From Saadallah Itani (2023-03-23):
-# Lebanon too announced today delay of Spring forward from March 25 to April 20.
-# From Paul Eggert (2023-03-23):
+# Lebanon ... announced today delay of Spring forward from March 25 to April 20.
+#
+# From Paul Eggert (2023-03-27):
+# This announcement was by the Lebanese caretaker prime minister Najib Mikati.
 # https://www.mtv.com.lb/en/News/Local/1352516/lebanon-postpones-daylight-saving-time-adoption
+# A video was later leaked to the media of parliament speaker Nabih Berri
+# asking Mikati to postpone DST to aid observance of Ramadan, Mikati objecting
+# that this would cause problems such as scheduling airline flights, to which
+# Berri interjected, "What flights?"
+#
+# The change was controversial and led to a partly-sectarian divide.
+# Many Lebanese institutions, including the education ministry, the Maronite
+# church, and two news channels LCBI and MTV, ignored the announcement and
+# went ahead with the long-scheduled spring-forward on March 25/26, some
+# arguing that the prime minister had not followed the law because the change
+# had not been approved by the cabinet.  Google went with the announcement;
+# Apple ignored it.  At least one bank followed the announcement for its doors,
+# but ignored the announcement in internal computer systems.
+# Beirut international airport listed two times for each departure.
+# Dan Azzi wrote "My view is that this whole thing is a Dumb and Dumber movie."
+# Eventually the prime minister backed down, said the cabinet had decided to
+# stick with its 1998 decision, and that DST would begin midnight March 29/30.
+# https://www.nna-leb.gov.lb/en/miscellaneous/604093/lebanon-has-two-times-of-day-amid-daylight-savings
+# https://www.cnbc.com/2023/03/27/lebanon-in-two-different-time-zones-as-government-disagrees-on-daylight-savings.html
+#
+# Although we could model the chaos with two Zones, that would likely cause
+# more trouble than it would cure.  Since so many manual clocks and
+# computer-based timestamps ignored the announcement, stick with official
+# cabinet resolutions in the data while recording the prime minister's
+# announcement as a comment.  This is how we treated a similar situation in
+# Rio de Janeiro in spring 1993.
 #
 # Rule	NAME	FROM	TO	-	IN	ON	AT	SAVE	LETTER/S
 Rule	Lebanon	1920	only	-	Mar	28	0:00	1:00	S
@@ -2755,11 +2783,13 @@ Rule	Lebanon	1988	only	-	Jun	1	0:00	1:00
 Rule	Lebanon	1989	only	-	May	10	0:00	1:00	S
 Rule	Lebanon	1990	1992	-	May	1	0:00	1:00	S
 Rule	Lebanon	1992	only	-	Oct	4	0:00	0	-
-Rule	Lebanon	1993	2022	-	Mar	lastSun	0:00	1:00	S
+Rule	Lebanon	1993	max	-	Mar	lastSun	0:00	1:00	S
 Rule	Lebanon	1993	1998	-	Sep	lastSun	0:00	0	-
 Rule	Lebanon	1999	max	-	Oct	lastSun	0:00	0	-
-Rule	Lebanon	2023	only	-	Apr	21	0:00	1:00	S
-Rule	Lebanon	2024	max	-	Mar	lastSun	0:00	1:00	S
+# This one-time rule, announced by the prime minister first for April 21
+# then for March 30, is commented out for reasons described above.
+#Rule	Lebanon	2023	only	-	Mar	30	0:00	1:00	S
+
 # Zone	NAME		STDOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Beirut	2:22:00 -	LMT	1880
 			2:00	Lebanon	EE%sT
Index: src/external/public-domain/tz/dist/version
diff -u src/external/public-domain/tz/dist/version:1.9 src/external/public-domain/tz/dist/version:1.10
--- src/external/public-domain/tz/dist/version:1.9	Fri Mar 24 12:46:08 2023
+++ src/external/public-domain/tz/dist/version	Fri Mar 31 19:05:28 2023
@@ -1 +1 @@
-2023bgtz
+2023cgtz



CVS commit: src/external/public-domain/tz/dist

2023-03-31 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Mar 31 19:05:28 UTC 2023

Modified Files:
src/external/public-domain/tz/dist: TZDATA_VERSION asia version

Log Message:
Merge tzdata2023c


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/external/public-domain/tz/dist/TZDATA_VERSION
cvs rdiff -u -r1.9 -r1.10 src/external/public-domain/tz/dist/asia \
src/external/public-domain/tz/dist/version

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



CVS import: src/external/public-domain/tz/dist

2023-03-31 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Mar 31 19:03:22 UTC 2023

Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv22907

Log Message:
Import tzdata2023c from 
https://github.com/JodaOrg/global-tz/releases/download/2023cgtz/tzdata2023cgtz.tar.gz

Summary of changes in tzdata2023c (2023-03-28 12:42:14 -0700):

   This essentially reverts the 2023b update, as the proposed delay
   of the start of summer time in Lebanon didn't end up happening as
   intended.   What did happen was apparently chaos ... the official
   start of summer time was still delayed, but only until last Wednesday
   night (between 2023-03-29 and 2029-03-30) - which has already passed.

   Since it is unclear what local time was actually observed during
   the period between when summer time was originally planned to start
   (last Sat night, between 2023-03-25 and 2023-03-26) and when it
   officially did, for now, this update simply reverts to the original
   start time (2023-03-26 00:00:00 local).   Should that turn out to
   be sub-optimal, a later update can correct it.   Only timestamps
   for the period between 2023-03-26 00:00:00 and 2023-03-30 00:00:00
   are affected.

Status:

Vendor Tag: TZDATA
Release Tags:   TZDATA2023CGTZ

U src/external/public-domain/tz/dist/calendars
U src/external/public-domain/tz/dist/CONTRIBUTING
U src/external/public-domain/tz/dist/LICENSE
U src/external/public-domain/tz/dist/Makefile
U src/external/public-domain/tz/dist/NEWS
U src/external/public-domain/tz/dist/README
U src/external/public-domain/tz/dist/SECURITY
U src/external/public-domain/tz/dist/theory.html
C src/external/public-domain/tz/dist/version
U src/external/public-domain/tz/dist/africa
U src/external/public-domain/tz/dist/antarctica
C src/external/public-domain/tz/dist/asia
U src/external/public-domain/tz/dist/australasia
U src/external/public-domain/tz/dist/europe
U src/external/public-domain/tz/dist/northamerica
U src/external/public-domain/tz/dist/southamerica
U src/external/public-domain/tz/dist/etcetera
U src/external/public-domain/tz/dist/factory
U src/external/public-domain/tz/dist/backward
U src/external/public-domain/tz/dist/backzone
U src/external/public-domain/tz/dist/iso3166.tab
U src/external/public-domain/tz/dist/leap-seconds.list
U src/external/public-domain/tz/dist/leapseconds
U src/external/public-domain/tz/dist/zone1970.tab
U src/external/public-domain/tz/dist/zone.tab
U src/external/public-domain/tz/dist/checklinks.awk
U src/external/public-domain/tz/dist/checktab.awk
U src/external/public-domain/tz/dist/leapseconds.awk
U src/external/public-domain/tz/dist/ziguard.awk
U src/external/public-domain/tz/dist/zishrink.awk

2 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTZDATA:yesterday -jTZDATA 
src/external/public-domain/tz/dist



CVS import: src/external/public-domain/tz/dist

2023-03-31 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Mar 31 19:03:22 UTC 2023

Update of /cvsroot/src/external/public-domain/tz/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv22907

Log Message:
Import tzdata2023c from 
https://github.com/JodaOrg/global-tz/releases/download/2023cgtz/tzdata2023cgtz.tar.gz

Summary of changes in tzdata2023c (2023-03-28 12:42:14 -0700):

   This essentially reverts the 2023b update, as the proposed delay
   of the start of summer time in Lebanon didn't end up happening as
   intended.   What did happen was apparently chaos ... the official
   start of summer time was still delayed, but only until last Wednesday
   night (between 2023-03-29 and 2029-03-30) - which has already passed.

   Since it is unclear what local time was actually observed during
   the period between when summer time was originally planned to start
   (last Sat night, between 2023-03-25 and 2023-03-26) and when it
   officially did, for now, this update simply reverts to the original
   start time (2023-03-26 00:00:00 local).   Should that turn out to
   be sub-optimal, a later update can correct it.   Only timestamps
   for the period between 2023-03-26 00:00:00 and 2023-03-30 00:00:00
   are affected.

Status:

Vendor Tag: TZDATA
Release Tags:   TZDATA2023CGTZ

U src/external/public-domain/tz/dist/calendars
U src/external/public-domain/tz/dist/CONTRIBUTING
U src/external/public-domain/tz/dist/LICENSE
U src/external/public-domain/tz/dist/Makefile
U src/external/public-domain/tz/dist/NEWS
U src/external/public-domain/tz/dist/README
U src/external/public-domain/tz/dist/SECURITY
U src/external/public-domain/tz/dist/theory.html
C src/external/public-domain/tz/dist/version
U src/external/public-domain/tz/dist/africa
U src/external/public-domain/tz/dist/antarctica
C src/external/public-domain/tz/dist/asia
U src/external/public-domain/tz/dist/australasia
U src/external/public-domain/tz/dist/europe
U src/external/public-domain/tz/dist/northamerica
U src/external/public-domain/tz/dist/southamerica
U src/external/public-domain/tz/dist/etcetera
U src/external/public-domain/tz/dist/factory
U src/external/public-domain/tz/dist/backward
U src/external/public-domain/tz/dist/backzone
U src/external/public-domain/tz/dist/iso3166.tab
U src/external/public-domain/tz/dist/leap-seconds.list
U src/external/public-domain/tz/dist/leapseconds
U src/external/public-domain/tz/dist/zone1970.tab
U src/external/public-domain/tz/dist/zone.tab
U src/external/public-domain/tz/dist/checklinks.awk
U src/external/public-domain/tz/dist/checktab.awk
U src/external/public-domain/tz/dist/leapseconds.awk
U src/external/public-domain/tz/dist/ziguard.awk
U src/external/public-domain/tz/dist/zishrink.awk

2 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTZDATA:yesterday -jTZDATA 
src/external/public-domain/tz/dist



CVS commit: src/sys/dev

2023-03-31 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Mar 31 15:00:26 UTC 2023

Modified Files:
src/sys/dev: spkr.c

Log Message:
spkr(4): Avoid some overflow issues.

XXX pullup-8
XXX pullup-9
XXX pullup-10

Reported-by: syzbot+1a9980f3631bbd710...@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=ea851fc4688cbac29a567cb49a4fd24d9afff426

Reported-by: syzbot+b4655f9c1734f886d...@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=b61236df29f595e38b12ee533b7b3275c8ec1865


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/spkr.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/spkr.c
diff -u src/sys/dev/spkr.c:1.24 src/sys/dev/spkr.c:1.25
--- src/sys/dev/spkr.c:1.24	Sat Sep 24 23:16:37 2022
+++ src/sys/dev/spkr.c	Fri Mar 31 15:00:26 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: spkr.c,v 1.24 2022/09/24 23:16:37 thorpej Exp $	*/
+/*	$NetBSD: spkr.c,v 1.25 2023/03/31 15:00:26 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1990 Eric S. Raymond (e...@snark.thyrsus.com)
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.24 2022/09/24 23:16:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.25 2023/03/31 15:00:26 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "wsmux.h"
@@ -204,6 +204,7 @@ playtone(struct spkr_softc *sc, int note
 			rest(sc, total);
 		return;
 	}
+	KASSERTMSG(note < __arraycount(pitchtab), "note=%d", note);
 
 	/*
 	 * Rest 1/8 (if NORMAL) or 3/8 (if STACCATO) in tick.
@@ -233,6 +234,10 @@ playstring(struct spkr_softc *sc, const 
 
 #define GETNUM(cp, v)	\
 	for (v = 0; slen > 0 && isdigit((unsigned char)cp[1]); ) { \
+		if (v > INT_MAX/10 - (cp[1] - '0')) { \
+			v = INT_MAX; \
+			continue; \
+		} \
 		v = v * 10 + (*++cp - '0'); \
 		slen--; \
 	}
@@ -320,6 +325,8 @@ playstring(struct spkr_softc *sc, const 
 slen--;
 			} else {
 GETNUM(cp, sc->sc_octave);
+KASSERTMSG(sc->sc_octave >= 0, "%d",
+sc->sc_octave);
 if (sc->sc_octave >= NOCTAVES)
 	sc->sc_octave = DFLT_OCTAVE;
 sc->sc_octprefix = true;
@@ -340,6 +347,9 @@ playstring(struct spkr_softc *sc, const 
 
 		case 'N':
 			GETNUM(cp, pitch);
+			KASSERTMSG(pitch >= 0, "pitch=%d", pitch);
+			if (pitch >= __arraycount(pitchtab))
+break;
 			for (sustain = 0; slen > 0 && cp[1] == '.'; cp++) {
 slen--;
 sustain++;



CVS commit: src/sys/dev

2023-03-31 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Mar 31 15:00:26 UTC 2023

Modified Files:
src/sys/dev: spkr.c

Log Message:
spkr(4): Avoid some overflow issues.

XXX pullup-8
XXX pullup-9
XXX pullup-10

Reported-by: syzbot+1a9980f3631bbd710...@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=ea851fc4688cbac29a567cb49a4fd24d9afff426

Reported-by: syzbot+b4655f9c1734f886d...@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=b61236df29f595e38b12ee533b7b3275c8ec1865


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/spkr.c

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



CVS commit: src

2023-03-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Mar 31 13:03:05 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: queries.c
src/usr.bin/xlint/lint1: err.c lex.c

Log Message:
lint: allow querying for octal integer constants


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/queries.c
cvs rdiff -u -r1.191 -r1.192 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.154 -r1.155 src/usr.bin/xlint/lint1/lex.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/usr.bin/xlint/lint1/queries.c
diff -u src/tests/usr.bin/xlint/lint1/queries.c:1.10 src/tests/usr.bin/xlint/lint1/queries.c:1.11
--- src/tests/usr.bin/xlint/lint1/queries.c:1.10	Tue Mar 28 14:44:35 2023
+++ src/tests/usr.bin/xlint/lint1/queries.c	Fri Mar 31 13:03:05 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: queries.c,v 1.10 2023/03/28 14:44:35 rillig Exp $	*/
+/*	$NetBSD: queries.c,v 1.11 2023/03/31 13:03:05 rillig Exp $	*/
 # 3 "queries.c"
 
 /*
@@ -15,7 +15,7 @@
  * 	such as casts between arithmetic types.
  */
 
-/* lint1-extra-flags: -q 1,2,3,4,5,6,7 -X 351 */
+/* lint1-extra-flags: -q 1,2,3,4,5,6,7,8 -X 351 */
 
 typedef unsigned char u8_t;
 typedef unsigned short u16_t;
@@ -294,6 +294,21 @@ Q7(void)
 	vstr = (vstr_t)vstr;
 }
 
+/*
+ * Octal numbers were common in the 1970s, especially on 36-bit machines.
+ * 50 years later, they are still used in numeric file permissions.
+ */
+void
+Q8(void)
+{
+
+	u16 = 0;
+	u16 = 00;
+	/* expect+1: octal number '0644' [Q8] */
+	u16 = 0644;
+	/* expect+1: octal number '644' [Q8] */
+	u16 = 644;
+}
 
 /*
  * Since queries do not affect the exit status, force a warning to make this

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.191 src/usr.bin/xlint/lint1/err.c:1.192
--- src/usr.bin/xlint/lint1/err.c:1.191	Tue Mar 28 20:04:52 2023
+++ src/usr.bin/xlint/lint1/err.c	Fri Mar 31 13:03:05 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.191 2023/03/28 20:04:52 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.192 2023/03/31 13:03:05 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: err.c,v 1.191 2023/03/28 20:04:52 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.192 2023/03/31 13:03:05 rillig Exp $");
 #endif
 
 #include 
@@ -698,6 +698,7 @@ static const char *queries[] = {
 	"pointer addition has integer on the left-hand side",	  /* Q5 */
 	"no-op cast from '%s' to '%s'",  /* Q6 */
 	"redundant cast from '%s' to '%s' before assignment",	  /* Q7 */
+	"octal number '%.*s'",	  /* Q8 */
 };
 
 bool any_query_enabled;		/* for optimizing non-query scenarios */

Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.154 src/usr.bin/xlint/lint1/lex.c:1.155
--- src/usr.bin/xlint/lint1/lex.c:1.154	Sun Feb 19 12:00:15 2023
+++ src/usr.bin/xlint/lint1/lex.c	Fri Mar 31 13:03:05 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.154 2023/02/19 12:00:15 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.155 2023/03/31 13:03:05 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: lex.c,v 1.154 2023/02/19 12:00:15 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.155 2023/03/31 13:03:05 rillig Exp $");
 #endif
 
 #include 
@@ -514,6 +514,11 @@ lex_integer_constant(const char *yytext,
 		warned = true;
 	}
 
+	if (any_query_enabled && base == 8 && uq != 0) {
+		/* octal number '%.*s' */
+		query_message(8, (int)len, cp);
+	}
+
 	/*
 	 * If the value is too big for the current type, we must choose
 	 * another type.



CVS commit: src

2023-03-31 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Mar 31 13:03:05 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: queries.c
src/usr.bin/xlint/lint1: err.c lex.c

Log Message:
lint: allow querying for octal integer constants


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/queries.c
cvs rdiff -u -r1.191 -r1.192 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.154 -r1.155 src/usr.bin/xlint/lint1/lex.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

2023-03-31 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Mar 31 07:34:26 UTC 2023

Modified Files:
src/sys/dev/pci: virtio.c virtio_pci.c virtiovar.h
src/sys/dev/virtio: virtio_mmio.c

Log Message:
Added flags to store status of attaching a virtio device

This prevents a panic on reboot after a virtio device had called
virtio_child_attach_failed().


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/virtio.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/virtio_pci.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/virtiovar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/virtio/virtio_mmio.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/pci/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.73 src/sys/dev/pci/virtio.c:1.74
--- src/sys/dev/pci/virtio.c:1.73	Fri Mar 31 07:31:48 2023
+++ src/sys/dev/pci/virtio.c	Fri Mar 31 07:34:26 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.73 2023/03/31 07:31:48 yamaguchi Exp $	*/
+/*	$NetBSD: virtio.c,v 1.74 2023/03/31 07:34:26 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.73 2023/03/31 07:31:48 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.74 2023/03/31 07:34:26 yamaguchi Exp $");
 
 #include 
 #include 
@@ -1327,6 +1327,9 @@ virtio_child_attach_start(struct virtio_
 {
 	char buf[1024];
 
+	KASSERT(sc->sc_child == NULL);
+	KASSERT(!ISSET(sc->sc_child_flags, VIRTIO_CHILD_DETACHED));
+
 	sc->sc_child = child;
 	sc->sc_ipl = ipl;
 
@@ -1359,7 +1362,6 @@ virtio_child_attach_finish(struct virtio
 	}
 #endif
 
-	sc->sc_finished_called = true;
 
 	sc->sc_vqs = vqs;
 	sc->sc_nvqs = nvqs;
@@ -1402,6 +1404,7 @@ virtio_child_attach_finish(struct virtio
 		}
 	}
 
+	SET(sc->sc_child_flags, VIRTIO_CHILD_ATTACH_FINISHED);
 	virtio_set_status(sc, VIRTIO_CONFIG_DEVICE_STATUS_DRIVER_OK);
 	return 0;
 
@@ -1420,7 +1423,11 @@ fail:
 void
 virtio_child_detach(struct virtio_softc *sc)
 {
-	sc->sc_child = NULL;
+
+	/* already detached */
+	if (ISSET(sc->sc_child_flags, VIRTIO_CHILD_DETACHED))
+		return;
+
 	sc->sc_vqs = NULL;
 
 	virtio_device_reset(sc);
@@ -1431,6 +1438,8 @@ virtio_child_detach(struct virtio_softc 
 		softint_disestablish(sc->sc_soft_ih);
 		sc->sc_soft_ih = NULL;
 	}
+
+	SET(sc->sc_child_flags, VIRTIO_CHILD_DETACHED);
 }
 
 void
@@ -1440,7 +1449,7 @@ virtio_child_attach_failed(struct virtio
 
 	virtio_set_status(sc, VIRTIO_CONFIG_DEVICE_STATUS_FAILED);
 
-	sc->sc_child = VIRTIO_CHILD_FAILED;
+	SET(sc->sc_child_flags, VIRTIO_CHILD_ATTACH_FAILED);
 }
 
 bus_dma_tag_t
@@ -1476,19 +1485,19 @@ virtio_attach_failed(struct virtio_softc
 	if (sc->sc_childdevid == 0)
 		return 1;
 
-	if (sc->sc_child == NULL) {
-		aprint_error_dev(self,
-		"no matching child driver; not configured\n");
+	if (ISSET(sc->sc_child_flags, VIRTIO_CHILD_ATTACH_FAILED)) {
+		aprint_error_dev(self, "virtio configuration failed\n");
 		return 1;
 	}
 
-	if (sc->sc_child == VIRTIO_CHILD_FAILED) {
-		aprint_error_dev(self, "virtio configuration failed\n");
+	if (sc->sc_child == NULL) {
+		aprint_error_dev(self,
+		"no matching child driver; not configured\n");
 		return 1;
 	}
 
 	/* sanity check */
-	if (!sc->sc_finished_called) {
+	if (!ISSET(sc->sc_child_flags, VIRTIO_CHILD_ATTACH_FINISHED)) {
 		aprint_error_dev(self, "virtio internal error, child driver "
 		"signaled OK but didn't initialize interrupts\n");
 		return 1;

Index: src/sys/dev/pci/virtio_pci.c
diff -u src/sys/dev/pci/virtio_pci.c:1.39 src/sys/dev/pci/virtio_pci.c:1.40
--- src/sys/dev/pci/virtio_pci.c:1.39	Thu Mar 23 03:27:48 2023
+++ src/sys/dev/pci/virtio_pci.c	Fri Mar 31 07:34:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_pci.c,v 1.39 2023/03/23 03:27:48 yamaguchi Exp $ */
+/* $NetBSD: virtio_pci.c,v 1.40 2023/03/31 07:34:26 yamaguchi Exp $ */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.39 2023/03/23 03:27:48 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_pci.c,v 1.40 2023/03/31 07:34:26 yamaguchi Exp $");
 
 #include 
 #include 
@@ -329,14 +329,12 @@ virtio_pci_detach(device_t self, int fla
 	struct virtio_softc * const sc = >sc_sc;
 	int r;
 
-	if (sc->sc_child != NULL) {
-		r = config_detach(sc->sc_child, flags);
-		if (r)
-			return r;
-	}
+	r = config_detach_children(self, flags);
+	if (r != 0)
+		return r;
 
 	/* Check that child detached properly */
-	KASSERT(sc->sc_child == NULL);
+	KASSERT(ISSET(sc->sc_child_flags, VIRTIO_CHILD_DETACHED));
 	KASSERT(sc->sc_vqs == NULL);
 	KASSERT(psc->sc_ihs_num == 0);
 

Index: src/sys/dev/pci/virtiovar.h
diff -u src/sys/dev/pci/virtiovar.h:1.27 src/sys/dev/pci/virtiovar.h:1.28
--- src/sys/dev/pci/virtiovar.h:1.27	Fri Mar 31 07:31:48 2023
+++ src/sys/dev/pci/virtiovar.h	Fri Mar 31 07:34:26 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: 

CVS commit: src/sys/dev

2023-03-31 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Mar 31 07:34:26 UTC 2023

Modified Files:
src/sys/dev/pci: virtio.c virtio_pci.c virtiovar.h
src/sys/dev/virtio: virtio_mmio.c

Log Message:
Added flags to store status of attaching a virtio device

This prevents a panic on reboot after a virtio device had called
virtio_child_attach_failed().


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/virtio.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/virtio_pci.c
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/virtiovar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/virtio/virtio_mmio.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/pci

2023-03-31 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Mar 31 07:31:48 UTC 2023

Modified Files:
src/sys/dev/pci: virtio.c virtiovar.h

Log Message:
Use descriptor chain for free slots instead of vq_entry list

Descriptors can be chained by themself. And descriptors added to
avail ring or used ring are already chained. But it was not used
for unused descriptors and another linked list structure named
vq_entry was used.
The chain is also used for unused descriptors to make virtio(4)
simpler.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/virtio.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/virtiovar.h

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

Modified files:

Index: src/sys/dev/pci/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.72 src/sys/dev/pci/virtio.c:1.73
--- src/sys/dev/pci/virtio.c:1.72	Wed Mar 29 09:44:25 2023
+++ src/sys/dev/pci/virtio.c	Fri Mar 31 07:31:48 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.72 2023/03/29 09:44:25 riastradh Exp $	*/
+/*	$NetBSD: virtio.c,v 1.73 2023/03/31 07:31:48 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.72 2023/03/29 09:44:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.73 2023/03/31 07:31:48 yamaguchi Exp $");
 
 #include 
 #include 
@@ -46,6 +46,13 @@ __KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1
 
 #define MINSEG_INDIRECT		2 /* use indirect if nsegs >= this value */
 
+/*
+ * The maximum descriptor size is 2^15. Use that value as the end of
+ * descriptor chain terminator since it will never be a valid index
+ * in the descriptor table.
+ */
+#define VRING_DESC_CHAIN_END		32768
+
 /* incomplete list */
 static const char *virtio_device_name[] = {
 	"unknown (0)",			/*  0 */
@@ -700,11 +707,20 @@ virtio_start_vq_intr(struct virtio_softc
 static void
 virtio_reset_vq(struct virtio_softc *sc, struct virtqueue *vq)
 {
+	struct vring_desc *vds;
 	int i, j;
 	int vq_size = vq->vq_num;
 
 	memset(vq->vq_vaddr, 0, vq->vq_bytesize);
 
+	/* build the descriptor chain for free slot management */
+	vds = vq->vq_desc;
+	for (i = 0; i < vq_size - 1; i++) {
+		vds[i].next = virtio_rw16(sc, i + 1);
+	}
+	vds[i].next = virtio_rw16(sc, VRING_DESC_CHAIN_END);
+	vq->vq_free_idx = 0;
+
 	/* build the indirect descriptor chain */
 	if (vq->vq_indirect != NULL) {
 		struct vring_desc *vd;
@@ -718,14 +734,6 @@ virtio_reset_vq(struct virtio_softc *sc,
 		}
 	}
 
-	/* free slot management */
-	SIMPLEQ_INIT(>vq_freelist);
-	for (i = 0; i < vq_size; i++) {
-		SIMPLEQ_INSERT_TAIL(>vq_freelist, >vq_entries[i],
-		qe_list);
-		vq->vq_entries[i].qe_index = i;
-	}
-
 	/* enqueue/dequeue status */
 	vq->vq_avail_idx = 0;
 	vq->vq_used_idx = 0;
@@ -855,11 +863,10 @@ virtio_alloc_vq(struct virtio_softc *sc,
 	}
 #undef VIRTIO_PTR
 
-	/* free slot management */
-	vq->vq_entries = kmem_zalloc(sizeof(struct vq_entry) * vq_num,
+	vq->vq_descx = kmem_zalloc(sizeof(vq->vq_descx[0]) * vq_num,
 	KM_SLEEP);
 
-	mutex_init(>vq_freelist_lock, MUTEX_SPIN, sc->sc_ipl);
+	mutex_init(>vq_freedesc_lock, MUTEX_SPIN, sc->sc_ipl);
 	mutex_init(>vq_aring_lock, MUTEX_SPIN, sc->sc_ipl);
 	mutex_init(>vq_uring_lock, MUTEX_SPIN, sc->sc_ipl);
 
@@ -891,15 +898,18 @@ err:
 int
 virtio_free_vq(struct virtio_softc *sc, struct virtqueue *vq)
 {
-	struct vq_entry *qe;
-	int i = 0;
+	uint16_t s;
+	size_t i;
 
 	if (vq->vq_vaddr == NULL)
 		return 0;
 
 	/* device must be already deactivated */
 	/* confirm the vq is empty */
-	SIMPLEQ_FOREACH(qe, >vq_freelist, qe_list) {
+	s = vq->vq_free_idx;
+	i = 0;
+	while (s != virtio_rw16(sc, VRING_DESC_CHAIN_END)) {
+		s = vq->vq_desc[s].next;
 		i++;
 	}
 	if (i != vq->vq_num) {
@@ -913,12 +923,12 @@ virtio_free_vq(struct virtio_softc *sc, 
 
 	vq_sync_aring_all(sc, vq, BUS_DMASYNC_POSTWRITE);
 
-	kmem_free(vq->vq_entries, sizeof(*vq->vq_entries) * vq->vq_num);
+	kmem_free(vq->vq_descx, sizeof(vq->vq_descx[0]) * vq->vq_num);
 	bus_dmamap_unload(sc->sc_dmat, vq->vq_dmamap);
 	bus_dmamap_destroy(sc->sc_dmat, vq->vq_dmamap);
 	bus_dmamem_unmap(sc->sc_dmat, vq->vq_vaddr, vq->vq_bytesize);
 	bus_dmamem_free(sc->sc_dmat, >vq_segs[0], 1);
-	mutex_destroy(>vq_freelist_lock);
+	mutex_destroy(>vq_freedesc_lock);
 	mutex_destroy(>vq_uring_lock);
 	mutex_destroy(>vq_aring_lock);
 	memset(vq, 0, sizeof(*vq));
@@ -929,31 +939,64 @@ virtio_free_vq(struct virtio_softc *sc, 
 /*
  * Free descriptor management.
  */
-static struct vq_entry *
-vq_alloc_entry(struct virtqueue *vq)
+static int
+vq_alloc_slot_locked(struct virtio_softc *sc, struct virtqueue *vq,
+size_t nslots)
 {
-	struct vq_entry *qe;
+	struct vring_desc *vd;
+	uint16_t rv, tail;
+	size_t i;
+
+	KASSERT(mutex_owned(>vq_freedesc_lock));
 
-	mutex_enter(>vq_freelist_lock);
-	if (SIMPLEQ_EMPTY(>vq_freelist)) {
-		mutex_exit(>vq_freelist_lock);
-		return NULL;
+	tail = virtio_rw16(sc, 

CVS commit: src/sys/dev/pci

2023-03-31 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Mar 31 07:31:48 UTC 2023

Modified Files:
src/sys/dev/pci: virtio.c virtiovar.h

Log Message:
Use descriptor chain for free slots instead of vq_entry list

Descriptors can be chained by themself. And descriptors added to
avail ring or used ring are already chained. But it was not used
for unused descriptors and another linked list structure named
vq_entry was used.
The chain is also used for unused descriptors to make virtio(4)
simpler.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/virtio.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/virtiovar.h

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



CVS commit: src/crypto/external/bsd/openssl/dist/crypto/rand

2023-03-31 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Mar 31 06:05:51 UTC 2023

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/rand: rand_unix.c

Log Message:
openssl: Omit local comment.

May be helpful explanation but it didn't make its way upstream,
whereas the file has moved and had other upstream changes, so let's
make the next merge less painful.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c:1.18 src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c:1.19
--- src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c:1.18	Fri Jan  7 15:50:11 2022
+++ src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c	Fri Mar 31 06:05:51 2023
@@ -270,7 +270,6 @@ static ssize_t sysctl_random(char *buf, 
 mib[1] = KERN_ARND;
 
 do {
-/* On NetBSD, KERN_ARND fails if more than 256 bytes are requested */
 len = buflen > 256 ? 256 : buflen;
 if (sysctl(mib, 2, buf, , NULL, 0) == -1)
 return done > 0 ? done : -1;



CVS commit: src/crypto/external/bsd/openssl/dist/crypto/rand

2023-03-31 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Mar 31 06:05:51 UTC 2023

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/rand: rand_unix.c

Log Message:
openssl: Omit local comment.

May be helpful explanation but it didn't make its way upstream,
whereas the file has moved and had other upstream changes, so let's
make the next merge less painful.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 \
src/crypto/external/bsd/openssl/dist/crypto/rand/rand_unix.c

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