CVS commit: src/sys/arch/riscv/riscv

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 16 05:56:50 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: locore.S

Log Message:
More register re-org


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/riscv/riscv/locore.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/riscv/riscv/locore.S
diff -u src/sys/arch/riscv/riscv/locore.S:1.36 src/sys/arch/riscv/riscv/locore.S:1.37
--- src/sys/arch/riscv/riscv/locore.S:1.36	Sun Oct 16 05:48:15 2022
+++ src/sys/arch/riscv/riscv/locore.S	Sun Oct 16 05:56:50 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.36 2022/10/16 05:48:15 skrll Exp $ */
+/* $NetBSD: locore.S,v 1.37 2022/10/16 05:56:50 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2022 The NetBSD Foundation, Inc.
@@ -227,10 +227,8 @@ ENTRY_NP(start)
 	VPRINTS("\n\r")
 #endif // _LP64
 
-#if ((VM_MIN_KERNEL_ADDRESS >> SEGSHIFT) & (NPDEPG - 1)) * SZREG
 	li	t1,  ((VM_MIN_KERNEL_ADDRESS >> SEGSHIFT) & (NPDEPG - 1)) * SZREG
-	add	s2, s2, t1
-#endif
+	add	s9, s2, t1
 
 #if PGSHIFT < PTE_PPN_SHIFT
 #error Code assumes PGSHIFT is greater than PTE_PPN_SHIFT
@@ -249,13 +247,13 @@ ENTRY_NP(start)
 	or	s0, s0, s7
 .Lfill:
 	VPRINTS("kern:")
-	VPRINTX(s2)
+	VPRINTX(s9)
 	VPRINTS(":  ")
 	VPRINTXNL(s0)
 
-	REG_S	s0, 0(s2)		// store PDE
+	REG_S	s0, 0(s9)		// store PDE
 	add	s0, s0, s6		// advance PA in PDE to next segment
-	add	s2, s2, SZREG		// advance to next PDE slot
+	add	s9, s9, SZREG		// advance to next PDE slot
 	addi	s5, s5, -1		// count down segment
 	bnez	s5, .Lfill		// loop if more
 
@@ -268,12 +266,12 @@ ENTRY_NP(start)
 	or	s0, s0, s7
 
 	VPRINTS("dtb: ")
-	VPRINTX(s2)
+	VPRINTX(s9)
 	VPRINTS(":  ")
 	VPRINTXNL(s0)
 
-	REG_S	s0, 0(s2)
-	add	s2, s2, SZREG		// advance to next PDE slot
+	REG_S	s0, 0(s9)
+	add	s9, s9, SZREG		// advance to next PDE slot
 
 #ifdef CONSADDR
 	ld	s0, .Lconsaddr
@@ -286,8 +284,8 @@ ENTRY_NP(start)
 	VPRINTS(":  ")
 	VPRINTXNL(s0)
 
-	REG_S	s0, 0(s2)
-	add	s2, s2, SZREG		// advance to next PDE slot
+	REG_S	s0, 0(s9)
+	add	s9, s9, SZREG		// advance to next PDE slot
 #endif
 
 	li	a0, 'P'



CVS commit: src/sys/arch/riscv/riscv

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 16 05:56:50 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: locore.S

Log Message:
More register re-org


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/riscv/riscv/locore.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/riscv/riscv

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 16 05:48:15 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: locore.S

Log Message:
Fix after register re-org


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/riscv/riscv/locore.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/riscv/riscv/locore.S
diff -u src/sys/arch/riscv/riscv/locore.S:1.35 src/sys/arch/riscv/riscv/locore.S:1.36
--- src/sys/arch/riscv/riscv/locore.S:1.35	Sat Oct 15 16:58:16 2022
+++ src/sys/arch/riscv/riscv/locore.S	Sun Oct 16 05:48:15 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.35 2022/10/15 16:58:16 skrll Exp $ */
+/* $NetBSD: locore.S,v 1.36 2022/10/16 05:48:15 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2022 The NetBSD Foundation, Inc.
@@ -365,9 +365,9 @@ vstart:
 	.option pop
 
 	// Now we should ready to start initializing the kernel.
-	mv	a0, s0			// hartid
+	mv	a0, s10			// hartid
 	mv	a1, t0			// vdtb
-	//mv	a1, s1			// dtb (physical)
+	//mv	a1, s11			// dtb (physical)
 
 	li	s0, 0			// zero frame pointer
 	call	_C_LABEL(init_riscv)	// do MD startup



CVS commit: src/sys/arch/riscv/riscv

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 16 05:48:15 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: locore.S

Log Message:
Fix after register re-org


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/riscv/riscv/locore.S

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



CVS commit: src/common/dist/zlib

2022-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 23:21:34 UTC 2022

Modified Files:
src/common/dist/zlib: zlib.h zutil.h

Log Message:
Handle standalone code.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/dist/zlib/zlib.h \
src/common/dist/zlib/zutil.h

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

Modified files:

Index: src/common/dist/zlib/zlib.h
diff -u src/common/dist/zlib/zlib.h:1.6 src/common/dist/zlib/zlib.h:1.7
--- src/common/dist/zlib/zlib.h:1.6	Sat Oct 15 15:49:32 2022
+++ src/common/dist/zlib/zlib.h	Sat Oct 15 19:21:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: zlib.h,v 1.6 2022/10/15 19:49:32 christos Exp $	*/
+/*	$NetBSD: zlib.h,v 1.7 2022/10/15 23:21:34 christos Exp $	*/
 
 /* zlib.h -- interface of the 'zlib' general purpose compression library
   version 1.2.13, October 13th, 2022
@@ -1726,7 +1726,9 @@ ZEXTERN uLong ZEXPORT adler32_combine OF
negative, the result has no meaning or utility.
 */
 
+#if !defined(_KERNEL) && !defined(_STANDALONE)
 ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
+#endif
 /*
  Update a running CRC-32 with the bytes buf[0..len-1] and return the
updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
Index: src/common/dist/zlib/zutil.h
diff -u src/common/dist/zlib/zutil.h:1.6 src/common/dist/zlib/zutil.h:1.7
--- src/common/dist/zlib/zutil.h:1.6	Sat Oct 15 15:49:32 2022
+++ src/common/dist/zlib/zutil.h	Sat Oct 15 19:21:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: zutil.h,v 1.6 2022/10/15 19:49:32 christos Exp $	*/
+/*	$NetBSD: zutil.h,v 1.7 2022/10/15 23:21:34 christos Exp $	*/
 
 /* zutil.h -- internal interface and configuration of the compression library
  * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler
@@ -49,6 +49,13 @@ typedef ush FAR ushf;
 typedef unsigned long  ulg;
 
 #if !defined(Z_U8) && !defined(Z_SOLO) && defined(STDC)
+# if defined(_KERNEL) || defined(_STANDALONE)
+#  ifdef _LP64
+#   define Z_U8 unsigned long
+#  else
+#   define Z_U8 unsigned long long
+#  endif
+# else
 #  include 
 #  if (ULONG_MAX == 0x)
 #define Z_U8 unsigned long
@@ -57,6 +64,7 @@ typedef unsigned long  ulg;
 #  elif (UINT_MAX == 0x)
 #define Z_U8 unsigned
 #  endif
+# endif
 #endif
 
 extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */



CVS commit: src/common/dist/zlib

2022-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 23:21:34 UTC 2022

Modified Files:
src/common/dist/zlib: zlib.h zutil.h

Log Message:
Handle standalone code.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/dist/zlib/zlib.h \
src/common/dist/zlib/zutil.h

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



CVS commit: src

2022-10-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Oct 15 21:53:22 UTC 2022

Modified Files:
src/sbin/blkdiscard: blkdiscard.8
src/share/man/man3lua: syslog.3lua
src/sys/arch/shark/shark: sequoia.c
src/sys/netinet: sctp_pcb.c
src/usr.bin/grep: grep.c

Log Message:
fix various typos in documentation and comments.
mainly in words functionality, functional, function.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/blkdiscard/blkdiscard.8
cvs rdiff -u -r1.3 -r1.4 src/share/man/man3lua/syslog.3lua
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/shark/shark/sequoia.c
cvs rdiff -u -r1.25 -r1.26 src/sys/netinet/sctp_pcb.c
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/grep/grep.c

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

Modified files:

Index: src/sbin/blkdiscard/blkdiscard.8
diff -u src/sbin/blkdiscard/blkdiscard.8:1.1 src/sbin/blkdiscard/blkdiscard.8:1.2
--- src/sbin/blkdiscard/blkdiscard.8:1.1	Mon Feb  7 09:33:26 2022
+++ src/sbin/blkdiscard/blkdiscard.8	Sat Oct 15 21:53:21 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: blkdiscard.8,v 1.1 2022/02/07 09:33:26 mrg Exp $
+.\"	$NetBSD: blkdiscard.8,v 1.2 2022/10/15 21:53:21 andvar Exp $
 .\"
 .\" Copyright (c) 2022 Matthew R. Green
 .\" All rights reserved.
@@ -158,6 +158,6 @@ command was written by
 .An Matthew R. Green
 .Aq m...@eterna.com.au .
 .Sh BUGS
-The secure erase funtionality of the
+The secure erase functionality of the
 .Fl s
 option is not yet implemented.

Index: src/share/man/man3lua/syslog.3lua
diff -u src/share/man/man3lua/syslog.3lua:1.3 src/share/man/man3lua/syslog.3lua:1.4
--- src/share/man/man3lua/syslog.3lua:1.3	Tue Jan  7 21:54:17 2014
+++ src/share/man/man3lua/syslog.3lua	Sat Oct 15 21:53:21 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: syslog.3lua,v 1.3 2014/01/07 21:54:17 mbalmer Exp $
+.\"	$NetBSD: syslog.3lua,v 1.4 2022/10/15 21:53:21 andvar Exp $
 .\"
 .\" Copyright (c) 2013, 2014 Marc Balmer .
 .\" All rights reserved.
@@ -50,7 +50,7 @@ The
 .Nm
 Lua binding provides access to the
 .Xr syslog 3
-funcionality.
+functionality.
 .Pp
 .Bl -tag -width  -compact
 .Pp

Index: src/sys/arch/shark/shark/sequoia.c
diff -u src/sys/arch/shark/shark/sequoia.c:1.16 src/sys/arch/shark/shark/sequoia.c:1.17
--- src/sys/arch/shark/shark/sequoia.c:1.16	Sat Aug  7 16:19:05 2021
+++ src/sys/arch/shark/shark/sequoia.c	Sat Oct 15 21:53:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sequoia.c,v 1.16 2021/08/07 16:19:05 thorpej Exp $	*/
+/*	$NetBSD: sequoia.c,v 1.17 2022/10/15 21:53:21 andvar Exp $	*/
 
 /*
  * Copyright 1997
@@ -40,7 +40,7 @@
 */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sequoia.c,v 1.16 2021/08/07 16:19:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sequoia.c,v 1.17 2022/10/15 21:53:21 andvar Exp $");
 
 #include 
 #include 
@@ -141,7 +141,7 @@ static bool sequoiaLock_held;
 
 /*
 **
-** FUNCITONAL PROTOTYPES
+** FUNCTIONAL PROTOTYPES
 **
 */
 static void ledSetBiled(int color);
@@ -149,7 +149,7 @@ static void ledTimeout(void *arg);
 
 /*
 ** 
-** FUNCITONS
+** FUNCTIONS
 **
 */
 void sequoiaInit(void)

Index: src/sys/netinet/sctp_pcb.c
diff -u src/sys/netinet/sctp_pcb.c:1.25 src/sys/netinet/sctp_pcb.c:1.26
--- src/sys/netinet/sctp_pcb.c:1.25	Sat May 28 22:16:44 2022
+++ src/sys/netinet/sctp_pcb.c	Sat Oct 15 21:53:21 2022
@@ -1,5 +1,5 @@
 /* $KAME: sctp_pcb.c,v 1.39 2005/06/16 18:29:25 jinmei Exp $ */
-/* $NetBSD: sctp_pcb.c,v 1.25 2022/05/28 22:16:44 andvar Exp $ */
+/* $NetBSD: sctp_pcb.c,v 1.26 2022/10/15 21:53:21 andvar Exp $ */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc.
@@ -33,7 +33,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sctp_pcb.c,v 1.25 2022/05/28 22:16:44 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctp_pcb.c,v 1.26 2022/10/15 21:53:21 andvar Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -3787,7 +3787,7 @@ sctp_pcb_init(void)
 {
 	/*
 	 * SCTP initialization for the PCB structures
-	 * should be called by the sctp_init() funciton.
+	 * should be called by the sctp_init() function.
 	 */
 	int i;
 	int hashtblsize = SCTP_TCBHASHSIZE;

Index: src/usr.bin/grep/grep.c
diff -u src/usr.bin/grep/grep.c:1.15 src/usr.bin/grep/grep.c:1.16
--- src/usr.bin/grep/grep.c:1.15	Sun Aug 12 09:03:21 2018
+++ src/usr.bin/grep/grep.c	Sat Oct 15 21:53:22 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: grep.c,v 1.15 2018/08/12 09:03:21 christos Exp $	*/
+/*	$NetBSD: grep.c,v 1.16 2022/10/15 21:53:22 andvar Exp $	*/
 /* 	$FreeBSD: head/usr.bin/grep/grep.c 211519 2010-08-19 22:55:17Z delphij $	*/
 /*	$OpenBSD: grep.c,v 1.42 2010/07/02 22:18:03 tedu Exp $	*/
 
@@ -34,7 +34,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: grep.c,v 1.15 2018/08/12 09:03:21 christos Exp $");
+__RCSID("$NetBSD: grep.c,v 1.16 2022/10/15 21:53:22 andvar Exp $");
 
 #include 
 #include 
@@ -60,7 +60,7 @@ nl_catd	 catalog;
 #endif
 
 /*
- * Default messags to use when NLS is disabled or no catalogue
+ * Default messages to use when NLS 

CVS commit: src

2022-10-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Oct 15 21:53:22 UTC 2022

Modified Files:
src/sbin/blkdiscard: blkdiscard.8
src/share/man/man3lua: syslog.3lua
src/sys/arch/shark/shark: sequoia.c
src/sys/netinet: sctp_pcb.c
src/usr.bin/grep: grep.c

Log Message:
fix various typos in documentation and comments.
mainly in words functionality, functional, function.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/blkdiscard/blkdiscard.8
cvs rdiff -u -r1.3 -r1.4 src/share/man/man3lua/syslog.3lua
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/shark/shark/sequoia.c
cvs rdiff -u -r1.25 -r1.26 src/sys/netinet/sctp_pcb.c
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/grep/grep.c

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/xlint/lint1

2022-10-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Oct 15 21:19:15 UTC 2022

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_309.c

Log Message:
tests/lint: add more examples for 'extra bits set to 0'

Seen in sys/external/bsd/compiler_rt/dist/lib/builtins/fp_lib.h:88.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_309.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/msg_309.c
diff -u src/tests/usr.bin/xlint/lint1/msg_309.c:1.5 src/tests/usr.bin/xlint/lint1/msg_309.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_309.c:1.5	Fri Jun 17 06:59:16 2022
+++ src/tests/usr.bin/xlint/lint1/msg_309.c	Sat Oct 15 21:19:15 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_309.c,v 1.5 2022/06/17 06:59:16 rillig Exp $	*/
+/*	$NetBSD: msg_309.c,v 1.6 2022/10/15 21:19:15 rillig Exp $	*/
 # 3 "msg_309.c"
 
 // Test for message: extra bits set to 0 in conversion of '%s' to '%s', op '%s' [309]
@@ -25,6 +25,33 @@ scale(unsigned long long x) {
 		return 16;
 
 	/*
+	 * The integer constant is explicitly unsigned.  Even in this case,
+	 * the code may have originated on a platform where 'x' had 32 bits
+	 * originally, and the intention may have been to clear the lower 16
+	 * bits.
+	 */
+	/* expect+1: warning: extra bits set to 0 in conversion of 'unsigned int' to 'unsigned long long', op '&' [309] */
+	if ((x & 0xU) != 0)
+		return 16;
+
+	/*
+	 * Even if the expression is written as '& ~', which makes the
+	 * intention of clearing the lower 16 bits clear, on a 32-bit
+	 * platform the integer constant stays at 32 bits, and when porting
+	 * the code to a 64-bit platform, the upper 32 bits are preserved.
+	 */
+	/* expect+1: warning: extra bits set to 0 in conversion of 'unsigned int' to 'unsigned long long', op '&' [309] */
+	if ((x & ~0xU) != 0)
+		return 16;
+
+	/*
+	 * Casting the integer constant to the proper type removes all
+	 * ambiguities about the programmer's intention.
+	 */
+	if ((x & (unsigned long long)~0xU) != 0)
+		return 16;
+
+	/*
 	 * In the remaining cases, the constant does not have its most
 	 * significant bit set, therefore there is no ambiguity.
 	 */



CVS commit: src/tests/usr.bin/xlint/lint1

2022-10-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Oct 15 21:19:15 UTC 2022

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_309.c

Log Message:
tests/lint: add more examples for 'extra bits set to 0'

Seen in sys/external/bsd/compiler_rt/dist/lib/builtins/fp_lib.h:88.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_309.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

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 20:11:45 UTC 2022

Modified Files:
src/sys/dev/pci: pci_resource.c

Log Message:
pci_resource(9): Fix whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/pci_resource.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/pci_resource.c
diff -u src/sys/dev/pci/pci_resource.c:1.2 src/sys/dev/pci/pci_resource.c:1.3
--- src/sys/dev/pci/pci_resource.c:1.2	Sat Oct 15 20:11:00 2022
+++ src/sys/dev/pci/pci_resource.c	Sat Oct 15 20:11:44 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_resource.c,v 1.2 2022/10/15 20:11:00 riastradh Exp $ */
+/* $NetBSD: pci_resource.c,v 1.3 2022/10/15 20:11:44 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2022 Jared McNeill 
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_resource.c,v 1.2 2022/10/15 20:11:00 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_resource.c,v 1.3 2022/10/15 20:11:44 riastradh Exp $");
 
 #include 
 #include 
@@ -137,7 +137,7 @@ struct pci_resources {
 };
 
 static void	pci_resource_scan_bus(struct pci_resources *,
-	  struct pci_device *, uint8_t);
+		struct pci_device *, uint8_t);
 
 #define	PCI_SBDF_FMT			"%04x:%02x:%02x.%u"
 #define	PCI_SBDF_FMT_ARGS(_pr, _pd)	\
@@ -593,7 +593,7 @@ pci_resource_claim(vmem_t *arena, vmem_a
  *   Allocate a resource from a vmem arena. This is called when configuring
  *   devices that were not already configured by system firmware.
  */
-static int 
+static int
 pci_resource_alloc(vmem_t *arena, vmem_size_t size, vmem_size_t align,
 uint64_t *base)
 {
@@ -921,9 +921,9 @@ pci_resource_alloc_device(struct pci_res
 			pci_conf_write(pr->pr_pc, pd->pd_tag,
 			PCI_BAR(pi->pi_bar), base);
 			if (pi->pi_mem.memtype == PCI_MAPREG_MEM_TYPE_64BIT) {
-base = (pcireg_t)   
-(PCI_MAPREG_MEM64_ADDR(addr) >> 32); 
-pci_conf_write(pr->pr_pc, pd->pd_tag,
+base = (pcireg_t)
+(PCI_MAPREG_MEM64_ADDR(addr) >> 32);
+pci_conf_write(pr->pr_pc, pd->pd_tag,
 PCI_BAR(pi->pi_bar + 1), base);
 			}
 		}



CVS commit: src/sys/dev/pci

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 20:11:45 UTC 2022

Modified Files:
src/sys/dev/pci: pci_resource.c

Log Message:
pci_resource(9): Fix whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/pci_resource.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

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 20:11:01 UTC 2022

Modified Files:
src/sys/dev/pci: pci_resource.c

Log Message:
pci_resource(9): vmem_create and vmem_add never fail with VM_SLEEP.

Prune dead error branches.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/pci_resource.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

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 20:11:01 UTC 2022

Modified Files:
src/sys/dev/pci: pci_resource.c

Log Message:
pci_resource(9): vmem_create and vmem_add never fail with VM_SLEEP.

Prune dead error branches.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/pci_resource.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/pci_resource.c
diff -u src/sys/dev/pci/pci_resource.c:1.1 src/sys/dev/pci/pci_resource.c:1.2
--- src/sys/dev/pci/pci_resource.c:1.1	Fri Oct 14 22:10:15 2022
+++ src/sys/dev/pci/pci_resource.c	Sat Oct 15 20:11:00 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_resource.c,v 1.1 2022/10/14 22:10:15 jmcneill Exp $ */
+/* $NetBSD: pci_resource.c,v 1.2 2022/10/15 20:11:00 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2022 Jared McNeill 
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_resource.c,v 1.1 2022/10/14 22:10:15 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_resource.c,v 1.2 2022/10/15 20:11:00 riastradh Exp $");
 
 #include 
 #include 
@@ -161,17 +161,12 @@ static vmem_t *
 pci_create_vmem(const char *name, bus_addr_t start, bus_addr_t end)
 {
 	vmem_t *arena;
+	int error __diagused;
 
 	arena = vmem_create(name, 0, 0, 1, NULL, NULL, NULL, 0, VM_SLEEP,
 	IPL_NONE);
-	if (arena == NULL) {
-		return NULL;
-	}
-
-	if (vmem_add(arena, start, end - start + 1, VM_SLEEP) != 0) {
-		vmem_destroy(arena);
-		arena = NULL;
-	}
+	error = vmem_add(arena, start, end - start + 1, VM_SLEEP);
+	KASSERTMSG(error == 0, "error=%d", error);
 
 	return arena;
 }



CVS commit: src/sys/dev/pci

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 20:00:35 UTC 2022

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

Log Message:
virtio(4): Use __BIT, not inline shift.

Reduces need for cast.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/virtioreg.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/virtioreg.h
diff -u src/sys/dev/pci/virtioreg.h:1.10 src/sys/dev/pci/virtioreg.h:1.11
--- src/sys/dev/pci/virtioreg.h:1.10	Wed Apr 13 10:56:11 2022
+++ src/sys/dev/pci/virtioreg.h	Sat Oct 15 20:00:35 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtioreg.h,v 1.10 2022/04/13 10:56:11 uwe Exp $	*/
+/*	$NetBSD: virtioreg.h,v 1.11 2022/10/15 20:00:35 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -79,11 +79,11 @@
 #define VIRTIO_DEVICE_ID_9P		 9
 
 /* common device/guest features */
-#define  VIRTIO_F_NOTIFY_ON_EMPTY		(1<<24)
-#define  VIRTIO_F_RING_INDIRECT_DESC		(1<<28)
-#define  VIRTIO_F_RING_EVENT_IDX		(1<<29)
-#define  VIRTIO_F_BAD_FEATURE			(1<<30)
-#define  VIRTIO_F_VERSION_1			(UINT64_C(1) << 32)
+#define  VIRTIO_F_NOTIFY_ON_EMPTY		__BIT(24)
+#define  VIRTIO_F_RING_INDIRECT_DESC		__BIT(28)
+#define  VIRTIO_F_RING_EVENT_IDX		__BIT(29)
+#define  VIRTIO_F_BAD_FEATURE			__BIT(30)
+#define  VIRTIO_F_VERSION_1			__BIT(32)
 
 /* common device status flags */
 #define  VIRTIO_CONFIG_DEVICE_STATUS_RESET		  0



CVS commit: src/sys/dev/pci

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 20:00:35 UTC 2022

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

Log Message:
virtio(4): Use __BIT, not inline shift.

Reduces need for cast.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/virtioreg.h

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

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 19:55:37 UTC 2022

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

Log Message:
virtio(4): Use howmany from sys/param.h instead of open-coding it.

howmany will divide by VIRTIO_PAGE_SIZE instead of doing &
~(VIRTIO_PAGE_SIZE - 1), but it's a constant 4096 so this should make
no difference in the compiled output except possibly at -O0.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/pci/virtio.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.59 src/sys/dev/pci/virtio.c:1.60
--- src/sys/dev/pci/virtio.c:1.59	Sat Oct 15 19:53:27 2022
+++ src/sys/dev/pci/virtio.c	Sat Oct 15 19:55:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.59 2022/10/15 19:53:27 riastradh Exp $	*/
+/*	$NetBSD: virtio.c,v 1.60 2022/10/15 19:55:37 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.59 2022/10/15 19:53:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.60 2022/10/15 19:55:37 riastradh Exp $");
 
 #include 
 #include 
@@ -760,8 +760,7 @@ virtio_alloc_vq(struct virtio_softc *sc,
 {
 	int vq_size, allocsize1, allocsize2, allocsize3, allocsize = 0;
 	int rsegs, r, hdrlen;
-#define VIRTQUEUE_ALIGN(n)	(((n) + (VIRTIO_PAGE_SIZE - 1)) &	\
-~(VIRTIO_PAGE_SIZE - 1))
+#define VIRTQUEUE_ALIGN(n)	howmany(n, VIRTIO_PAGE_SIZE)
 
 	/* Make sure callers allocate vqs in order */
 	KASSERT(sc->sc_nvqs == index);



CVS commit: src/sys/dev/pci

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 19:55:37 UTC 2022

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

Log Message:
virtio(4): Use howmany from sys/param.h instead of open-coding it.

howmany will divide by VIRTIO_PAGE_SIZE instead of doing &
~(VIRTIO_PAGE_SIZE - 1), but it's a constant 4096 so this should make
no difference in the compiled output except possibly at -O0.

No functional change intended.


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

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 19:53:27 UTC 2022

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

Log Message:
virtio(4): Sprinkle KNF.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/pci/virtio.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.58 src/sys/dev/pci/virtio.c:1.59
--- src/sys/dev/pci/virtio.c:1.58	Sun Aug 14 10:06:54 2022
+++ src/sys/dev/pci/virtio.c	Sat Oct 15 19:53:27 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.58 2022/08/14 10:06:54 riastradh Exp $	*/
+/*	$NetBSD: virtio.c,v 1.59 2022/10/15 19:53:27 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.58 2022/08/14 10:06:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.59 2022/10/15 19:53:27 riastradh Exp $");
 
 #include 
 #include 
@@ -105,8 +105,8 @@ virtio_reinit_start(struct virtio_softc 
 			continue;
 		if (n != vq->vq_num) {
 			panic("%s: virtqueue size changed, vq index %d\n",
-			  device_xname(sc->sc_dev),
-			  vq->vq_index);
+			device_xname(sc->sc_dev),
+			vq->vq_index);
 		}
 		virtio_init_vq(sc, vq, true);
 		sc->sc_ops->setup_queue(sc, vq->vq_index,
@@ -167,7 +167,8 @@ virtio_negotiate_features(struct virtio_
 
 
 uint8_t
-virtio_read_device_config_1(struct virtio_softc *sc, int index) {
+virtio_read_device_config_1(struct virtio_softc *sc, int index)
+{
 	bus_space_tag_t	   iot = sc->sc_devcfg_iot;
 	bus_space_handle_t ioh = sc->sc_devcfg_ioh;
 	uint8_t val;
@@ -179,7 +180,8 @@ virtio_read_device_config_1(struct virti
 }
 
 uint16_t
-virtio_read_device_config_2(struct virtio_softc *sc, int index) {
+virtio_read_device_config_2(struct virtio_softc *sc, int index)
+{
 	bus_space_tag_t	   iot = sc->sc_devcfg_iot;
 	bus_space_handle_t ioh = sc->sc_devcfg_ioh;
 	uint16_t val;
@@ -190,13 +192,15 @@ virtio_read_device_config_2(struct virti
 
 	DPRINTFR("read_2", "%04x", val, index, 2);
 	DPRINTFR2("read_2", "%04x",
-		bus_space_read_stream_2(sc->sc_devcfg_iot, sc->sc_devcfg_ioh, index),
-		bus_space_read_2(sc->sc_devcfg_iot, sc->sc_devcfg_ioh, index));
+	bus_space_read_stream_2(sc->sc_devcfg_iot, sc->sc_devcfg_ioh,
+		index),
+	bus_space_read_2(sc->sc_devcfg_iot, sc->sc_devcfg_ioh, index));
 	return val;
 }
 
 uint32_t
-virtio_read_device_config_4(struct virtio_softc *sc, int index) {
+virtio_read_device_config_4(struct virtio_softc *sc, int index)
+{
 	bus_space_tag_t	   iot = sc->sc_devcfg_iot;
 	bus_space_handle_t ioh = sc->sc_devcfg_ioh;
 	uint32_t val;
@@ -207,8 +211,9 @@ virtio_read_device_config_4(struct virti
 
 	DPRINTFR("read_4", "%08x", val, index, 4);
 	DPRINTFR2("read_4", "%08x",
-		bus_space_read_stream_4(sc->sc_devcfg_iot, sc->sc_devcfg_ioh, index),
-		bus_space_read_4(sc->sc_devcfg_iot, sc->sc_devcfg_ioh, index));
+	bus_space_read_stream_4(sc->sc_devcfg_iot, sc->sc_devcfg_ioh,
+		index),
+	bus_space_read_4(sc->sc_devcfg_iot, sc->sc_devcfg_ioh, index));
 	return val;
 }
 
@@ -218,7 +223,8 @@ virtio_read_device_config_4(struct virti
  * it. We access it using two 32 reads. See virtio spec 4.1.3.1.
  */
 uint64_t
-virtio_read_device_config_8(struct virtio_softc *sc, int index) {
+virtio_read_device_config_8(struct virtio_softc *sc, int index)
+{
 	bus_space_tag_t	   iot = sc->sc_devcfg_iot;
 	bus_space_handle_t ioh = sc->sc_devcfg_ioh;
 	union {
@@ -240,11 +246,13 @@ virtio_read_device_config_8(struct virti
 
 	DPRINTFR("read_8", "%08lx", val, index, 8);
 	DPRINTFR2("read_8 low ", "%08x",
-		bus_space_read_stream_4(sc->sc_devcfg_iot, sc->sc_devcfg_ioh, index),
-		bus_space_read_4(sc->sc_devcfg_iot, sc->sc_devcfg_ioh, index));
+	bus_space_read_stream_4(sc->sc_devcfg_iot, sc->sc_devcfg_ioh,
+		index),
+	bus_space_read_4(sc->sc_devcfg_iot, sc->sc_devcfg_ioh, index));
 	DPRINTFR2("read_8 high ", "%08x",
-		bus_space_read_stream_4(sc->sc_devcfg_iot, sc->sc_devcfg_ioh, index + 4),
-		bus_space_read_4(sc->sc_devcfg_iot, sc->sc_devcfg_ioh, index + 4));
+	bus_space_read_stream_4(sc->sc_devcfg_iot, sc->sc_devcfg_ioh,
+		index + 4),
+	bus_space_read_4(sc->sc_devcfg_iot, sc->sc_devcfg_ioh, index + 4));
 	return val;
 }
 
@@ -254,7 +262,8 @@ virtio_read_device_config_8(struct virti
  * register to always be little endian. These functions cater for these.
  */
 uint16_t
-virtio_read_device_config_le_2(struct virtio_softc *sc, int index) {
+virtio_read_device_config_le_2(struct virtio_softc *sc, int index)
+{
 	bus_space_tag_t	   iot = sc->sc_devcfg_iot;
 	bus_space_handle_t ioh = sc->sc_devcfg_ioh;
 	uint16_t val;
@@ -265,13 +274,14 @@ virtio_read_device_config_le_2(struct vi
 
 	DPRINTFR("read_le_2", "%04x", val, index, 2);
 	DPRINTFR2("read_le_2", "%04x",
-		bus_space_read_stream_2(sc->sc_devcfg_iot, 

CVS commit: src/doc

2022-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 19:51:04 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
new zlib


To generate a diff of this commit:
cvs rdiff -u -r1.2920 -r1.2921 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/sys/dev/pci

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 19:53:27 UTC 2022

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

Log Message:
virtio(4): Sprinkle KNF.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/pci/virtio.c

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



CVS commit: src/doc

2022-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 19:51:04 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
new zlib


To generate a diff of this commit:
cvs rdiff -u -r1.2920 -r1.2921 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.2920 src/doc/CHANGES:1.2921
--- src/doc/CHANGES:1.2920	Sat Oct 15 14:59:31 2022
+++ src/doc/CHANGES	Sat Oct 15 15:51:04 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2920 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2921 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -700,3 +700,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	ntp: Import ntp 4.2.8p15. [christos 20221009]
 	tzdata: updated to 2022e (using the 2022egtz fork) [kre 20221013]
 	tzcode: Updated to 2022e. [christos 20221015]
+	zlib(3): Import 1.2.13 [christos 20221015]



CVS commit: src/common/dist/zlib

2022-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 19:49:34 UTC 2022

Modified Files:
src/common/dist/zlib: compress.c crc32.c deflate.c deflate.h gzguts.h
gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c
uncompr.c zconf.h zlib.h zutil.c zutil.h
Removed Files:
src/common/dist/zlib/contrib/amd64: amd64-match.S
src/common/dist/zlib/contrib/asm686: README.686 match.S
src/common/dist/zlib/contrib/inflate86: inffas86.c inffast.S
src/common/dist/zlib/contrib/masmx64: bld_ml64.bat gvmat64.asm
inffas8664.c inffasx64.asm readme.txt
src/common/dist/zlib/contrib/masmx86: bld_ml32.bat inffas32.asm
match686.asm readme.txt
src/common/dist/zlib/contrib/vstudio/vc14: miniunz.vcxproj.user
minizip.vcxproj.user testzlib.vcxproj.user testzlibdll.vcxproj.user
zlibstat.vcxproj.user zlibvc.vcxproj.user

Log Message:
merge conflicts between 1.2.10 and 1.2.13


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/common/dist/zlib/compress.c \
src/common/dist/zlib/infback.c src/common/dist/zlib/inftrees.c \
src/common/dist/zlib/uncompr.c src/common/dist/zlib/zconf.h \
src/common/dist/zlib/zutil.c
cvs rdiff -u -r1.5 -r1.6 src/common/dist/zlib/crc32.c \
src/common/dist/zlib/deflate.c src/common/dist/zlib/trees.c \
src/common/dist/zlib/zlib.h src/common/dist/zlib/zutil.h
cvs rdiff -u -r1.4 -r1.5 src/common/dist/zlib/deflate.h \
src/common/dist/zlib/inffast.c
cvs rdiff -u -r1.2 -r1.3 src/common/dist/zlib/gzguts.h \
src/common/dist/zlib/gzwrite.c
cvs rdiff -u -r1.6 -r1.7 src/common/dist/zlib/inflate.c
cvs rdiff -u -r1.1.1.1 -r0 src/common/dist/zlib/contrib/amd64/amd64-match.S
cvs rdiff -u -r1.1.1.2 -r0 src/common/dist/zlib/contrib/asm686/README.686 \
src/common/dist/zlib/contrib/asm686/match.S
cvs rdiff -u -r1.1.1.2 -r0 src/common/dist/zlib/contrib/inflate86/inffas86.c
cvs rdiff -u -r1.1.1.1 -r0 src/common/dist/zlib/contrib/inflate86/inffast.S
cvs rdiff -u -r1.1.1.1 -r0 src/common/dist/zlib/contrib/masmx64/bld_ml64.bat
cvs rdiff -u -r1.1.1.2 -r0 src/common/dist/zlib/contrib/masmx64/gvmat64.asm \
src/common/dist/zlib/contrib/masmx64/inffas8664.c \
src/common/dist/zlib/contrib/masmx64/inffasx64.asm \
src/common/dist/zlib/contrib/masmx64/readme.txt
cvs rdiff -u -r1.1.1.2 -r0 src/common/dist/zlib/contrib/masmx86/bld_ml32.bat \
src/common/dist/zlib/contrib/masmx86/inffas32.asm \
src/common/dist/zlib/contrib/masmx86/readme.txt
cvs rdiff -u -r1.1.1.1 -r0 src/common/dist/zlib/contrib/masmx86/match686.asm
cvs rdiff -u -r1.1.1.1 -r0 \
src/common/dist/zlib/contrib/vstudio/vc14/miniunz.vcxproj.user \
src/common/dist/zlib/contrib/vstudio/vc14/minizip.vcxproj.user \
src/common/dist/zlib/contrib/vstudio/vc14/testzlib.vcxproj.user \
src/common/dist/zlib/contrib/vstudio/vc14/testzlibdll.vcxproj.user \
src/common/dist/zlib/contrib/vstudio/vc14/zlibstat.vcxproj.user \
src/common/dist/zlib/contrib/vstudio/vc14/zlibvc.vcxproj.user

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



CVS import: src/common/dist/zlib

2022-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 19:41:20 UTC 2022

Update of /cvsroot/src/common/dist/zlib
In directory ivanova.netbsd.org:/tmp/cvs-serv15394

Log Message:
Import zlib-1.2.13, previous was 1.2.10

Changes in 1.2.13 (13 Oct 2022)
- Fix configure issue that discarded provided CC definition
- Correct incorrect inputs provided to the CRC functions
- Repair prototypes and exporting of new CRC functions
- Fix inflateBack to detect invalid input with distances too far
- Have infback() deliver all of the available output up to any error
- Fix a bug when getting a gzip header extra field with inflate()
- Fix bug in block type selection when Z_FIXED used
- Tighten deflateBound bounds
- Remove deleted assembler code references
- Various portability and appearance improvements

Changes in 1.2.12 (27 Mar 2022)
- Cygwin does not have _wopen(), so do not create gzopen_w() there
- Permit a deflateParams() parameter change as soon as possible
- Limit hash table inserts after switch from stored deflate
- Fix bug when window full in deflate_stored()
- Fix CLEAR_HASH macro to be usable as a single statement
- Avoid a conversion error in gzseek when off_t type too small
- Have Makefile return non-zero error code on test failure
- Avoid some conversion warnings in gzread.c and gzwrite.c
- Update use of errno for newer Windows CE versions
- Small speedup to inflate [psumbera]
- Return an error if the gzputs string length can't fit in an int
- Add address checking in clang to -w option of configure
- Don't compute check value for raw inflate if asked to validate
- Handle case where inflateSync used when header never processed
- Avoid the use of ptrdiff_t
- Avoid an undefined behavior of memcpy() in gzappend()
- Avoid undefined behaviors of memcpy() in gz*printf()
- Avoid an undefined behavior of memcpy() in _tr_stored_block()
- Make the names in functions declarations identical to definitions
- Remove old assembler code in which bugs have manifested
- Fix deflateEnd() to not report an error at start of raw deflate
- Add legal disclaimer to README
- Emphasize the need to continue decompressing gzip members
- Correct the initialization requirements for deflateInit2()
- Fix a bug that can crash deflate on some input when using Z_FIXED
- Assure that the number of bits for deflatePrime() is valid
- Use a structure to make globals in enough.c evident
- Use a macro for the printf format of big_t in enough.c
- Clean up code style in enough.c, update version
- Use inline function instead of macro for index in enough.c
- Clarify that prefix codes are counted in enough.c
- Show all the codes for the maximum tables size in enough.c
- Add gznorm.c example, which normalizes gzip files
- Fix the zran.c example to work on a multiple-member gzip file
- Add tables for crc32_combine(), to speed it up by a factor of 200
- Add crc32_combine_gen() and crc32_combine_op() for fast combines
- Speed up software CRC-32 computation by a factor of 1.5 to 3
- Use atomic test and set, if available, for dynamic CRC tables
- Don't bother computing check value after successful inflateSync()
- Correct comment in crc32.c
- Add use of the ARMv8 crc32 instructions when requested
- Use ARM crc32 instructions if the ARM architecture has them
- Explicitly note that the 32-bit check values are 32 bits
- Avoid adding empty gzip member after gzflush with Z_FINISH
- Fix memory leak on error in gzlog.c
- Fix error in comment on the polynomial representation of a byte
- Clarify gz* function interfaces, referring to parameter names
- Change macro name in inflate.c to avoid collision in VxWorks
- Correct typo in blast.c
- Improve portability of contrib/minizip
- Fix indentation in minizip's zip.c
- Replace black/white with allow/block. (theresa-m)
- minizip warning fix if MAXU32 already defined. (gvollant)
- Fix unztell64() in minizip to work past 4GB. (Daniël Hörchner)
- Clean up minizip to reduce warnings for testing
- Add fallthrough comments for gcc
- Eliminate use of ULL constants
- Separate out address sanitizing from warnings in configure
- Remove destructive aspects of make distclean
- Check for cc masquerading as gcc or clang in configure
- Fix crc32.c to compile local functions only if used

Changes in 1.2.11 (15 Jan 2017)
- Fix deflate stored bug when pulling last block from window
- Permit immediate deflateParams changes before any deflate input

Status:

Vendor Tag: ZLIB
Release Tags:   zlib-1-2-13

C src/common/dist/zlib/zutil.h
U src/common/dist/zlib/inftrees.h
U src/common/dist/zlib/inflate.c
U src/common/dist/zlib/CMakeLists.txt
U src/common/dist/zlib/zlib.map
U src/common/dist/zlib/zlib.pc.cmakein
U src/common/dist/zlib/LICENSE
U src/common/dist/zlib/zlib.3.pdf
U src/common/dist/zlib/configure
C src/common/dist/zlib/compress.c
U src/common/dist/zlib/zlib.3
U src/common/dist/zlib/ChangeLog
C src/common/dist/zlib/deflate.c
U src/common/dist/zlib/inffixed.h
U src/common/dist/zlib/Makefile
U 

CVS import: src/common/dist/zlib

2022-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 19:41:20 UTC 2022

Update of /cvsroot/src/common/dist/zlib
In directory ivanova.netbsd.org:/tmp/cvs-serv15394

Log Message:
Import zlib-1.2.13, previous was 1.2.10

Changes in 1.2.13 (13 Oct 2022)
- Fix configure issue that discarded provided CC definition
- Correct incorrect inputs provided to the CRC functions
- Repair prototypes and exporting of new CRC functions
- Fix inflateBack to detect invalid input with distances too far
- Have infback() deliver all of the available output up to any error
- Fix a bug when getting a gzip header extra field with inflate()
- Fix bug in block type selection when Z_FIXED used
- Tighten deflateBound bounds
- Remove deleted assembler code references
- Various portability and appearance improvements

Changes in 1.2.12 (27 Mar 2022)
- Cygwin does not have _wopen(), so do not create gzopen_w() there
- Permit a deflateParams() parameter change as soon as possible
- Limit hash table inserts after switch from stored deflate
- Fix bug when window full in deflate_stored()
- Fix CLEAR_HASH macro to be usable as a single statement
- Avoid a conversion error in gzseek when off_t type too small
- Have Makefile return non-zero error code on test failure
- Avoid some conversion warnings in gzread.c and gzwrite.c
- Update use of errno for newer Windows CE versions
- Small speedup to inflate [psumbera]
- Return an error if the gzputs string length can't fit in an int
- Add address checking in clang to -w option of configure
- Don't compute check value for raw inflate if asked to validate
- Handle case where inflateSync used when header never processed
- Avoid the use of ptrdiff_t
- Avoid an undefined behavior of memcpy() in gzappend()
- Avoid undefined behaviors of memcpy() in gz*printf()
- Avoid an undefined behavior of memcpy() in _tr_stored_block()
- Make the names in functions declarations identical to definitions
- Remove old assembler code in which bugs have manifested
- Fix deflateEnd() to not report an error at start of raw deflate
- Add legal disclaimer to README
- Emphasize the need to continue decompressing gzip members
- Correct the initialization requirements for deflateInit2()
- Fix a bug that can crash deflate on some input when using Z_FIXED
- Assure that the number of bits for deflatePrime() is valid
- Use a structure to make globals in enough.c evident
- Use a macro for the printf format of big_t in enough.c
- Clean up code style in enough.c, update version
- Use inline function instead of macro for index in enough.c
- Clarify that prefix codes are counted in enough.c
- Show all the codes for the maximum tables size in enough.c
- Add gznorm.c example, which normalizes gzip files
- Fix the zran.c example to work on a multiple-member gzip file
- Add tables for crc32_combine(), to speed it up by a factor of 200
- Add crc32_combine_gen() and crc32_combine_op() for fast combines
- Speed up software CRC-32 computation by a factor of 1.5 to 3
- Use atomic test and set, if available, for dynamic CRC tables
- Don't bother computing check value after successful inflateSync()
- Correct comment in crc32.c
- Add use of the ARMv8 crc32 instructions when requested
- Use ARM crc32 instructions if the ARM architecture has them
- Explicitly note that the 32-bit check values are 32 bits
- Avoid adding empty gzip member after gzflush with Z_FINISH
- Fix memory leak on error in gzlog.c
- Fix error in comment on the polynomial representation of a byte
- Clarify gz* function interfaces, referring to parameter names
- Change macro name in inflate.c to avoid collision in VxWorks
- Correct typo in blast.c
- Improve portability of contrib/minizip
- Fix indentation in minizip's zip.c
- Replace black/white with allow/block. (theresa-m)
- minizip warning fix if MAXU32 already defined. (gvollant)
- Fix unztell64() in minizip to work past 4GB. (Daniël Hörchner)
- Clean up minizip to reduce warnings for testing
- Add fallthrough comments for gcc
- Eliminate use of ULL constants
- Separate out address sanitizing from warnings in configure
- Remove destructive aspects of make distclean
- Check for cc masquerading as gcc or clang in configure
- Fix crc32.c to compile local functions only if used

Changes in 1.2.11 (15 Jan 2017)
- Fix deflate stored bug when pulling last block from window
- Permit immediate deflateParams changes before any deflate input

Status:

Vendor Tag: ZLIB
Release Tags:   zlib-1-2-13

C src/common/dist/zlib/zutil.h
U src/common/dist/zlib/inftrees.h
U src/common/dist/zlib/inflate.c
U src/common/dist/zlib/CMakeLists.txt
U src/common/dist/zlib/zlib.map
U src/common/dist/zlib/zlib.pc.cmakein
U src/common/dist/zlib/LICENSE
U src/common/dist/zlib/zlib.3.pdf
U src/common/dist/zlib/configure
C src/common/dist/zlib/compress.c
U src/common/dist/zlib/zlib.3
U src/common/dist/zlib/ChangeLog
C src/common/dist/zlib/deflate.c
U src/common/dist/zlib/inffixed.h
U src/common/dist/zlib/Makefile
U 

CVS import: src/common/dist/zlib

2022-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 19:38:41 UTC 2022

Update of /cvsroot/src/common/dist/zlib
In directory ivanova.netbsd.org:/tmp/cvs-serv2001

Log Message:
Import zlib-1.2.13, previous was 1.2.10

Changes in 1.2.13 (13 Oct 2022)
- Fix configure issue that discarded provided CC definition
- Correct incorrect inputs provided to the CRC functions
- Repair prototypes and exporting of new CRC functions
- Fix inflateBack to detect invalid input with distances too far
- Have infback() deliver all of the available output up to any error
- Fix a bug when getting a gzip header extra field with inflate()
- Fix bug in block type selection when Z_FIXED used
- Tighten deflateBound bounds
- Remove deleted assembler code references
- Various portability and appearance improvements

Changes in 1.2.12 (27 Mar 2022)
- Cygwin does not have _wopen(), so do not create gzopen_w() there
- Permit a deflateParams() parameter change as soon as possible
- Limit hash table inserts after switch from stored deflate
- Fix bug when window full in deflate_stored()
- Fix CLEAR_HASH macro to be usable as a single statement
- Avoid a conversion error in gzseek when off_t type too small
- Have Makefile return non-zero error code on test failure
- Avoid some conversion warnings in gzread.c and gzwrite.c
- Update use of errno for newer Windows CE versions
- Small speedup to inflate [psumbera]
- Return an error if the gzputs string length can't fit in an int
- Add address checking in clang to -w option of configure
- Don't compute check value for raw inflate if asked to validate
- Handle case where inflateSync used when header never processed
- Avoid the use of ptrdiff_t
- Avoid an undefined behavior of memcpy() in gzappend()
- Avoid undefined behaviors of memcpy() in gz*printf()
- Avoid an undefined behavior of memcpy() in _tr_stored_block()
- Make the names in functions declarations identical to definitions
- Remove old assembler code in which bugs have manifested
- Fix deflateEnd() to not report an error at start of raw deflate
- Add legal disclaimer to README
- Emphasize the need to continue decompressing gzip members
- Correct the initialization requirements for deflateInit2()
- Fix a bug that can crash deflate on some input when using Z_FIXED
- Assure that the number of bits for deflatePrime() is valid
- Use a structure to make globals in enough.c evident
- Use a macro for the printf format of big_t in enough.c
- Clean up code style in enough.c, update version
- Use inline function instead of macro for index in enough.c
- Clarify that prefix codes are counted in enough.c
- Show all the codes for the maximum tables size in enough.c
- Add gznorm.c example, which normalizes gzip files
- Fix the zran.c example to work on a multiple-member gzip file
- Add tables for crc32_combine(), to speed it up by a factor of 200
- Add crc32_combine_gen() and crc32_combine_op() for fast combines
- Speed up software CRC-32 computation by a factor of 1.5 to 3
- Use atomic test and set, if available, for dynamic CRC tables
- Don't bother computing check value after successful inflateSync()
- Correct comment in crc32.c
- Add use of the ARMv8 crc32 instructions when requested
- Use ARM crc32 instructions if the ARM architecture has them
- Explicitly note that the 32-bit check values are 32 bits
- Avoid adding empty gzip member after gzflush with Z_FINISH
- Fix memory leak on error in gzlog.c
- Fix error in comment on the polynomial representation of a byte
- Clarify gz* function interfaces, referring to parameter names
- Change macro name in inflate.c to avoid collision in VxWorks
- Correct typo in blast.c
- Improve portability of contrib/minizip
- Fix indentation in minizip's zip.c
- Replace black/white with allow/block. (theresa-m)
- minizip warning fix if MAXU32 already defined. (gvollant)
- Fix unztell64() in minizip to work past 4GB. (Daniël Hörchner)
- Clean up minizip to reduce warnings for testing
- Add fallthrough comments for gcc
- Eliminate use of ULL constants
- Separate out address sanitizing from warnings in configure
- Remove destructive aspects of make distclean
- Check for cc masquerading as gcc or clang in configure
- Fix crc32.c to compile local functions only if used

Changes in 1.2.11 (15 Jan 2017)
- Fix deflate stored bug when pulling last block from window
- Permit immediate deflateParams changes before any deflate input

Status:

Vendor Tag: ZLIB
Release Tags:   zlib-1-2-13

C src/common/dist/zlib/zutil.h
U src/common/dist/zlib/inftrees.h
C src/common/dist/zlib/inflate.c
U src/common/dist/zlib/CMakeLists.txt
U src/common/dist/zlib/zlib.map
U src/common/dist/zlib/zlib.pc.cmakein
N src/common/dist/zlib/LICENSE
U src/common/dist/zlib/zlib.3.pdf
U src/common/dist/zlib/configure
C src/common/dist/zlib/compress.c
U src/common/dist/zlib/zlib.3
U src/common/dist/zlib/ChangeLog
C src/common/dist/zlib/deflate.c
U src/common/dist/zlib/inffixed.h
U src/common/dist/zlib/Makefile
U 

CVS import: src/common/dist/zlib

2022-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 19:38:41 UTC 2022

Update of /cvsroot/src/common/dist/zlib
In directory ivanova.netbsd.org:/tmp/cvs-serv2001

Log Message:
Import zlib-1.2.13, previous was 1.2.10

Changes in 1.2.13 (13 Oct 2022)
- Fix configure issue that discarded provided CC definition
- Correct incorrect inputs provided to the CRC functions
- Repair prototypes and exporting of new CRC functions
- Fix inflateBack to detect invalid input with distances too far
- Have infback() deliver all of the available output up to any error
- Fix a bug when getting a gzip header extra field with inflate()
- Fix bug in block type selection when Z_FIXED used
- Tighten deflateBound bounds
- Remove deleted assembler code references
- Various portability and appearance improvements

Changes in 1.2.12 (27 Mar 2022)
- Cygwin does not have _wopen(), so do not create gzopen_w() there
- Permit a deflateParams() parameter change as soon as possible
- Limit hash table inserts after switch from stored deflate
- Fix bug when window full in deflate_stored()
- Fix CLEAR_HASH macro to be usable as a single statement
- Avoid a conversion error in gzseek when off_t type too small
- Have Makefile return non-zero error code on test failure
- Avoid some conversion warnings in gzread.c and gzwrite.c
- Update use of errno for newer Windows CE versions
- Small speedup to inflate [psumbera]
- Return an error if the gzputs string length can't fit in an int
- Add address checking in clang to -w option of configure
- Don't compute check value for raw inflate if asked to validate
- Handle case where inflateSync used when header never processed
- Avoid the use of ptrdiff_t
- Avoid an undefined behavior of memcpy() in gzappend()
- Avoid undefined behaviors of memcpy() in gz*printf()
- Avoid an undefined behavior of memcpy() in _tr_stored_block()
- Make the names in functions declarations identical to definitions
- Remove old assembler code in which bugs have manifested
- Fix deflateEnd() to not report an error at start of raw deflate
- Add legal disclaimer to README
- Emphasize the need to continue decompressing gzip members
- Correct the initialization requirements for deflateInit2()
- Fix a bug that can crash deflate on some input when using Z_FIXED
- Assure that the number of bits for deflatePrime() is valid
- Use a structure to make globals in enough.c evident
- Use a macro for the printf format of big_t in enough.c
- Clean up code style in enough.c, update version
- Use inline function instead of macro for index in enough.c
- Clarify that prefix codes are counted in enough.c
- Show all the codes for the maximum tables size in enough.c
- Add gznorm.c example, which normalizes gzip files
- Fix the zran.c example to work on a multiple-member gzip file
- Add tables for crc32_combine(), to speed it up by a factor of 200
- Add crc32_combine_gen() and crc32_combine_op() for fast combines
- Speed up software CRC-32 computation by a factor of 1.5 to 3
- Use atomic test and set, if available, for dynamic CRC tables
- Don't bother computing check value after successful inflateSync()
- Correct comment in crc32.c
- Add use of the ARMv8 crc32 instructions when requested
- Use ARM crc32 instructions if the ARM architecture has them
- Explicitly note that the 32-bit check values are 32 bits
- Avoid adding empty gzip member after gzflush with Z_FINISH
- Fix memory leak on error in gzlog.c
- Fix error in comment on the polynomial representation of a byte
- Clarify gz* function interfaces, referring to parameter names
- Change macro name in inflate.c to avoid collision in VxWorks
- Correct typo in blast.c
- Improve portability of contrib/minizip
- Fix indentation in minizip's zip.c
- Replace black/white with allow/block. (theresa-m)
- minizip warning fix if MAXU32 already defined. (gvollant)
- Fix unztell64() in minizip to work past 4GB. (Daniël Hörchner)
- Clean up minizip to reduce warnings for testing
- Add fallthrough comments for gcc
- Eliminate use of ULL constants
- Separate out address sanitizing from warnings in configure
- Remove destructive aspects of make distclean
- Check for cc masquerading as gcc or clang in configure
- Fix crc32.c to compile local functions only if used

Changes in 1.2.11 (15 Jan 2017)
- Fix deflate stored bug when pulling last block from window
- Permit immediate deflateParams changes before any deflate input

Status:

Vendor Tag: ZLIB
Release Tags:   zlib-1-2-13

C src/common/dist/zlib/zutil.h
U src/common/dist/zlib/inftrees.h
C src/common/dist/zlib/inflate.c
U src/common/dist/zlib/CMakeLists.txt
U src/common/dist/zlib/zlib.map
U src/common/dist/zlib/zlib.pc.cmakein
N src/common/dist/zlib/LICENSE
U src/common/dist/zlib/zlib.3.pdf
U src/common/dist/zlib/configure
C src/common/dist/zlib/compress.c
U src/common/dist/zlib/zlib.3
U src/common/dist/zlib/ChangeLog
C src/common/dist/zlib/deflate.c
U src/common/dist/zlib/inffixed.h
U src/common/dist/zlib/Makefile
U 

CVS commit: src/doc

2022-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 18:59:31 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new tzcode


To generate a diff of this commit:
cvs rdiff -u -r1.1892 -r1.1893 src/doc/3RDPARTY
cvs rdiff -u -r1.2919 -r1.2920 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.1892 src/doc/3RDPARTY:1.1893
--- src/doc/3RDPARTY:1.1892	Fri Oct 14 03:44:28 2022
+++ src/doc/3RDPARTY	Sat Oct 15 14:59:31 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1892 2022/10/14 07:44:28 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1893 2022/10/15 18:59:31 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1422,14 +1422,14 @@ Location:	external/bsd/tradcpp
 Notes:
 
 Package:	tz
-Version:	tzcode2022c / tzdata2022egtz
+Version:	tzcode2022e / tzdata2022egtz
 Current Vers:	tzcode2022e / tzdata2022e
 Maintainer:	Paul Eggert 
 Archive Site:	ftp://ftp.iana.org/tz/releases/
 Archive Site:	ftp://munnari.oz.au/pub/oldtz/
 Old Archive Site:	ftp://elsie.nci.nih.gov/pub/
 Home Page:	http://www.iana.org/time-zones
-Date:		2022-08-16
+Date:		2022-10-15
 Mailing List:	t...@iana.org
 Responsible:	kleink, christos, kre
 License:	Public domain

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2919 src/doc/CHANGES:1.2920
--- src/doc/CHANGES:1.2919	Thu Oct 13 07:27:52 2022
+++ src/doc/CHANGES	Sat Oct 15 14:59:31 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2919 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2920 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -699,3 +699,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	postfix(1): Import version 3.7.3. [christos 20221008]
 	ntp: Import ntp 4.2.8p15. [christos 20221009]
 	tzdata: updated to 2022e (using the 2022egtz fork) [kre 20221013]
+	tzcode: Updated to 2022e. [christos 20221015]



CVS commit: src/doc

2022-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 18:59:31 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new tzcode


To generate a diff of this commit:
cvs rdiff -u -r1.1892 -r1.1893 src/doc/3RDPARTY
cvs rdiff -u -r1.2919 -r1.2920 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/lib/libc/time

2022-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 18:57:37 UTC 2022

Modified Files:
src/lib/libc/time: NEWS tzselect.ksh version

Log Message:
update to 2022e; no real changes


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/lib/libc/time/NEWS
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/time/tzselect.ksh \
src/lib/libc/time/version

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

Modified files:

Index: src/lib/libc/time/NEWS
diff -u src/lib/libc/time/NEWS:1.37 src/lib/libc/time/NEWS:1.38
--- src/lib/libc/time/NEWS:1.37	Tue Aug 16 07:07:40 2022
+++ src/lib/libc/time/NEWS	Sat Oct 15 14:57:37 2022
@@ -1,5 +1,48 @@
 News for the tz database
 
+Release 2022e - 2022-10-11 11:13:02 -0700
+
+  Briefly:
+Jordan and Syria switch from +02/+03 with DST to year-round +03.
+
+  Changes to future timestamps
+
+Jordan and Syria are abandoning the DST regime and are changing to
+permanent +03, so they will not fall back from +03 to +02 on
+2022-10-28.  (Thanks to Steffen Thorsen and Issam Al-Zuwairi.)
+
+  Changes to past timestamps
+
+On 1922-01-01 Tijuana adopted standard time at 00:00, not 01:00.
+
+  Changes to past time zone abbreviations and DST flags
+
+The temporary advancement of clocks in central Mexico in summer
+1931 is now treated as daylight saving time, instead of as two
+changes to standard time.
+
+
+Release 2022d - 2022-09-23 12:02:57 -0700
+
+  Briefly:
+Palestine transitions are now Saturdays at 02:00.
+Simplify three Ukraine zones into one.
+
+  Changes to future timestamps
+
+Palestine now springs forward and falls back at 02:00 on the
+first Saturday on or after March 24 and October 24, respectively.
+This means 2022 falls back 10-29 at 02:00, not 10-28 at 01:00.
+(Thanks to Heba Hamad.)
+
+  Changes to past timestamps
+
+Simplify three Ukraine zones to one, since the post-1970
+differences seem to have been imaginary.  Move Europe/Uzhgorod and
+Europe/Zaporozhye to 'backzone'; backward-compatibility links
+still work, albeit with different timestamps before October 1991.
+
+
 Release 2022c - 2022-08-15 17:47:18 -0700
 
   Briefly:

Index: src/lib/libc/time/tzselect.ksh
diff -u src/lib/libc/time/tzselect.ksh:1.20 src/lib/libc/time/tzselect.ksh:1.21
--- src/lib/libc/time/tzselect.ksh:1.20	Tue Aug 16 07:07:40 2022
+++ src/lib/libc/time/tzselect.ksh	Sat Oct 15 14:57:37 2022
@@ -3,7 +3,7 @@
 # Ask the user about the time zone, and output the resulting TZ value to stdout.
 # Interact with the user via stderr and stdin.
 #
-#	$NetBSD: tzselect.ksh,v 1.20 2022/08/16 11:07:40 christos Exp $
+#	$NetBSD: tzselect.ksh,v 1.21 2022/10/15 18:57:37 christos Exp $
 #
 PKGVERSION='(tzcode) '
 TZVERSION=see_Makefile
@@ -35,6 +35,7 @@ REPORT_BUGS_TO=t...@iana.org
 #
 #	Gawk (GNU awk) 
 #	mawk 
+#	nawk 
 
 
 # Specify default values for environment variables if they are unset.
Index: src/lib/libc/time/version
diff -u src/lib/libc/time/version:1.20 src/lib/libc/time/version:1.21
--- src/lib/libc/time/version:1.20	Tue Aug 16 07:07:40 2022
+++ src/lib/libc/time/version	Sat Oct 15 14:57:37 2022
@@ -1 +1 @@
-2022c
+2022e



CVS commit: src/lib/libc/time

2022-10-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 15 18:57:37 UTC 2022

Modified Files:
src/lib/libc/time: NEWS tzselect.ksh version

Log Message:
update to 2022e; no real changes


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/lib/libc/time/NEWS
cvs rdiff -u -r1.20 -r1.21 src/lib/libc/time/tzselect.ksh \
src/lib/libc/time/version

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



CVS commit: src/sys/dev/scsipi

2022-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 15 18:42:49 UTC 2022

Modified Files:
src/sys/dev/scsipi: scsiconf.c

Log Message:
Add PQUIRK_ONLYBIG for Oracle OCI BlockVolumes.

Oracle cloud BlockVolumes do not appear to support SCSI READ6 or WRITE6
commands, so set PQUIRK_ONLYBIG to avoid it here.


To generate a diff of this commit:
cvs rdiff -u -r1.302 -r1.303 src/sys/dev/scsipi/scsiconf.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/scsipi/scsiconf.c
diff -u src/sys/dev/scsipi/scsiconf.c:1.302 src/sys/dev/scsipi/scsiconf.c:1.303
--- src/sys/dev/scsipi/scsiconf.c:1.302	Thu Apr 14 16:50:26 2022
+++ src/sys/dev/scsipi/scsiconf.c	Sat Oct 15 18:42:49 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsiconf.c,v 1.302 2022/04/14 16:50:26 pgoyette Exp $	*/
+/*	$NetBSD: scsiconf.c,v 1.303 2022/10/15 18:42:49 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.302 2022/04/14 16:50:26 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.303 2022/10/15 18:42:49 jmcneill Exp $");
 
 #include 
 #include 
@@ -792,6 +792,8 @@ static const struct scsi_quirk_inquiry_p
 	 "SEAGATE ", "SX336704LC"   , ""}, PQUIRK_CAP_SYNC | PQUIRK_CAP_WIDE16},
 	{{T_DIRECT, T_FIXED,
 	 "SEAGATE ", "SX173404LC",   ""}, PQUIRK_CAP_SYNC | PQUIRK_CAP_WIDE16},
+	{{T_DIRECT, T_FIXED,
+	 "ORACLE",   "BlockVolume",	 ""},	  PQUIRK_ONLYBIG},
 
 	{{T_DIRECT, T_REMOV,
 	 "IOMEGA", "ZIP 100",		 "J.03"}, PQUIRK_NOLUNS|PQUIRK_NOSYNC},



CVS commit: src/sys/dev/scsipi

2022-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 15 18:42:49 UTC 2022

Modified Files:
src/sys/dev/scsipi: scsiconf.c

Log Message:
Add PQUIRK_ONLYBIG for Oracle OCI BlockVolumes.

Oracle cloud BlockVolumes do not appear to support SCSI READ6 or WRITE6
commands, so set PQUIRK_ONLYBIG to avoid it here.


To generate a diff of this commit:
cvs rdiff -u -r1.302 -r1.303 src/sys/dev/scsipi/scsiconf.c

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



CVS commit: src/distrib/utils/embedded

2022-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 15 18:32:31 UTC 2022

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf evbarm.conf
src/distrib/utils/embedded/files: ec2_init

Log Message:
ec2_init: Add support for Oracle Cloud


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/distrib/utils/embedded/conf/arm64.conf
cvs rdiff -u -r1.39 -r1.40 src/distrib/utils/embedded/conf/evbarm.conf
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/embedded/files/ec2_init

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64.conf
diff -u src/distrib/utils/embedded/conf/arm64.conf:1.14 src/distrib/utils/embedded/conf/arm64.conf:1.15
--- src/distrib/utils/embedded/conf/arm64.conf:1.14	Sat Oct 16 14:05:48 2021
+++ src/distrib/utils/embedded/conf/arm64.conf	Sat Oct 15 18:32:30 2022
@@ -1,4 +1,4 @@
-# $NetBSD: arm64.conf,v 1.14 2021/10/16 14:05:48 jmcneill Exp $
+# $NetBSD: arm64.conf,v 1.15 2022/10/15 18:32:30 jmcneill Exp $
 # ARM64 customization script used by mkimage
 #
 board=arm64
@@ -28,7 +28,7 @@ customize() {
 mdnsd=YES
 devpubd=YES
 wscons=\$(dev_exists wsdisplay0)
-ec2_init=\$(dev_exists ena0)
+ec2_init=\$(is_cloud)
 if checkyesno ec2_init ; then
 	dhcpcd_flags="\$dhcpcd_flags -w"
 else

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.39 src/distrib/utils/embedded/conf/evbarm.conf:1.40
--- src/distrib/utils/embedded/conf/evbarm.conf:1.39	Tue Jul  6 11:49:36 2021
+++ src/distrib/utils/embedded/conf/evbarm.conf	Sat Oct 15 18:32:30 2022
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.39 2021/07/06 11:49:36 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.40 2022/10/15 18:32:30 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -145,6 +145,24 @@ dev_exists() {
 	fi
 }
 
+is_cloud() {
+	ret=NO
+
+	# AWS EC2
+	if [ "\$(dev_exists ena0)" = "YES" ]; then
+		ret=YES
+	fi
+
+	# Oracle OCI
+	case "\$(/sbin/sysctl -n machdep.dmi.chassis-asset-tag)" in
+	OracleCloud*)
+		ret=YES
+		;;
+	esac
+
+	printf \$ret
+}
+
 rc_configured=YES
 hostname=${hostname:-${board}}
 no_swap=YES

Index: src/distrib/utils/embedded/files/ec2_init
diff -u src/distrib/utils/embedded/files/ec2_init:1.4 src/distrib/utils/embedded/files/ec2_init:1.5
--- src/distrib/utils/embedded/files/ec2_init:1.4	Tue Jul 20 19:31:23 2021
+++ src/distrib/utils/embedded/files/ec2_init	Sat Oct 15 18:32:30 2022
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: ec2_init,v 1.4 2021/07/20 19:31:23 rhialto Exp $
+# $NetBSD: ec2_init,v 1.5 2022/10/15 18:32:30 jmcneill Exp $
 #
 # PROVIDE: ec2_init
 # REQUIRE: NETWORKING
@@ -13,9 +13,27 @@ rcvar=${name}
 start_cmd="ec2_init"
 stop_cmd=":"
 
-EC2_USER="ec2-user"
-METADATA_URL="http://169.254.169.254/latest/meta-data/;
-SSH_KEY_URL="public-keys/0/openssh-key"
+CLOUD_TYPE=EC2	# default
+
+case "$(/sbin/sysctl -n machdep.dmi.chassis-asset-tag)" in
+OracleCloud*)
+	CLOUD_TYPE=OCI
+	;;
+esac
+
+case ${CLOUD_TYPE} in
+EC2)
+	EC2_USER="ec2-user"
+	METADATA_URL="http://169.254.169.254/latest/meta-data/;
+	SSH_KEY_URL="public-keys/0/openssh-key"
+	;;
+OCI)
+	EC2_USER="opc"
+	METADATA_URL="http://169.254.169.254/opc/v1/instance/;
+	SSH_KEY_URL="metadata/ssh_authorized_keys"
+	;;
+esac
+
 HOSTNAME_URL="hostname"
 
 SSH_KEY_FILE="/home/${EC2_USER}/.ssh/authorized_keys"
@@ -24,7 +42,7 @@ OS_METADATA_URL="http://169.254.169.254/
 
 ec2_newuser()
 {
-	echo "Creating EC2 user account ${EC2_USER}"
+	echo "Creating ${CLOUD_TYPE} user account ${EC2_USER}"
 	useradd -g users -G wheel,operator -m "${EC2_USER}"
 }
 
@@ -39,25 +57,25 @@ ec2_init()
 	umask 022
 
 	# set hostname; it may be 5-10 seconds for the metadata service
-	# to  become reachable.
+	# to become reachable.
 	try=0
 	while [ $((try++)) -lt 20 ]
 	do
 		HOSTNAME=$(ftp -o - -q 2 "${METADATA_URL}${HOSTNAME_URL}")
 		if [ -n "$HOSTNAME" ]; then
-			echo "Setting EC2 hostname: ${HOSTNAME}"
+			echo "Setting ${CLOUD_TYPE} hostname: ${HOSTNAME}"
 			echo "$HOSTNAME" > /etc/myname
 			hostname "$HOSTNAME"
 			break
 		fi
-		echo "EC2 hostname not available yet (try $try)"
+		echo "${CLOUD_TYPE} hostname not available yet (try $try)"
 		sleep 1
 	done
 
-	# create EC2 user
+	# create cloud user
 	id "${EC2_USER}" >/dev/null 2>&1 || ec2_newuser
 
-	# fetch the public key from Amazon Web Services
+	# fetch the public key from the metadata service
 	EC2_SSH_KEY=$(ftp -o - -q 2 "${METADATA_URL}${SSH_KEY_URL}")
 
 	if [ -n "$EC2_SSH_KEY" ]; then
@@ -71,7 +89,7 @@ ec2_init()
 
 		grep -q "$EC2_SSH_KEY" "$SSH_KEY_FILE"
 		if [ $? -ne 0 ]; then
-			echo "Setting EC2 SSH public key for user ${EC2_USER}: ${EC2_SSH_KEY##* }"
+			echo "Setting ${CLOUD_TYPE} SSH public key for user ${EC2_USER}: ${EC2_SSH_KEY##* }"
 			echo "$EC2_SSH_KEY" >> "$SSH_KEY_FILE"
 		fi
 	fi



CVS commit: src/distrib/utils/embedded

2022-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 15 18:32:31 UTC 2022

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf evbarm.conf
src/distrib/utils/embedded/files: ec2_init

Log Message:
ec2_init: Add support for Oracle Cloud


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/distrib/utils/embedded/conf/arm64.conf
cvs rdiff -u -r1.39 -r1.40 src/distrib/utils/embedded/conf/evbarm.conf
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/embedded/files/ec2_init

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



CVS commit: src/sys/arch/riscv/riscv

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 16:58:16 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: locore.S

Log Message:
More register use re-org.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/riscv/riscv/locore.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/riscv/riscv/locore.S
diff -u src/sys/arch/riscv/riscv/locore.S:1.34 src/sys/arch/riscv/riscv/locore.S:1.35
--- src/sys/arch/riscv/riscv/locore.S:1.34	Sat Oct 15 16:34:29 2022
+++ src/sys/arch/riscv/riscv/locore.S	Sat Oct 15 16:58:16 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.34 2022/10/15 16:34:29 skrll Exp $ */
+/* $NetBSD: locore.S,v 1.35 2022/10/15 16:58:16 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2022 The NetBSD Foundation, Inc.
@@ -90,8 +90,8 @@ ENTRY_NP(start)
 	/*
 	 * The BP only executes from here on.
 	 */
-	mv	s0, a0			// copy hartid
-	mv	s1, a1			// copy dtb PA
+	mv	s10, a0			// copy hartid
+	mv	s11, a1			// copy dtb PA
 
 	/* set the stack pointer for boot */
 	PTR_LA	t0, _C_LABEL(bootstk)
@@ -106,10 +106,10 @@ ENTRY_NP(start)
 	VPRINTXNL(a0)
 
 	VPRINTS("hart:")
-	VPRINTXNL(s0)
+	VPRINTXNL(s10)
 
 	VPRINTS("dtb: ")
-	VPRINTXNL(s1)
+	VPRINTXNL(s11)
 
 	/*
 	 * Calculate the difference between the VA and PA for start and
@@ -262,7 +262,7 @@ ENTRY_NP(start)
 	li	s7, PTE_KERN | PTE_R | PTE_W
 
 	// DTB physical address
-	mv	s0, s1
+	mv	s0, s11
 	srli	s0, s0, SEGSHIFT	// round down to NBSEG, and shift in
 	slli	s0, s0, (SEGSHIFT - PGSHIFT + PTE_PPN_SHIFT)	// ... to PPN
 	or	s0, s0, s7
@@ -349,13 +349,13 @@ vstart:
 	PTR_S	s8, 0(t0)	/* kern_vtopdiff = start(virt) - start(phys) */
 
 #if notyet
-	mv	a0, s1			// dtb
+	mv	a0, s11			// dtb
 	call	_C_LABEL(init_mmu)
 #endif
 
 	li	t0, VM_MIN_KERNEL_ADDRESS + VM_KERNEL_SIZE
 	li	t1, NBSEG - 1
-	and	t1, s1, t1
+	and	t1, s11, t1
 	or	t0, t0, t1
 
 	/* Set the global pointer */



CVS commit: src/sys/arch/riscv/riscv

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 16:58:16 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: locore.S

Log Message:
More register use re-org.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/riscv/riscv/locore.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/riscv/riscv

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 16:34:29 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: locore.S

Log Message:
Shuffle some register usage


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/riscv/riscv/locore.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/riscv/riscv/locore.S
diff -u src/sys/arch/riscv/riscv/locore.S:1.33 src/sys/arch/riscv/riscv/locore.S:1.34
--- src/sys/arch/riscv/riscv/locore.S:1.33	Sat Oct 15 16:29:56 2022
+++ src/sys/arch/riscv/riscv/locore.S	Sat Oct 15 16:34:29 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.33 2022/10/15 16:29:56 skrll Exp $ */
+/* $NetBSD: locore.S,v 1.34 2022/10/15 16:34:29 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2022 The NetBSD Foundation, Inc.
@@ -94,8 +94,8 @@ ENTRY_NP(start)
 	mv	s1, a1			// copy dtb PA
 
 	/* set the stack pointer for boot */
-	PTR_LA	s8, _C_LABEL(bootstk)
-	mv	sp, s8
+	PTR_LA	t0, _C_LABEL(bootstk)
+	mv	sp, t0
 
 	VPRINTS("\n\nNetBSD start\n\n")
 	VPRINTS("sp:  ")
@@ -115,10 +115,10 @@ ENTRY_NP(start)
 	 * Calculate the difference between the VA and PA for start and
 	 * keep in s8.  Store this in kern_vtopdiff once the MMU is on.
 	 */
-	PTR_LA	s11, start
+	PTR_LA	t0, start
 	PTR_L	s8, .Lstart
 
-	sub	s8, s8, s11
+	sub	s8, s8, t0
 
 	PTR_LA	s5, _C_LABEL(lwp0uspace)
 	PTR_LA	s6, _C_LABEL(bootstk)
@@ -330,9 +330,9 @@ vstart:
 	PTR_LA	a0, _C_LABEL(cpu_exception_handler)
 	csrw	stvec, a0
 
-	PTR_LA	s2, bootstk		// top of lwp0uspace
-	PTR_S	s2, L_PCB(tp)		// set uarea of lwp (already zeroed)
-	addi	sp, s2, -TF_LEN		// switch to new stack
+	PTR_LA	t0, bootstk		// top of lwp0uspace
+	PTR_S	t0, L_PCB(tp)		// set uarea of lwp (already zeroed)
+	addi	sp, t0, -TF_LEN		// switch to new stack
 	PTR_S	sp, L_MD_UTF(tp)	// store pointer to empty trapframe
 
 	PTR_LA	t1, _C_LABEL(kernel_pmap_store)
@@ -345,8 +345,8 @@ vstart:
 	 * Store kern_vtopdiff (the difference between the physical
 	 * and virtual address of the "start" symbol).
 	 */
-	PTR_LA	s11, _C_LABEL(kern_vtopdiff)
-	PTR_S	s8, 0(s11)	/* kern_vtopdiff = start(virt) - start(phys) */
+	PTR_LA	t0, _C_LABEL(kern_vtopdiff)
+	PTR_S	s8, 0(t0)	/* kern_vtopdiff = start(virt) - start(phys) */
 
 #if notyet
 	mv	a0, s1			// dtb



CVS commit: src/sys/arch/riscv/riscv

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 16:34:29 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: locore.S

Log Message:
Shuffle some register usage


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/riscv/riscv/locore.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/riscv/riscv

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 16:29:56 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: locore.S

Log Message:
Comment re-arragement


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/riscv/riscv/locore.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/riscv/riscv/locore.S
diff -u src/sys/arch/riscv/riscv/locore.S:1.32 src/sys/arch/riscv/riscv/locore.S:1.33
--- src/sys/arch/riscv/riscv/locore.S:1.32	Sat Oct 15 16:20:32 2022
+++ src/sys/arch/riscv/riscv/locore.S	Sat Oct 15 16:29:56 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.32 2022/10/15 16:20:32 skrll Exp $ */
+/* $NetBSD: locore.S,v 1.33 2022/10/15 16:29:56 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2022 The NetBSD Foundation, Inc.
@@ -120,17 +120,17 @@ ENTRY_NP(start)
 
 	sub	s8, s8, s11
 
+	PTR_LA	s5, _C_LABEL(lwp0uspace)
+	PTR_LA	s6, _C_LABEL(bootstk)
+
 	/*
 	 * Our load address is not fixed, but our VA is.  We need to construct
 	 * an initial PDETAB.
+	 *
+	 * The space for the inital page table is included in the kernel
+	 * .bss size calculation so we know the space exists.
 	 */
 
-	PTR_LA	s5, _C_LABEL(lwp0uspace)
-	PTR_LA	s6, _C_LABEL(bootstk)
-
-	// The space for the inital page table is included in the kernel
-	// .bss size calculation so we know the space exists.
-
 	li	a1, 0
 	PTR_LA	s2, _C_LABEL(l1_pte)
 	mv	s4, s2			// last page table



CVS commit: src/sys/arch/riscv/riscv

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 16:29:56 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: locore.S

Log Message:
Comment re-arragement


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/riscv/riscv/locore.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/riscv/riscv

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 16:20:32 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: locore.S

Log Message:
Remove unnecessary register assignments


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/riscv/riscv/locore.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/riscv/riscv

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 16:20:32 UTC 2022

Modified Files:
src/sys/arch/riscv/riscv: locore.S

Log Message:
Remove unnecessary register assignments


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/riscv/riscv/locore.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/riscv/riscv/locore.S
diff -u src/sys/arch/riscv/riscv/locore.S:1.31 src/sys/arch/riscv/riscv/locore.S:1.32
--- src/sys/arch/riscv/riscv/locore.S:1.31	Fri Oct 14 08:10:22 2022
+++ src/sys/arch/riscv/riscv/locore.S	Sat Oct 15 16:20:32 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.31 2022/10/14 08:10:22 skrll Exp $ */
+/* $NetBSD: locore.S,v 1.32 2022/10/15 16:20:32 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014, 2022 The NetBSD Foundation, Inc.
@@ -125,9 +125,6 @@ ENTRY_NP(start)
 	 * an initial PDETAB.
 	 */
 
-	li	s10, PAGE_SIZE
-	li	s9, USPACE
-
 	PTR_LA	s5, _C_LABEL(lwp0uspace)
 	PTR_LA	s6, _C_LABEL(bootstk)
 



CVS commit: src/sys/kern

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:28:23 UTC 2022

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

Log Message:
kobj(9): Rephrase kobj_load and kobj_affix positively.

Write error cases as branches, normal cases as straight-line code.

Side effect: One fewer call to kobj_jettison in case of error in
kobj_affix, but it already calls kobj_jettison once in the error case
via kobj_unload, which does kobj_jettison itself, and kobj_jettison
is idempotent.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/kern/subr_kobj.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/subr_kobj.c
diff -u src/sys/kern/subr_kobj.c:1.72 src/sys/kern/subr_kobj.c:1.73
--- src/sys/kern/subr_kobj.c:1.72	Sat Oct 15 15:27:20 2022
+++ src/sys/kern/subr_kobj.c	Sat Oct 15 15:28:23 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kobj.c,v 1.72 2022/10/15 15:27:20 riastradh Exp $	*/
+/*	$NetBSD: subr_kobj.c,v 1.73 2022/10/15 15:28:23 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.72 2022/10/15 15:27:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.73 2022/10/15 15:28:23 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"
@@ -610,10 +610,13 @@ kobj_load(kobj_t ko)
 	 * symbols will be done by kobj_affix().
 	 */
 	error = kobj_checksyms(ko, false);
-	if (error == 0) {
-		error = kobj_relocate(ko, true);
-	}
- out:
+	if (error)
+		goto out;
+
+	error = kobj_relocate(ko, true);
+	if (error)
+		goto out;
+out:
 	if (hdr != NULL) {
 		kobj_free(ko, hdr, sizeof(*hdr));
 	}
@@ -731,21 +734,22 @@ kobj_affix(kobj_t ko, const char *name)
 
 	/* Cache addresses of undefined symbols. */
 	error = kobj_checksyms(ko, true);
+	if (error)
+		goto out;
 
 	/* Now do global relocations. */
-	if (error == 0)
-		error = kobj_relocate(ko, false);
+	error = kobj_relocate(ko, false);
+	if (error)
+		goto out;
 
 	/*
 	 * Now that we know the name, register the symbol table.
 	 * Do after global relocations because ksyms will pack
 	 * the table.
 	 */
-	if (error == 0) {
-		ksyms_modload(ko->ko_name, ko->ko_symtab, ko->ko_symcnt *
-		sizeof(Elf_Sym), ko->ko_strtab, ko->ko_strtabsz);
-		ko->ko_ksyms = true;
-	}
+	ksyms_modload(ko->ko_name, ko->ko_symtab,
+	ko->ko_symcnt * sizeof(Elf_Sym), ko->ko_strtab, ko->ko_strtabsz);
+	ko->ko_ksyms = true;
 
 	/* Jettison unneeded memory post-link. */
 	kobj_jettison(ko);
@@ -755,47 +759,55 @@ kobj_affix(kobj_t ko, const char *name)
 	 *
 	 * Most architectures use this opportunity to flush their caches.
 	 */
-	if (error == 0 && ko->ko_text_address != 0) {
+	if (ko->ko_text_address != 0) {
 		error = kobj_machdep(ko, (void *)ko->ko_text_address,
 		ko->ko_text_size, true);
-		if (error != 0)
+		if (error) {
 			kobj_error(ko, "machine dependent init failed (text)"
 			" %d", error);
+			goto out;
+		}
 	}
 
-	if (error == 0 && ko->ko_data_address != 0) {
+	if (ko->ko_data_address != 0) {
 		error = kobj_machdep(ko, (void *)ko->ko_data_address,
 		ko->ko_data_size, true);
-		if (error != 0)
+		if (error) {
 			kobj_error(ko, "machine dependent init failed (data)"
 			" %d", error);
+			goto out;
+		}
 	}
 
-	if (error == 0 && ko->ko_rodata_address != 0) {
+	if (ko->ko_rodata_address != 0) {
 		error = kobj_machdep(ko, (void *)ko->ko_rodata_address,
 		ko->ko_rodata_size, true);
-		if (error != 0)
+		if (error) {
 			kobj_error(ko, "machine dependent init failed (rodata)"
 			" %d", error);
+			goto out;
+		}
 	}
 
-	if (error == 0) {
-		ko->ko_loaded = true;
+	ko->ko_loaded = true;
 
-		/* Change the memory protections, when needed. */
-		if (ko->ko_text_address != 0) {
-			uvm_km_protect(module_map, ko->ko_text_address,
-			 ko->ko_text_size, VM_PROT_READ|VM_PROT_EXECUTE);
-		}
-		if (ko->ko_rodata_address != 0) {
-			uvm_km_protect(module_map, ko->ko_rodata_address,
-			ko->ko_rodata_size, VM_PROT_READ);
-		}
-	} else {
+	/* Change the memory protections, when needed. */
+	if (ko->ko_text_address != 0) {
+		uvm_km_protect(module_map, ko->ko_text_address,
+		ko->ko_text_size, VM_PROT_READ|VM_PROT_EXECUTE);
+	}
+	if (ko->ko_rodata_address != 0) {
+		uvm_km_protect(module_map, ko->ko_rodata_address,
+		ko->ko_rodata_size, VM_PROT_READ);
+	}
+
+	/* Success! */
+	error = 0;
+
+out:	if (error) {
 		/* If there was an error, destroy the whole object. */
 		kobj_unload(ko);
 	}
-
 	return error;
 }
 



CVS commit: src/sys/kern

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:28:23 UTC 2022

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

Log Message:
kobj(9): Rephrase kobj_load and kobj_affix positively.

Write error cases as branches, normal cases as straight-line code.

Side effect: One fewer call to kobj_jettison in case of error in
kobj_affix, but it already calls kobj_jettison once in the error case
via kobj_unload, which does kobj_jettison itself, and kobj_jettison
is idempotent.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/kern/subr_kobj.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

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:27:20 UTC 2022

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

Log Message:
kobj(9): Fix kobj_read_mem error branches.

Rewrite positively to simplify logic: Write errors as branches,
normal case as straight-line code.

In the case where allocate=true but arithmetic overflow occurs, this
avoids trying to kmem_free null, which is forbidden.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/kern/subr_kobj.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/subr_kobj.c
diff -u src/sys/kern/subr_kobj.c:1.71 src/sys/kern/subr_kobj.c:1.72
--- src/sys/kern/subr_kobj.c:1.71	Sat Oct 15 15:23:24 2022
+++ src/sys/kern/subr_kobj.c	Sat Oct 15 15:27:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kobj.c,v 1.71 2022/10/15 15:23:24 riastradh Exp $	*/
+/*	$NetBSD: subr_kobj.c,v 1.72 2022/10/15 15:27:20 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.71 2022/10/15 15:23:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.72 2022/10/15 15:27:20 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"
@@ -1145,7 +1145,7 @@ kobj_read_mem(kobj_t ko, void **basep, s
 bool allocate)
 {
 	void *base = *basep;
-	int error;
+	int error = 0;
 
 	KASSERT(ko->ko_source != NULL);
 
@@ -1154,31 +1154,23 @@ kobj_read_mem(kobj_t ko, void **basep, s
 		(unsigned long long)off);
 		error = EINVAL;
 		base = NULL;
+		goto out;
 	} else if (ko->ko_memsize != -1 &&
 	(size > ko->ko_memsize || off > ko->ko_memsize - size)) {
 		kobj_error(ko, "preloaded object short");
 		error = EINVAL;
 		base = NULL;
-	} else if (allocate) {
-		base = kmem_alloc(size, KM_SLEEP);
-		error = 0;
-	} else {
-		error = 0;
+		goto out;
 	}
 
-	if (error == 0) {
-		/* Copy the section */
-		memcpy(base, (uint8_t *)ko->ko_source + off, size);
-	}
+	if (allocate)
+		base = kmem_alloc(size, KM_SLEEP);
 
-	if (allocate && error != 0) {
-		kmem_free(base, size);
-		base = NULL;
-	}
+	/* Copy the section */
+	memcpy(base, (uint8_t *)ko->ko_source + off, size);
 
-	if (allocate)
+out:	if (allocate)
 		*basep = base;
-
 	return error;
 }
 



CVS commit: src/sys/kern

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:27:20 UTC 2022

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

Log Message:
kobj(9): Fix kobj_read_mem error branches.

Rewrite positively to simplify logic: Write errors as branches,
normal case as straight-line code.

In the case where allocate=true but arithmetic overflow occurs, this
avoids trying to kmem_free null, which is forbidden.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/kern/subr_kobj.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

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:23:24 UTC 2022

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

Log Message:
kobj(9): Avoid arithmetic overflow in overflow detection.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/kern/subr_kobj.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/subr_kobj.c
diff -u src/sys/kern/subr_kobj.c:1.70 src/sys/kern/subr_kobj.c:1.71
--- src/sys/kern/subr_kobj.c:1.70	Sat Oct 15 15:22:27 2022
+++ src/sys/kern/subr_kobj.c	Sat Oct 15 15:23:24 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kobj.c,v 1.70 2022/10/15 15:22:27 riastradh Exp $	*/
+/*	$NetBSD: subr_kobj.c,v 1.71 2022/10/15 15:23:24 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.70 2022/10/15 15:22:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.71 2022/10/15 15:23:24 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"
@@ -1154,7 +1154,8 @@ kobj_read_mem(kobj_t ko, void **basep, s
 		(unsigned long long)off);
 		error = EINVAL;
 		base = NULL;
-	} else if (ko->ko_memsize != -1 && off + size > ko->ko_memsize) {
+	} else if (ko->ko_memsize != -1 &&
+	(size > ko->ko_memsize || off > ko->ko_memsize - size)) {
 		kobj_error(ko, "preloaded object short");
 		error = EINVAL;
 		base = NULL;



CVS commit: src/sys/kern

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:23:24 UTC 2022

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

Log Message:
kobj(9): Avoid arithmetic overflow in overflow detection.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/kern/subr_kobj.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

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:22:27 UTC 2022

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

Log Message:
kobj(9): Forbid reading negative offsets.

Shouldn't have any functional change, but let's fail with EINVAL
rather than reading arbitrarily distant memory.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/kern/subr_kobj.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/subr_kobj.c
diff -u src/sys/kern/subr_kobj.c:1.69 src/sys/kern/subr_kobj.c:1.70
--- src/sys/kern/subr_kobj.c:1.69	Sat Aug 21 23:00:32 2021
+++ src/sys/kern/subr_kobj.c	Sat Oct 15 15:22:27 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kobj.c,v 1.69 2021/08/21 23:00:32 andvar Exp $	*/
+/*	$NetBSD: subr_kobj.c,v 1.70 2022/10/15 15:22:27 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.69 2021/08/21 23:00:32 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.70 2022/10/15 15:22:27 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"
@@ -1149,7 +1149,12 @@ kobj_read_mem(kobj_t ko, void **basep, s
 
 	KASSERT(ko->ko_source != NULL);
 
-	if (ko->ko_memsize != -1 && off + size > ko->ko_memsize) {
+	if (off < 0) {
+		kobj_error(ko, "negative offset %lld",
+		(unsigned long long)off);
+		error = EINVAL;
+		base = NULL;
+	} else if (ko->ko_memsize != -1 && off + size > ko->ko_memsize) {
 		kobj_error(ko, "preloaded object short");
 		error = EINVAL;
 		base = NULL;



CVS commit: src/sys/kern

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:22:27 UTC 2022

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

Log Message:
kobj(9): Forbid reading negative offsets.

Shouldn't have any functional change, but let's fail with EINVAL
rather than reading arbitrarily distant memory.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/kern/subr_kobj.c

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



CVS commit: src/sys/miscfs/specfs

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:20:46 UTC 2022

Modified Files:
src/sys/miscfs/specfs: spec_vnops.c

Log Message:
specfs(9): Attribute blame by stack trace for write to r/o medium.


To generate a diff of this commit:
cvs rdiff -u -r1.215 -r1.216 src/sys/miscfs/specfs/spec_vnops.c

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



CVS commit: src/sys/miscfs/specfs

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:20:46 UTC 2022

Modified Files:
src/sys/miscfs/specfs: spec_vnops.c

Log Message:
specfs(9): Attribute blame by stack trace for write to r/o medium.


To generate a diff of this commit:
cvs rdiff -u -r1.215 -r1.216 src/sys/miscfs/specfs/spec_vnops.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/miscfs/specfs/spec_vnops.c
diff -u src/sys/miscfs/specfs/spec_vnops.c:1.215 src/sys/miscfs/specfs/spec_vnops.c:1.216
--- src/sys/miscfs/specfs/spec_vnops.c:1.215	Wed Sep 21 10:59:10 2022
+++ src/sys/miscfs/specfs/spec_vnops.c	Sat Oct 15 15:20:46 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: spec_vnops.c,v 1.215 2022/09/21 10:59:10 riastradh Exp $	*/
+/*	$NetBSD: spec_vnops.c,v 1.216 2022/10/15 15:20:46 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.215 2022/09/21 10:59:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.216 2022/10/15 15:20:46 riastradh Exp $");
+
+#ifdef _KERNEL_OPT
+#include "opt_ddb.h"
+#endif
 
 #include 
 #include 
@@ -86,6 +90,10 @@ __KERNEL_RCSID(0, "$NetBSD: spec_vnops.c
 #include 
 #include 
 
+#ifdef DDB
+#include 
+#endif
+
 /*
  * Lock order:
  *
@@ -1485,6 +1493,9 @@ spec_strategy(void *v)
 			if (mp && (mp->mnt_flag & MNT_RDONLY)) {
 printf("%s blk %"PRId64" written while ro!\n",
 mp->mnt_stat.f_mntonname, bp->b_blkno);
+#ifdef DDB
+db_stacktrace();
+#endif
 			}
 		}
 #endif /* DIAGNOSTIC */



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

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:20:06 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/i915drm: i915_pci_autoconf.c

Log Message:
i915: Suspend ioctls while device is suspended.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c

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

Modified files:

Index: src/sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c
diff -u src/sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c:1.13 src/sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c:1.14
--- src/sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c:1.13	Thu Sep 22 14:37:38 2022
+++ src/sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c	Sat Oct 15 15:20:06 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_pci_autoconf.c,v 1.13 2022/09/22 14:37:38 riastradh Exp $	*/
+/*	$NetBSD: i915_pci_autoconf.c,v 1.14 2022/10/15 15:20:06 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i915_pci_autoconf.c,v 1.13 2022/09/22 14:37:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_pci_autoconf.c,v 1.14 2022/10/15 15:20:06 riastradh Exp $");
 
 #include 
 #include 
@@ -39,6 +39,7 @@ __KERNEL_RCSID(0, "$NetBSD: i915_pci_aut
 #include 
 #include 
 
+#include 
 #include 
 
 #include "i915_drv.h"
@@ -255,6 +256,8 @@ i915drmkms_suspend(device_t self, const 
 	struct drm_device *const dev = sc->sc_drm_dev;
 	int ret;
 
+	drm_suspend_ioctl(dev);
+
 	ret = i915_drm_prepare(dev);
 	if (ret)
 		return false;
@@ -277,12 +280,13 @@ i915drmkms_resume(device_t self, const p
 
 	ret = i915_drm_resume_early(dev);
 	if (ret)
-		return false;
+		goto out;
 	ret = i915_drm_resume(dev);
 	if (ret)
-		return false;
+		goto out;
 
-	return true;
+out:	drm_resume_ioctl(dev);
+	return ret == 0;
 }
 
 static void



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

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:20:06 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/i915drm: i915_pci_autoconf.c

Log Message:
i915: Suspend ioctls while device is suspended.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/sys/external/bsd/drm2/i915drm/i915_pci_autoconf.c

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



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

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:19:28 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_drv.c drm_ioctl.c
src/sys/external/bsd/drm2/dist/include/drm: drm_device.h drm_ioctl.h

Log Message:
drm: New mechanism to suspend ioctls during system suspend.

drm drivers must opt into this by calling drm_suspend_ioctl in their
driver suspend routine, and drm_resume_ioctl in their driver resume
routine.

This is a stop-gap measure -- it would be better to fill in the
pm_runtime_* API with new pmf(9) hooks to acquire/release references
to devices for coordinating with suspend/resume, but getting the
details right is tricky, and this stop-gap is enough to get i915
suspend/resume to work reliably on my Kaby Lake laptop.  Rather than
wait until I've got all the details right, let's just go with this
stop-gap for now.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/external/bsd/drm2/dist/drm/drm_drv.c \
src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/include/drm/drm_device.h
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/include/drm/drm_ioctl.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/external/bsd/drm2/dist/drm/drm_drv.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.23 src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.24
--- src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.23	Sun Jul 17 14:11:18 2022
+++ src/sys/external/bsd/drm2/dist/drm/drm_drv.c	Sat Oct 15 15:19:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_drv.c,v 1.23 2022/07/17 14:11:18 riastradh Exp $	*/
+/*	$NetBSD: drm_drv.c,v 1.24 2022/10/15 15:19:28 riastradh Exp $	*/
 
 /*
  * Created: Fri Jan 19 10:48:35 2001 by fa...@acm.org
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.23 2022/07/17 14:11:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.24 2022/10/15 15:19:28 riastradh Exp $");
 
 #include 
 #include 
@@ -695,6 +695,12 @@ int drm_dev_init(struct drm_device *dev,
 	mutex_init(>filelist_mutex);
 	mutex_init(>clientlist_mutex);
 	mutex_init(>master_mutex);
+#ifdef __NetBSD__
+	mutex_init(>suspend_lock);
+	DRM_INIT_WAITQUEUE(>suspend_cv, "drmsusp");
+	dev->active_ioctls = 0;
+	dev->suspender = NULL;
+#endif
 
 	dev->sc_monitor_hotplug.smpsw_name = PSWITCH_HK_DISPLAY_CYCLE;
 	dev->sc_monitor_hotplug.smpsw_type = PSWITCH_TYPE_HOTKEY;
@@ -757,6 +763,12 @@ err_pswitch:
 #ifndef __NetBSD__		/* XXX drm sysfs */
 	put_device(dev->dev);
 #endif
+#ifdef __NetBSD__
+	KASSERT(dev->suspender == NULL);
+	KASSERT(dev->active_ioctls == 0);
+	DRM_DESTROY_WAITQUEUE(>suspend_cv);
+	mutex_destroy(>suspend_lock);
+#endif
 	mutex_destroy(>master_mutex);
 	mutex_destroy(>clientlist_mutex);
 	mutex_destroy(>filelist_mutex);
@@ -844,6 +856,13 @@ void drm_dev_fini(struct drm_device *dev
 	put_device(dev->dev);
 #endif
 
+#ifdef __NetBSD__
+	KASSERT(dev->suspender == NULL);
+	KASSERT(dev->active_ioctls == 0);
+	DRM_DESTROY_WAITQUEUE(>suspend_cv);
+	mutex_destroy(>suspend_lock);
+#endif
+
 	mutex_destroy(>master_mutex);
 	mutex_destroy(>clientlist_mutex);
 	mutex_destroy(>filelist_mutex);
Index: src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c:1.23 src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c:1.24
--- src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c:1.23	Sat Aug 27 21:24:15 2022
+++ src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c	Sat Oct 15 15:19:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_ioctl.c,v 1.23 2022/08/27 21:24:15 riastradh Exp $	*/
+/*	$NetBSD: drm_ioctl.c,v 1.24 2022/10/15 15:19:28 riastradh Exp $	*/
 
 /*
  * Created: Fri Jan  8 09:01:26 1999 by fa...@valinux.com
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_ioctl.c,v 1.23 2022/08/27 21:24:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_ioctl.c,v 1.24 2022/10/15 15:19:28 riastradh Exp $");
 
 #include 
 #include 
@@ -739,6 +739,58 @@ static const struct drm_ioctl_desc drm_i
 
 #define DRM_CORE_IOCTL_COUNT	ARRAY_SIZE( drm_ioctls )
 
+#ifdef __NetBSD__
+/* ioctl suspend/resume */
+
+static void
+drm_ioctl_enter(struct drm_device *dev)
+{
+	int ret __diagused;
+
+	mutex_lock(>suspend_lock);
+	DRM_WAIT_NOINTR_UNTIL(ret, >suspend_cv, >suspend_lock,
+	dev->suspender == NULL);
+	KASSERTMSG(ret == 0, "error=%d", -ret);
+	dev->active_ioctls++;
+	mutex_unlock(>suspend_lock);
+}
+
+static void
+drm_ioctl_exit(struct drm_device *dev)
+{
+
+	mutex_lock(>suspend_lock);
+	KASSERT(dev->suspender == NULL);
+	if (--dev->active_ioctls == 0)
+		DRM_WAKEUP_ALL(>suspend_cv, >suspend_lock);
+	mutex_unlock(>suspend_lock);
+}
+
+void
+drm_suspend_ioctl(struct drm_device *dev)
+{
+	int ret;
+
+	mutex_lock(>suspend_lock);
+	DRM_WAIT_NOINTR_UNTIL(ret, >suspend_cv, >suspend_lock,
+	dev->suspender == NULL && dev->active_ioctls == 0);
+	

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

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 15:19:28 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_drv.c drm_ioctl.c
src/sys/external/bsd/drm2/dist/include/drm: drm_device.h drm_ioctl.h

Log Message:
drm: New mechanism to suspend ioctls during system suspend.

drm drivers must opt into this by calling drm_suspend_ioctl in their
driver suspend routine, and drm_resume_ioctl in their driver resume
routine.

This is a stop-gap measure -- it would be better to fill in the
pm_runtime_* API with new pmf(9) hooks to acquire/release references
to devices for coordinating with suspend/resume, but getting the
details right is tricky, and this stop-gap is enough to get i915
suspend/resume to work reliably on my Kaby Lake laptop.  Rather than
wait until I've got all the details right, let's just go with this
stop-gap for now.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/external/bsd/drm2/dist/drm/drm_drv.c \
src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/include/drm/drm_device.h
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/include/drm/drm_ioctl.h

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



CVS commit: src/share/man/man9

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 14:54:21 UTC 2022

Modified Files:
src/share/man/man9: vmem.9

Log Message:
vmem(9): Clarify possible failure modes.

Note that vmem_alloc and vmem_xalloc have failure modes -- failing
with ENOMEM despite VM_SLEEP, or importing or sleeping forever --
that appear to be bugs when align/phase/nocross/minaddr/maxaddr are
specified.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man9/vmem.9

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/man9/vmem.9
diff -u src/share/man/man9/vmem.9:1.20 src/share/man/man9/vmem.9:1.21
--- src/share/man/man9/vmem.9:1.20	Tue Jun 16 01:29:00 2020
+++ src/share/man/man9/vmem.9	Sat Oct 15 14:54:21 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vmem.9,v 1.20 2020/06/16 01:29:00 thorpej Exp $
+.\"	$NetBSD: vmem.9,v 1.21 2022/10/15 14:54:21 riastradh Exp $
 .\"
 .\" Copyright (c)2006 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -500,18 +500,45 @@ The caller must ensure that no one will 
 .\" 
 .Sh RETURN VALUES
 .Fn vmem_create
-return a pointer to the newly allocated vmem_t.
-Otherwise, it returns
-.Dv NULL .
-.Pp
-On success,
-.Fn vmem_xalloc
 and
+.Fn vmem_xcreate
+return a pointer to the newly allocated vmem_t on success, or
+.Dv NULL
+if
+.Dv VM_NOSLEEP
+was specified and memory could not be allocated immediately.
+.Pp
+.Fn vmem_add
+returns 0 on success, or
+.Er ENOMEM
+if
+.Dv VM_NOSLEEP
+was specified and memory could not be allocated immediately to record
+the region.
+.Pp
 .Fn vmem_alloc
-return 0.
-Otherwise,
-.Dv ENOMEM
-is returned.
+and
+.Fn vmem_xalloc
+return 0 on success, or
+.Er ENOMEM
+if either:
+.Bl -dash
+.It
+.Dv VM_NOSLEEP
+was specified and a matching region could not be allocated immediately;
+or
+.It
+non-default
+.Fa align ,
+.Fa phase ,
+or
+.Fa nocross
+parameters were specified, and a matching region could not be allocated
+without calling the backing
+.Fa allocfn
+passed to
+.Fn vmem_create .
+.El
 .\" 
 .Sh CODE REFERENCES
 The
@@ -546,3 +573,29 @@ and
 .Xr RUN_ONCE 9 ,
 so it cannot be used as early during system bootstrap as
 .Xr extent 9 .
+.Pp
+.Nm
+has no way to pass
+.Fa align ,
+.Fa phase ,
+.Fa nocross ,
+.Fa minaddr ,
+or
+.Fa maxaddr
+constraints into the backing allocator
+.Fa allocfn ,
+so even if
+.Dv VM_SLEEP
+is specified,
+.Fn vmem_alloc
+and
+.Fn vmem_xalloc
+may spuriously fail immediately with
+.Fa align ,
+.Fa phase ,
+or
+.Fa nocross ,
+or sleep forever with
+.Fa minaddr
+or
+.Fa maxaddr .



CVS commit: src/share/man/man9

2022-10-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 15 14:54:21 UTC 2022

Modified Files:
src/share/man/man9: vmem.9

Log Message:
vmem(9): Clarify possible failure modes.

Note that vmem_alloc and vmem_xalloc have failure modes -- failing
with ENOMEM despite VM_SLEEP, or importing or sleeping forever --
that appear to be bugs when align/phase/nocross/minaddr/maxaddr are
specified.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man9/vmem.9

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

2022-10-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct 15 14:03:16 UTC 2022

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

Log Message:
Fix style and typo in comments. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/pciide_pdc202xx_reg.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/pciide_pdc202xx_reg.h
diff -u src/sys/dev/pci/pciide_pdc202xx_reg.h:1.15 src/sys/dev/pci/pciide_pdc202xx_reg.h:1.16
--- src/sys/dev/pci/pciide_pdc202xx_reg.h:1.15	Mon Oct 19 18:41:16 2009
+++ src/sys/dev/pci/pciide_pdc202xx_reg.h	Sat Oct 15 14:03:16 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pciide_pdc202xx_reg.h,v 1.15 2009/10/19 18:41:16 bouyer Exp $ */
+/*	$NetBSD: pciide_pdc202xx_reg.h,v 1.16 2022/10/15 14:03:16 rin Exp $ */
 
 /*
  * Copyright (c) 1999 Manuel Bouyer.
@@ -35,13 +35,13 @@
 #define PDC2xx_STATE		0x50
 #define PDC2xx_STATE_IDERAID		0x0001
 #define PDC2xx_STATE_NATIVE		0x0080
-/* controller initial state values(PDC20246 only) */
+/* controller initial state values (PDC20246 only) */
 #define PDC246_STATE_SHIPID		0x8000
 #define PDC246_STATE_IOCHRDY		0x0400
 #define PDC246_STATE_LBA(channel)	(0x0100 << (channel))
 #define PDC246_STATE_ISAIRQ		0x0008
 #define PDC246_STATE_EN(channel)	(0x0002 << (channel))
-/* controller initial state values(PDC20262 only) */
+/* controller initial state values (PDC20262 only) */
 #define PDC262_STATE_EN(chan)		(0x1000 << (chan))
 #define PDC262_STATE_80P(chan)		(0x0400 << (chan))
 
@@ -88,7 +88,7 @@
 #define PDC262_SCR_GEN_LAT	0x20
 #define PDC265_SCR_GEN_LAT	0x03
 
-/* ATAPI port ((PDC20262 only) (4 bytes) */
+/* ATAPI port (PDC20262 only, 4 bytes) */
 #define PDC262_ATAPI(chan) (0x20 + (4 * (chan)))
 #define PDC262_ATAPI_WC_MASK	0x0fff
 #define PDC262_ATAPI_DMA_READ	0x1000
@@ -98,7 +98,7 @@
 #define PDC262_ATAPI_LBA48_WRITE 0x0600
 
 /*
- * The timings provided here cmoes from the PDC20262 docs. I hope they are
+ * The timings provided here comes from the PDC20262 docs. I hope they are
  * right for the PDC20246 too ...
  */
 



CVS commit: src/sys/dev/pci

2022-10-15 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Oct 15 14:03:16 UTC 2022

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

Log Message:
Fix style and typo in comments. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/pciide_pdc202xx_reg.h

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



CVS commit: src/sys/arch/arm

2022-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 15 11:31:40 UTC 2022

Modified Files:
src/sys/arch/arm: Makefile.inc
Removed Files:
src/sys/arch/arm/mpcore: dic.c dic_intr.h dicreg.h files.mpcore
mpcore_a2x_space.c mpcore_a4x_space.c mpcore_axi.c mpcore_clock.c
mpcore_pmr.c mpcore_space.c mpcorereg.h mpcorevar.h

Log Message:
Remove unused ARM11 MPCore code.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/Makefile.inc
cvs rdiff -u -r1.3 -r0 src/sys/arch/arm/mpcore/dic.c \
src/sys/arch/arm/mpcore/mpcore_a4x_space.c \
src/sys/arch/arm/mpcore/mpcore_axi.c \
src/sys/arch/arm/mpcore/mpcore_clock.c
cvs rdiff -u -r1.1 -r0 src/sys/arch/arm/mpcore/dic_intr.h \
src/sys/arch/arm/mpcore/dicreg.h src/sys/arch/arm/mpcore/mpcorevar.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/arm/mpcore/files.mpcore \
src/sys/arch/arm/mpcore/mpcorereg.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/arm/mpcore/mpcore_a2x_space.c \
src/sys/arch/arm/mpcore/mpcore_space.c
cvs rdiff -u -r1.5 -r0 src/sys/arch/arm/mpcore/mpcore_pmr.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/arch/arm/Makefile.inc
diff -u src/sys/arch/arm/Makefile.inc:1.1 src/sys/arch/arm/Makefile.inc:1.2
--- src/sys/arch/arm/Makefile.inc:1.1	Mon Apr  4 19:43:34 2011
+++ src/sys/arch/arm/Makefile.inc	Sat Oct 15 11:31:40 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.1 2011/04/04 19:43:34 dyoung Exp $
+#	$NetBSD: Makefile.inc,v 1.2 2022/10/15 11:31:40 jmcneill Exp $
 
 AARM=	${SYSDIR}/arch/arm/arm/*.S
 SARM=	${SYSDIR}/arch/arm/arm/*.[ch] ${SYSDIR}/arch/arm/include/*.h
@@ -13,7 +13,6 @@ SARM+=	${SYSDIR}/arch/arm/iomd/*.[ch]
 SARM+=	${SYSDIR}/arch/arm/ixp12x0/*.[ch]
 SARM+=	${SYSDIR}/arch/arm/mainbus/*.[ch]
 SARM+=	${SYSDIR}/arch/arm/marvell/*.[ch]
-SARM+=	${SYSDIR}/arch/arm/mpcore/*.[ch]
 SARM+=	${SYSDIR}/arch/arm/ofw/*.[ch]
 SARM+=	${SYSDIR}/arch/arm/omap/*.[ch]
 SARM+=	${SYSDIR}/arch/arm/pic/*.[ch]



CVS commit: src/sys/arch/arm

2022-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 15 11:31:40 UTC 2022

Modified Files:
src/sys/arch/arm: Makefile.inc
Removed Files:
src/sys/arch/arm/mpcore: dic.c dic_intr.h dicreg.h files.mpcore
mpcore_a2x_space.c mpcore_a4x_space.c mpcore_axi.c mpcore_clock.c
mpcore_pmr.c mpcore_space.c mpcorereg.h mpcorevar.h

Log Message:
Remove unused ARM11 MPCore code.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/Makefile.inc
cvs rdiff -u -r1.3 -r0 src/sys/arch/arm/mpcore/dic.c \
src/sys/arch/arm/mpcore/mpcore_a4x_space.c \
src/sys/arch/arm/mpcore/mpcore_axi.c \
src/sys/arch/arm/mpcore/mpcore_clock.c
cvs rdiff -u -r1.1 -r0 src/sys/arch/arm/mpcore/dic_intr.h \
src/sys/arch/arm/mpcore/dicreg.h src/sys/arch/arm/mpcore/mpcorevar.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/arm/mpcore/files.mpcore \
src/sys/arch/arm/mpcore/mpcorereg.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/arm/mpcore/mpcore_a2x_space.c \
src/sys/arch/arm/mpcore/mpcore_space.c
cvs rdiff -u -r1.5 -r0 src/sys/arch/arm/mpcore/mpcore_pmr.c

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



CVS commit: src/sys/arch/arm/arm

2022-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 15 11:19:23 UTC 2022

Modified Files:
src/sys/arch/arm/arm: efi_runtime.c

Log Message:
Add a boot option to disable EFI runtime services.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/arm/efi_runtime.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/arch/arm/arm/efi_runtime.c
diff -u src/sys/arch/arm/arm/efi_runtime.c:1.9 src/sys/arch/arm/arm/efi_runtime.c:1.10
--- src/sys/arch/arm/arm/efi_runtime.c:1.9	Sat Jun 18 08:13:44 2022
+++ src/sys/arch/arm/arm/efi_runtime.c	Sat Oct 15 11:19:23 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: efi_runtime.c,v 1.9 2022/06/18 08:13:44 skrll Exp $ */
+/* $NetBSD: efi_runtime.c,v 1.10 2022/10/15 11:19:23 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "efi.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: efi_runtime.c,v 1.9 2022/06/18 08:13:44 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: efi_runtime.c,v 1.10 2022/10/15 11:19:23 jmcneill Exp $");
 
 #include 
 #include 
@@ -43,6 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: efi_runtime.
 #include 
 
 #include 
+#include 
 
 #ifdef _LP64
 #define	EFIERR(x)	(0x8000 | x)
@@ -77,6 +78,12 @@ arm_efirt_init(paddr_t efi_system_table)
 	const size_t sz = PAGE_SIZE * 2;
 	vaddr_t va, cva;
 	paddr_t cpa;
+	int val;
+
+	if (get_bootconf_option(boot_args, "noefirt",
+BOOTOPT_TYPE_BOOLEAN, ) && val) {
+		return ENXIO;
+	}
 
 	va = uvm_km_alloc(kernel_map, sz, 0, UVM_KMF_VAONLY);
 	if (va == 0) {



CVS commit: src/sys/arch/arm/arm

2022-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 15 11:19:23 UTC 2022

Modified Files:
src/sys/arch/arm/arm: efi_runtime.c

Log Message:
Add a boot option to disable EFI runtime services.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/arm/efi_runtime.c

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



CVS commit: src/sys/arch

2022-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 15 11:07:39 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: bus_space.c db_interface.c locore.S
pmap.c
src/sys/arch/aarch64/conf: files.aarch64
src/sys/arch/aarch64/include: pmap.h
src/sys/arch/arm/acpi: acpi_machdep.c acpi_pci_graviton.c
acpi_pci_layerscape_gen4.c acpi_pci_n1sdp.c acpipchb.c
src/sys/arch/arm/apple: apple_platform.c
src/sys/arch/arm/broadcom: bcm2838_pcie.c
src/sys/arch/arm/fdt: pcihost_fdt.c
src/sys/arch/arm/include: bus_defs.h
src/sys/arch/arm/nvidia: tegra_pcie.c
src/sys/arch/arm/rockchip: rk3399_pcie.c
src/sys/arch/evbarm/fdt: fdt_bus_machdep.c

Log Message:
Use "non-posted" instead of "strongly ordered" to describe nGnRnE mappings

Rename the following defines:
 - _ARM_BUS_SPACE_MAP_STRONGLY_ORDERED to BUS_SPACE_MAP_NONPOSTED
 - PMAP_DEV_SO to PMAP_DEV_NP
 - LX_BLKPAG_ATTR_DEVICE_MEM_SO to LX_BLKPAG_ATTR_DEVICE_MEM_NP
Rename the following option:
 - AARCH64_DEVICE_MEM_STRONGLY_ORDERED to AARCH64_DEVICE_MEM_NONPOSTED


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/aarch64/aarch64/bus_space.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/aarch64/aarch64/db_interface.c
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.139 -r1.140 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/aarch64/conf/files.aarch64
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/aarch64/include/pmap.h
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/acpi/acpi_machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/acpi/acpi_pci_graviton.c \
src/sys/arch/arm/acpi/acpi_pci_layerscape_gen4.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/acpi/acpi_pci_n1sdp.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/acpi/acpipchb.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/apple/apple_platform.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/broadcom/bcm2838_pcie.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/fdt/pcihost_fdt.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/include/bus_defs.h
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/arm/nvidia/tegra_pcie.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/rockchip/rk3399_pcie.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/fdt/fdt_bus_machdep.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/arch/aarch64/aarch64/bus_space.c
diff -u src/sys/arch/aarch64/aarch64/bus_space.c:1.16 src/sys/arch/aarch64/aarch64/bus_space.c:1.17
--- src/sys/arch/aarch64/aarch64/bus_space.c:1.16	Wed Apr 14 05:43:09 2021
+++ src/sys/arch/aarch64/aarch64/bus_space.c	Sat Oct 15 11:07:38 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_space.c,v 1.16 2021/04/14 05:43:09 ryo Exp $ */
+/* $NetBSD: bus_space.c,v 1.17 2022/10/15 11:07:38 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: bus_space.c,v 1.16 2021/04/14 05:43:09 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bus_space.c,v 1.17 2022/10/15 11:07:38 jmcneill Exp $");
 
 #include 
 #include 
@@ -568,8 +568,8 @@ generic_bs_map(void *t, bus_addr_t bpa, 
 		pmapflags = PMAP_WRITE_COMBINE;
 	else if ((flag & BUS_SPACE_MAP_CACHEABLE) != 0)
 		pmapflags = PMAP_WRITE_BACK;
-	else if ((flag & _ARM_BUS_SPACE_MAP_STRONGLY_ORDERED) != 0)
-		pmapflags = PMAP_DEV_SO;
+	else if ((flag & BUS_SPACE_MAP_NONPOSTED) != 0)
+		pmapflags = PMAP_DEV_NP;
 	else
 		pmapflags = PMAP_DEV;
 

Index: src/sys/arch/aarch64/aarch64/db_interface.c
diff -u src/sys/arch/aarch64/aarch64/db_interface.c:1.19 src/sys/arch/aarch64/aarch64/db_interface.c:1.20
--- src/sys/arch/aarch64/aarch64/db_interface.c:1.19	Mon Sep 19 17:23:14 2022
+++ src/sys/arch/aarch64/aarch64/db_interface.c	Sat Oct 15 11:07:38 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.19 2022/09/19 17:23:14 ryo Exp $ */
+/* $NetBSD: db_interface.c,v 1.20 2022/10/15 11:07:38 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.19 2022/09/19 17:23:14 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.20 2022/10/15 11:07:38 jmcneill Exp $");
 
 #include 
 #include 
@@ -431,8 +431,8 @@ db_pte_print(pt_entry_t pte, int level,
 		case LX_BLKPAG_ATTR_DEVICE_MEM:
 			pr(", DEV");
 			break;
-		case LX_BLKPAG_ATTR_DEVICE_MEM_SO:
-			pr(", DEV(SO)");
+		case LX_BLKPAG_ATTR_DEVICE_MEM_NP:
+			pr(", DEV(NP)");
 			break;
 		default:
 			pr(", ATTR(%lu)", __SHIFTOUT(pte, LX_BLKPAG_ATTR_INDX));

Index: src/sys/arch/aarch64/aarch64/locore.S
diff -u src/sys/arch/aarch64/aarch64/locore.S:1.87 src/sys/arch/aarch64/aarch64/locore.S:1.88
--- src/sys/arch/aarch64/aarch64/locore.S:1.87	Tue Aug 23 05:31:12 2022
+++ src/sys/arch/aarch64/aarch64/locore.S	Sat Oct 15 11:07:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.87 2022/08/23 05:31:12 ryo Exp $	*/
+/*	

CVS commit: src/sys/arch

2022-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 15 11:07:39 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: bus_space.c db_interface.c locore.S
pmap.c
src/sys/arch/aarch64/conf: files.aarch64
src/sys/arch/aarch64/include: pmap.h
src/sys/arch/arm/acpi: acpi_machdep.c acpi_pci_graviton.c
acpi_pci_layerscape_gen4.c acpi_pci_n1sdp.c acpipchb.c
src/sys/arch/arm/apple: apple_platform.c
src/sys/arch/arm/broadcom: bcm2838_pcie.c
src/sys/arch/arm/fdt: pcihost_fdt.c
src/sys/arch/arm/include: bus_defs.h
src/sys/arch/arm/nvidia: tegra_pcie.c
src/sys/arch/arm/rockchip: rk3399_pcie.c
src/sys/arch/evbarm/fdt: fdt_bus_machdep.c

Log Message:
Use "non-posted" instead of "strongly ordered" to describe nGnRnE mappings

Rename the following defines:
 - _ARM_BUS_SPACE_MAP_STRONGLY_ORDERED to BUS_SPACE_MAP_NONPOSTED
 - PMAP_DEV_SO to PMAP_DEV_NP
 - LX_BLKPAG_ATTR_DEVICE_MEM_SO to LX_BLKPAG_ATTR_DEVICE_MEM_NP
Rename the following option:
 - AARCH64_DEVICE_MEM_STRONGLY_ORDERED to AARCH64_DEVICE_MEM_NONPOSTED


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/aarch64/aarch64/bus_space.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/aarch64/aarch64/db_interface.c
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/aarch64/aarch64/locore.S
cvs rdiff -u -r1.139 -r1.140 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/aarch64/conf/files.aarch64
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/aarch64/include/pmap.h
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/acpi/acpi_machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/acpi/acpi_pci_graviton.c \
src/sys/arch/arm/acpi/acpi_pci_layerscape_gen4.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/acpi/acpi_pci_n1sdp.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/acpi/acpipchb.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/apple/apple_platform.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/broadcom/bcm2838_pcie.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/arm/fdt/pcihost_fdt.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/include/bus_defs.h
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/arm/nvidia/tegra_pcie.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/rockchip/rk3399_pcie.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/fdt/fdt_bus_machdep.c

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



CVS commit: [netbsd-8] src

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:52:16 UTC 2022

Modified Files:
src/share/man/man4 [netbsd-8]: lm.4
src/sys/dev/ic [netbsd-8]: nslm7x.c
src/sys/dev/isa [netbsd-8]: wbsio.c wbsioreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1774):

share/man/man4/lm.4: revision 1.37
sys/dev/isa/wbsio.c: revision 1.28
sys/dev/ic/nslm7x.c: revision 1.78
sys/dev/isa/wbsioreg.h: revision 1.10

Add Nuvoton NCT6799D support.


To generate a diff of this commit:
cvs rdiff -u -r1.32.40.2 -r1.32.40.3 src/share/man/man4/lm.4
cvs rdiff -u -r1.64.10.3 -r1.64.10.4 src/sys/dev/ic/nslm7x.c
cvs rdiff -u -r1.10.10.6 -r1.10.10.7 src/sys/dev/isa/wbsio.c
cvs rdiff -u -r1.5.2.5 -r1.5.2.6 src/sys/dev/isa/wbsioreg.h

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



CVS commit: [netbsd-8] src

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:52:16 UTC 2022

Modified Files:
src/share/man/man4 [netbsd-8]: lm.4
src/sys/dev/ic [netbsd-8]: nslm7x.c
src/sys/dev/isa [netbsd-8]: wbsio.c wbsioreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1774):

share/man/man4/lm.4: revision 1.37
sys/dev/isa/wbsio.c: revision 1.28
sys/dev/ic/nslm7x.c: revision 1.78
sys/dev/isa/wbsioreg.h: revision 1.10

Add Nuvoton NCT6799D support.


To generate a diff of this commit:
cvs rdiff -u -r1.32.40.2 -r1.32.40.3 src/share/man/man4/lm.4
cvs rdiff -u -r1.64.10.3 -r1.64.10.4 src/sys/dev/ic/nslm7x.c
cvs rdiff -u -r1.10.10.6 -r1.10.10.7 src/sys/dev/isa/wbsio.c
cvs rdiff -u -r1.5.2.5 -r1.5.2.6 src/sys/dev/isa/wbsioreg.h

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/lm.4
diff -u src/share/man/man4/lm.4:1.32.40.2 src/share/man/man4/lm.4:1.32.40.3
--- src/share/man/man4/lm.4:1.32.40.2	Thu Jul 26 20:37:42 2018
+++ src/share/man/man4/lm.4	Sat Oct 15 10:52:16 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: lm.4,v 1.32.40.2 2018/07/26 20:37:42 snj Exp $
+.\"	$NetBSD: lm.4,v 1.32.40.3 2022/10/15 10:52:16 martin Exp $
 .\"
 .\" Copyright (c) 2000 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 March 8, 2018
+.Dd October 11, 2022
 .Dt LM 4
 .Os
 .Sh NAME
@@ -89,13 +89,9 @@ Nuvoton
 .Em NCT6102D ,
 .Em NCT6104D ,
 .Em NCT6106D ,
-.Em NCT6779D ,
-.Em NCT6791D ,
-.Em NCT6792D ,
-.Em NCT6793D ,
-.Em NCT6795D ,
+.Em NCT6779D
 and
-.Em NCT6796D .
+.Em NCT679[1235689]D .
 .It
 Winbond
 .Em W83627HF* ,

Index: src/sys/dev/ic/nslm7x.c
diff -u src/sys/dev/ic/nslm7x.c:1.64.10.3 src/sys/dev/ic/nslm7x.c:1.64.10.4
--- src/sys/dev/ic/nslm7x.c:1.64.10.3	Wed Jul 17 15:43:18 2019
+++ src/sys/dev/ic/nslm7x.c	Sat Oct 15 10:52:16 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: nslm7x.c,v 1.64.10.3 2019/07/17 15:43:18 martin Exp $ */
+/*	$NetBSD: nslm7x.c,v 1.64.10.4 2022/10/15 10:52:16 martin Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nslm7x.c,v 1.64.10.3 2019/07/17 15:43:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nslm7x.c,v 1.64.10.4 2022/10/15 10:52:16 martin Exp $");
 
 #include 
 #include 
@@ -2157,6 +2157,7 @@ static const struct wb_product wbsio_pro
 { WBSIO_ID_NCT6795D,"NCT6795D", nct6779d_sensors, NULL },
 { WBSIO_ID_NCT6796D,"NCT6796D", nct6779d_sensors, NULL },
 { WBSIO_ID_NCT6798D,"NCT6798D", nct6779d_sensors, NULL },
+{ WBSIO_ID_NCT6799D,"NCT6799D", nct6779d_sensors, NULL },
 { 0, NULL, NULL, NULL }
 };
 

Index: src/sys/dev/isa/wbsio.c
diff -u src/sys/dev/isa/wbsio.c:1.10.10.6 src/sys/dev/isa/wbsio.c:1.10.10.7
--- src/sys/dev/isa/wbsio.c:1.10.10.6	Wed Jul 17 15:43:18 2019
+++ src/sys/dev/isa/wbsio.c	Sat Oct 15 10:52:16 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: wbsio.c,v 1.10.10.6 2019/07/17 15:43:18 martin Exp $	*/
+/*	$NetBSD: wbsio.c,v 1.10.10.7 2022/10/15 10:52:16 martin Exp $	*/
 /*	$OpenBSD: wbsio.c,v 1.10 2015/03/14 03:38:47 jsg Exp $	*/
 /*
  * Copyright (c) 2008 Mark Kettenis 
@@ -99,6 +99,7 @@ static const struct wbsio_product {
 	{ WBSIO_ID_NCT6795D,	12,	"NCT6795D" },
 	{ WBSIO_ID_NCT6796D,	13,	"NCT6796D" },
 	{ WBSIO_ID_NCT6798D,	13,	"NCT6798D" },
+	{ WBSIO_ID_NCT6799D,	13,	"NCT6799D" },
 };
 
 static const struct wbsio_product *wbsio_lookup(uint8_t id, uint8_t rev);

Index: src/sys/dev/isa/wbsioreg.h
diff -u src/sys/dev/isa/wbsioreg.h:1.5.2.5 src/sys/dev/isa/wbsioreg.h:1.5.2.6
--- src/sys/dev/isa/wbsioreg.h:1.5.2.5	Wed Jul 17 15:43:18 2019
+++ src/sys/dev/isa/wbsioreg.h	Sat Oct 15 10:52:16 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: wbsioreg.h,v 1.5.2.5 2019/07/17 15:43:18 martin Exp $ */
+/* $NetBSD: wbsioreg.h,v 1.5.2.6 2022/10/15 10:52:16 martin Exp $ */
 
 /* $OpenBSD: wbsioreg.h,v 1.4 2015/01/02 23:02:54 chris Exp $ */
 /*
@@ -72,6 +72,7 @@
 #define WBSIO_ID_NCT6795D	0xd35
 #define WBSIO_ID_NCT6796D	0xd420	/* 13bits */
 #define WBSIO_ID_NCT6798D	0xd428
+#define WBSIO_ID_NCT6799D	0xd800
 
 /* Make the above WBSIO_ID_* vaue from WBSIO_ID, WBSIO_REV and IDbits */
 #define WBSIO_MAKEID(id, rev, bits)	\



CVS commit: src/sys/arch/arm/acpi

2022-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 15 10:45:40 UTC 2022

Modified Files:
src/sys/arch/arm/acpi: acpi_pci_smccc.c

Log Message:
fix indentation


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/acpi/acpi_pci_smccc.c

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



CVS commit: src/sys/arch/arm/acpi

2022-10-15 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 15 10:45:40 UTC 2022

Modified Files:
src/sys/arch/arm/acpi: acpi_pci_smccc.c

Log Message:
fix indentation


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/acpi/acpi_pci_smccc.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/arch/arm/acpi/acpi_pci_smccc.c
diff -u src/sys/arch/arm/acpi/acpi_pci_smccc.c:1.1 src/sys/arch/arm/acpi/acpi_pci_smccc.c:1.2
--- src/sys/arch/arm/acpi/acpi_pci_smccc.c:1.1	Sat Aug  7 21:27:53 2021
+++ src/sys/arch/arm/acpi/acpi_pci_smccc.c	Sat Oct 15 10:45:40 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci_smccc.c,v 1.1 2021/08/07 21:27:53 jmcneill Exp $ */
+/* $NetBSD: acpi_pci_smccc.c,v 1.2 2022/10/15 10:45:40 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2021 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_pci_smccc.c,v 1.1 2021/08/07 21:27:53 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_pci_smccc.c,v 1.2 2022/10/15 10:45:40 jmcneill Exp $");
 
 #include 
 #include 
@@ -84,7 +84,7 @@ acpi_pci_smccc_conf_write(pci_chipset_ta
 	}
 
 	status = pci_smccc_write(PCI_SMCCC_SBDF(ap->ap_seg, b, d, f), reg,
-PCI_SMCCC_ACCESS_32BIT, data);
+ PCI_SMCCC_ACCESS_32BIT, data);
 	if (!PCI_SMCCC_SUCCESS(status)) {
 		return EINVAL;
 	}



CVS commit: [netbsd-8] src/doc

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:35:16 UTC 2022

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Tickets #1774 - #1776


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.155 -r1.1.2.156 src/doc/CHANGES-8.3

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



CVS commit: [netbsd-8] src/doc

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:35:16 UTC 2022

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Tickets #1774 - #1776


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.155 -r1.1.2.156 src/doc/CHANGES-8.3

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-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.155 src/doc/CHANGES-8.3:1.1.2.156
--- src/doc/CHANGES-8.3:1.1.2.155	Tue Oct 11 18:24:18 2022
+++ src/doc/CHANGES-8.3	Sat Oct 15 10:35:16 2022
@@ -1,4 +1,4 @@
- $NetBSD: CHANGES-8.3,v 1.1.2.155 2022/10/11 18:24:18 martin Exp $
+ $NetBSD: CHANGES-8.3,v 1.1.2.156 2022/10/15 10:35:16 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -2917,3 +2917,26 @@ sys/arch/x86/pci/amdzentemp.c			1.8-1.10
 	- Add support for per CCD temperature sensor.
 	[msaitoh, ticket #1773]
 
+share/man/man4/lm.41.37
+sys/dev/ic/nslm7x.c1.78
+sys/dev/isa/wbsio.c1.28
+sys/dev/isa/wbsioreg.h1.10
+
+	Add Nuvoton NCT6799D support.
+	[msaitoh, ticket #1774]
+
+sys/arch/x86/include/specialreg.h		1.189-1.192
+usr.sbin/cpuctl/arch/i386.c			1.128
+
+	- Add top-down slots event bit of architectural performance monitoring
+	  leaf.
+	- Modify CPUID Fn000a %ebx's string. Add new string for %ecx.
+	- Modify output of CPUID Fn000a.
+	- Update some AMD CPUID bits.
+	- Fix typo. 
+	[msaitoh, ticket #1775]
+
+sys/dev/pci/ichsmb.c1.76-1.77 (via patch)
+
+	Add Intel 600 Series PCH support.
+	[msaitoh, ticket #1776]



CVS commit: [netbsd-8] src/sys/dev/pci

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:33:42 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-8]: ichsmb.c

Log Message:
Pull up the following (via patch), requested by msaitoh in ticket #1776:

sys/dev/pci/ichsmb.c1.76-1.77

Add Intel 600 Series PCH support.


To generate a diff of this commit:
cvs rdiff -u -r1.50.6.5 -r1.50.6.6 src/sys/dev/pci/ichsmb.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/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.50.6.5 src/sys/dev/pci/ichsmb.c:1.50.6.6
--- src/sys/dev/pci/ichsmb.c:1.50.6.5	Fri Dec  3 17:54:30 2021
+++ src/sys/dev/pci/ichsmb.c	Sat Oct 15 10:33:42 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.50.6.5 2021/12/03 17:54:30 martin Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.50.6.6 2022/10/15 10:33:42 martin Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.44 2020/10/07 11:23:05 jsg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.50.6.5 2021/12/03 17:54:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.50.6.6 2022/10/15 10:33:42 martin Exp $");
 
 #include 
 #include 
@@ -145,6 +145,8 @@ ichsmb_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_INTEL_495_YU_SMB:
 		case PCI_PRODUCT_INTEL_5HS_H_SMB:
 		case PCI_PRODUCT_INTEL_5HS_LP_SMB:
+		case PCI_PRODUCT_INTEL_6HS_H_SMB:
+		case PCI_PRODUCT_INTEL_6HS_LP_SMB:
 			return 1;
 		}
 	}



CVS commit: [netbsd-8] src/sys/dev/pci

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:33:42 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-8]: ichsmb.c

Log Message:
Pull up the following (via patch), requested by msaitoh in ticket #1776:

sys/dev/pci/ichsmb.c1.76-1.77

Add Intel 600 Series PCH support.


To generate a diff of this commit:
cvs rdiff -u -r1.50.6.5 -r1.50.6.6 src/sys/dev/pci/ichsmb.c

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



CVS commit: [netbsd-9] src/doc

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:31:45 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Tickets #1541 - #1544


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/doc/CHANGES-9.4

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



CVS commit: [netbsd-9] src/doc

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:31:45 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Tickets #1541 - #1544


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/doc/CHANGES-9.4

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-9.4
diff -u src/doc/CHANGES-9.4:1.1.2.24 src/doc/CHANGES-9.4:1.1.2.25
--- src/doc/CHANGES-9.4:1.1.2.24	Tue Oct 11 18:26:37 2022
+++ src/doc/CHANGES-9.4	Sat Oct 15 10:31:45 2022
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.24 2022/10/11 18:26:37 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.25 2022/10/15 10:31:45 martin Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -351,3 +351,37 @@ usr.bin/skey/skeyaudit.sh			1.5
 	Adapt to removal of "Mail".
 	[is, ticket #1540]
 
+share/man/man4/lm.41.37
+sys/dev/ic/nslm7x.c1.78
+sys/dev/isa/wbsio.c1.28
+sys/dev/isa/wbsioreg.h1.10
+
+	Add Nuvoton NCT6799D support.
+	[msaitoh, ticket #1541]
+
+sys/arch/x86/include/specialreg.h		1.189-1.192
+sys/dev/nvmm/x86/nvmm_x86.c			1.23
+usr.sbin/cpuctl/arch/i386.c			1.128
+
+	- Add top-down slots event bit of architectural performance monitoring
+	  leaf.
+	- Modify CPUID Fn000a %ebx's string. Add new string for %ecx.
+	- Modify output of CPUID Fn000a.
+	- Update some AMD CPUID bits.
+	- Fix typo.
+	[msaitoh, ticket #1542]
+
+sys/dev/tprof/tprof_x86_intel.c 		1.4
+usr.sbin/tprof/arch/tprof_x86.c 		1.10-1.12
+
+	- Add topdown-slots to Intel architectural performance monitoring
+	  version 1.
+	- Disable the unsupported events based on CPUID Fn000a %eax.
+	- Fix typo in comment. Remove duplicated macros.
+	[msaitoh, ticket #1543]
+
+sys/dev/pci/ichsmb.c1.76-1.77 (via patch)
+
+	Add Intel 600 Series PCH support.
+	[msaitoh, ticket #1544]
+



CVS commit: [netbsd-9] src/sys/dev/pci

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:29:40 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: ichsmb.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1544:

sys/dev/pci/ichsmb.c1.76-1.77

Add Intel 600 Series PCH support.


To generate a diff of this commit:
cvs rdiff -u -r1.60.4.3 -r1.60.4.4 src/sys/dev/pci/ichsmb.c

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



CVS commit: [netbsd-9] src/sys/dev/pci

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:29:40 UTC 2022

Modified Files:
src/sys/dev/pci [netbsd-9]: ichsmb.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1544:

sys/dev/pci/ichsmb.c1.76-1.77

Add Intel 600 Series PCH support.


To generate a diff of this commit:
cvs rdiff -u -r1.60.4.3 -r1.60.4.4 src/sys/dev/pci/ichsmb.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/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.60.4.3 src/sys/dev/pci/ichsmb.c:1.60.4.4
--- src/sys/dev/pci/ichsmb.c:1.60.4.3	Fri Dec  3 17:49:41 2021
+++ src/sys/dev/pci/ichsmb.c	Sat Oct 15 10:29:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.60.4.3 2021/12/03 17:49:41 martin Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.60.4.4 2022/10/15 10:29:40 martin Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.44 2020/10/07 11:23:05 jsg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.60.4.3 2021/12/03 17:49:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.60.4.4 2022/10/15 10:29:40 martin Exp $");
 
 #include 
 #include 
@@ -152,6 +152,8 @@ ichsmb_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_INTEL_495_YU_SMB:
 		case PCI_PRODUCT_INTEL_5HS_H_SMB:
 		case PCI_PRODUCT_INTEL_5HS_LP_SMB:
+		case PCI_PRODUCT_INTEL_6HS_H_SMB:
+		case PCI_PRODUCT_INTEL_6HS_LP_SMB:
 			return 1;
 		}
 	}



CVS commit: [netbsd-9] src

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:20:32 UTC 2022

Modified Files:
src/sys/dev/tprof [netbsd-9]: tprof_x86_intel.c
src/usr.sbin/tprof/arch [netbsd-9]: tprof_x86.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1543):

sys/dev/tprof/tprof_x86_intel.c: revision 1.4
usr.sbin/tprof/arch/tprof_x86.c: revision 1.10
usr.sbin/tprof/arch/tprof_x86.c: revision 1.11
usr.sbin/tprof/arch/tprof_x86.c: revision 1.12

Fix typo in a comment.

Use CPUID_PERF_* macros defined in specialreg.h. No functional change.

Add topdown-slots to Intel architectural performance monitoring version 1.

Disable the unsupported events from the bit vector length in EAX.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.2.1 src/sys/dev/tprof/tprof_x86_intel.c
cvs rdiff -u -r1.8.4.1 -r1.8.4.2 src/usr.sbin/tprof/arch/tprof_x86.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/tprof/tprof_x86_intel.c
diff -u src/sys/dev/tprof/tprof_x86_intel.c:1.3 src/sys/dev/tprof/tprof_x86_intel.c:1.3.2.1
--- src/sys/dev/tprof/tprof_x86_intel.c:1.3	Fri Jun 14 11:50:35 2019
+++ src/sys/dev/tprof/tprof_x86_intel.c	Sat Oct 15 10:20:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_x86_intel.c,v 1.3 2019/06/14 11:50:35 msaitoh Exp $	*/
+/*	$NetBSD: tprof_x86_intel.c,v 1.3.2.1 2022/10/15 10:20:32 martin Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tprof_x86_intel.c,v 1.3 2019/06/14 11:50:35 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_x86_intel.c,v 1.3.2.1 2022/10/15 10:20:32 martin Exp $");
 
 #include 
 #include 
@@ -90,10 +90,6 @@ __KERNEL_RCSID(0, "$NetBSD: tprof_x86_in
 #define	PERFEVTSEL_INV		__BIT(23)
 #define	PERFEVTSEL_COUNTER_MASK	__BITS(24, 31)
 
-#define CPUID_0A_VERSION	__BITS(0, 7)
-#define CPUID_0A_NCOUNTERS	__BITS(8, 15)
-#define CPUID_0A_BITWIDTH	__BITS(16, 23)
-
 static uint64_t counter_bitwidth;
 static uint64_t counter_val = 500;
 static uint64_t counter_reset_val;
@@ -195,14 +191,14 @@ tprof_intel_ident(void)
 		return TPROF_IDENT_NONE;
 	}
 	x86_cpuid(0x0A, descs);
-	if ((descs[0] & CPUID_0A_VERSION) == 0) {
+	if ((descs[0] & CPUID_PERF_VERSION) == 0) {
 		return TPROF_IDENT_NONE;
 	}
-	if ((descs[0] & CPUID_0A_NCOUNTERS) == 0) {
+	if ((descs[0] & CPUID_PERF_NGPPC) == 0) {
 		return TPROF_IDENT_NONE;
 	}
 
-	counter_bitwidth = __SHIFTOUT(descs[0], CPUID_0A_BITWIDTH);
+	counter_bitwidth = __SHIFTOUT(descs[0], CPUID_PERF_NBWGPPC);
 
 	return TPROF_IDENT_INTEL_GENERIC;
 }

Index: src/usr.sbin/tprof/arch/tprof_x86.c
diff -u src/usr.sbin/tprof/arch/tprof_x86.c:1.8.4.1 src/usr.sbin/tprof/arch/tprof_x86.c:1.8.4.2
--- src/usr.sbin/tprof/arch/tprof_x86.c:1.8.4.1	Sat Oct 12 14:34:45 2019
+++ src/usr.sbin/tprof/arch/tprof_x86.c	Sat Oct 15 10:20:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_x86.c,v 1.8.4.1 2019/10/12 14:34:45 martin Exp $	*/
+/*	$NetBSD: tprof_x86.c,v 1.8.4.2 2022/10/15 10:20:32 martin Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -85,6 +85,7 @@ static struct name_to_event intel_arch1_
 	{ "llc-misses",			0x2E, 0x41, true },
 	{ "branch-instruction-retired",	0xC4, 0x00, true },
 	{ "branch-misses-retired",	0xC5, 0x00, true },
+	{ "topdown-slots",		0xA4, 0x01, true },
 };
 
 static struct event_table intel_arch1 = {
@@ -98,7 +99,7 @@ static struct event_table intel_arch1 = 
 static struct event_table *
 init_intel_arch1(void)
 {
-	unsigned int eax, ebx, ecx, edx;
+	unsigned int eax, ebx, ecx, edx, vectorlen;
 	struct event_table *table;
 	size_t i;
 
@@ -108,9 +109,17 @@ init_intel_arch1(void)
 	edx = 0;
 	x86_cpuid(, , , );
 
+	vectorlen = __SHIFTOUT(eax, CPUID_PERF_BVECLEN);
+
 	table = _arch1;
 	for (i = 0; i < table->nevents; i++) {
-		/* Disable the unsupported events. */
+		/*
+		 * Disable the unsupported events from:
+		 * a) the bit vector length in EAX.
+		 * b) the disable bit in EBX.
+		 */
+		if (i >= vectorlen)
+			table->names[i].enabled = false;
 		if ((ebx & (i << 1)) != 0)
 			table->names[i].enabled = false;
 	}
@@ -550,7 +559,7 @@ init_intel_generic(void)
 			table->next = init_intel_silvermont_airmont();
 			break;
 		case 0x5C: /* Goldmont (Apollo Lake) */
-		case 0x5F: /* Goldmont (Denvertion) */
+		case 0x5F: /* Goldmont (Denverton) */
 			table->next = init_intel_goldmont();
 			break;
 		case 0x7A: /* Goldmont Plus (Gemini Lake) */



CVS commit: [netbsd-9] src

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:20:32 UTC 2022

Modified Files:
src/sys/dev/tprof [netbsd-9]: tprof_x86_intel.c
src/usr.sbin/tprof/arch [netbsd-9]: tprof_x86.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1543):

sys/dev/tprof/tprof_x86_intel.c: revision 1.4
usr.sbin/tprof/arch/tprof_x86.c: revision 1.10
usr.sbin/tprof/arch/tprof_x86.c: revision 1.11
usr.sbin/tprof/arch/tprof_x86.c: revision 1.12

Fix typo in a comment.

Use CPUID_PERF_* macros defined in specialreg.h. No functional change.

Add topdown-slots to Intel architectural performance monitoring version 1.

Disable the unsupported events from the bit vector length in EAX.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.2.1 src/sys/dev/tprof/tprof_x86_intel.c
cvs rdiff -u -r1.8.4.1 -r1.8.4.2 src/usr.sbin/tprof/arch/tprof_x86.c

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



CVS commit: [netbsd-8] src

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:16:08 UTC 2022

Modified Files:
src/sys/arch/x86/include [netbsd-8]: specialreg.h
src/usr.sbin/cpuctl/arch [netbsd-8]: i386.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1775):

sys/arch/x86/include/specialreg.h: revision 1.189
usr.sbin/cpuctl/arch/i386.c: revision 1.128
sys/arch/x86/include/specialreg.h: revision 1.190
sys/arch/x86/include/specialreg.h: revision 1.191
sys/arch/x86/include/specialreg.h: revision 1.192

s/shareing/sharing/. No functional change.

Add top-down slots event bit of architectural performance monitoring leaf.

Modify CPUID Fn000a %ebx's string. Add new string for %ecx.

Modify output of CPUID Fn000a.
old:
cpu0: Perfmon-eax 0x8300805
cpu0: Perfmon-eax 0x8300805
cpu0: Perfmon-edx 0x8604
new:
cpu0: Perfmon: Ver. 5
cpu0: Perfmon: General: bitwidth 48, 8 counters
cpu0: Perfmon: General: avail 0xff
cpu0: Perfmon: General: avail 0xff
cpu0: Perfmon: Fixed: bitwidth 48, 4 counters
cpu0: Perfmon: Fixed: avail 0xf

Update some AMD CPUID bits:
- Rename FSREP_MOV to FSRM.
- Add Memory Bandwidth Enforcement (MBE)
- Add AMD's PPIN. Rename CPUID_SEF_PPIN to CPUID_SEF_INTEL_PPIN.
- Add Collaborative Processor Performance Control (CPPC).
- Add HOST_MCE_OVERRIDE.
- Add some unknown bits as Bxx.
- Add comments.
- Use __BIT().


To generate a diff of this commit:
cvs rdiff -u -r1.98.2.23 -r1.98.2.24 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.74.6.14 -r1.74.6.15 src/usr.sbin/cpuctl/arch/i386.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/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.98.2.23 src/sys/arch/x86/include/specialreg.h:1.98.2.24
--- src/sys/arch/x86/include/specialreg.h:1.98.2.23	Mon Jan 31 17:46:36 2022
+++ src/sys/arch/x86/include/specialreg.h	Sat Oct 15 10:16:07 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.98.2.23 2022/01/31 17:46:36 martin Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.98.2.24 2022/10/15 10:16:07 martin Exp $	*/
 
 /*
  * Copyright (c) 2014-2019 The NetBSD Foundation, Inc.
@@ -287,7 +287,7 @@
 #define CPUID_DCP_CACHELEVEL	__BITS(7, 5)	/* Cache level (start at 1) */
 #define CPUID_DCP_SELFINITCL	__BIT(8)	/* Self initializing cachelvl*/
 #define CPUID_DCP_FULLASSOC	__BIT(9)	/* Full associative */
-#define CPUID_DCP_SHAREING	__BITS(25, 14)	/* shareing */
+#define CPUID_DCP_SHARING	__BITS(25, 14)	/* sharing */
 #define CPUID_DCP_CORE_P_PKG	__BITS(31, 26)	/* Cores/package */
 
 /* %ebx */
@@ -459,7 +459,7 @@
 /* %ecx = 0, %edx */
 #define CPUID_SEF_AVX512_4VNNIW	__BIT(2)  /* AVX512 4-reg Neural Network ins */
 #define CPUID_SEF_AVX512_4FMAPS	__BIT(3)  /* AVX512 4-reg Mult Accum Single precision */
-#define CPUID_SEF_FSREP_MOV	__BIT(4)  /* Fast Short REP MOVE */
+#define CPUID_SEF_FSRM		__BIT(4)  /* Fast Short Rep Move */
 #define CPUID_SEF_AVX512_VP2INTERSECT __BIT(8) /* AVX512 VP2INTERSECT */
 #define CPUID_SEF_SRBDS_CTRL	__BIT(9)  /* IA32_MCU_OPT_CTRL */
 #define CPUID_SEF_MD_CLEAR	__BIT(10) /* VERW clears CPU buffers */
@@ -479,7 +479,7 @@
 
 #define CPUID_SEF_FLAGS2	"\20"	  \
 "\3" "AVX512_4VNNIW" "\4" "AVX512_4FMAPS" \
-	"\5" "FSREP_MOV"		  \
+	"\5" "FSRM"			  \
 	"\11VP2INTERSECT" "\12SRBDS_CTRL" "\13MD_CLEAR"			  \
 			"\16TSX_FORCE_ABORT" "\17SERIALIZE" "\20HYBRID"	  \
 	"\21" "TSXLDTRK"		"\23" "PCONFIG"	"\24" "ARCH_LBR"  \
@@ -503,7 +503,7 @@
 	"\31" "LAM"
 
 /* %ecx = 1, %ebx */
-#define CPUID_SEF_PPIN		__BIT(0)  /* IA32_PPIN & IA32_PPIN_CTL MSRs */
+#define CPUID_SEF_INTEL_PPIN	__BIT(0)  /* IA32_PPIN & IA32_PPIN_CTL MSRs */
 
 #define CPUID_SEF1_FLAGS_B	"\20"\
 "\1" "PPIN"
@@ -533,10 +533,16 @@
 #define CPUID_PERF_LLCMISS	__BIT(4)   /* No LLCache miss */
 #define CPUID_PERF_BRINSRETR	__BIT(5)   /* No branch inst. retried */
 #define CPUID_PERF_BRMISPRRETR	__BIT(6)   /* No branch mispredict retry */
+#define CPUID_PERF_TOPDOWNSLOT	__BIT(7)   /* No top-down slots */
 
-#define CPUID_PERF_FLAGS1	"\177\20"			  \
-	"b\0CORECYCL\0" "b\1INSTRETRY\0" "b\2REFCYCL\0" "b\3LLCREF\0" \
-	"b\4LLCMISS\0" "b\5BRINSRETR\0" "b\6BRMISPRRETR\0"
+#define CPUID_PERF_FLAGS1	"\177\20"  \
+	"b\0CORECYCL\0"	"b\1INST\0"	"b\2REFCYCL\0"	"b\3LLCREF\0"	  \
+	"b\4LLCMISS\0"	"b\5BRINST\0"	"b\6BRMISPR\0"	"b\7TOPDOWNSLOT\0"
+
+/* %ecx */
+
+#define CPUID_PERF_FLAGS2	"\177\20"  \
+	"b\0INST\0" "b\1CLK_CORETHREAD\0" "b\2CLK_REF_TSC\0" "b\3TOPDOWNSLOT\0"
 
 /* %edx */
 #define CPUID_PERF_NFFPC	__BITS(4, 0)   /* Num of fixed-funct perfcnt */
@@ -588,10 +594,10 @@
  */
 
 /* %ecx = 1, %eax */
-#define CPUID_PES1_XSAVEOPT	0x0001	/* xsaveopt instruction */
-#define CPUID_PES1_XSAVEC	0x0002	/* xsavec & compacted XRSTOR */
-#define CPUID_PES1_XGETBV	0x0004	/* xgetbv with ECX = 1 */
-#define CPUID_PES1_XSAVES	0x0008	/* 

CVS commit: [netbsd-8] src

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:16:08 UTC 2022

Modified Files:
src/sys/arch/x86/include [netbsd-8]: specialreg.h
src/usr.sbin/cpuctl/arch [netbsd-8]: i386.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1775):

sys/arch/x86/include/specialreg.h: revision 1.189
usr.sbin/cpuctl/arch/i386.c: revision 1.128
sys/arch/x86/include/specialreg.h: revision 1.190
sys/arch/x86/include/specialreg.h: revision 1.191
sys/arch/x86/include/specialreg.h: revision 1.192

s/shareing/sharing/. No functional change.

Add top-down slots event bit of architectural performance monitoring leaf.

Modify CPUID Fn000a %ebx's string. Add new string for %ecx.

Modify output of CPUID Fn000a.
old:
cpu0: Perfmon-eax 0x8300805
cpu0: Perfmon-eax 0x8300805
cpu0: Perfmon-edx 0x8604
new:
cpu0: Perfmon: Ver. 5
cpu0: Perfmon: General: bitwidth 48, 8 counters
cpu0: Perfmon: General: avail 0xff
cpu0: Perfmon: General: avail 0xff
cpu0: Perfmon: Fixed: bitwidth 48, 4 counters
cpu0: Perfmon: Fixed: avail 0xf

Update some AMD CPUID bits:
- Rename FSREP_MOV to FSRM.
- Add Memory Bandwidth Enforcement (MBE)
- Add AMD's PPIN. Rename CPUID_SEF_PPIN to CPUID_SEF_INTEL_PPIN.
- Add Collaborative Processor Performance Control (CPPC).
- Add HOST_MCE_OVERRIDE.
- Add some unknown bits as Bxx.
- Add comments.
- Use __BIT().


To generate a diff of this commit:
cvs rdiff -u -r1.98.2.23 -r1.98.2.24 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.74.6.14 -r1.74.6.15 src/usr.sbin/cpuctl/arch/i386.c

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



CVS commit: [netbsd-9] src

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:08:41 UTC 2022

Modified Files:
src/sys/arch/x86/include [netbsd-9]: specialreg.h
src/sys/dev/nvmm/x86 [netbsd-9]: nvmm_x86.c
src/usr.sbin/cpuctl/arch [netbsd-9]: i386.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1542):

sys/arch/x86/include/specialreg.h: revision 1.189
sys/dev/nvmm/x86/nvmm_x86.c: revision 1.23
usr.sbin/cpuctl/arch/i386.c: revision 1.128
sys/arch/x86/include/specialreg.h: revision 1.190
sys/arch/x86/include/specialreg.h: revision 1.191
sys/arch/x86/include/specialreg.h: revision 1.192

s/shareing/sharing/. No functional change.

Add top-down slots event bit of architectural performance monitoring leaf.

Modify CPUID Fn000a %ebx's string. Add new string for %ecx.

Modify output of CPUID Fn000a.
old:
cpu0: Perfmon-eax 0x8300805
cpu0: Perfmon-eax 0x8300805
cpu0: Perfmon-edx 0x8604
new:
cpu0: Perfmon: Ver. 5
cpu0: Perfmon: General: bitwidth 48, 8 counters
cpu0: Perfmon: General: avail 0xff
cpu0: Perfmon: General: avail 0xff
cpu0: Perfmon: Fixed: bitwidth 48, 4 counters
cpu0: Perfmon: Fixed: avail 0xf

Update some AMD CPUID bits:
- Rename FSREP_MOV to FSRM.
- Add Memory Bandwidth Enforcement (MBE)
- Add AMD's PPIN. Rename CPUID_SEF_PPIN to CPUID_SEF_INTEL_PPIN.
- Add Collaborative Processor Performance Control (CPPC).
- Add HOST_MCE_OVERRIDE.
- Add some unknown bits as Bxx.
- Add comments.
- Use __BIT().


To generate a diff of this commit:
cvs rdiff -u -r1.150.2.10 -r1.150.2.11 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.7.4.7 -r1.7.4.8 src/sys/dev/nvmm/x86/nvmm_x86.c
cvs rdiff -u -r1.104.2.10 -r1.104.2.11 src/usr.sbin/cpuctl/arch/i386.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/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.150.2.10 src/sys/arch/x86/include/specialreg.h:1.150.2.11
--- src/sys/arch/x86/include/specialreg.h:1.150.2.10	Mon Jan 31 17:42:17 2022
+++ src/sys/arch/x86/include/specialreg.h	Sat Oct 15 10:08:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.150.2.10 2022/01/31 17:42:17 martin Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.150.2.11 2022/10/15 10:08:40 martin Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -311,7 +311,7 @@
 #define CPUID_DCP_CACHELEVEL	__BITS(7, 5)	/* Cache level (start at 1) */
 #define CPUID_DCP_SELFINITCL	__BIT(8)	/* Self initializing cachelvl*/
 #define CPUID_DCP_FULLASSOC	__BIT(9)	/* Full associative */
-#define CPUID_DCP_SHAREING	__BITS(25, 14)	/* shareing */
+#define CPUID_DCP_SHARING	__BITS(25, 14)	/* sharing */
 #define CPUID_DCP_CORE_P_PKG	__BITS(31, 26)	/* Cores/package */
 
 /* %ebx */
@@ -483,7 +483,7 @@
 /* %ecx = 0, %edx */
 #define CPUID_SEF_AVX512_4VNNIW	__BIT(2)  /* AVX512 4-reg Neural Network ins */
 #define CPUID_SEF_AVX512_4FMAPS	__BIT(3)  /* AVX512 4-reg Mult Accum Single precision */
-#define CPUID_SEF_FSREP_MOV	__BIT(4)  /* Fast Short REP MOVE */
+#define CPUID_SEF_FSRM		__BIT(4)  /* Fast Short Rep Move */
 #define CPUID_SEF_AVX512_VP2INTERSECT __BIT(8) /* AVX512 VP2INTERSECT */
 #define CPUID_SEF_SRBDS_CTRL	__BIT(9)  /* IA32_MCU_OPT_CTRL */
 #define CPUID_SEF_MD_CLEAR	__BIT(10) /* VERW clears CPU buffers */
@@ -503,7 +503,7 @@
 
 #define CPUID_SEF_FLAGS2	"\20"	  \
 "\3" "AVX512_4VNNIW" "\4" "AVX512_4FMAPS" \
-	"\5" "FSREP_MOV"		  \
+	"\5" "FSRM"			  \
 	"\11VP2INTERSECT" "\12SRBDS_CTRL" "\13MD_CLEAR"			  \
 			"\16TSX_FORCE_ABORT" "\17SERIALIZE" "\20HYBRID"	  \
 	"\21" "TSXLDTRK"		"\23" "PCONFIG"	"\24" "ARCH_LBR"  \
@@ -527,7 +527,7 @@
 	"\31" "LAM"
 
 /* %ecx = 1, %ebx */
-#define CPUID_SEF_PPIN		__BIT(0)  /* IA32_PPIN & IA32_PPIN_CTL MSRs */
+#define CPUID_SEF_INTEL_PPIN	__BIT(0)  /* IA32_PPIN & IA32_PPIN_CTL MSRs */
 
 #define CPUID_SEF1_FLAGS_B	"\20"\
 "\1" "PPIN"
@@ -557,10 +557,16 @@
 #define CPUID_PERF_LLCMISS	__BIT(4)   /* No LLCache miss */
 #define CPUID_PERF_BRINSRETR	__BIT(5)   /* No branch inst. retried */
 #define CPUID_PERF_BRMISPRRETR	__BIT(6)   /* No branch mispredict retry */
+#define CPUID_PERF_TOPDOWNSLOT	__BIT(7)   /* No top-down slots */
 
-#define CPUID_PERF_FLAGS1	"\177\20"			  \
-	"b\0CORECYCL\0" "b\1INSTRETRY\0" "b\2REFCYCL\0" "b\3LLCREF\0" \
-	"b\4LLCMISS\0" "b\5BRINSRETR\0" "b\6BRMISPRRETR\0"
+#define CPUID_PERF_FLAGS1	"\177\20"  \
+	"b\0CORECYCL\0"	"b\1INST\0"	"b\2REFCYCL\0"	"b\3LLCREF\0"	  \
+	"b\4LLCMISS\0"	"b\5BRINST\0"	"b\6BRMISPR\0"	"b\7TOPDOWNSLOT\0"
+
+/* %ecx */
+
+#define CPUID_PERF_FLAGS2	"\177\20"  \
+	"b\0INST\0" "b\1CLK_CORETHREAD\0" "b\2CLK_REF_TSC\0" "b\3TOPDOWNSLOT\0"
 
 /* %edx */
 #define CPUID_PERF_NFFPC	__BITS(4, 0)   /* Num of fixed-funct perfcnt */
@@ -612,10 +618,10 @@
  */
 
 /* %ecx = 1, %eax */
-#define CPUID_PES1_XSAVEOPT	0x0001	/* xsaveopt instruction */

CVS commit: [netbsd-9] src

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 10:08:41 UTC 2022

Modified Files:
src/sys/arch/x86/include [netbsd-9]: specialreg.h
src/sys/dev/nvmm/x86 [netbsd-9]: nvmm_x86.c
src/usr.sbin/cpuctl/arch [netbsd-9]: i386.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1542):

sys/arch/x86/include/specialreg.h: revision 1.189
sys/dev/nvmm/x86/nvmm_x86.c: revision 1.23
usr.sbin/cpuctl/arch/i386.c: revision 1.128
sys/arch/x86/include/specialreg.h: revision 1.190
sys/arch/x86/include/specialreg.h: revision 1.191
sys/arch/x86/include/specialreg.h: revision 1.192

s/shareing/sharing/. No functional change.

Add top-down slots event bit of architectural performance monitoring leaf.

Modify CPUID Fn000a %ebx's string. Add new string for %ecx.

Modify output of CPUID Fn000a.
old:
cpu0: Perfmon-eax 0x8300805
cpu0: Perfmon-eax 0x8300805
cpu0: Perfmon-edx 0x8604
new:
cpu0: Perfmon: Ver. 5
cpu0: Perfmon: General: bitwidth 48, 8 counters
cpu0: Perfmon: General: avail 0xff
cpu0: Perfmon: General: avail 0xff
cpu0: Perfmon: Fixed: bitwidth 48, 4 counters
cpu0: Perfmon: Fixed: avail 0xf

Update some AMD CPUID bits:
- Rename FSREP_MOV to FSRM.
- Add Memory Bandwidth Enforcement (MBE)
- Add AMD's PPIN. Rename CPUID_SEF_PPIN to CPUID_SEF_INTEL_PPIN.
- Add Collaborative Processor Performance Control (CPPC).
- Add HOST_MCE_OVERRIDE.
- Add some unknown bits as Bxx.
- Add comments.
- Use __BIT().


To generate a diff of this commit:
cvs rdiff -u -r1.150.2.10 -r1.150.2.11 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.7.4.7 -r1.7.4.8 src/sys/dev/nvmm/x86/nvmm_x86.c
cvs rdiff -u -r1.104.2.10 -r1.104.2.11 src/usr.sbin/cpuctl/arch/i386.c

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



CVS commit: [netbsd-9] src

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 09:45:54 UTC 2022

Modified Files:
src/share/man/man4 [netbsd-9]: lm.4
src/sys/dev/ic [netbsd-9]: nslm7x.c
src/sys/dev/isa [netbsd-9]: wbsio.c wbsioreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1541):

share/man/man4/lm.4: revision 1.37
sys/dev/isa/wbsio.c: revision 1.28
sys/dev/ic/nslm7x.c: revision 1.78
sys/dev/isa/wbsioreg.h: revision 1.10

Add Nuvoton NCT6799D support.

Add NCT679[89] to the supported list.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.4.1 src/share/man/man4/lm.4
cvs rdiff -u -r1.73 -r1.73.2.1 src/sys/dev/ic/nslm7x.c
cvs rdiff -u -r1.25 -r1.25.2.1 src/sys/dev/isa/wbsio.c
cvs rdiff -u -r1.9 -r1.9.2.1 src/sys/dev/isa/wbsioreg.h

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/lm.4
diff -u src/share/man/man4/lm.4:1.36 src/share/man/man4/lm.4:1.36.4.1
--- src/share/man/man4/lm.4:1.36	Thu Mar  8 07:39:28 2018
+++ src/share/man/man4/lm.4	Sat Oct 15 09:45:54 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: lm.4,v 1.36 2018/03/08 07:39:28 wiz Exp $
+.\"	$NetBSD: lm.4,v 1.36.4.1 2022/10/15 09:45:54 martin Exp $
 .\"
 .\" Copyright (c) 2000 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 March 8, 2018
+.Dd October 11, 2022
 .Dt LM 4
 .Os
 .Sh NAME
@@ -89,13 +89,9 @@ Nuvoton
 .Em NCT6102D ,
 .Em NCT6104D ,
 .Em NCT6106D ,
-.Em NCT6779D ,
-.Em NCT6791D ,
-.Em NCT6792D ,
-.Em NCT6793D ,
-.Em NCT6795D ,
+.Em NCT6779D
 and
-.Em NCT6796D .
+.Em NCT679[1235689]D .
 .It
 Winbond
 .Em W83627HF* ,

Index: src/sys/dev/ic/nslm7x.c
diff -u src/sys/dev/ic/nslm7x.c:1.73 src/sys/dev/ic/nslm7x.c:1.73.2.1
--- src/sys/dev/ic/nslm7x.c:1.73	Wed Jul 10 16:23:55 2019
+++ src/sys/dev/ic/nslm7x.c	Sat Oct 15 09:45:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: nslm7x.c,v 1.73 2019/07/10 16:23:55 msaitoh Exp $ */
+/*	$NetBSD: nslm7x.c,v 1.73.2.1 2022/10/15 09:45:54 martin Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nslm7x.c,v 1.73 2019/07/10 16:23:55 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nslm7x.c,v 1.73.2.1 2022/10/15 09:45:54 martin Exp $");
 
 #include 
 #include 
@@ -2157,6 +2157,7 @@ static const struct wb_product wbsio_pro
 { WBSIO_ID_NCT6795D,"NCT6795D", nct6779d_sensors, NULL },
 { WBSIO_ID_NCT6796D,"NCT6796D", nct6779d_sensors, NULL },
 { WBSIO_ID_NCT6798D,"NCT6798D", nct6779d_sensors, NULL },
+{ WBSIO_ID_NCT6799D,"NCT6799D", nct6779d_sensors, NULL },
 { 0, NULL, NULL, NULL }
 };
 

Index: src/sys/dev/isa/wbsio.c
diff -u src/sys/dev/isa/wbsio.c:1.25 src/sys/dev/isa/wbsio.c:1.25.2.1
--- src/sys/dev/isa/wbsio.c:1.25	Wed Jul 10 16:23:55 2019
+++ src/sys/dev/isa/wbsio.c	Sat Oct 15 09:45:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: wbsio.c,v 1.25 2019/07/10 16:23:55 msaitoh Exp $	*/
+/*	$NetBSD: wbsio.c,v 1.25.2.1 2022/10/15 09:45:54 martin Exp $	*/
 /*	$OpenBSD: wbsio.c,v 1.10 2015/03/14 03:38:47 jsg Exp $	*/
 /*
  * Copyright (c) 2008 Mark Kettenis 
@@ -99,6 +99,7 @@ static const struct wbsio_product {
 	{ WBSIO_ID_NCT6795D,	12,	"NCT6795D" },
 	{ WBSIO_ID_NCT6796D,	13,	"NCT6796D" },
 	{ WBSIO_ID_NCT6798D,	13,	"NCT6798D" },
+	{ WBSIO_ID_NCT6799D,	13,	"NCT6799D" },
 };
 
 static const struct wbsio_product *wbsio_lookup(uint8_t id, uint8_t rev);

Index: src/sys/dev/isa/wbsioreg.h
diff -u src/sys/dev/isa/wbsioreg.h:1.9 src/sys/dev/isa/wbsioreg.h:1.9.2.1
--- src/sys/dev/isa/wbsioreg.h:1.9	Wed Jul 10 16:23:55 2019
+++ src/sys/dev/isa/wbsioreg.h	Sat Oct 15 09:45:54 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: wbsioreg.h,v 1.9 2019/07/10 16:23:55 msaitoh Exp $ */
+/* $NetBSD: wbsioreg.h,v 1.9.2.1 2022/10/15 09:45:54 martin Exp $ */
 
 /* $OpenBSD: wbsioreg.h,v 1.4 2015/01/02 23:02:54 chris Exp $ */
 /*
@@ -72,6 +72,7 @@
 #define WBSIO_ID_NCT6795D	0xd35
 #define WBSIO_ID_NCT6796D	0xd420	/* 13bits */
 #define WBSIO_ID_NCT6798D	0xd428
+#define WBSIO_ID_NCT6799D	0xd800
 
 /* Make the above WBSIO_ID_* vaue from WBSIO_ID, WBSIO_REV and IDbits */
 #define WBSIO_MAKEID(id, rev, bits)	\



CVS commit: [netbsd-9] src

2022-10-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 15 09:45:54 UTC 2022

Modified Files:
src/share/man/man4 [netbsd-9]: lm.4
src/sys/dev/ic [netbsd-9]: nslm7x.c
src/sys/dev/isa [netbsd-9]: wbsio.c wbsioreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1541):

share/man/man4/lm.4: revision 1.37
sys/dev/isa/wbsio.c: revision 1.28
sys/dev/ic/nslm7x.c: revision 1.78
sys/dev/isa/wbsioreg.h: revision 1.10

Add Nuvoton NCT6799D support.

Add NCT679[89] to the supported list.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.4.1 src/share/man/man4/lm.4
cvs rdiff -u -r1.73 -r1.73.2.1 src/sys/dev/ic/nslm7x.c
cvs rdiff -u -r1.25 -r1.25.2.1 src/sys/dev/isa/wbsio.c
cvs rdiff -u -r1.9 -r1.9.2.1 src/sys/dev/isa/wbsioreg.h

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



CVS commit: src/sys/arch/riscv/include

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 06:53:49 UTC 2022

Modified Files:
src/sys/arch/riscv/include: sysreg.h

Log Message:
Fix typo in SATP_MODE_SV64


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/riscv/include/sysreg.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/arch/riscv/include/sysreg.h
diff -u src/sys/arch/riscv/include/sysreg.h:1.17 src/sys/arch/riscv/include/sysreg.h:1.18
--- src/sys/arch/riscv/include/sysreg.h:1.17	Sat Oct 15 06:52:35 2022
+++ src/sys/arch/riscv/include/sysreg.h	Sat Oct 15 06:53:49 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: sysreg.h,v 1.17 2022/10/15 06:52:35 simonb Exp $ */
+/* $NetBSD: sysreg.h,v 1.18 2022/10/15 06:53:49 skrll Exp $ */
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -257,7 +257,7 @@ riscvreg_cycle_read(void)
 #define	 SATP_MODE_SV39		8
 #define	 SATP_MODE_SV48		9
 #define	 SATP_MODE_SV57		10
-#define	 SATP_MODE_SV64		10
+#define	 SATP_MODE_SV64		11
 #define	SATP_ASID		__BITS(59,44)
 #define	SATP_PPN		__BITS(43,0)
 #else



CVS commit: src/sys/arch/riscv/include

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 06:53:49 UTC 2022

Modified Files:
src/sys/arch/riscv/include: sysreg.h

Log Message:
Fix typo in SATP_MODE_SV64


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/riscv/include/sysreg.h

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



CVS commit: src/sys/arch/riscv/include

2022-10-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Oct 15 06:52:35 UTC 2022

Modified Files:
src/sys/arch/riscv/include: sysreg.h

Log Message:
Consistency nit: use "__volatile" instead of "volatile" with asm()s.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/riscv/include/sysreg.h

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



CVS commit: src/sys/arch/riscv/include

2022-10-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Oct 15 06:52:35 UTC 2022

Modified Files:
src/sys/arch/riscv/include: sysreg.h

Log Message:
Consistency nit: use "__volatile" instead of "volatile" with asm()s.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/riscv/include/sysreg.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/arch/riscv/include/sysreg.h
diff -u src/sys/arch/riscv/include/sysreg.h:1.16 src/sys/arch/riscv/include/sysreg.h:1.17
--- src/sys/arch/riscv/include/sysreg.h:1.16	Sat Oct 15 06:48:31 2022
+++ src/sys/arch/riscv/include/sysreg.h	Sat Oct 15 06:52:35 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: sysreg.h,v 1.16 2022/10/15 06:48:31 simonb Exp $ */
+/* $NetBSD: sysreg.h,v 1.17 2022/10/15 06:52:35 simonb Exp $ */
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@ riscvreg_fcsr_write_frm(uint32_t __new)
 {
 	uint32_t __old;
 	__new = __SHIFTIN(__new, FCSR_FRM);
-	__asm volatile("fsrm\t%0, %1" : "=r"(__old) : "r"(__new));
+	__asm __volatile("fsrm\t%0, %1" : "=r"(__old) : "r"(__new));
 	return __SHIFTOUT(__old, FCSR_FRM);
 }
 



CVS commit: src/sys/arch/riscv/include

2022-10-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Oct 15 06:48:31 UTC 2022

Modified Files:
src/sys/arch/riscv/include: sysreg.h

Log Message:
Add SATP modes for bare, SV57 and SV64.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/riscv/include/sysreg.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/arch/riscv/include/sysreg.h
diff -u src/sys/arch/riscv/include/sysreg.h:1.15 src/sys/arch/riscv/include/sysreg.h:1.16
--- src/sys/arch/riscv/include/sysreg.h:1.15	Sat Oct 15 06:41:43 2022
+++ src/sys/arch/riscv/include/sysreg.h	Sat Oct 15 06:48:31 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: sysreg.h,v 1.15 2022/10/15 06:41:43 simonb Exp $ */
+/* $NetBSD: sysreg.h,v 1.16 2022/10/15 06:48:31 simonb Exp $ */
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -253,12 +253,16 @@ riscvreg_cycle_read(void)
 
 #ifdef _LP64
 #define	SATP_MODE		__BITS(63,60)
+#define	 SATP_MODE_BARE		0
 #define	 SATP_MODE_SV39		8
 #define	 SATP_MODE_SV48		9
+#define	 SATP_MODE_SV57		10
+#define	 SATP_MODE_SV64		10
 #define	SATP_ASID		__BITS(59,44)
 #define	SATP_PPN		__BITS(43,0)
 #else
 #define	SATP_MODE		__BIT(31)
+#define	 SATP_MODE_BARE		0
 #define	 SATP_MODE_SV32		1
 #define	SATP_ASID		__BITS(30,22)
 #define	SATP_PPN		__BITS(21,0)



CVS commit: src/sys/arch/riscv/include

2022-10-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Oct 15 06:48:31 UTC 2022

Modified Files:
src/sys/arch/riscv/include: sysreg.h

Log Message:
Add SATP modes for bare, SV57 and SV64.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/riscv/include/sysreg.h

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



CVS commit: src/sys/arch/riscv/include

2022-10-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Oct 15 06:46:41 UTC 2022

Modified Files:
src/sys/arch/riscv/include: cpu_counter.h

Log Message:
Use __volatile so the compiler doesn't optimise out successive calls
to cpu_counter().
Add a 64-bit cycle counter on _LP64.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/include/cpu_counter.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/arch/riscv/include/cpu_counter.h
diff -u src/sys/arch/riscv/include/cpu_counter.h:1.2 src/sys/arch/riscv/include/cpu_counter.h:1.3
--- src/sys/arch/riscv/include/cpu_counter.h:1.2	Sat Oct 15 06:41:43 2022
+++ src/sys/arch/riscv/include/cpu_counter.h	Sat Oct 15 06:46:41 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_counter.h,v 1.2 2022/10/15 06:41:43 simonb Exp $	*/
+/*	$NetBSD: cpu_counter.h,v 1.3 2022/10/15 06:46:41 simonb Exp $	*/
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  */
 
-/* $NetBSD: cpu_counter.h,v 1.2 2022/10/15 06:41:43 simonb Exp $ */
+/* $NetBSD: cpu_counter.h,v 1.3 2022/10/15 06:46:41 simonb Exp $ */
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -67,13 +67,28 @@
 #ifdef _KERNEL
 
 #define	cpu_hascounter()	true
+
+#ifdef _LP64
+static __inline uint64_t
+cpu_counter(void)
+{
+	uint64_t __count;
+
+	__asm __volatile("csrr\t%0, cycle" : "=r"(__count));
+	return __count;
+}
+
+
+#else /* 32-bit */
 #define	cpu_counter()		cpu_counter32()
+#endif /* 32-bit */
 
 static __inline uint32_t
 cpu_counter32(void)
 {
 	uint32_t __count;
-	__asm("csrr\t%0, cycle" : "=r"(__count));
+
+	__asm __volatile("csrr\t%0, cycle" : "=r"(__count));
 	return __count;
 }
 



CVS commit: src/sys/arch/riscv/include

2022-10-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Oct 15 06:46:41 UTC 2022

Modified Files:
src/sys/arch/riscv/include: cpu_counter.h

Log Message:
Use __volatile so the compiler doesn't optimise out successive calls
to cpu_counter().
Add a 64-bit cycle counter on _LP64.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/include/cpu_counter.h

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



CVS commit: src/sys/arch/riscv

2022-10-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Oct 15 06:41:44 UTC 2022

Modified Files:
src/sys/arch/riscv/include: cpu_counter.h pmap.h pte.h sysreg.h
src/sys/arch/riscv/riscv: pmap_machdep.c riscv_machdep.c trap.c

Log Message:
#define


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/include/cpu_counter.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/riscv/include/pmap.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/riscv/include/pte.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/riscv/include/sysreg.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/riscv/riscv/pmap_machdep.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/riscv/riscv/riscv_machdep.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/riscv/riscv/trap.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/arch/riscv/include/cpu_counter.h
diff -u src/sys/arch/riscv/include/cpu_counter.h:1.1 src/sys/arch/riscv/include/cpu_counter.h:1.2
--- src/sys/arch/riscv/include/cpu_counter.h:1.1	Fri Sep 19 17:36:26 2014
+++ src/sys/arch/riscv/include/cpu_counter.h	Sat Oct 15 06:41:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_counter.h,v 1.1 2014/09/19 17:36:26 matt Exp $	*/
+/*	$NetBSD: cpu_counter.h,v 1.2 2022/10/15 06:41:43 simonb Exp $	*/
 
 /*
  * Copyright (c) 2000 Soren S. Jorvang.  All rights reserved.
@@ -25,7 +25,7 @@
  * SUCH DAMAGE.
  */
 
-/* $NetBSD: cpu_counter.h,v 1.1 2014/09/19 17:36:26 matt Exp $ */
+/* $NetBSD: cpu_counter.h,v 1.2 2022/10/15 06:41:43 simonb Exp $ */
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -56,7 +56,7 @@
  */
 
 #ifndef _RISCV_CPU_COUNTER_H_
-#define _RISCV_CPU_COUNTER_H_
+#define	_RISCV_CPU_COUNTER_H_
 
 /*
  * Machine-specific support for CPU counter.
@@ -67,7 +67,7 @@
 #ifdef _KERNEL
 
 #define	cpu_hascounter()	true
-#define cpu_counter()		cpu_counter32()
+#define	cpu_counter()		cpu_counter32()
 
 static __inline uint32_t
 cpu_counter32(void)

Index: src/sys/arch/riscv/include/pmap.h
diff -u src/sys/arch/riscv/include/pmap.h:1.10 src/sys/arch/riscv/include/pmap.h:1.11
--- src/sys/arch/riscv/include/pmap.h:1.10	Tue Sep 20 07:18:23 2022
+++ src/sys/arch/riscv/include/pmap.h	Sat Oct 15 06:41:43 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.10 2022/09/20 07:18:23 skrll Exp $ */
+/* $NetBSD: pmap.h,v 1.11 2022/10/15 06:41:43 simonb Exp $ */
 
 /*
  * Copyright (c) 2014, 2019, 2021 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #ifndef _RISCV_PMAP_H_
-#define _RISCV_PMAP_H_
+#define	_RISCV_PMAP_H_
 
 #ifdef _KERNEL_OPT
 #include "opt_modular.h"
@@ -50,57 +50,57 @@
 #include 
 #include 
 
-#define PMAP_SEGTABSIZE	NPTEPG
-#define PMAP_PDETABSIZE	NPTEPG
+#define	PMAP_SEGTABSIZE	NPTEPG
+#define	PMAP_PDETABSIZE	NPTEPG
 
 #ifdef _LP64
-#define PTPSHIFT	3
+#define	PTPSHIFT	3
 /* This is SV48. */
 //#define SEGLENGTH + SEGSHIFT + SEGSHIFT */
 
 /* This is SV39. */
-#define XSEGSHIFT	(SEGSHIFT + SEGLENGTH)
-#define NBXSEG		(1ULL << XSEGSHIFT)
-#define XSEGOFSET	(NBXSEG - 1)		/* byte offset into xsegment */
-#define XSEGLENGTH	(PGSHIFT - 3)
-#define NXSEGPG		(1 << XSEGLENGTH)
+#define	XSEGSHIFT	(SEGSHIFT + SEGLENGTH)
+#define	NBXSEG		(1ULL << XSEGSHIFT)
+#define	XSEGOFSET	(NBXSEG - 1)		/* byte offset into xsegment */
+#define	XSEGLENGTH	(PGSHIFT - 3)
+#define	NXSEGPG		(1 << XSEGLENGTH)
 #else
-#define PTPSHIFT	2
-#define XSEGSHIFT	SEGLENGTH
+#define	PTPSHIFT	2
+#define	XSEGSHIFT	SEGLENGTH
 #endif
 
-#define SEGLENGTH	(PGSHIFT - PTPSHIFT)
-#define SEGSHIFT	(SEGLENGTH + PGSHIFT)
-#define NBSEG		(1 << SEGSHIFT)		/* bytes/segment */
-#define SEGOFSET	(NBSEG - 1)		/* byte offset into segment */
+#define	SEGLENGTH	(PGSHIFT - PTPSHIFT)
+#define	SEGSHIFT	(SEGLENGTH + PGSHIFT)
+#define	NBSEG		(1 << SEGSHIFT)		/* bytes/segment */
+#define	SEGOFSET	(NBSEG - 1)		/* byte offset into segment */
 
-#define KERNEL_PID	0
+#define	KERNEL_PID	0
 
-#define PMAP_HWPAGEWALKER		1
-#define PMAP_TLB_MAX			1
+#define	PMAP_HWPAGEWALKER		1
+#define	PMAP_TLB_MAX			1
 #ifdef _LP64
-#define PMAP_INVALID_PDETAB_ADDRESS	((pmap_pdetab_t *)(VM_MIN_KERNEL_ADDRESS - PAGE_SIZE))
-#define PMAP_INVALID_SEGTAB_ADDRESS	((pmap_segtab_t *)(VM_MIN_KERNEL_ADDRESS - PAGE_SIZE))
+#define	PMAP_INVALID_PDETAB_ADDRESS	((pmap_pdetab_t *)(VM_MIN_KERNEL_ADDRESS - PAGE_SIZE))
+#define	PMAP_INVALID_SEGTAB_ADDRESS	((pmap_segtab_t *)(VM_MIN_KERNEL_ADDRESS - PAGE_SIZE))
 #else
-#define PMAP_INVALID_PDETAB_ADDRESS	((pmap_pdetab_t *)0xdeadbeef)
-#define PMAP_INVALID_SEGTAB_ADDRESS	((pmap_segtab_t *)0xdeadbeef)
+#define	PMAP_INVALID_PDETAB_ADDRESS	((pmap_pdetab_t *)0xdeadbeef)
+#define	PMAP_INVALID_SEGTAB_ADDRESS	((pmap_segtab_t *)0xdeadbeef)
 #endif
-#define PMAP_TLB_NUM_PIDS		(__SHIFTOUT_MASK(SATP_ASID) + 1)
-#define PMAP_TLB_BITMAP_LENGTH  PMAP_TLB_NUM_PIDS
-#define PMAP_TLB_FLUSH_ASID_ON_RESET	false
+#define	PMAP_TLB_NUM_PIDS		(__SHIFTOUT_MASK(SATP_ASID) + 1)
+#define	PMAP_TLB_BITMAP_LENGTH  PMAP_TLB_NUM_PIDS
+#define	

CVS commit: src/sys/arch/riscv

2022-10-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Oct 15 06:41:44 UTC 2022

Modified Files:
src/sys/arch/riscv/include: cpu_counter.h pmap.h pte.h sysreg.h
src/sys/arch/riscv/riscv: pmap_machdep.c riscv_machdep.c trap.c

Log Message:
#define


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/include/cpu_counter.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/riscv/include/pmap.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/riscv/include/pte.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/riscv/include/sysreg.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/riscv/riscv/pmap_machdep.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/riscv/riscv/riscv_machdep.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/riscv/riscv/trap.c

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



CVS commit: src/sys/arch/riscv/include

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 06:07:04 UTC 2022

Modified Files:
src/sys/arch/riscv/include: vmparam.h

Log Message:
Update a comment


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/riscv/include/vmparam.h

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



CVS commit: src/sys/arch/riscv/include

2022-10-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 15 06:07:04 UTC 2022

Modified Files:
src/sys/arch/riscv/include: vmparam.h

Log Message:
Update a comment


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/riscv/include/vmparam.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/arch/riscv/include/vmparam.h
diff -u src/sys/arch/riscv/include/vmparam.h:1.11 src/sys/arch/riscv/include/vmparam.h:1.12
--- src/sys/arch/riscv/include/vmparam.h:1.11	Wed Oct 12 07:53:15 2022
+++ src/sys/arch/riscv/include/vmparam.h	Sat Oct 15 06:07:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.11 2022/10/12 07:53:15 simonb Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.12 2022/10/15 06:07:04 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
@@ -108,7 +108,7 @@
  * User/kernel map constants.
  */
 #define VM_MIN_ADDRESS		((vaddr_t)0x)
-#ifdef _LP64	/* Sv39 */
+#ifdef _LP64	/* Sv39 / Sv48 / Sv57 */
 /*
  * kernel virtual space layout:
  *   0x_ffc0__  -   64GiB  KERNEL VM Space (inc. text/data/bss)