CVS commit: src

2020-08-17 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Tue Aug 18 03:02:51 UTC 2020

Modified Files:
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/tests: mi
src/tests/fs/lfs: Makefile
Added Files:
src/tests/fs/lfs: t_rfw.c

Log Message:
Add skipped test for in-kernel roll-forward agent


To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.892 -r1.893 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.2 -r1.3 src/tests/fs/lfs/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/fs/lfs/t_rfw.c

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

Modified files:

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.327 src/distrib/sets/lists/debug/mi:1.328
--- src/distrib/sets/lists/debug/mi:1.327	Fri Aug 14 00:53:16 2020
+++ src/distrib/sets/lists/debug/mi	Tue Aug 18 03:02:50 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.327 2020/08/14 00:53:16 riastradh Exp $
+# $NetBSD: mi,v 1.328 2020/08/18 03:02:50 perseant Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -1666,6 +1666,7 @@
 ./usr/libdata/debug/usr/tests/fs/hfs/t_pathconvert.debug		tests-fs-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/fs/kernfs/t_basic.debug			tests-fs-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/fs/lfs/t_pr.debugtests-fs-debug		debug,atf,rump
+./usr/libdata/debug/usr/tests/fs/lfs/t_rfw.debug			tests-fs-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/fs/msdosfs/t_snapshot.debug		tests-fs-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/fs/nfs/nfsservice/rumpnfsd.debug			tests-fs-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/fs/nfs/t_mountd.debug			tests-fs-debug		debug,atf,rump

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.892 src/distrib/sets/lists/tests/mi:1.893
--- src/distrib/sets/lists/tests/mi:1.892	Sun Aug 16 20:43:01 2020
+++ src/distrib/sets/lists/tests/mi	Tue Aug 18 03:02:50 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.892 2020/08/16 20:43:01 rillig Exp $
+# $NetBSD: mi,v 1.893 2020/08/18 03:02:50 perseant Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1501,6 +1501,7 @@
 ./usr/tests/fs/lfs/Atffiletests-fs-tests		atf,rump
 ./usr/tests/fs/lfs/Kyuafiletests-fs-tests		atf,rump,kyua
 ./usr/tests/fs/lfs/t_pr	tests-fs-tests		atf,rump
+./usr/tests/fs/lfs/t_rfwtests-fs-tests		atf,rump
 ./usr/tests/fs/msdosfs	tests-fs-tests		compattestfile,atf
 ./usr/tests/fs/msdosfs/Atffiletests-fs-tests		atf,rump
 ./usr/tests/fs/msdosfs/Kyuafiletests-fs-tests		atf,rump,kyua

Index: src/tests/fs/lfs/Makefile
diff -u src/tests/fs/lfs/Makefile:1.2 src/tests/fs/lfs/Makefile:1.3
--- src/tests/fs/lfs/Makefile:1.2	Sun Mar  1 18:08:13 2020
+++ src/tests/fs/lfs/Makefile	Tue Aug 18 03:02:50 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2020/03/01 18:08:13 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2020/08/18 03:02:50 perseant Exp $
 #
 
 .include 
@@ -6,7 +6,7 @@
 TESTSDIR=	${TESTSBASE}/fs/lfs
 WARNS=		4
 
-TESTS_C=	t_pr
+TESTS_C=	t_pr t_rfw
 
 LDADD+=-lrumpfs_lfs -lrumpfs_ffs# fs drivers
 LDADD+=-lrumpdev_disk -lrumpdev	# disk device

Added files:

Index: src/tests/fs/lfs/t_rfw.c
diff -u /dev/null src/tests/fs/lfs/t_rfw.c:1.1
--- /dev/null	Tue Aug 18 03:02:51 2020
+++ src/tests/fs/lfs/t_rfw.c	Tue Aug 18 03:02:50 2020
@@ -0,0 +1,272 @@
+/*	$NetBSD: t_rfw.c,v 1.1 2020/08/18 03:02:50 perseant Exp $	*/
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "h_macros.h"
+
+/* Debugging conditions */
+/* #define FORCE_SUCCESS */ /* Don't actually revert, everything worked */
+/* #define FORCE_SYSCTL */ /* Don't check - necessary for FORCE_SUCCESS */
+
+/* Write a well-known byte pattern into a file, appending if it exists */
+int write_file(const char *, int);
+
+/* Check the byte pattern and size of the file */
+int check_file(const char *, int);
+
+ATF_TC(rfw);
+ATF_TC_HEAD(rfw, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+		"LFS roll-forward creates an inconsistent filesystem");
+	atf_tc_set_md_var(tc, "timeout", "20");
+}
+
+#define IMGNAME "disk.img"
+#define FAKEBLK "/dev/blk"
+#define LOGFILE "newfs.log"
+#define SBLOCK0_COPY "sb0.dd"
+#define SBLOCK1_COPY "sb1.dd"
+#define MAXLINE 132
+#define CHUNKSIZE 300
+ATF_TC_BODY(rfw, tc)
+{
+	struct ufs_args args;
+	FILE *pipe;
+#if (!defined FORCE_SUCCESS && !defined FORCE_SYSCTL)
+	int o_sysctl_rfw;
+	int n_sysctl_rfw;
+	int mib[3];
+	size_t len;
+#endif
+	char buf[MAXLINE];
+	long long sb0addr = -1, sb1addr = -1;
+
+	/*
+	 * Initialize.
+	 */
+#if (!defined FORCE_SUCCESS && !defined FORCE_SYSCTL)
+	/* Set sysctl to allow 

CVS commit: src/sys/dev/usb

2020-08-17 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Aug 18 02:53:25 UTC 2020

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.774 -r1.775 src/sys/dev/usb/usbdevs.h \
src/sys/dev/usb/usbdevs_data.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/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.774 src/sys/dev/usb/usbdevs.h:1.775
--- src/sys/dev/usb/usbdevs.h:1.774	Sat Jul  4 08:06:12 2020
+++ src/sys/dev/usb/usbdevs.h	Tue Aug 18 02:53:25 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.774 2020/07/04 08:06:12 ryoon Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.775 2020/08/18 02:53:25 simonb Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.783 2020/06/19 11:52:42 flxd Exp
+ *	NetBSD: usbdevs,v 1.785 2020/08/18 02:53:01 simonb Exp
  */
 
 /*-
@@ -2656,6 +2656,8 @@
 
 /* Future Bits products */
 #define	USB_PRODUCT_FUTUREBITS_4PI	0x6019		/* 4Pi reprap */
+/* Moonbase Otago share vendor ID with Future Bits products */
+#define	USB_PRODUCT_FUTUREBITS_ONERNG	0x6086		/* OneRNG Random Number Generator */
 
 /* Pen Driver */
 #define	USB_PRODUCT_PEN_USBDISKPRO	0x0120		/* USB Disk Pro */
Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.774 src/sys/dev/usb/usbdevs_data.h:1.775
--- src/sys/dev/usb/usbdevs_data.h:1.774	Sat Jul  4 08:06:12 2020
+++ src/sys/dev/usb/usbdevs_data.h	Tue Aug 18 02:53:25 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.774 2020/07/04 08:06:12 ryoon Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.775 2020/08/18 02:53:25 simonb Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.783 2020/06/19 11:52:42 flxd Exp
+ *	NetBSD: usbdevs,v 1.785 2020/08/18 02:53:01 simonb Exp
  */
 
 /*-
@@ -3571,6 +3571,8 @@ static const uint16_t usb_products[] = {
 	5115, 0,
 	USB_VENDOR_FUTUREBITS, USB_PRODUCT_FUTUREBITS_4PI, 
 	15974, 15978, 0,
+	USB_VENDOR_FUTUREBITS, USB_PRODUCT_FUTUREBITS_ONERNG, 
+	15985, 15992, 15999, 16006, 0,
 	USB_VENDOR_PEN, USB_PRODUCT_PEN_USBDISKPRO, 
 	4901, 12931, 4999, 0,
 	USB_VENDOR_PEN, USB_PRODUCT_PEN_USBREADER, 
@@ -3586,133 +3588,133 @@ static const uint16_t usb_products[] = {
 	USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_ENET, 
 	4931, 4940, 0,
 	USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_ENET3, 
-	3145, 15985, 4931, 4915, 0,
+	3145, 16016, 4931, 4915, 0,
 	USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_ENET2, 
 	4931, 4940, 0,
 	USB_VENDOR_PHEENET, USB_PRODUCT_PHEENET_GWU513, 
-	15990, 0,
+	16021, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_DSS350, 
-	15997, 8723, 2295, 7266, 2812, 0,
+	16028, 8723, 2295, 7266, 2812, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_DSS, 
-	15997, 16001, 2295, 7266, 2812, 0,
+	16028, 16032, 2295, 7266, 2812, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_SA235, 
-	16005, 0,
+	16036, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_HUB, 
 	7084, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_PCA645VC, 
-	16011, 5803, 2995, 0,
+	16042, 5803, 2995, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_PCA646VC, 
-	16020, 5803, 2995, 0,
+	16051, 5803, 2995, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_PCVC675K, 
-	16029, 16038, 5803, 2995, 0,
+	16060, 16069, 5803, 2995, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_PCVC680K, 
-	16044, 16038, 4999, 5803, 2995, 0,
+	16075, 16069, 4999, 5803, 2995, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_PCVC690K, 
-	16053, 16038, 4999, 16062, 5803, 2995, 0,
+	16084, 16069, 4999, 16093, 5803, 2995, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_PCVC730K, 
-	16067, 16076, 16083, 5803, 2995, 0,
+	16098, 16107, 16114, 5803, 2995, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_PCVC740K, 
-	16087, 16076, 4999, 5803, 2995, 0,
+	16118, 16107, 4999, 5803, 2995, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_PCVC750K, 
-	16096, 16076, 4999, 16062, 5803, 2995, 0,
+	16127, 16107, 4999, 16093, 5803, 2995, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_DSS150, 
-	15997, 16105, 2295, 7266, 2812, 0,
+	16028, 16136, 2295, 7266, 2812, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_CPWUA054, 
-	16109, 0,
+	16140, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_SNU5600, 
-	16118, 0,
+	16149, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_SNU5630NS05, 
-	16126, 0,
+	16157, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_DIVAUSB, 
-	16139, 4901, 16144, 8485, 0,
+	16170, 4901, 16175, 8485, 0,
 	USB_VENDOR_PHILIPS, USB_PRODUCT_PHILIPS_RT2870, 
 	5094, 0,
 	USB_VENDOR_PHILIPSSEMI, USB_PRODUCT_PHILIPSSEMI_HUB1122, 
 	7084, 0,
 	

CVS commit: src/sys/dev/usb

2020-08-17 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Aug 18 02:53:02 UTC 2020

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add Moonbase Otago OneRNG Random Number Generator.


To generate a diff of this commit:
cvs rdiff -u -r1.784 -r1.785 src/sys/dev/usb/usbdevs

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

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.784 src/sys/dev/usb/usbdevs:1.785
--- src/sys/dev/usb/usbdevs:1.784	Sat Jul  4 08:05:26 2020
+++ src/sys/dev/usb/usbdevs	Tue Aug 18 02:53:01 2020
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.784 2020/07/04 08:05:26 ryoon Exp $
+$NetBSD: usbdevs,v 1.785 2020/08/18 02:53:01 simonb Exp $
 
 /*-
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -2649,6 +2649,8 @@ product PEGATRON RT3072		0x0011	RT3072
 
 /* Future Bits products */
 product FUTUREBITS 4PI		0x6019	4Pi reprap
+/* Moonbase Otago share vendor ID with Future Bits products */
+product	FUTUREBITS ONERNG	0x6086	OneRNG Random Number Generator
 
 /* Pen Driver */
 product PEN USBDISKPRO		0x0120	USB Disk Pro



CVS commit: src/sys/arch/mips/mips

2020-08-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 17 21:50:14 UTC 2020

Modified Files:
src/sys/arch/mips/mips: mips_stacktrace.c

Log Message:
avoid build failure on !DBB kernels.

should fix arc, emips, ews4800mips, mipsco, newsmips and pmax builds.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/mips/mips_stacktrace.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/mips/mips/mips_stacktrace.c
diff -u src/sys/arch/mips/mips/mips_stacktrace.c:1.3 src/sys/arch/mips/mips/mips_stacktrace.c:1.4
--- src/sys/arch/mips/mips/mips_stacktrace.c:1.3	Mon Aug 17 04:15:34 2020
+++ src/sys/arch/mips/mips/mips_stacktrace.c	Mon Aug 17 21:50:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_stacktrace.c,v 1.3 2020/08/17 04:15:34 mrg Exp $	*/
+/*	$NetBSD: mips_stacktrace.c,v 1.4 2020/08/17 21:50:14 mrg Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mips_stacktrace.c,v 1.3 2020/08/17 04:15:34 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_stacktrace.c,v 1.4 2020/08/17 21:50:14 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -62,9 +62,9 @@ __KERNEL_RCSID(0, "$NetBSD: mips_stacktr
 #ifdef DDB
 #include 
 #include 
-#endif
 #include 
 #include 
+#endif
 
 #ifdef KGDB
 #include 
@@ -201,7 +201,11 @@ kdbpeek(vaddr_t addr, unsigned *valp)
 		printf("kdbpeek: NULL\n");
 		return false;
 	} else {
+#if _KERNEL
+		*valp = *(unsigned *)addr;
+#else
 		db_read_bytes((db_addr_t)addr, sizeof(unsigned), (char *)valp);
+#endif
 		return true;
 	}
 }
@@ -223,9 +227,15 @@ kdbrpeek(vaddr_t addr, size_t n)
 		rc = 0xdeadfeed;
 	} else {
 		if (sizeof(mips_reg_t) == 8 && n == 8)
+#if _KERNEL
 			db_read_bytes((db_addr_t)addr, sizeof(int64_t), (char *));
 		else
 			db_read_bytes((db_addr_t)addr, sizeof(int32_t), (char *));
+#else
+			rc = *(int64_t *)addr;
+ 		else
+			rc = *(int32_t *)addr;
+#endif
 	}
 	return rc;
 }



CVS commit: src/sys/arch/mips/cavium

2020-08-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Aug 17 21:25:12 UTC 2020

Modified Files:
src/sys/arch/mips/cavium: mainbus.c octeon1p_iobus.c octeon_iobus.c
src/sys/arch/mips/cavium/include: iobusvar.h

Log Message:
Attach an iobus with octrnm even if using devicetree (there is no
corresponding node for this device in the DT).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/cavium/mainbus.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/cavium/octeon1p_iobus.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/cavium/octeon_iobus.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mips/cavium/include/iobusvar.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/mips/cavium/mainbus.c
diff -u src/sys/arch/mips/cavium/mainbus.c:1.3 src/sys/arch/mips/cavium/mainbus.c:1.4
--- src/sys/arch/mips/cavium/mainbus.c:1.3	Thu Jul 16 16:40:28 2020
+++ src/sys/arch/mips/cavium/mainbus.c	Mon Aug 17 21:25:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.3 2020/07/16 16:40:28 jmcneill Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.4 2020/08/17 21:25:12 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2007
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.3 2020/07/16 16:40:28 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.4 2020/08/17 21:25:12 jmcneill Exp $");
 
 #define	_MIPS_BUS_DMA_PRIVATE
 
@@ -118,6 +118,10 @@ mainbus_attach_devicetree(device_t self)
 	config_found_sm_loc(self, "mainbus", NULL, , mainbus_print,
 	mainbus_submatch);
 
+	aa.aa_name = "iobus";
+	config_found_sm_loc(self, "mainbus", NULL, , mainbus_print,
+	mainbus_submatch);
+
 	octpow_bootstrap(_configuration);
 	octfpa_bootstrap(_configuration);
 

Index: src/sys/arch/mips/cavium/octeon1p_iobus.c
diff -u src/sys/arch/mips/cavium/octeon1p_iobus.c:1.5 src/sys/arch/mips/cavium/octeon1p_iobus.c:1.6
--- src/sys/arch/mips/cavium/octeon1p_iobus.c:1.5	Tue Jun 23 05:18:02 2020
+++ src/sys/arch/mips/cavium/octeon1p_iobus.c	Mon Aug 17 21:25:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon1p_iobus.c,v 1.5 2020/06/23 05:18:02 simonb Exp $	*/
+/*	$NetBSD: octeon1p_iobus.c,v 1.6 2020/08/17 21:25:12 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: octeon1p_iobus.c,v 1.5 2020/06/23 05:18:02 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon1p_iobus.c,v 1.6 2020/08/17 21:25:12 jmcneill Exp $");
 
 #include 
 #include 
@@ -67,6 +67,7 @@ static const struct iobus_unit iobus_uni
 
 static const struct iobus_dev iobus_dev_octrnm = {
 	.name = "octrnm",
+	.flags = IOBUS_DEV_FDT,
 	.nunits = RNM_NUNITS,
 	.units = iobus_units_octrnm
 };

Index: src/sys/arch/mips/cavium/octeon_iobus.c
diff -u src/sys/arch/mips/cavium/octeon_iobus.c:1.4 src/sys/arch/mips/cavium/octeon_iobus.c:1.5
--- src/sys/arch/mips/cavium/octeon_iobus.c:1.4	Tue Jun 23 05:14:18 2020
+++ src/sys/arch/mips/cavium/octeon_iobus.c	Mon Aug 17 21:25:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon_iobus.c,v 1.4 2020/06/23 05:14:18 simonb Exp $	*/
+/*	$NetBSD: octeon_iobus.c,v 1.5 2020/08/17 21:25:12 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2007
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: octeon_iobus.c,v 1.4 2020/06/23 05:14:18 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon_iobus.c,v 1.5 2020/08/17 21:25:12 jmcneill Exp $");
 
 #include "locators.h"
 
@@ -40,6 +40,8 @@ __KERNEL_RCSID(0, "$NetBSD: octeon_iobus
 
 #include 
 
+#include 
+
 struct iobus_softc {
 	device_t		sc_dev;
 
@@ -88,6 +90,7 @@ iobus_attach(device_t parent, device_t s
 	struct iobus_softc *sc = device_private(self);
 	const struct iobus_dev *dev;
 	struct iobus_attach_args aa;
+	const bool fdt_p = fdtbus_get_data() != NULL;
 	int i, j;
 
 	sc->sc_dev = self;
@@ -100,6 +103,9 @@ iobus_attach(device_t parent, device_t s
 	for (i = 0; i < (int)iobus_ndevs; i++) {
 		dev = iobus_devs[i];
 		for (j = 0; j < dev->nunits; j++) {
+			if (fdt_p && (dev->flags & IOBUS_DEV_FDT) == 0)
+continue;
+
 			aa.aa_name = dev->name;
 			aa.aa_unitno = j;
 			aa.aa_unit = >units[j];

Index: src/sys/arch/mips/cavium/include/iobusvar.h
diff -u src/sys/arch/mips/cavium/include/iobusvar.h:1.1 src/sys/arch/mips/cavium/include/iobusvar.h:1.2
--- src/sys/arch/mips/cavium/include/iobusvar.h:1.1	Wed Apr 29 08:32:01 2015
+++ src/sys/arch/mips/cavium/include/iobusvar.h	Mon Aug 17 21:25:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: iobusvar.h,v 1.1 2015/04/29 08:32:01 hikaru Exp $	*/
+/*	$NetBSD: iobusvar.h,v 1.2 2020/08/17 21:25:12 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2007
@@ -43,6 +43,8 @@ struct iobus_unit {
 
 struct iobus_dev {
 	const char	*name;
+	int		flags;
+#define	IOBUS_DEV_FDT	0x01
 	int		nunits;
 	const struct iobus_unit *units;
 };



CVS commit: src/sys/arch/mips/cavium

2020-08-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Aug 17 21:00:29 UTC 2020

Modified Files:
src/sys/arch/mips/cavium: octeon_intr.c

Log Message:
IPI_SHOOTDOWN needs to be IPL_SCHED. Spotted by nick.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mips/cavium/octeon_intr.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/mips/cavium/octeon_intr.c
diff -u src/sys/arch/mips/cavium/octeon_intr.c:1.22 src/sys/arch/mips/cavium/octeon_intr.c:1.23
--- src/sys/arch/mips/cavium/octeon_intr.c:1.22	Wed Aug  5 04:47:35 2020
+++ src/sys/arch/mips/cavium/octeon_intr.c	Mon Aug 17 21:00:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon_intr.c,v 1.22 2020/08/05 04:47:35 simonb Exp $	*/
+/*	$NetBSD: octeon_intr.c,v 1.23 2020/08/17 21:00:29 jmcneill Exp $	*/
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
  * All rights reserved.
@@ -44,7 +44,7 @@
 #define __INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: octeon_intr.c,v 1.22 2020/08/05 04:47:35 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon_intr.c,v 1.23 2020/08/17 21:00:29 jmcneill Exp $");
 
 #include 
 #include 
@@ -173,12 +173,33 @@ static struct octeon_intrhand ipi_intrha
 		.ih_irq = CIU_INT_MBOX_15_0,
 		.ih_ipl = IPL_HIGH,
 	},
+	[1] = {
+		.ih_func = octeon_ipi_intr,
+		.ih_arg = (void *)(uintptr_t)__BITS(31,16),
+		.ih_irq = CIU_INT_MBOX_31_16,
+		.ih_ipl = IPL_SCHED,
+	},
 };
+
+static int ipi_prio[NIPIS] = {
+	[IPI_NOP] = IPL_HIGH,
+	[IPI_AST] = IPL_HIGH,
+	[IPI_SHOOTDOWN] = IPL_SCHED,
+	[IPI_SYNCICACHE] = IPL_HIGH,
+	[IPI_KPREEMPT] = IPL_HIGH,
+	[IPI_SUSPEND] = IPL_HIGH,
+	[IPI_HALT] = IPL_HIGH,
+	[IPI_XCALL] = IPL_HIGH,
+	[IPI_GENERIC] = IPL_HIGH,
+	[IPI_WDOG] = IPL_HIGH,
+};
+
 #endif
 
 static struct octeon_intrhand *octciu_intrs[NIRQS] = {
 #ifdef MULTIPROCESSOR
 	[CIU_INT_MBOX_15_0] = _intrhands[0],
+	[CIU_INT_MBOX_31_16] = _intrhands[1],
 #endif
 };
 
@@ -256,6 +277,7 @@ octeon_intr_init(struct cpu_info *ci)
 #ifdef MULTIPROCESSOR
 	// Enable the IPIs
 	cpu->cpu_ip4_enable[0] |= __BIT(CIU_INT_MBOX_15_0);
+	cpu->cpu_ip3_enable[0] |= __BIT(CIU_INT_MBOX_31_16);
 #endif
 
 	if (ci->ci_dev) {
@@ -514,10 +536,11 @@ octeon_ipi_intr(void *arg)
 {
 	struct cpu_info * const ci = curcpu();
 	struct cpu_softc * const cpu = ci->ci_softc;
-	uint32_t ipi_mask = (uintptr_t) arg;
+	const uint32_t mbox_mask = (uintptr_t) arg;
+	uint32_t ipi_mask = mbox_mask;
 
-	KASSERTMSG(ci->ci_cpl == IPL_HIGH,
-	"ipi_mask %#"PRIx32" cpl %d", ipi_mask, ci->ci_cpl);
+	KASSERTMSG((mbox_mask & __BITS(31,16)) == 0 || ci->ci_cpl >= IPL_SCHED,
+	"mbox_mask %#"PRIx32" cpl %d", mbox_mask, ci->ci_cpl);
 
 	ipi_mask &= mips3_ld(cpu->cpu_mbox_set);
 	if (ipi_mask == 0)
@@ -525,7 +548,7 @@ octeon_ipi_intr(void *arg)
 
 	mips3_sd(cpu->cpu_mbox_clr, ipi_mask);
 
-	KASSERT(ipi_mask < __BIT(NIPIS));
+	KASSERT(__SHIFTOUT(ipi_mask, mbox_mask) < __BIT(NIPIS));
 
 #if NWDOG > 0
 	// Handle WDOG requests ourselves.
@@ -546,7 +569,7 @@ octeon_ipi_intr(void *arg)
 	atomic_or_64(>ci_active_ipis, ipi_mask);
 	atomic_and_64(>ci_request_ipis, ~ipi_mask);
 
-	ipi_process(ci, ipi_mask);
+	ipi_process(ci, __SHIFTOUT(ipi_mask, mbox_mask));
 
 	atomic_and_64(>ci_active_ipis, ~ipi_mask);
 
@@ -571,7 +594,8 @@ octeon_send_ipi(struct cpu_info *ci, int
 		return -1;
 
 	struct cpu_softc * const cpu = ci->ci_softc;
-	const uint32_t ipi_mask = __BIT(req);
+	const u_int ipi_shift = ipi_prio[req] == IPL_SCHED ? 16 : 0;
+	const uint32_t ipi_mask = __BIT(req + ipi_shift);
 
 	atomic_or_64(>ci_request_ipis, ipi_mask);
 



CVS commit: src/sys/arch/amd64/conf

2020-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 17 20:43:13 UTC 2020

Modified Files:
src/sys/arch/amd64/conf: GENERIC

Log Message:
remove commented out MEMORY_DISK_* entries


To generate a diff of this commit:
cvs rdiff -u -r1.576 -r1.577 src/sys/arch/amd64/conf/GENERIC

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/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.576 src/sys/arch/amd64/conf/GENERIC:1.577
--- src/sys/arch/amd64/conf/GENERIC:1.576	Mon Aug 17 15:41:32 2020
+++ src/sys/arch/amd64/conf/GENERIC	Mon Aug 17 16:43:13 2020
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.576 2020/08/17 19:41:32 christos Exp $
+# $NetBSD: GENERIC,v 1.577 2020/08/17 20:43:13 christos Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.576 $"
+#ident		"GENERIC-$Revision: 1.577 $"
 
 maxusers	64		# estimated number of users
 
@@ -1143,9 +1143,7 @@ pseudo-device	fss			# file system snapsh
 
 pseudo-device	md			# memory disk device (ramdisk)
 options		MEMORY_DISK_HOOKS	# enable md specific hooks
-#options	MEMORY_DISK_IS_ROOT	# enable root ramdisk
 options 	MEMORY_DISK_DYNAMIC	# enable dynamic resizing
-#options 	MEMORY_DISK_SERVER	# enable userland server hooks
 
 pseudo-device	vnd			# disk-like interface to files
 options 	VND_COMPRESSION		# compressed vnd(4)



CVS commit: src/sys/arch/amd64/conf

2020-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 17 19:41:32 UTC 2020

Modified Files:
src/sys/arch/amd64/conf: GENERIC

Log Message:
correct MEMORY_DISK_* option docs


To generate a diff of this commit:
cvs rdiff -u -r1.575 -r1.576 src/sys/arch/amd64/conf/GENERIC

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/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.575 src/sys/arch/amd64/conf/GENERIC:1.576
--- src/sys/arch/amd64/conf/GENERIC:1.575	Sun Aug 16 06:27:47 2020
+++ src/sys/arch/amd64/conf/GENERIC	Mon Aug 17 15:41:32 2020
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.575 2020/08/16 10:27:47 jdolecek Exp $
+# $NetBSD: GENERIC,v 1.576 2020/08/17 19:41:32 christos Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.575 $"
+#ident		"GENERIC-$Revision: 1.576 $"
 
 maxusers	64		# estimated number of users
 
@@ -1142,8 +1142,10 @@ options 	RAID_AUTOCONFIG		# auto-configu
 pseudo-device	fss			# file system snapshot device
 
 pseudo-device	md			# memory disk device (ramdisk)
-options 	MEMORY_DISK_HOOKS	# enable root ramdisk
-options 	MEMORY_DISK_DYNAMIC	# loaded via kernel module(7)
+options		MEMORY_DISK_HOOKS	# enable md specific hooks
+#options	MEMORY_DISK_IS_ROOT	# enable root ramdisk
+options 	MEMORY_DISK_DYNAMIC	# enable dynamic resizing
+#options 	MEMORY_DISK_SERVER	# enable userland server hooks
 
 pseudo-device	vnd			# disk-like interface to files
 options 	VND_COMPRESSION		# compressed vnd(4)



CVS commit: src/share/man/man4

2020-08-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Aug 17 17:18:02 UTC 2020

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

Log Message:
Move wayward clause to where it belongs and makes sense.

Note how blowfish-cbc chooses the CBC IV.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/share/man/man4/cgd.4

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

Modified files:

Index: src/share/man/man4/cgd.4
diff -u src/share/man/man4/cgd.4:1.23 src/share/man/man4/cgd.4:1.24
--- src/share/man/man4/cgd.4:1.23	Mon Aug 17 00:43:15 2020
+++ src/share/man/man4/cgd.4	Mon Aug 17 17:18:02 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: cgd.4,v 1.23 2020/08/17 00:43:15 riastradh Exp $
+.\" $NetBSD: cgd.4,v 1.24 2020/08/17 17:18:02 riastradh Exp $
 .\"
 .\" Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -131,8 +131,7 @@ The
 initialization vector for each disk sector is chosen to be the
 encryption under
 .Tn 3DES
-of the little-endian encoding of the disk sector number, which has no
-impact on security but reduces performance.
+of the little-endian encoding of the disk sector number.
 .Pp
 Note: Internally, the
 .Sq parity bits
@@ -146,6 +145,11 @@ key.
 Blowfish in
 .Tn CBC
 mode.
+The
+.Tn CBC
+initialization vector for each disk sector is chosen to be the
+encryption under Blowfish of the little-endian encoding of the disk
+sector number.
 It is strongly encouraged that keys be at least 128 bits long.
 There are no performance advantages of using shorter keys.
 The default key length is 128 bits.
@@ -165,7 +169,8 @@ the
 initialization vector was chosen to be the
 .Em eight-fold
 encryption under the block cipher of the little-endian encoding of the
-disk sector number.
+disk sector number, which has no impact on security but reduces
+performance.
 For compatibility with such disks, the
 .Sq IV method
 must be set to



CVS commit: src/usr.bin/tsort

2020-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Aug 17 16:26:03 UTC 2020

Modified Files:
src/usr.bin/tsort: Makefile tsort.c

Log Message:
be host friendly


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/tsort/Makefile
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/tsort/tsort.c

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

Modified files:

Index: src/usr.bin/tsort/Makefile
diff -u src/usr.bin/tsort/Makefile:1.8 src/usr.bin/tsort/Makefile:1.9
--- src/usr.bin/tsort/Makefile:1.8	Wed Aug 12 19:23:04 2020
+++ src/usr.bin/tsort/Makefile	Mon Aug 17 12:26:03 2020
@@ -1,9 +1,12 @@
-#	$NetBSD: Makefile,v 1.8 2020/08/12 23:23:04 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2020/08/17 16:26:03 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/9/93
 
+.include 
 WARNS= 6
 PROG=	tsort
+.if !defined(HOSTPROGNAME)
 LDADD+= -lutil
 DPADD+= ${LIBUTIL}
+.endif
 
 .include 

Index: src/usr.bin/tsort/tsort.c
diff -u src/usr.bin/tsort/tsort.c:1.24 src/usr.bin/tsort/tsort.c:1.25
--- src/usr.bin/tsort/tsort.c:1.24	Wed Aug 12 19:23:04 2020
+++ src/usr.bin/tsort/tsort.c	Mon Aug 17 12:26:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tsort.c,v 1.24 2020/08/12 23:23:04 christos Exp $	*/
+/*	$NetBSD: tsort.c,v 1.25 2020/08/17 16:26:03 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = "@(#)tsort.c	8.3 (Berkeley) 5/4/95";
 #endif
-__RCSID("$NetBSD: tsort.c,v 1.24 2020/08/12 23:23:04 christos Exp $");
+__RCSID("$NetBSD: tsort.c,v 1.25 2020/08/17 16:26:03 christos Exp $");
 #endif /* not lint */
 
 #include 
@@ -56,7 +56,9 @@ __RCSID("$NetBSD: tsort.c,v 1.24 2020/08
 #include 
 #include 
 #include 
+#if !HAVE_NBTOOL_CONFIG_H
 #include 
+#endif
 
 /*
  *  Topological sort.  Input is a list of pairs of strings separated by



CVS commit: src/tests/sys/crypto

2020-08-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Aug 17 16:26:02 UTC 2020

Modified Files:
src/tests/sys/crypto/aes: Makefile t_aes.c
src/tests/sys/crypto/chacha: Makefile t_chacha.c

Log Message:
Make the AES and ChaCha NEON tests work in softfloat userland.

(`Softfloat' here refers to the ABI, which of course may be running
on a CPU with NEON.)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/sys/crypto/aes/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tests/sys/crypto/aes/t_aes.c
cvs rdiff -u -r1.4 -r1.5 src/tests/sys/crypto/chacha/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tests/sys/crypto/chacha/t_chacha.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/sys/crypto/aes/Makefile
diff -u src/tests/sys/crypto/aes/Makefile:1.4 src/tests/sys/crypto/aes/Makefile:1.5
--- src/tests/sys/crypto/aes/Makefile:1.4	Sun Aug 16 15:52:14 2020
+++ src/tests/sys/crypto/aes/Makefile	Mon Aug 17 16:26:02 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2020/08/16 15:52:14 martin Exp $
+#	$NetBSD: Makefile,v 1.5 2020/08/17 16:26:02 riastradh Exp $
 
 .include 
 
@@ -19,7 +19,7 @@ SRCS.t_aes+=	aes_ct_dec.c
 SRCS.t_aes+=	aes_ct_enc.c
 SRCS.t_aes+=	aes_selftest.c
 
-.if !empty(MACHINE_ARCH:Mearmv7hf*) || !empty(MACHINE_ARCH:Maarch64*)
+.if !empty(MACHINE_ARCH:Mearmv7*) || !empty(MACHINE_ARCH:Maarch64*)
 
 .PATH:	${NETBSDSRCDIR}/sys/crypto/aes/arch/arm
 CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/crypto/aes/arch/arm
@@ -32,10 +32,16 @@ SRCS.t_aes+=	aes_armv8_64.S
 SRCS.t_aes+=	aes_neon.c
 SRCS.t_aes+=	aes_neon_impl.c
 SRCS.t_aes+=	aes_neon_subr.c
-.if !empty(MACHINE_ARCH:Mearmv7hf*)
+.if !empty(MACHINE_ARCH:Mearmv7*)
 SRCS.t_aes+=	aes_neon_32.S
 .endif
 
+.if !empty(MACHINE_ARCH:Mearmv7*) && empty(MACHINE_ARCH:Mearmv7hf*)
+COPTS.aes_neon.c+=	-mfloat-abi=softfp -mfpu=neon
+COPTS.aes_neon_subr.c+=	-mfloat-abi=softfp -mfpu=neon
+AOPTS.aes_neon_32.S+=	-D__SOFTFP__
+.endif
+
 .endif# earmv7/aarch64
 
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"

Index: src/tests/sys/crypto/aes/t_aes.c
diff -u src/tests/sys/crypto/aes/t_aes.c:1.3 src/tests/sys/crypto/aes/t_aes.c:1.4
--- src/tests/sys/crypto/aes/t_aes.c:1.3	Sun Jul 26 14:01:14 2020
+++ src/tests/sys/crypto/aes/t_aes.c	Mon Aug 17 16:26:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_aes.c,v 1.3 2020/07/26 14:01:14 riastradh Exp $	*/
+/*	$NetBSD: t_aes.c,v 1.4 2020/08/17 16:26:02 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
 #include 
 #endif
 
-#ifdef __ARM_NEON
+#if __ARM_ARCH >= 7
 #include 
 #endif
 
@@ -93,7 +93,7 @@ ATF_TC_BODY(name, tc)			  \
 AES_SELFTEST(aes_armv8_selftest, _armv8_impl, "ARMv8.0-AES self-test")
 #endif
 
-#ifdef __ARM_NEON
+#if __ARM_ARCH >= 7
 AES_SELFTEST(aes_neon_selftest, _neon_impl, "ARM NEON vpaes self-test")
 #endif
 
@@ -118,7 +118,7 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC(tp, aes_armv8_selftest);
 #endif
 
-#ifdef __ARM_NEON
+#if __ARM_ARCH >= 7
 	ATF_TP_ADD_TC(tp, aes_neon_selftest);
 #endif
 

Index: src/tests/sys/crypto/chacha/Makefile
diff -u src/tests/sys/crypto/chacha/Makefile:1.4 src/tests/sys/crypto/chacha/Makefile:1.5
--- src/tests/sys/crypto/chacha/Makefile:1.4	Sun Aug 16 15:52:14 2020
+++ src/tests/sys/crypto/chacha/Makefile	Mon Aug 17 16:26:02 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2020/08/16 15:52:14 martin Exp $
+#	$NetBSD: Makefile,v 1.5 2020/08/17 16:26:02 riastradh Exp $
 
 .include 
 
@@ -16,19 +16,24 @@ SRCS.t_chacha+=	t_chacha.c
 SRCS.t_chacha+=	chacha_ref.c
 SRCS.t_chacha+=	chacha_selftest.c
 
-.if !empty(MACHINE_ARCH:Mearmv7hf*) || !empty(MACHINE_ARCH:Maarch64*)
+.if !empty(MACHINE_ARCH:Mearmv7*) || !empty(MACHINE_ARCH:Maarch64*)
 
 .PATH:	${NETBSDSRCDIR}/sys/crypto/chacha/arch/arm
 CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/crypto/chacha/arch/arm
 
 SRCS.t_chacha+=	chacha_neon.c
-.if !empty(MACHINE_ARCH:Mearmv7hf*)
+.if !empty(MACHINE_ARCH:Mearmv7*)
 SRCS.t_chacha+=	chacha_neon_32.S
 .elif !empty(MACHINE_ARCH:Maarch64*)
 SRCS.t_chacha+=	chacha_neon_64.S
 .endif
 SRCS.t_chacha+=	chacha_neon_impl.c
 
+.if !empty(MACHINE_ARCH:Mearmv7*) && empty(MACHINE_ARCH:Mearmv7hf*)
+COPTS.chacha_neon.c+=		-mfloat-abi=softfp -mfpu=neon
+AOPTS.chacha_neon_32.S+=	-D__SOFTFP__
+.endif
+
 .endif# earmv7 or aarch64
 
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"

Index: src/tests/sys/crypto/chacha/t_chacha.c
diff -u src/tests/sys/crypto/chacha/t_chacha.c:1.3 src/tests/sys/crypto/chacha/t_chacha.c:1.4
--- src/tests/sys/crypto/chacha/t_chacha.c:1.3	Mon Jul 27 20:59:53 2020
+++ src/tests/sys/crypto/chacha/t_chacha.c	Mon Aug 17 16:26:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_chacha.c,v 1.3 2020/07/27 20:59:53 riastradh Exp $	*/
+/*	$NetBSD: t_chacha.c,v 1.4 2020/08/17 16:26:02 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include 
 #endif
 
-#ifdef __ARM_NEON
+#if __ARM_ARCH >= 7
 #include 
 

CVS commit: src/sys/arch/mips/mips

2020-08-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Aug 17 15:22:51 UTC 2020

Modified Files:
src/sys/arch/mips/mips: cpu_subr.c

Log Message:
Give a hint to what the IPI numbers are, i.e. "(A/R)" meaning active and
requested respectively


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/mips/mips/cpu_subr.c

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

Modified files:

Index: src/sys/arch/mips/mips/cpu_subr.c
diff -u src/sys/arch/mips/mips/cpu_subr.c:1.57 src/sys/arch/mips/mips/cpu_subr.c:1.58
--- src/sys/arch/mips/mips/cpu_subr.c:1.57	Sun Aug  9 06:26:49 2020
+++ src/sys/arch/mips/mips/cpu_subr.c	Mon Aug 17 15:22:51 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.57 2020/08/09 06:26:49 skrll Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.58 2020/08/17 15:22:51 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.57 2020/08/09 06:26:49 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.58 2020/08/17 15:22:51 skrll Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -852,8 +852,7 @@ cpu_debug_dump(void)
 	CPU_INFO_ITERATOR cii;
 	struct cpu_info *ci;
 	char running, hatched, paused, resumed, halted;
-
-	db_printf("CPU CPUID STATE CPUINFOCPL INT MTX IPIS\n");
+	db_printf("CPU CPUID STATE CPUINFOCPL INT MTX IPIS(A/R)\n");
 	for (CPU_INFO_FOREACH(cii, ci)) {
 		hatched = (kcpuset_isset(cpus_hatched, cpu_index(ci)) ? 'H' : '-');
 		running = (kcpuset_isset(cpus_running, cpu_index(ci)) ? 'R' : '-');



CVS commit: [netbsd-9] src/doc

2020-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 17 14:38:32 UTC 2020

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

Log Message:
Fix entry for ticket #1051


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.96 -r1.1.2.97 src/doc/CHANGES-9.1

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.1
diff -u src/doc/CHANGES-9.1:1.1.2.96 src/doc/CHANGES-9.1:1.1.2.97
--- src/doc/CHANGES-9.1:1.1.2.96	Mon Aug 17 11:31:07 2020
+++ src/doc/CHANGES-9.1	Mon Aug 17 14:38:32 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.96 2020/08/17 11:31:07 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.97 2020/08/17 14:38:32 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -4727,8 +4727,8 @@ usr.sbin/dumplfs/dumplfs.c			1.65
 	[riastradh, ticket #1050]
 
 xsrc/external/mit/xorg-server/dist/fb/fb.h		1.3
-xsrc/external/mit/xorg-server/dist/fb/fbfill.c		1.2,1.3
-xsrc/external/mit/xorg-server/dist/fb/fbtile.c		1.1-1.3
+xsrc/external/mit/xorg-server/dist/fb/fbfill.c		1.2
+xsrc/external/mit/xorg-server/dist/fb/fbtile.c		1.3
 xsrc/external/mit/xorg-server/dist/fb/wfbrename.h	1.2
 external/mit/xorg/server/xorg-server/fb/Makefile.fb	1.12
 



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

2020-08-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Aug 17 14:17:49 UTC 2020

Modified Files:
src/sys/arch/mips/include: intr.h

Log Message:
Disable __HAVE_PREEMPTION.  It is currently marked

#if defined(MULTIPROCESSOR) && defined(__HAVE_FAST_SOFTINTS)

but has no chance of working on OCTEON due to at least the spl functions


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/mips/include/intr.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/mips/include/intr.h
diff -u src/sys/arch/mips/include/intr.h:1.11 src/sys/arch/mips/include/intr.h:1.12
--- src/sys/arch/mips/include/intr.h:1.11	Sun Jul 26 08:08:41 2020
+++ src/sys/arch/mips/include/intr.h	Mon Aug 17 14:17:49 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.11 2020/07/26 08:08:41 simonb Exp $ */
+/* $NetBSD: intr.h,v 1.12 2020/08/17 14:17:49 skrll Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -112,10 +112,12 @@ typedef struct {
 
 #ifdef _KERNEL
 
+#if 0
 #if defined(MULTIPROCESSOR) && defined(__HAVE_FAST_SOFTINTS)
 #define	__HAVE_PREEMPTION	1
 #define	SOFTINT_KPREEMPT	(SOFTINT_COUNT+0)
 #endif
+#endif
 
 #ifdef __INTR_PRIVATE
 extern	struct splsw	mips_splsw;



CVS commit: [netbsd-9] src/doc

2020-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 17 11:31:07 UTC 2020

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

Log Message:
Tickets #1050 - #1054


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.95 -r1.1.2.96 src/doc/CHANGES-9.1

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.1
diff -u src/doc/CHANGES-9.1:1.1.2.95 src/doc/CHANGES-9.1:1.1.2.96
--- src/doc/CHANGES-9.1:1.1.2.95	Fri Aug 14 11:05:16 2020
+++ src/doc/CHANGES-9.1	Mon Aug 17 11:31:07 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.95 2020/08/14 11:05:16 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.96 2020/08/17 11:31:07 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -4694,3 +4694,67 @@ tools/gcc/mknative-gcc.old			1.8 (via pa
 
 	Update to GCC 7.5.0.
 	[mrg, ticket #1049]
+
+lib/libp2k/p2k.c1.72
+sbin/fsck_lfs/pass1.c1.46
+sys/arch/i386/stand/efiboot/bootx64/Makefile	1.3
+sys/rump/fs/lib/liblfs/Makefile			1.15
+sys/ufs/lfs/lfs.h1.205-1.207
+sys/ufs/lfs/lfs_accessors.h			1.49
+sys/ufs/lfs/lfs_alloc.c1.140,1.141 (patch)
+sys/ufs/lfs/lfs_balloc.c			1.95
+sys/ufs/lfs/lfs_bio.c1.146,1.147 (patch)
+sys/ufs/lfs/lfs_debug.c1.55
+sys/ufs/lfs/lfs_extern.h			1.116-1.118
+sys/ufs/lfs/lfs_inode.c1.158
+sys/ufs/lfs/lfs_inode.h1.25
+sys/ufs/lfs/lfs_pages.c1.21
+sys/ufs/lfs/lfs_rename.c			1.23
+sys/ufs/lfs/lfs_segment.c			1.284,1.285
+sys/ufs/lfs/lfs_subr.c1.98-1.102
+sys/ufs/lfs/lfs_vfsops.c			1.371-1.373,1.375 (patch)
+sys/ufs/lfs/lfs_vnops.c1.326-1.330
+usr.sbin/dumplfs/dumplfs.c			1.65
+
+	- fix various lfs deadlocks including PR kern/52301
+	- stop lfs leaking orphaned files on crash.
+	- add support for transition of lfs from read/write to read-only
+	- give lfs better diagnostic assertions
+	- make lfs closer to being MP-safe (not quite there yet)
+	- fix some lfs panics
+	- fix unload/reload of lfs.kmod
+	- fix unaligned on-disk data structure access
+	[riastradh, ticket #1050]
+
+xsrc/external/mit/xorg-server/dist/fb/fb.h		1.3
+xsrc/external/mit/xorg-server/dist/fb/fbfill.c		1.2,1.3
+xsrc/external/mit/xorg-server/dist/fb/fbtile.c		1.1-1.3
+xsrc/external/mit/xorg-server/dist/fb/wfbrename.h	1.2
+external/mit/xorg/server/xorg-server/fb/Makefile.fb	1.12
+
+	Revert upstream "fb: Remove even/odd tile slow-pathing" changes.
+	This causes serious performance regression on 1bpp servers.
+	[tsutsui, ticket #1051]
+
+sys/dev/ic/bwfm.c1.28,1.29 (patch)
+sys/dev/ic/bwfmreg.h1.7 (patch)
+sys/dev/ic/bwfmvar.h1.11,1.12 (patch)
+sys/dev/sdmmc/if_bwfm_sdio.c			1.22 (patch)
+
+	bwfm(4): switch from pcq to pool_cache.
+	Various code cleanup and cosmetic changes to sync closer to current.
+	[mrg, ticket #1052]
+
+sys/secmodel/securelevel/secmodel_securelevel.c	1.36
+
+	Allow loading an entropy file with rndctl -L at securelevel=1
+	if entropy is not yet in seeded state.
+	[riastradh, ticket #1053]
+
+sys/dev/pci/cmdide.c1.46
+
+	cmdide(4): remove explicit irqack() call for unexpected interrupt.
+	Also reclassify the "bogus intr" as aprint_verbose() to avoid noise
+	on boot.
+	[jdolecek, ticket #1054]
+



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

2020-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 17 11:29:31 UTC 2020

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

Log Message:
Pull up following revision(s) (requested by jdolecek in ticket #1054):

sys/dev/pci/cmdide.c: revision 1.46

remove explicit irqack() call for unexpected interrupt; this happens
normally during boot when running identify for the drive as polled
command, and fixes hard hang caused by the irqack() on a sun machine
the unexpected interrupt happens because cmdide doesn't respect
WDCTL_IDS bit and triggers interrupt also for polled commands

also reclassify the "bogus intr" as aprint_verbose() to avoid noise
on boot

discussed and tested by Martin Husemann


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.43.10.1 src/sys/dev/pci/cmdide.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/cmdide.c
diff -u src/sys/dev/pci/cmdide.c:1.43 src/sys/dev/pci/cmdide.c:1.43.10.1
--- src/sys/dev/pci/cmdide.c:1.43	Sun Oct 22 13:13:55 2017
+++ src/sys/dev/pci/cmdide.c	Mon Aug 17 11:29:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmdide.c,v 1.43 2017/10/22 13:13:55 jdolecek Exp $	*/
+/*	$NetBSD: cmdide.c,v 1.43.10.1 2020/08/17 11:29:31 martin Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cmdide.c,v 1.43 2017/10/22 13:13:55 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cmdide.c,v 1.43.10.1 2020/08/17 11:29:31 martin Exp $");
 
 #include 
 #include 
@@ -245,10 +245,9 @@ cmd_pci_intr(void *arg)
 		(i == 1 && (secirq & CMD_ARTTIM23_IRQ))) {
 			crv = wdcintr(wdc_cp);
 			if (crv == 0) {
-aprint_error("%s:%d: bogus intr\n",
+aprint_verbose("%s:%d: bogus intr\n",
 device_xname(
   sc->sc_wdcdev.sc_atac.atac_dev), i);
-sc->sc_wdcdev.irqack(wdc_cp);
 			} else
 rv = 1;
 		}



CVS commit: [netbsd-9] src/sys/secmodel/securelevel

2020-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 17 11:27:33 UTC 2020

Modified Files:
src/sys/secmodel/securelevel [netbsd-9]: secmodel_securelevel.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1053):

sys/secmodel/securelevel/secmodel_securelevel.c: revision 1.36

Accept ioctl(RNDADDDATA) estimates at securelevel 1 (but not 2).
securelevel=1 is supposed to be a reasonable default for normal
computers.  This got in the way of ever getting entropy from a seed
on a machine with no HWRNG -- e.g., from another machine, or by
making the executive decision that what has been sampled is good
enough and issuing `head -c 32 < /dev/urandom > /dev/random'.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.32.4.1 \
src/sys/secmodel/securelevel/secmodel_securelevel.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/secmodel/securelevel/secmodel_securelevel.c
diff -u src/sys/secmodel/securelevel/secmodel_securelevel.c:1.32 src/sys/secmodel/securelevel/secmodel_securelevel.c:1.32.4.1
--- src/sys/secmodel/securelevel/secmodel_securelevel.c:1.32	Sun Jul 15 05:16:45 2018
+++ src/sys/secmodel/securelevel/secmodel_securelevel.c	Mon Aug 17 11:27:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: secmodel_securelevel.c,v 1.32 2018/07/15 05:16:45 maxv Exp $ */
+/* $NetBSD: secmodel_securelevel.c,v 1.32.4.1 2020/08/17 11:27:33 martin Exp $ */
 /*-
  * Copyright (c) 2006 Elad Efrat 
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: secmodel_securelevel.c,v 1.32 2018/07/15 05:16:45 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: secmodel_securelevel.c,v 1.32.4.1 2020/08/17 11:27:33 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_insecure.h"
@@ -596,7 +596,7 @@ secmodel_securelevel_device_cb(kauth_cre
 		break;
 
 	case KAUTH_DEVICE_RND_ADDDATA_ESTIMATE:
-		if (securelevel > 0)
+		if (securelevel > 1)
 			result = KAUTH_RESULT_DENY;
 		break;
 



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

2020-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 17 11:22:45 UTC 2020

Modified Files:
src/sys/dev/ic [netbsd-9]: bwfm.c bwfmreg.h bwfmvar.h
src/sys/dev/sdmmc [netbsd-9]: if_bwfm_sdio.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1052):

sys/dev/ic/bwfm.c: revision 1.28
sys/dev/ic/bwfm.c: revision 1.29
sys/dev/sdmmc/if_bwfm_sdio.c: revision 1.22
sys/dev/ic/bwfmreg.h: revision 1.7
sys/dev/ic/bwfmvar.h: revision 1.11
sys/dev/ic/bwfmvar.h: revision 1.12
(all via patch)

Add include guards and appropriate includes to bwfmreg.h, bwfmvar.h.

No functional change intended.

Need  for kmem_*.

Currently accidentally side-loaded by .

bwfm: Switch from pcq to pool_cache.
pcq_get is required to be serialized, but it's far from clear that it
is serialized here.


To generate a diff of this commit:
cvs rdiff -u -r1.14.6.2 -r1.14.6.3 src/sys/dev/ic/bwfm.c
cvs rdiff -u -r1.3.10.1 -r1.3.10.2 src/sys/dev/ic/bwfmreg.h
cvs rdiff -u -r1.3.6.1 -r1.3.6.2 src/sys/dev/ic/bwfmvar.h
cvs rdiff -u -r1.3.8.3 -r1.3.8.4 src/sys/dev/sdmmc/if_bwfm_sdio.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/ic/bwfm.c
diff -u src/sys/dev/ic/bwfm.c:1.14.6.2 src/sys/dev/ic/bwfm.c:1.14.6.3
--- src/sys/dev/ic/bwfm.c:1.14.6.2	Sun Aug  9 14:03:08 2020
+++ src/sys/dev/ic/bwfm.c	Mon Aug 17 11:22:45 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: bwfm.c,v 1.14.6.2 2020/08/09 14:03:08 martin Exp $ */
+/* $NetBSD: bwfm.c,v 1.14.6.3 2020/08/17 11:22:45 martin Exp $ */
 /* $OpenBSD: bwfm.c,v 1.5 2017/10/16 22:27:16 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -24,7 +24,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -139,7 +139,6 @@ bwfm_attach(struct bwfm_softc *sc)
 {
 	struct ieee80211com *ic = >sc_ic;
 	struct ifnet *ifp = >sc_if;
-	struct bwfm_task *t;
 	char fw_version[BWFM_DCMD_SMLEN];
 	uint32_t bandlist[3];
 	uint32_t tmp;
@@ -151,12 +150,10 @@ bwfm_attach(struct bwfm_softc *sc)
 		printf("%s: could not create workqueue\n", DEVNAME(sc));
 		return;
 	}
-	sc->sc_freetask = pcq_create(BWFM_TASK_COUNT, KM_SLEEP);
-	for (i = 0; i < BWFM_TASK_COUNT; i++) {
-		t = >sc_task[i];
-		t->t_sc = sc;
-		pcq_put(sc->sc_freetask, t);
-	}
+	sc->sc_freetask = pool_cache_init(sizeof(struct bwfm_task), 0, 0, 0,
+	"bwfmtask", NULL, IPL_NET /* XXX IPL_SOFTNET? */,
+	NULL, NULL, NULL);
+	pool_prime(>sc_freetask->pc_pool, BWFM_TASK_COUNT);
 
 	/* Stop the device in case it was previously initialized */
 	bwfm_fwvar_cmd_set_int(sc, BWFM_C_DOWN, 1);
@@ -249,7 +246,7 @@ bwfm_attach(struct bwfm_softc *sc)
 	error = if_initialize(ifp);
 	if (error != 0) {
 		printf("%s: if_initialize failed(%d)\n", DEVNAME(sc), error);
-		pcq_destroy(sc->sc_freetask);
+		pool_cache_destroy(sc->sc_freetask);
 		workqueue_destroy(sc->sc_taskq);
 
 		return; /* Error */
@@ -289,7 +286,7 @@ bwfm_detach(struct bwfm_softc *sc, int f
 	if (sc->sc_taskq)
 		workqueue_destroy(sc->sc_taskq);
 	if (sc->sc_freetask)
-		pcq_destroy(sc->sc_freetask);
+		pool_cache_destroy(sc->sc_freetask);
 
 	return 0;
 }
@@ -600,12 +597,13 @@ bwfm_key_set(struct ieee80211com *ic, co
 	struct bwfm_softc *sc = ic->ic_ifp->if_softc;
 	struct bwfm_task *t;
 
-	t = pcq_get(sc->sc_freetask);
+	t = pool_cache_get(sc->sc_freetask, PR_NOWAIT);
 	if (t == NULL) {
 		printf("%s: no free tasks\n", DEVNAME(sc));
 		return 0;
 	}
 
+	t->t_sc = sc;
 	t->t_cmd = BWFM_TASK_KEY_SET;
 	t->t_key.key = wk;
 	memcpy(t->t_key.mac, mac, sizeof(t->t_key.mac));
@@ -691,12 +689,13 @@ bwfm_key_delete(struct ieee80211com *ic,
 	struct bwfm_softc *sc = ic->ic_ifp->if_softc;
 	struct bwfm_task *t;
 
-	t = pcq_get(sc->sc_freetask);
+	t = pool_cache_get(sc->sc_freetask, PR_NOWAIT);
 	if (t == NULL) {
 		printf("%s: no free tasks\n", DEVNAME(sc));
 		return 0;
 	}
 
+	t->t_sc = sc;
 	t->t_cmd = BWFM_TASK_KEY_DELETE;
 	t->t_key.key = wk;
 	memset(t->t_key.mac, 0, sizeof(t->t_key.mac));
@@ -725,12 +724,13 @@ bwfm_newstate(struct ieee80211com *ic, e
 	struct bwfm_softc *sc = ic->ic_ifp->if_softc;
 	struct bwfm_task *t;
 
-	t = pcq_get(sc->sc_freetask);
+	t = pool_cache_get(sc->sc_freetask, PR_NOWAIT);
 	if (t == NULL) {
 		printf("%s: no free tasks\n", DEVNAME(sc));
 		return EIO;
 	}
 
+	t->t_sc = sc;
 	t->t_cmd = BWFM_TASK_NEWSTATE;
 	t->t_newstate.state = nstate;
 	t->t_newstate.arg = arg;
@@ -808,7 +808,7 @@ bwfm_task(struct work *wk, void *arg)
 		panic("bwfm: unknown task command %d", t->t_cmd);
 	}
 
-	pcq_put(sc->sc_freetask, t);
+	pool_cache_put(sc->sc_freetask, t);
 }
 
 int
@@ -1906,13 +1906,14 @@ bwfm_rx_event(struct bwfm_softc *sc, str
 {
 	struct bwfm_task *t;
 
-	t = pcq_get(sc->sc_freetask);
+	t = pool_cache_get(sc->sc_freetask, PR_NOWAIT);
 	if (t == NULL) {
 		m_freem(m);
 		printf("%s: no free tasks\n", DEVNAME(sc));
 		return;
 	}
 
+	t->t_sc = sc;
 	

CVS commit: [netbsd-9] src/external/mit/xorg/server/xorg-server/fb

2020-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 17 11:10:20 UTC 2020

Modified Files:
src/external/mit/xorg/server/xorg-server/fb [netbsd-9]: Makefile.fb

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1051):

external/mit/xorg/server/xorg-server/fb/Makefile.fb: revision 1.12

Put back fbtile.c to SRCS.fb


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.2.1 \
src/external/mit/xorg/server/xorg-server/fb/Makefile.fb

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

Modified files:

Index: src/external/mit/xorg/server/xorg-server/fb/Makefile.fb
diff -u src/external/mit/xorg/server/xorg-server/fb/Makefile.fb:1.11 src/external/mit/xorg/server/xorg-server/fb/Makefile.fb:1.11.2.1
--- src/external/mit/xorg/server/xorg-server/fb/Makefile.fb:1.11	Mon Dec 31 11:14:04 2018
+++ src/external/mit/xorg/server/xorg-server/fb/Makefile.fb	Mon Aug 17 11:10:20 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.fb,v 1.11 2018/12/31 11:14:04 mrg Exp $
+#	$NetBSD: Makefile.fb,v 1.11.2.1 2020/08/17 11:10:20 martin Exp $
 
 .PATH:		${X11SRCDIR.xorg-server}/fb
 SRCS.fb=	fballpriv.c \
@@ -25,6 +25,7 @@ SRCS.fb=	fballpriv.c \
 		fbseg.c \
 		fbsetsp.c   \
 		fbsolid.c   \
+		fbtile.c\
 		fbtrap.c\
 		fbutil.c\
 		fbwindow.c



CVS commit: [netbsd-9] xsrc/external/mit/xorg-server/dist/fb

2020-08-17 Thread Martin Husemann
Module Name:xsrc
Committed By:   martin
Date:   Mon Aug 17 11:09:15 UTC 2020

Modified Files:
xsrc/external/mit/xorg-server/dist/fb [netbsd-9]: fb.h fbfill.c
wfbrename.h
Added Files:
xsrc/external/mit/xorg-server/dist/fb [netbsd-9]: fbtile.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1051):

external/mit/xorg-server/dist/fb/fbfill.c: revision 1.2
external/mit/xorg-server/dist/fb/fbtile.c: revision 1.3
external/mit/xorg-server/dist/fb/wfbrename.h: revision 1.2
external/mit/xorg-server/dist/fb/fbtile.c: revisions 1.1-1.3
external/mit/xorg-server/dist/fb/fb.h: revision 1.3

Revert upstream "fb: Remove even/odd tile slow-pathing" changes.
https://gitlab.freedesktop.org/xorg/xserver/-/commit/e572bcc7f4236b7e0f23ab762f225b3bce37db59
> fb: Remove even/odd tile slow-pathing
>
> Again, clearly meant to be a fast path, but this turns out not to be the
> case.

This causes serious performance regression on 1bpp servers.

Ok'ed by mrg@.  See my post on tech-x11@ for more details:
 https://mail-index.netbsd.org/tech-x11/2020/08/07/msg002115.html


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.6.2.1 -r1.1.1.6.2.2 \
xsrc/external/mit/xorg-server/dist/fb/fb.h
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.4.1 \
xsrc/external/mit/xorg-server/dist/fb/fbfill.c
cvs rdiff -u -r0 -r1.3.2.2 xsrc/external/mit/xorg-server/dist/fb/fbtile.c
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.2.1 \
xsrc/external/mit/xorg-server/dist/fb/wfbrename.h

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/fb/fb.h
diff -u xsrc/external/mit/xorg-server/dist/fb/fb.h:1.1.1.6.2.1 xsrc/external/mit/xorg-server/dist/fb/fb.h:1.1.1.6.2.2
--- xsrc/external/mit/xorg-server/dist/fb/fb.h:1.1.1.6.2.1	Sun Jul 26 10:56:19 2020
+++ xsrc/external/mit/xorg-server/dist/fb/fb.h	Mon Aug 17 11:09:15 2020
@@ -,6 +,45 @@ extern _X_EXPORT WriteMemoryProcPtr wfbW
 #endif
 
 /*
+ * fbtile.c
+ */
+
+extern _X_EXPORT void
+
+fbEvenTile(FbBits * dst,
+   FbStride dstStride,
+   int dstX,
+   int width,
+   int height,
+   FbBits * tile,
+   FbStride tileStride,
+   int tileHeight, int alu, FbBits pm, int xRot, int yRot);
+
+extern _X_EXPORT void
+
+fbOddTile(FbBits * dst,
+  FbStride dstStride,
+  int dstX,
+  int width,
+  int height,
+  FbBits * tile,
+  FbStride tileStride,
+  int tileWidth,
+  int tileHeight, int alu, FbBits pm, int bpp, int xRot, int yRot);
+
+extern _X_EXPORT void
+
+fbTile(FbBits * dst,
+   FbStride dstStride,
+   int dstX,
+   int width,
+   int height,
+   FbBits * tile,
+   FbStride tileStride,
+   int tileWidth,
+   int tileHeight, int alu, FbBits pm, int bpp, int xRot, int yRot);
+
+/*
  * fbwindow.c
  */
 

Index: xsrc/external/mit/xorg-server/dist/fb/fbfill.c
diff -u xsrc/external/mit/xorg-server/dist/fb/fbfill.c:1.1.1.3 xsrc/external/mit/xorg-server/dist/fb/fbfill.c:1.1.1.3.4.1
--- xsrc/external/mit/xorg-server/dist/fb/fbfill.c:1.1.1.3	Wed Aug 10 07:44:35 2016
+++ xsrc/external/mit/xorg-server/dist/fb/fbfill.c	Mon Aug 17 11:09:15 2020
@@ -27,44 +27,6 @@
 #include "fb.h"
 
 static void
-fbTile(FbBits * dst, FbStride dstStride, int dstX, int width, int height,
-   FbBits * tile, FbStride tileStride, int tileWidth, int tileHeight,
-   int alu, FbBits pm, int bpp, int xRot, int yRot)
-{
-int tileX, tileY;
-int widthTmp;
-int h, w;
-int x, y;
-
-modulus(-yRot, tileHeight, tileY);
-y = 0;
-while (height) {
-h = tileHeight - tileY;
-if (h > height)
-h = height;
-height -= h;
-widthTmp = width;
-x = dstX;
-modulus(dstX - xRot, tileWidth, tileX);
-while (widthTmp) {
-w = tileWidth - tileX;
-if (w > widthTmp)
-w = widthTmp;
-widthTmp -= w;
-fbBlt(tile + tileY * tileStride,
-  tileStride,
-  tileX,
-  dst + y * dstStride,
-  dstStride, x, w, h, alu, pm, bpp, FALSE, FALSE);
-x += w;
-tileX = 0;
-}
-y += h;
-tileY = 0;
-}
-}
-
-static void
 fbStipple(FbBits * dst, FbStride dstStride,
   int dstX, int dstBpp,
   int width, int height,

Index: xsrc/external/mit/xorg-server/dist/fb/wfbrename.h
diff -u xsrc/external/mit/xorg-server/dist/fb/wfbrename.h:1.1.1.6 xsrc/external/mit/xorg-server/dist/fb/wfbrename.h:1.1.1.6.2.1
--- xsrc/external/mit/xorg-server/dist/fb/wfbrename.h:1.1.1.6	Mon Dec 31 09:36:09 2018
+++ xsrc/external/mit/xorg-server/dist/fb/wfbrename.h	Mon Aug 17 11:09:15 2020
@@ -43,6 +43,7 @@
 #define fbDots16 wfbDots16
 #define fbDots32 wfbDots32
 #define fbDots8 wfbDots8

CVS commit: [netbsd-9] src

2020-08-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Aug 17 10:30:23 UTC 2020

Modified Files:
src/lib/libp2k [netbsd-9]: p2k.c
src/sbin/fsck_lfs [netbsd-9]: pass1.c
src/sys/arch/i386/stand/efiboot/bootx64 [netbsd-9]: Makefile
src/sys/rump/fs/lib/liblfs [netbsd-9]: Makefile
src/sys/ufs/lfs [netbsd-9]: lfs.h lfs_accessors.h lfs_alloc.c
lfs_balloc.c lfs_bio.c lfs_debug.c lfs_extern.h lfs_inode.c
lfs_inode.h lfs_pages.c lfs_rename.c lfs_segment.c lfs_subr.c
lfs_vfsops.c lfs_vnops.c
src/usr.sbin/dumplfs [netbsd-9]: dumplfs.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1050):

sys/ufs/lfs/lfs_subr.c: revision 1.101
sys/ufs/lfs/lfs_subr.c: revision 1.102
sys/ufs/lfs/lfs_inode.c: revision 1.158
sys/ufs/lfs/lfs_inode.h: revision 1.25
sys/ufs/lfs/lfs_balloc.c: revision 1.95
sys/ufs/lfs/lfs_pages.c: revision 1.21
sys/ufs/lfs/lfs_vnops.c: revision 1.330
sys/ufs/lfs/lfs_alloc.c: revision 1.140 (patch)
sys/ufs/lfs/lfs_alloc.c: revision 1.141 (patch)
lib/libp2k/p2k.c: revision 1.72
sys/ufs/lfs/lfs.h: revision 1.205
sys/ufs/lfs/lfs.h: revision 1.206
sys/ufs/lfs/lfs_segment.c: revision 1.284
sys/ufs/lfs/lfs.h: revision 1.207
sys/ufs/lfs/lfs_segment.c: revision 1.285
sys/ufs/lfs/lfs_debug.c: revision 1.55
sys/ufs/lfs/lfs_rename.c: revision 1.23
usr.sbin/dumplfs/dumplfs.c: revision 1.65
sys/ufs/lfs/lfs_vfsops.c: revision 1.371
sys/arch/i386/stand/efiboot/bootx64/Makefile: revision 1.3
sys/ufs/lfs/lfs_vfsops.c: revision 1.372
sys/ufs/lfs/lfs_vfsops.c: revision 1.373
sbin/fsck_lfs/pass1.c: revision 1.46
sys/ufs/lfs/lfs_vnops.c: revision 1.326
sys/ufs/lfs/lfs_vnops.c: revision 1.327
sys/ufs/lfs/lfs_vfsops.c: revision 1.375 (patch)
sys/ufs/lfs/lfs_vnops.c: revision 1.328
sys/ufs/lfs/lfs_subr.c: revision 1.98
sys/ufs/lfs/lfs_extern.h: revision 1.116
sys/ufs/lfs/lfs_vnops.c: revision 1.329
sys/ufs/lfs/lfs_subr.c: revision 1.99
sys/ufs/lfs/lfs_extern.h: revision 1.117
sys/ufs/lfs/lfs_accessors.h: revision 1.49
sys/ufs/lfs/lfs_extern.h: revision 1.118
sys/rump/fs/lib/liblfs/Makefile: revision 1.15
sys/ufs/lfs/lfs_bio.c: revision 1.146 (patch)
sys/ufs/lfs/lfs_bio.c: revision 1.147
sys/ufs/lfs/lfs_subr.c: revision 1.100

Fix kassert in lfs by initializing vp first.

Use a marker node to iterate lfs_dchainhd / i_lfs_dchain.

I believe elements can be removed while the lock is dropped,
including the next node we're hanging on to.

Just use VOP_BWRITE for lfs_bwrite_log.
Hope this doesn't cause trouble with vfs_suspend.

Teach lfs to transition ro<->rw.

Prevent new dirops while we issue lfs_flush_dirops.

lfs_flush_dirops assumes (by KASSERT((ip->i_state & IN_ADIROP) == 0))
that vnodes on the dchain will not become involved in active dirops
even while holding no other locks (lfs_lock, v_interlock), so we must
set lfs_writer here.  All other callers already set lfs_writer.

We set fs->lfs_writer++ without explicitly doing lfs_writer_enter
because
(a) we already waited for the dirops to drain, and
(b) we hold lfs_lock and cannot drop it before setting lfs_writer.

Assert lfs_writer where I think we can now prove it.

Serialize access to the splay tree with lfs_lock.

Change some cheap KDASSERT into KASSERT.

Take a reference and fix assertions in lfs_flush_dirops.
Fixes panic:
KASSERT((ip->i_state & IN_ADIROP) == 0) at lfs_vnops.c:1670
lfs_flush_dirops
lfs_check
lfs_setattr
VOP_SETATTR
change_mode
sys_fchmod
syscall

This assertion -- and the assertion that vp->v_uflag has VU_DIROP set
-- is valid only until we release lfs_lock, because we may race with
lfs_unmark_dirop which will remove the nodes and change the flags.

Further, vp itself is valid only as long as it is referenced, which it
is as long as it's on the dchain, but lfs_unmark_dirop drops the
dchain's reference.

Don't lfs_writer_enter while holding v_interlock.

There's no need to lfs_writer_enter at all here, as far as I can see.
lfs_flush_fs will do it for us.

Break deadlock in PR kern/52301.

The lock order is lfs_writer -> lfs_seglock.  The problem in 52301 is
that lfs_segwrite violates this lock order by sometimes doing
lfs_seglock -> lfs_writer, either (a) when doing a checkpoint or (b),
opportunistically, when there are no dirops pending.  Both cases can
deadlock, because dirops sometimes take the seglock (lfs_truncate,
lfs_valloc, lfs_vfree):
(a) There may be dirops pending, and they may be waiting for the
seglock, so we can't wait for them to complete while holding the
seglock.
(b) The test for fs->lfs_dirops == 0 happens unlocked, and the state
may change by the time lfs_writer_enter acquires lfs_lock.

To resolve this in each case:
(a) Do 

CVS commit: src/sys/arch/evbarm/conf

2020-08-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 17 09:03:03 UTC 2020

Modified Files:
src/sys/arch/evbarm/conf: GENERIC.common

Log Message:
enable raidframe.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/evbarm/conf/GENERIC.common

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/evbarm/conf/GENERIC.common
diff -u src/sys/arch/evbarm/conf/GENERIC.common:1.37 src/sys/arch/evbarm/conf/GENERIC.common:1.38
--- src/sys/arch/evbarm/conf/GENERIC.common:1.37	Sat Jun 13 16:51:25 2020
+++ src/sys/arch/evbarm/conf/GENERIC.common	Mon Aug 17 09:03:03 2020
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC.common,v 1.37 2020/06/13 16:51:25 ad Exp $
+#	$NetBSD: GENERIC.common,v 1.38 2020/08/17 09:03:03 mrg Exp $
 #
 #	GENERIC evbarm kernel config (template)
 #
@@ -131,6 +131,17 @@ pseudo-device	vnd			# disk-like interfac
 #pseudo-device	fss			# file system snapshot device
 pseudo-device	drvctl			# driver control
 pseudo-device	cgd			# cryptographic disk devices
+pseudo-device	raid			# RAIDframe disk driver
+options 	RAID_AUTOCONFIG		# auto-configuration of RAID components
+#Options to enable various other RAIDframe RAID types.
+#options 	RF_INCLUDE_EVENODD=1
+#options 	RF_INCLUDE_RAID5_RS=1
+#options 	RF_INCLUDE_PARITYLOGGING=1
+#options 	RF_INCLUDE_CHAINDECLUSTER=1
+#options 	RF_INCLUDE_INTERDECLUSTER=1
+#options 	RF_INCLUDE_PARITY_DECLUSTERING=1
+#options 	RF_INCLUDE_PARITY_DECLUSTERING_DS=1
+pseudo-device	fss			# file system snapshot device
 
 # network pseudo-devices
 pseudo-device	bpfilter		# Berkeley packet filter



CVS commit: src/sys/uvm/pmap

2020-08-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 17 08:56:27 UTC 2020

Modified Files:
src/sys/uvm/pmap: pmap_segtab.c

Log Message:
add pmaphist calls around seg_tab[] manipulation.  hopefully will
help find what causes this:

panic: pmap_segtab_alloc: pm_segtab.seg_tab[1010] != 0 (0x98004eeb6068): 
from free list


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/uvm/pmap/pmap_segtab.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/uvm/pmap/pmap_segtab.c
diff -u src/sys/uvm/pmap/pmap_segtab.c:1.15 src/sys/uvm/pmap/pmap_segtab.c:1.16
--- src/sys/uvm/pmap/pmap_segtab.c:1.15	Fri Aug  7 07:19:45 2020
+++ src/sys/uvm/pmap/pmap_segtab.c	Mon Aug 17 08:56:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_segtab.c,v 1.15 2020/08/07 07:19:45 skrll Exp $	*/
+/*	$NetBSD: pmap_segtab.c,v 1.16 2020/08/17 08:56:27 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.15 2020/08/07 07:19:45 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.16 2020/08/17 08:56:27 mrg Exp $");
 
 /*
  *	Manages physical address maps.
@@ -210,12 +210,18 @@ pmap_segtab_release(pmap_t pmap, pmap_se
 {
 	pmap_segtab_t *stp = *stp_p;
 
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLARGS(pmaphist, "pm=%#jx stpp=%#jx free=%jd",
+	(uintptr_t)pmap, (uintptr_t)stp_p, free_stp, 0);
+	UVMHIST_LOG(pmaphist, " callback=%jx flags=%jx va=%jx vinc=%jx",
+	(uintptr_t)callback, flags, (uintptr_t)va, (uintptr_t)vinc);
 	for (size_t i = (va / vinc) & (PMAP_SEGTABSIZE - 1);
 	 i < PMAP_SEGTABSIZE;
 	 i++, va += vinc) {
 #ifdef _LP64
 		if (vinc > NBSEG) {
 			if (stp->seg_seg[i] != NULL) {
+UVMHIST_LOG(pmaphist, " recursing", 0, 0, 0, 0);
 pmap_segtab_release(pmap, >seg_seg[i],
 true, callback, flags, va, vinc / NSEGPG);
 KASSERT(stp->seg_seg[i] == NULL);
@@ -255,6 +261,7 @@ pmap_segtab_release(pmap_t pmap, pmap_se
 #endif
 
 		stp->seg_tab[i] = NULL;
+		UVMHIST_LOG(pmaphist, " zeroing tab[%jd]", i, 0, 0, 0);
 	}
 
 	if (free_stp) {
@@ -448,6 +455,10 @@ pmap_pte_reserve(pmap_t pmap, vaddr_t va
 	pmap_segtab_t *stp = pmap->pm_segtab;
 	pt_entry_t *pte;
 
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLARGS(pmaphist, "pm=%#jx va=%#jx flags=%jx",
+	(uintptr_t)pmap, (uintptr_t)va, flags, 0);
+
 	pte = pmap_pte_lookup(pmap, va);
 	if (__predict_false(pte == NULL)) {
 #ifdef _LP64
@@ -513,6 +524,8 @@ pmap_pte_reserve(pmap_t pmap, vaddr_t va
 		*pte_p = pte;
 #endif
 		KASSERT(pte == stp->seg_tab[(va >> SEGSHIFT) & (PMAP_SEGTABSIZE - 1)]);
+		UVMHIST_LOG(pmaphist, " set tab[%jd]=%jx",
+		(va >> SEGSHIFT) & (PMAP_SEGTABSIZE - 1), pte, 0, 0);
 
 #ifdef DEBUG
 		for (size_t i = 0; i < NPTEPG; i++) {



CVS commit: src/sys/dev

2020-08-17 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Mon Aug 17 08:34:36 UTC 2020

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

Log Message:
ipmi(4): Fixed a bug that incorrect condition is notified.

When the value obtained from the sensor is below the lower limit of
the critical threshold, it is notified that the value is below the lower
limit of the warning threshold.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ipmi.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/ipmi.c
diff -u src/sys/dev/ipmi.c:1.4 src/sys/dev/ipmi.c:1.5
--- src/sys/dev/ipmi.c:1.4	Sat May 18 08:38:00 2019
+++ src/sys/dev/ipmi.c	Mon Aug 17 08:34:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipmi.c,v 1.4 2019/05/18 08:38:00 mlelstv Exp $ */
+/*	$NetBSD: ipmi.c,v 1.5 2020/08/17 08:34:36 nonaka Exp $ */
 
 /*
  * Copyright (c) 2019 Michael van Elst
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.4 2019/05/18 08:38:00 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.5 2020/08/17 08:34:36 nonaka Exp $");
 
 #include 
 #include 
@@ -1632,14 +1632,14 @@ ipmi_sensor_status(struct ipmi_softc *sc
 		edata->value_cur > psensor->i_limits.sel_warnmax)
 			return ENVSYS_SWARNOVER;
 
-		if (psensor->i_props & PROP_WARNMIN &&
-		edata->value_cur < psensor->i_limits.sel_warnmin)
-			return ENVSYS_SWARNUNDER;
-
 		if (psensor->i_props & PROP_CRITMIN &&
 		edata->value_cur < psensor->i_limits.sel_critmin)
 			return ENVSYS_SCRITUNDER;
 
+		if (psensor->i_props & PROP_WARNMIN &&
+		edata->value_cur < psensor->i_limits.sel_warnmin)
+			return ENVSYS_SWARNUNDER;
+
 		break;
 
 	case IPMI_SENSOR_TYPE_INTRUSION:



CVS commit: src/sys/dev/pci/ixgbe

2020-08-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug 17 08:23:30 UTC 2020

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

Log Message:
 Simplify SFP+ check. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/sys/dev/pci/ixgbe/ixgbe.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/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.238 src/sys/dev/pci/ixgbe/ixgbe.c:1.239
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.238	Mon Aug 17 07:59:06 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Aug 17 08:23:30 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.238 2020/08/17 07:59:06 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.239 2020/08/17 08:23:30 msaitoh Exp $ */
 
 /**
 
@@ -4465,7 +4465,6 @@ ixgbe_handle_timer(struct work *wk, void
 	u64		v0, v1, v2, v3, v4, v5, v6, v7;
 	int		hung = 0;
 	int		i;
-	bool		do_probe = false;
 
 	IXGBE_CORE_LOCK(adapter);
 
@@ -4475,12 +4474,11 @@ ixgbe_handle_timer(struct work *wk, void
 		bool is_full = ixgbe_sfp_cage_full(hw);
 
 		/* do probe if cage state changed */
-		if (was_full ^ is_full)
-			do_probe = true;
-	}
-	if (do_probe) {
-		atomic_or_32(>task_requests, IXGBE_REQUEST_TASK_MOD);
-		ixgbe_schedule_admin_tasklet(adapter);
+		if (was_full ^ is_full) {
+			atomic_or_32(>task_requests,
+			IXGBE_REQUEST_TASK_MOD);
+			ixgbe_schedule_admin_tasklet(adapter);
+		}
 	}
 
 	ixgbe_update_link_status(adapter);



CVS commit: src/sys/dev/pci/ixgbe

2020-08-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug 17 07:59:06 UTC 2020

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe.h

Log Message:
 Re-enabling interrupt is required only when a work is scheduled form the
interrput context.


To generate a diff of this commit:
cvs rdiff -u -r1.237 -r1.238 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/pci/ixgbe/ixgbe.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/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.237 src/sys/dev/pci/ixgbe/ixgbe.c:1.238
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.237	Mon Aug 17 07:26:55 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Aug 17 07:59:06 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.237 2020/08/17 07:26:55 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.238 2020/08/17 07:59:06 msaitoh Exp $ */
 
 /**
 
@@ -3173,9 +3173,10 @@ ixgbe_msix_admin(void *arg)
 	}
 
 	if (task_requests != 0) {
+		/* Re-enabling other interrupts is done in the admin task */
+		task_requests |= IXGBE_REQUEST_TASK_NEED_ACKINTR;
 		atomic_or_32(>task_requests, task_requests);
 		ixgbe_schedule_admin_tasklet(adapter);
-		/* Re-enabling other interrupts is done in the admin task */
 	} else {
 		/* Re-enable other interrupts */
 		IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER);
@@ -4802,11 +4803,13 @@ ixgbe_handle_admin(struct work *wk, void
 #endif
 	}
 	atomic_store_relaxed(>admin_pending, 0);
-	if ((adapter->feat_en & IXGBE_FEATURE_MSIX) != 0) {
-		/* Re-enable other interrupts */
-		IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER);
-	} else
-		ixgbe_enable_intr(adapter);
+	if ((req & IXGBE_REQUEST_TASK_NEED_ACKINTR) != 0) {
+		if ((adapter->feat_en & IXGBE_FEATURE_MSIX) != 0) {
+			/* Re-enable other interrupts */
+			IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER);
+		} else
+			ixgbe_enable_intr(adapter);
+	}
 
 	IXGBE_CORE_UNLOCK(adapter);
 	IFNET_UNLOCK(ifp);
@@ -5210,6 +5213,8 @@ ixgbe_legacy_irq(void *arg)
 		reenable_intr = false;
 	}
 	if (task_requests != 0) {
+		/* Re-enabling other interrupts is done in the admin task */
+		task_requests |= IXGBE_REQUEST_TASK_NEED_ACKINTR;
 		atomic_or_32(>task_requests, task_requests);
 		ixgbe_schedule_admin_tasklet(adapter);
 		reenable_intr = false;

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.68 src/sys/dev/pci/ixgbe/ixgbe.h:1.69
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.68	Mon Aug 17 07:26:55 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Mon Aug 17 07:59:06 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.68 2020/08/17 07:26:55 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.69 2020/08/17 07:59:06 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -768,6 +768,7 @@ bool ixgbe_rxeof(struct ix_queue *);
 #define IXGBE_REQUEST_TASK_FDIR		0x08
 #define IXGBE_REQUEST_TASK_PHY		0x10
 #define IXGBE_REQUEST_TASK_LSC		0x20
+#define IXGBE_REQUEST_TASK_NEED_ACKINTR	0x80
 
 /* For NetBSD */
 const struct sysctlnode *ixgbe_sysctl_instance(struct adapter *);



CVS commit: src/sys/arch

2020-08-17 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Aug 17 07:50:42 UTC 2020

Modified Files:
src/sys/arch/algor/algor: machdep.c
src/sys/arch/evbmips/alchemy: mtx-1.c omsal400.c
src/sys/arch/evbmips/atheros: machdep.c
src/sys/arch/evbmips/cavium: machdep.c
src/sys/arch/evbmips/gdium: machdep.c
src/sys/arch/evbmips/ingenic: machdep.c
src/sys/arch/evbmips/loongson: machdep.c

Log Message:
Add some compile time asserts for endianness on boards/systems that
only support a single endianness.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/algor/algor/machdep.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbmips/alchemy/mtx-1.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbmips/alchemy/omsal400.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbmips/atheros/machdep.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbmips/cavium/machdep.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/evbmips/gdium/machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbmips/ingenic/machdep.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbmips/loongson/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/algor/algor/machdep.c
diff -u src/sys/arch/algor/algor/machdep.c:1.56 src/sys/arch/algor/algor/machdep.c:1.57
--- src/sys/arch/algor/algor/machdep.c:1.56	Mon Aug 17 07:22:46 2020
+++ src/sys/arch/algor/algor/machdep.c	Mon Aug 17 07:50:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.56 2020/08/17 07:22:46 mrg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.57 2020/08/17 07:50:41 simonb Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.56 2020/08/17 07:22:46 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.57 2020/08/17 07:50:41 simonb Exp $");
 
 #include "opt_algor_p4032.h"
 #include "opt_algor_p5064.h" 
@@ -164,6 +164,9 @@ void	mach_init(int, char *[], char *[]);
 
 int	cpuspeed = 150;		/* XXX XXX XXX */
 
+/* The ALGOR kernels only support little endian */
+CTASSERT(_BYTE_ORDER == _LITTLE_ENDIAN);
+
 void
 mach_init(int argc, char *argv[], char *envp[])
 {

Index: src/sys/arch/evbmips/alchemy/mtx-1.c
diff -u src/sys/arch/evbmips/alchemy/mtx-1.c:1.8 src/sys/arch/evbmips/alchemy/mtx-1.c:1.9
--- src/sys/arch/evbmips/alchemy/mtx-1.c:1.8	Tue Jun  9 22:49:55 2015
+++ src/sys/arch/evbmips/alchemy/mtx-1.c	Mon Aug 17 07:50:41 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: mtx-1.c,v 1.8 2015/06/09 22:49:55 matt Exp $ */
+/* $NetBSD: mtx-1.c,v 1.9 2020/08/17 07:50:41 simonb Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */ 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mtx-1.c,v 1.8 2015/06/09 22:49:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mtx-1.c,v 1.9 2020/08/17 07:50:41 simonb Exp $");
 
 #include 
 #include 
@@ -72,6 +72,9 @@ static struct alchemy_board mtx1_info = 
 	NULL,	/* poweroff */
 };
 
+/* The MTX-1 kernels only support little endian */
+CTASSERT(_BYTE_ORDER == _LITTLE_ENDIAN);
+
 const struct alchemy_board *
 board_info(void)
 {

Index: src/sys/arch/evbmips/alchemy/omsal400.c
diff -u src/sys/arch/evbmips/alchemy/omsal400.c:1.10 src/sys/arch/evbmips/alchemy/omsal400.c:1.11
--- src/sys/arch/evbmips/alchemy/omsal400.c:1.10	Tue Jun  9 22:49:55 2015
+++ src/sys/arch/evbmips/alchemy/omsal400.c	Mon Aug 17 07:50:41 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: omsal400.c,v 1.10 2015/06/09 22:49:55 matt Exp $ */
+/* $NetBSD: omsal400.c,v 1.11 2020/08/17 07:50:41 simonb Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -36,7 +36,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omsal400.c,v 1.10 2015/06/09 22:49:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omsal400.c,v 1.11 2020/08/17 07:50:41 simonb Exp $");
 
 #include 
 #include 
@@ -93,6 +93,9 @@ static struct alchemy_board omsal400_inf
 	_pcmcia,
 };
 
+/* The OMS AL400 kernels only support little endian */
+CTASSERT(_BYTE_ORDER == _LITTLE_ENDIAN);
+
 const struct alchemy_board *
 board_info(void)
 {

Index: src/sys/arch/evbmips/atheros/machdep.c
diff -u src/sys/arch/evbmips/atheros/machdep.c:1.32 src/sys/arch/evbmips/atheros/machdep.c:1.33
--- src/sys/arch/evbmips/atheros/machdep.c:1.32	Wed Jul 22 01:24:39 2020
+++ src/sys/arch/evbmips/atheros/machdep.c	Mon Aug 17 07:50:42 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.32 2020/07/22 01:24:39 msaitoh Exp $ */
+/* $NetBSD: machdep.c,v 1.33 2020/08/17 07:50:42 simonb Exp $ */
 
 /*
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.32 2020/07/22 01:24:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.33 2020/08/17 07:50:42 simonb Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -154,6 +154,9 @@ phys_ram_seg_t mem_clusters[VM_PHYSSEG_M
 
 void	mach_init(void); /* XXX */
 
+/* Currently the Atheros kernels only support big endian boards */

CVS commit: src/sys/dev/pci/ixgbe

2020-08-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug 17 07:26:55 UTC 2020

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe.h

Log Message:
Fix a bug that the driver sometimes missed module insertion.

 The ixgbe_sfp_probe() function was only for 82598 and other chips had no
way to poll SFP+ cage. The ixgbe_handle_mod() already has function to treat
module insertion/removal for all chips, so enqueue the work if the cage
status changed. All of ixgbe chips' SFP+ module interrupt is only on the
inserstion. This change also detect the removal by the timer.


To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pci/ixgbe/ixgbe.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/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.236 src/sys/dev/pci/ixgbe/ixgbe.c:1.237
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.236	Mon Aug 17 06:30:25 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Aug 17 07:26:55 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.236 2020/08/17 06:30:25 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.237 2020/08/17 07:26:55 msaitoh Exp $ */
 
 /**
 
@@ -257,7 +257,7 @@ static int	ixgbe_sysctl_wol_enable(SYSCT
 static int	ixgbe_sysctl_wufc(SYSCTLFN_PROTO);
 
 /* Support for pluggable optic modules */
-static bool	ixgbe_sfp_probe(struct adapter *);
+static bool	ixgbe_sfp_cage_full(struct ixgbe_hw *);
 
 /* Legacy (single vector) interrupt handler */
 static int	ixgbe_legacy_irq(void *);
@@ -962,15 +962,9 @@ ixgbe_attach(device_t parent, device_t d
 	hw->phy.reset_if_overtemp = TRUE;
 	error = ixgbe_reset_hw(hw);
 	hw->phy.reset_if_overtemp = FALSE;
-	if (error == IXGBE_ERR_SFP_NOT_PRESENT) {
-		/*
-		 * No optics in this port, set up
-		 * so the timer routine will probe
-		 * for later insertion.
-		 */
-		adapter->sfp_probe = TRUE;
+	if (error == IXGBE_ERR_SFP_NOT_PRESENT)
 		error = IXGBE_SUCCESS;
-	} else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) {
+	else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) {
 		aprint_error_dev(dev, "Unsupported SFP+ module detected!\n");
 		unsupported_sfp = true;
 		error = IXGBE_SUCCESS;
@@ -4463,19 +4457,30 @@ static void
 ixgbe_handle_timer(struct work *wk, void *context)
 {
 	struct adapter	*adapter = context;
+	struct ixgbe_hw *hw = >hw;
 	device_t	dev = adapter->dev;
 	struct ix_queue	*que = adapter->queues;
 	u64		queues = 0;
 	u64		v0, v1, v2, v3, v4, v5, v6, v7;
 	int		hung = 0;
 	int		i;
+	bool		do_probe = false;
 
 	IXGBE_CORE_LOCK(adapter);
 
 	/* Check for pluggable optics */
-	if (adapter->sfp_probe)
-		if (!ixgbe_sfp_probe(adapter))
-			goto out; /* Nothing to do */
+	if (ixgbe_is_sfp(hw)) {
+		bool was_full = hw->phy.sfp_type != ixgbe_sfp_type_not_present;
+		bool is_full = ixgbe_sfp_cage_full(hw);
+
+		/* do probe if cage state changed */
+		if (was_full ^ is_full)
+			do_probe = true;
+	}
+	if (do_probe) {
+		atomic_or_32(>task_requests, IXGBE_REQUEST_TASK_MOD);
+		ixgbe_schedule_admin_tasklet(adapter);
+	}
 
 	ixgbe_update_link_status(adapter);
 	ixgbe_update_stats_counters(adapter);
@@ -4553,7 +4558,6 @@ ixgbe_handle_timer(struct work *wk, void
 	}
 #endif
 
-out:
 	atomic_store_relaxed(>timer_pending, 0);
 	IXGBE_CORE_UNLOCK(adapter);
 	callout_reset(>timer, hz, ixgbe_local_timer, adapter);
@@ -4607,38 +4611,22 @@ ixgbe_handle_recovery_mode_timer(struct 
 } /* ixgbe_handle_recovery_mode_timer */
 
 /
- * ixgbe_sfp_probe
+ * ixgbe_sfp_cage_full
  *
  *   Determine if a port had optics inserted.
  /
 static bool
-ixgbe_sfp_probe(struct adapter *adapter)
+ixgbe_sfp_cage_full(struct ixgbe_hw *hw)
 {
-	struct ixgbe_hw	*hw = >hw;
-	device_t	dev = adapter->dev;
-	bool		result = FALSE;
+	uint32_t mask;
 
-	if ((hw->phy.type == ixgbe_phy_nl) &&
-	(hw->phy.sfp_type == ixgbe_sfp_type_not_present)) {
-		s32 ret = hw->phy.ops.identify_sfp(hw);
-		if (ret)
-			goto out;
-		ret = hw->phy.ops.reset(hw);
-		adapter->sfp_probe = FALSE;
-		if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) {
-			device_printf(dev,"Unsupported SFP+ module detected!");
-			device_printf(dev,
-			"Reload driver with supported module.\n");
-			goto out;
-		} else
-			device_printf(dev, "SFP+ module detected!\n");
-		/* We now have supported optics */
-		result = TRUE;
-	}
-out:
+	if (hw->mac.type >= ixgbe_mac_X540)
+		mask = IXGBE_ESDP_SDP0;
+	else
+		mask = IXGBE_ESDP_SDP2;
 
-	return (result);
-} /* ixgbe_sfp_probe */
+	return IXGBE_READ_REG(hw, IXGBE_ESDP) & mask;
+} /* ixgbe_sfp_cage_full */
 
 /
  * ixgbe_handle_mod - Tasklet for SFP module interrupts

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u 

CVS commit: src/sys/arch/algor/algor

2020-08-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Aug 17 07:22:47 UTC 2020

Modified Files:
src/sys/arch/algor/algor: machdep.c

Log Message:
remove duplicate symbol now published in shared mips.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/algor/algor/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/algor/algor/machdep.c
diff -u src/sys/arch/algor/algor/machdep.c:1.55 src/sys/arch/algor/algor/machdep.c:1.56
--- src/sys/arch/algor/algor/machdep.c:1.55	Thu Dec 22 14:47:54 2016
+++ src/sys/arch/algor/algor/machdep.c	Mon Aug 17 07:22:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.55 2016/12/22 14:47:54 cherry Exp $	*/
+/*	$NetBSD: machdep.c,v 1.56 2020/08/17 07:22:46 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.55 2016/12/22 14:47:54 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.56 2020/08/17 07:22:46 mrg Exp $");
 
 #include "opt_algor_p4032.h"
 #include "opt_algor_p5064.h" 
@@ -532,7 +532,6 @@ cpu_startup(void)
 }
 
 int	waittime = -1;
-struct pcb dumppcb;
 
 void
 cpu_reboot(int howto, char *bootstr)



CVS commit: src/sys/dev/pci/ixgbe

2020-08-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Aug 17 06:30:25 UTC 2020

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

Log Message:
 Add missing workqueue_wait() for the recovery_mode_timer workqueue.


To generate a diff of this commit:
cvs rdiff -u -r1.235 -r1.236 src/sys/dev/pci/ixgbe/ixgbe.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/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.235 src/sys/dev/pci/ixgbe/ixgbe.c:1.236
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.235	Thu Aug 13 08:42:18 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Aug 17 06:30:25 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.235 2020/08/13 08:42:18 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.236 2020/08/17 06:30:25 msaitoh Exp $ */
 
 /**
 
@@ -3522,6 +3522,13 @@ ixgbe_free_workqueue(struct adapter *ada
 		adapter->timer_wq = NULL;
 	}
 	if (adapter->recovery_mode_timer_wq != NULL) {
+		/*
+		 * ixgbe_ifstop() doesn't call the workqueue_wait() for
+		 * the recovery_mode_timer workqueue, so call it here.
+		 */
+		workqueue_wait(adapter->recovery_mode_timer_wq,
+		>recovery_mode_timer_wc);
+		atomic_store_relaxed(>recovery_mode_timer_pending, 0);
 		workqueue_destroy(adapter->recovery_mode_timer_wq);
 		adapter->recovery_mode_timer_wq = NULL;
 	}



CVS commit: src/sys/arch/evbmips/cavium

2020-08-17 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Aug 17 06:23:01 UTC 2020

Modified Files:
src/sys/arch/evbmips/cavium: autoconf.c

Log Message:
Handle using "octeth" as root device by converting "octethN" to "cnmacN"
for any N < 100.  This allows booting for u-boot to use root=$(ethact)
on the command line and the kernel can use the ethernet interface the
kernel was loaded on as the NFS root device.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbmips/cavium/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/arch/evbmips/cavium/autoconf.c
diff -u src/sys/arch/evbmips/cavium/autoconf.c:1.8 src/sys/arch/evbmips/cavium/autoconf.c:1.9
--- src/sys/arch/evbmips/cavium/autoconf.c:1.8	Tue Jun 23 05:19:12 2020
+++ src/sys/arch/evbmips/cavium/autoconf.c	Mon Aug 17 06:23:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.8 2020/06/23 05:19:12 simonb Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.9 2020/08/17 06:23:01 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.8 2020/06/23 05:19:12 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.9 2020/08/17 06:23:01 simonb Exp $");
 
 #include 
 #include 
@@ -95,12 +95,24 @@ findroot(void)
 		return;
 
 	if (rootspec && *rootspec) {
+		/* if we get passed root=octethN, convert to cnmacN */
+		if (strncmp(rootspec, "octeth", 6) == 0) {
+			/* allow for up to 100 interfaces */
+			static char buf[sizeof("cnmacXX")];
+			const char *cp = [strlen("octeth")];
+
+			KASSERT(strlen(cp) < sizeof("XX"));
+			snprintf(buf, sizeof(buf), "cnmac%s", cp);
+			rootspec = buf;
+		}
+
 		/* XXX hard coded "cnmac" for network boot */
 		if (strncmp(rootspec, "cnmac", 5) == 0) {
 			rootfstype = "nfs";
 			netboot = 1;
 			return;
 		}
+
 		/*
 		 * XXX
 		 * Assume that if the root spec is not a cnmac, it'll



CVS commit: src/tests/fs/ffs

2020-08-17 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Mon Aug 17 06:18:39 UTC 2020

Modified Files:
src/tests/fs/ffs: ffs_common.sh

Log Message:
Remove unused function rump_shutdown()


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/ffs/ffs_common.sh

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

Modified files:

Index: src/tests/fs/ffs/ffs_common.sh
diff -u src/tests/fs/ffs/ffs_common.sh:1.3 src/tests/fs/ffs/ffs_common.sh:1.4
--- src/tests/fs/ffs/ffs_common.sh:1.3	Sat Oct  8 13:23:53 2016
+++ src/tests/fs/ffs/ffs_common.sh	Mon Aug 17 06:18:39 2020
@@ -1,4 +1,4 @@
-# $NetBSD: ffs_common.sh,v 1.3 2016/10/08 13:23:53 gson Exp $ 
+# $NetBSD: ffs_common.sh,v 1.4 2020/08/17 06:18:39 gson Exp $ 
 
 create_ffs()
 {
@@ -23,17 +23,6 @@ create_ffs_server()
 		${sarg} ${IMG} ${RUMP_SERVER}
 }
 
-rump_shutdown()
-{
-	for s in ${RUMP_SOCKETS_LIST}; do
-		atf_check -s exit:0 env RUMP_SERVER=unix://${s} rump.halt;
-	done
-# check that the quota inode creation didn't corrupt the filesystem
-	atf_check -s exit:0 -o "match:already clean" \
-		-o "match:Phase 6 - Check Quotas" \
-		fsck_ffs -nf -F ${IMG}
-}
-
 # from tests/ipf/h_common.sh via tests/sbin/resize_ffs
 test_case()
 {



CVS commit: src/share/man/man9

2020-08-17 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Aug 17 06:07:53 UTC 2020

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

Log Message:
cprng(9): Remove trailing comma.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/share/man/man9/cprng.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/cprng.9
diff -u src/share/man/man9/cprng.9:1.13 src/share/man/man9/cprng.9:1.14
--- src/share/man/man9/cprng.9:1.13	Mon Aug 17 00:55:05 2020
+++ src/share/man/man9/cprng.9	Mon Aug 17 06:07:53 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: cprng.9,v 1.13 2020/08/17 00:55:05 riastradh Exp $
+.\"	$NetBSD: cprng.9,v 1.14 2020/08/17 06:07:53 wiz Exp $
 .\"
 .\" Copyright (c) 2011-2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -39,7 +39,7 @@
 .Nm cprng_strong64 ,
 .Nm cprng_fast ,
 .Nm cprng_fast32 ,
-.Nm cprng_fast64 ,
+.Nm cprng_fast64
 .Nd cryptographic pseudorandom number generators
 .Sh SYNOPSIS
 .In sys/cprng.h