CVS commit: src/sys

2020-05-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon May 18 05:47:54 UTC 2020

Modified Files:
src/sys/dev/ic: bwireg.h
src/sys/dev/pci: if_bnx.c
src/sys/sys: disklabel_gpt.h

Log Message:
 Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/bwireg.h
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/pci/if_bnx.c
cvs rdiff -u -r1.13 -r1.14 src/sys/sys/disklabel_gpt.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/ic/bwireg.h
diff -u src/sys/dev/ic/bwireg.h:1.3 src/sys/dev/ic/bwireg.h:1.4
--- src/sys/dev/ic/bwireg.h:1.3	Wed Jan 28 14:49:10 2009
+++ src/sys/dev/ic/bwireg.h	Mon May 18 05:47:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bwireg.h,v 1.3 2009/01/28 14:49:10 sborrill Exp $	*/
+/*	$NetBSD: bwireg.h,v 1.4 2020/05/18 05:47:54 msaitoh Exp $	*/
 /*	$OpenBSD: bwireg.h,v 1.7 2007/11/17 16:50:02 mglocker Exp $	*/
 
 /*
@@ -583,7 +583,7 @@
 	0x1a1d,	0x1719,	0x1616,	0x1414,	0x1414,	0x1400,	0x1414,	0x1614,	\
 	0x1716,	0x1a19,	0x1f1d,	0x2521,	0x2a27,	0x2f2a,	0x332d,	0x3b35,	\
 	0x5140,	0x6c62,	0x0077
-/* G PHY Revsion 7 */
+/* G PHY Revision 7 */
 #define BWI_PHY_NOISE_SCALE_11G_REV7	\
 	0xa4a4,	0xa4a4,	0xa4a4,	0xa4a4,	0xa4a4,	0xa4a4,	0xa4a4,	0xa4a4,	\
 	0xa4a4,	0xa4a4,	0xa4a4,	0xa4a4,	0xa4a4,	0xa400,	0xa4a4,	0xa4a4,	\

Index: src/sys/dev/pci/if_bnx.c
diff -u src/sys/dev/pci/if_bnx.c:1.94 src/sys/dev/pci/if_bnx.c:1.95
--- src/sys/dev/pci/if_bnx.c:1.94	Fri Feb 28 14:57:55 2020
+++ src/sys/dev/pci/if_bnx.c	Mon May 18 05:47:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bnx.c,v 1.94 2020/02/28 14:57:55 msaitoh Exp $	*/
+/*	$NetBSD: if_bnx.c,v 1.95 2020/05/18 05:47:54 msaitoh Exp $	*/
 /*	$OpenBSD: if_bnx.c,v 1.101 2013/03/28 17:21:44 brad Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.94 2020/02/28 14:57:55 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.95 2020/05/18 05:47:54 msaitoh Exp $");
 
 /*
  * The following controllers are supported by this driver:
@@ -642,7 +642,7 @@ bnx_attach(device_t parent, device_t sel
 	BNX_PCICFG_MISC_CONFIG_REG_WINDOW_ENA |
 	BNX_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP);
 
-	/* Save ASIC revsion info. */
+	/* Save ASIC revision info. */
 	sc->bnx_chipid =  REG_RD(sc, BNX_MISC_ID);
 
 	/*

Index: src/sys/sys/disklabel_gpt.h
diff -u src/sys/sys/disklabel_gpt.h:1.13 src/sys/sys/disklabel_gpt.h:1.14
--- src/sys/sys/disklabel_gpt.h:1.13	Tue Nov  6 04:04:34 2018
+++ src/sys/sys/disklabel_gpt.h	Mon May 18 05:47:54 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: disklabel_gpt.h,v 1.13 2018/11/06 04:04:34 mrg Exp $	*/
+/*	$NetBSD: disklabel_gpt.h,v 1.14 2020/05/18 05:47:54 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2002 Marcel Moolenaar
@@ -43,7 +43,7 @@
  */
 struct gpt_hdr {
 	int8_t		hdr_sig[8];	/* identifies GUID Partition Table */
-	uint32_t	hdr_revision;	/* GPT specification revsion */
+	uint32_t	hdr_revision;	/* GPT specification revision */
 	uint32_t	hdr_size;	/* size of GPT Header */
 	uint32_t	hdr_crc_self;	/* CRC32 of GPT Header */
 	uint32_t	hdr__rsvd0;	/* must be zero */



CVS commit: src/bin

2020-05-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 17 23:34:11 UTC 2020

Modified Files:
src/bin/cp: Makefile cp.c utils.c
src/bin/ls: Makefile print.c

Log Message:
No ACL support for install media (SMALLPROG)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/bin/cp/Makefile
cvs rdiff -u -r1.60 -r1.61 src/bin/cp/cp.c
cvs rdiff -u -r1.48 -r1.49 src/bin/cp/utils.c
cvs rdiff -u -r1.14 -r1.15 src/bin/ls/Makefile
cvs rdiff -u -r1.56 -r1.57 src/bin/ls/print.c

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

Modified files:

Index: src/bin/cp/Makefile
diff -u src/bin/cp/Makefile:1.9 src/bin/cp/Makefile:1.10
--- src/bin/cp/Makefile:1.9	Sun Jul 20 18:36:37 1997
+++ src/bin/cp/Makefile	Sun May 17 19:34:11 2020
@@ -1,7 +1,11 @@
-#	$NetBSD: Makefile,v 1.9 1997/07/20 22:36:37 christos Exp $
+#	$NetBSD: Makefile,v 1.10 2020/05/17 23:34:11 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 5/31/93
 
 PROG=	cp
 SRCS=	cp.c utils.c
 
+.ifdef SMALLPROG
+CPPFLAGS+=-DSMALL
+.endif
+
 .include 

Index: src/bin/cp/cp.c
diff -u src/bin/cp/cp.c:1.60 src/bin/cp/cp.c:1.61
--- src/bin/cp/cp.c:1.60	Sat May 16 14:31:45 2020
+++ src/bin/cp/cp.c	Sun May 17 19:34:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cp.c,v 1.60 2020/05/16 18:31:45 christos Exp $ */
+/* $NetBSD: cp.c,v 1.61 2020/05/17 23:34:11 christos Exp $ */
 
 /*
  * Copyright (c) 1988, 1993, 1994
@@ -43,7 +43,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = "@(#)cp.c	8.5 (Berkeley) 4/29/95";
 #else
-__RCSID("$NetBSD: cp.c,v 1.60 2020/05/16 18:31:45 christos Exp $");
+__RCSID("$NetBSD: cp.c,v 1.61 2020/05/17 23:34:11 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -511,9 +511,11 @@ copy(char *argv[], enum op type, int fts
 if (pflag) {
 	if (setfile(curr->fts_statp, 0))
 		this_failed = any_failed = 1;
+#ifndef SMALL
 	if (preserve_dir_acls(curr->fts_statp,
 	curr->fts_accpath, to.p_path) != 0)
 		this_failed = any_failed = 1;
+#endif
 }
 if (this_failed && (dne = popdne()))
 	(void)chmod(to.p_path, 

Index: src/bin/cp/utils.c
diff -u src/bin/cp/utils.c:1.48 src/bin/cp/utils.c:1.49
--- src/bin/cp/utils.c:1.48	Sat May 16 14:31:45 2020
+++ src/bin/cp/utils.c	Sun May 17 19:34:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: utils.c,v 1.48 2020/05/16 18:31:45 christos Exp $ */
+/* $NetBSD: utils.c,v 1.49 2020/05/17 23:34:11 christos Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)utils.c	8.3 (Berkeley) 4/1/94";
 #else
-__RCSID("$NetBSD: utils.c,v 1.48 2020/05/16 18:31:45 christos Exp $");
+__RCSID("$NetBSD: utils.c,v 1.49 2020/05/17 23:34:11 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -43,7 +43,9 @@ __RCSID("$NetBSD: utils.c,v 1.48 2020/05
 #include 
 #include 
 #include 
+#ifndef SMALL
 #include 
+#endif
 #include 
 
 #include 
@@ -256,8 +258,10 @@ copy_file(FTSENT *entp, int dne)
 	if (pflag && (fcpxattr(from_fd, to_fd) != 0))
 		warn("%s: error copying extended attributes", to.p_path);
 
+#ifndef SMALL
 	if (pflag && preserve_fd_acls(from_fd, to_fd) != 0)
 		rval = 1;
+#endif
 
 	(void)close(from_fd);
 
@@ -408,6 +412,7 @@ setfile(struct stat *fs, int fd)
 	return (rval);
 }
 
+#ifndef SMALL
 int
 preserve_fd_acls(int source_fd, int dest_fd)
 {
@@ -546,6 +551,7 @@ preserve_dir_acls(struct stat *fs, char 
 	acl_free(acl);
 	return (0);
 }
+#endif
 
 void
 usage(void)

Index: src/bin/ls/Makefile
diff -u src/bin/ls/Makefile:1.14 src/bin/ls/Makefile:1.15
--- src/bin/ls/Makefile:1.14	Thu Dec 14 15:09:36 2006
+++ src/bin/ls/Makefile	Sun May 17 19:34:11 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2006/12/14 20:09:36 he Exp $
+#	$NetBSD: Makefile,v 1.15 2020/05/17 23:34:11 christos Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/2/93
 
 PROG=	ls
@@ -7,4 +7,8 @@ SRCS=	cmp.c ls.c main.c print.c util.c
 LDADD+=	-lutil
 DPADD+=	${LIBUTIL}
 
+.ifdef SMALLPROG
+CPPFLAGS+= -DSMALL
+.endif
+
 .include 

Index: src/bin/ls/print.c
diff -u src/bin/ls/print.c:1.56 src/bin/ls/print.c:1.57
--- src/bin/ls/print.c:1.56	Sat May 16 14:31:45 2020
+++ src/bin/ls/print.c	Sun May 17 19:34:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.56 2020/05/16 18:31:45 christos Exp $	*/
+/*	$NetBSD: print.c,v 1.57 2020/05/17 23:34:11 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -37,13 +37,15 @@
 #if 0
 static char sccsid[] = "@(#)print.c	8.5 (Berkeley) 7/28/94";
 #else
-__RCSID("$NetBSD: print.c,v 1.56 2020/05/16 18:31:45 christos Exp $");
+__RCSID("$NetBSD: print.c,v 1.57 2020/05/17 23:34:11 christos Exp $");
 #endif
 #endif /* not lint */
 
 #include 
 #include 
+#ifndef SMALL
 #include 
+#endif
 
 #include 
 #include 
@@ -69,7 +71,9 @@ static void	printlink(FTSENT *);
 static void	printtime(time_t);
 static void	printtotal(DISPLAY *dp);
 static int	printtype(u_int);
+#ifndef SMALL
 static void	aclmode(char *, const FTSENT *);
+#endif
 
 static time_t	now;
 
@@ -156,7 +160,9 @@ printlong(DISPLAY *dp)
 	

CVS commit: src/sys/dev/ic

2020-05-17 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun May 17 21:50:47 UTC 2020

Modified Files:
src/sys/dev/ic: dwc_gmac.c dwc_gmac_reg.h

Log Message:
Mask all the MMC counter interrupts if the MMC module is present.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/ic/dwc_gmac.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/dwc_gmac_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/ic/dwc_gmac.c
diff -u src/sys/dev/ic/dwc_gmac.c:1.69 src/sys/dev/ic/dwc_gmac.c:1.70
--- src/sys/dev/ic/dwc_gmac.c:1.69	Wed Jan 29 14:14:55 2020
+++ src/sys/dev/ic/dwc_gmac.c	Sun May 17 21:50:47 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_gmac.c,v 1.69 2020/01/29 14:14:55 thorpej Exp $ */
+/* $NetBSD: dwc_gmac.c,v 1.70 2020/05/17 21:50:47 chs Exp $ */
 
 /*-
  * Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.69 2020/01/29 14:14:55 thorpej Exp $");
+__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.70 2020/05/17 21:50:47 chs Exp $");
 
 /* #define	DWC_GMAC_DEBUG	1 */
 
@@ -254,6 +254,16 @@ dwc_gmac_attach(struct dwc_gmac_softc *s
 	} else {
 		sc->sc_descm = _methods_standard;
 	}
+	if (hwft & GMAC_DMA_FEAT_RMON) {
+		uint32_t val;
+
+		/* Mask all MMC interrupts */
+		val = 0x;
+		bus_space_write_4(sc->sc_bst, sc->sc_bsh,
+		GMAC_MMC_RX_INT_MSK, val);
+		bus_space_write_4(sc->sc_bst, sc->sc_bsh,
+		GMAC_MMC_TX_INT_MSK, val);
+	}
 
 	/*
 	 * Allocate Tx and Rx rings

Index: src/sys/dev/ic/dwc_gmac_reg.h
diff -u src/sys/dev/ic/dwc_gmac_reg.h:1.19 src/sys/dev/ic/dwc_gmac_reg.h:1.20
--- src/sys/dev/ic/dwc_gmac_reg.h:1.19	Mon Oct  8 17:09:31 2018
+++ src/sys/dev/ic/dwc_gmac_reg.h	Sun May 17 21:50:47 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_gmac_reg.h,v 1.19 2018/10/08 17:09:31 martin Exp $ */
+/* $NetBSD: dwc_gmac_reg.h,v 1.20 2020/05/17 21:50:47 chs Exp $ */
 
 /*-
  * Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
@@ -79,6 +79,46 @@
 #define	AWIN_GMAC_MAC_FLOWCTRL_TFE	__BIT(1)
 #define	AWIN_GMAC_MAC_FLOWCTRL_BUSY	__BIT(0)
 
+#define	GMAC_MMC_CTRL			0x0100	/* MMC control */
+#define	GMAC_MMC_RX_INTR		0x0104	/* MMC RX interrupt */
+#define	GMAC_MMC_TX_INTR		0x0108	/* MMC TX interrupt */
+#define	GMAC_MMC_RX_INT_MSK		0x010c	/* MMC RX interrupt mask */
+#define	GMAC_MMC_TX_INT_MSK		0x0110	/* MMC TX interrupt mask */
+#define	GMAC_MMC_TXOCTETCNT_GB		0x0114	/* TX octet good+bad */
+#define	GMAC_MMC_TXFRMCNT_GB		0x0118	/* TX frame good+bad */
+#define	GMAC_MMC_TXUNDFLWERR		0x0148	/* TX underflow */
+#define	GMAC_MMC_TXCARERR		0x0160	/* TX carrier error */
+#define	GMAC_MMC_TXOCTETCNT_G		0x0164	/* TX octet good */
+#define	GMAC_MMC_TXFRMCNT_G		0x0168	/* TX frame good */
+#define	GMAC_MMC_RXFRMCNT_GB		0x0180	/* RX frame good+bad */
+#define	GMAC_MMC_RXOCTETCNT_GB		0x0184	/* RX octet good+bad */
+#define	GMAC_MMC_RXOCTETCNT_G		0x0188	/* RX octet good */
+#define	GMAC_MMC_RXMCFRMCNT_G		0x0190	/* RX mcast frame good */
+#define	GMAC_MMC_RXCRCERR		0x0194	/* RX CRC error */
+#define	GMAC_MMC_RXLENERR		0x01c8	/* RX length error */
+#define	GMAC_MMC_RXFIFOOVRFLW		0x01d4	/* RX FIFO overflow */
+#define	GMAC_MMC_IPC_INT_MSK		0x0200	/* RX csum offload intr mask */
+#define	GMAC_MMC_IPC_INTR		0x0208	/* RX csum offload interrupt */
+#define	GMAC_MMC_RXIPV4GFRM		0x0210	/* RX IPv4 good frame */
+#define	GMAC_MMC_RXIPV4HDERRFRM		0x0214	/* RX IPv4 header error */
+#define	GMAC_MMC_RXIPV6GFRM		0x0224	/* RX IPv6 good frame */
+#define	GMAC_MMC_RXIPV6HDERRFRM		0x0228	/* RX IPv6 header error */
+#define	GMAC_MMC_RXUDPERRFRM		0x0234	/* RX UDP csum error frame */
+#define	GMAC_MMC_RXTCPERRFRM		0x023c	/* RX TCP csum error frame */
+#define	GMAC_MMC_RXICMPERRFRM		0x0244	/* RX ICMP csum error frame */
+#define	GMAC_MMC_RXIPV4HDERROCT		0x0254	/* RX IPv4 header error octets */
+#define	GMAC_MMC_RXIPV6HDERROCT		0x0268	/* RX IPv6 header error octets */
+#define	GMAC_MMC_RXUDPERROCT		0x0274	/* RX UDP error octets */
+#define	GMAC_MMC_RXTCPERROCT		0x027c	/* RX TCP error octets */
+#define	GMAC_MMC_RXICMPERROCT		0x0280	/* RX ICMP error octets */
+
+#define	GMAC_MMC_CTRL_FHP		__BIT(5) /* Full-Half preset */
+#define	GMAC_MMC_CTRL_CP		__BIT(4) /* Counters preset */
+#define	GMAC_MMC_CTRL_MCF		__BIT(3) /* MMC counter freeze */
+#define	GMAC_MMC_CTRL_ROR		__BIT(2) /* reset on read */
+#define	GMAC_MMC_CTRL_CSR		__BIT(1) /* Counter stop rollover */
+#define	GMAC_MMC_CTRL_CR		__BIT(0) /* Counters reset */
+
 #define	AWIN_GMAC_DMA_BUSMODE		0x1000
 #define	AWIN_GMAC_DMA_TXPOLL		0x1004
 #define	AWIN_GMAC_DMA_RXPOLL		0x1008
@@ -128,7 +168,12 @@
 		burst len */
 #define	GMAC_BUSMODE_RESET		__BIT(0)
 
-#define	AWIN_GMAC_MII_IRQ		__BIT(0)
+#define	AWIN_GMAC_MRCOIS		__BIT(7) /* MMC RX csum offload intr */
+#define	AWIN_GMAC_MTIS			__BIT(6) /* MMC TX interrupt */
+#define	AWIN_GMAC_MRIS			__BIT(3) /* MMC RX interrupt */
+#define	AWIN_GMAC_MIS			

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

2020-05-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun May 17 20:29:39 UTC 2020

Modified Files:
src/sys/arch/arm/rockchip: rk_v1crypto.c

Log Message:
Use rnd_add_data_sync from the callback.

(Doesn't make a difference in HEAD but this is the stated API
contract and it matters if we want to pull this up.)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/rockchip/rk_v1crypto.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/rockchip/rk_v1crypto.c
diff -u src/sys/arch/arm/rockchip/rk_v1crypto.c:1.1 src/sys/arch/arm/rockchip/rk_v1crypto.c:1.2
--- src/sys/arch/arm/rockchip/rk_v1crypto.c:1.1	Sun May 17 19:57:25 2020
+++ src/sys/arch/arm/rockchip/rk_v1crypto.c	Sun May 17 20:29:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rk_v1crypto.c,v 1.1 2020/05/17 19:57:25 riastradh Exp $	*/
+/*	$NetBSD: rk_v1crypto.c,v 1.2 2020/05/17 20:29:39 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: rk_v1crypto.c,v 1.1 2020/05/17 19:57:25 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: rk_v1crypto.c,v 1.2 2020/05/17 20:29:39 riastradh Exp $");
 
 #include 
 
@@ -272,7 +272,8 @@ rk_v1crypto_rng_get(size_t nbytes, void 
 			device_printf(self, "failed repeated output test\n");
 			break;
 		}
-		rnd_add_data(>sc_rndsource, buf, sizeof buf, entropybits);
+		rnd_add_data_sync(>sc_rndsource, buf, sizeof buf,
+		entropybits);
 		nbits -= MIN(nbits, MAX(1, entropybits));
 	}
 	explicit_memset(buf, 0, sizeof buf);



CVS commit: src/sys/arch

2020-05-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun May 17 19:57:25 UTC 2020

Modified Files:
src/sys/arch/arm/dts: rk3399-pinebook-pro.dts rk3399-rockpro64.dts
src/sys/arch/arm/rockchip: files.rockchip rk3399_cru.c
src/sys/arch/evbarm/conf: GENERIC64
Added Files:
src/sys/arch/arm/dts: rk3399-crypto.dtsi
src/sys/arch/arm/rockchip: rk_v1crypto.c rk_v1crypto.h

Log Message:
Rockchip crypto engine RNG driver.

As found on the rk3288 and rk3399.  This driver only supports the
TRNG, not the rest of the crypto engine, although it uses the AES unit
to do a self-test at attach time to verify that the engine works.

There seem to be two versions of the Rockchip crypto engine, v1 and
v2; this one is for v1.  Can't name a driver `rkcryptov1' so we'll
clumsily call it `rkv1crypto' instead to leave room for `rkv2crypto'
later on.

The crypto binding derived from the Rockchip BSP Linux kernel, in the
location it appears on the rk3399, is in rk3399-crypto.dtsi, since
there doesn't seem to be a better place to put it at the moment among
this twisty maze of inclusions, all different.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/dts/rk3399-crypto.dtsi
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/dts/rk3399-pinebook-pro.dts
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/dts/rk3399-rockpro64.dts
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/rockchip/files.rockchip
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/rockchip/rk3399_cru.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/rockchip/rk_v1crypto.c \
src/sys/arch/arm/rockchip/rk_v1crypto.h
cvs rdiff -u -r1.157 -r1.158 src/sys/arch/evbarm/conf/GENERIC64

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/dts/rk3399-pinebook-pro.dts
diff -u src/sys/arch/arm/dts/rk3399-pinebook-pro.dts:1.2 src/sys/arch/arm/dts/rk3399-pinebook-pro.dts:1.3
--- src/sys/arch/arm/dts/rk3399-pinebook-pro.dts:1.2	Wed Jan  1 14:15:46 2020
+++ src/sys/arch/arm/dts/rk3399-pinebook-pro.dts	Sun May 17 19:57:25 2020
@@ -12,6 +12,7 @@
 #include 
 #include "rk3399.dtsi"
 #include "rk3399-opp.dtsi"
+#include "rk3399-crypto.dtsi"
 
 / {
 	model = "Pine64 Pinebook Pro";

Index: src/sys/arch/arm/dts/rk3399-rockpro64.dts
diff -u src/sys/arch/arm/dts/rk3399-rockpro64.dts:1.10 src/sys/arch/arm/dts/rk3399-rockpro64.dts:1.11
--- src/sys/arch/arm/dts/rk3399-rockpro64.dts:1.10	Thu Dec 19 00:52:29 2019
+++ src/sys/arch/arm/dts/rk3399-rockpro64.dts	Sun May 17 19:57:25 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: rk3399-rockpro64.dts,v 1.10 2019/12/19 00:52:29 jakllsch Exp $ */
+/* $NetBSD: rk3399-rockpro64.dts,v 1.11 2020/05/17 19:57:25 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill 
@@ -27,6 +27,7 @@
  */
 
 #include "../../../external/gpl2/dts/dist/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts"
+#include "rk3399-crypto.dtsi"
 
 / {
 	pwm-fan {
@@ -147,7 +148,6 @@
 		status = "okay";
 	};
 #endif
-
 };
 
  {

Index: src/sys/arch/arm/rockchip/files.rockchip
diff -u src/sys/arch/arm/rockchip/files.rockchip:1.23 src/sys/arch/arm/rockchip/files.rockchip:1.24
--- src/sys/arch/arm/rockchip/files.rockchip:1.23	Thu Dec 19 00:25:58 2019
+++ src/sys/arch/arm/rockchip/files.rockchip	Sun May 17 19:57:25 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.rockchip,v 1.23 2019/12/19 00:25:58 jakllsch Exp $
+#	$NetBSD: files.rockchip,v 1.24 2020/05/17 19:57:25 riastradh Exp $
 #
 # Configuration info for Rockchip family SoCs
 #
@@ -112,6 +112,11 @@ device	rki2s	
 attach  rki2s at fdt with rk_i2s
 filearch/arm/rockchip/rk_i2s.c		rk_i2s
 
+# Crypto engine v1
+device	rkv1crypto
+attach	rkv1crypto at fdt with rk_v1crypto
+file	arch/arm/rockchip/rk_v1crypto.c		rk_v1crypto
+
 # SOC parameters
 defflag	opt_soc.h			SOC_ROCKCHIP
 defflag	opt_soc.h			SOC_RK3328: SOC_ROCKCHIP

Index: src/sys/arch/arm/rockchip/rk3399_cru.c
diff -u src/sys/arch/arm/rockchip/rk3399_cru.c:1.19 src/sys/arch/arm/rockchip/rk3399_cru.c:1.20
--- src/sys/arch/arm/rockchip/rk3399_cru.c:1.19	Sat Jan  4 13:32:32 2020
+++ src/sys/arch/arm/rockchip/rk3399_cru.c	Sun May 17 19:57:25 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: rk3399_cru.c,v 1.19 2020/01/04 13:32:32 jmcneill Exp $ */
+/* $NetBSD: rk3399_cru.c,v 1.20 2020/05/17 19:57:25 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: rk3399_cru.c,v 1.19 2020/01/04 13:32:32 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: rk3399_cru.c,v 1.20 2020/05/17 19:57:25 riastradh Exp $");
 
 #include 
 #include 
@@ -847,6 +847,27 @@ static struct rk_cru_clk rk3399_cru_clks
 		 0),
 	RK_MUX(RK3399_SCLK_PCIE_CORE, "clk_pcie_core", mux_pciecore_cru_phy_parents, CLKSEL_CON(18), __BIT(7)),
 
+	/* Crypto */
+	RK_COMPOSITE(RK3399_SCLK_CRYPTO0, "clk_crypto0", mux_pll_src_cpll_gpll_ppll_parents,
+		 CLKSEL_CON(24),	/* muxdiv_reg */
+		 __BITS(7,6),	/* mux_mask */
+		 __BITS(4,0),	/* div_mask */
+		

CVS commit: src/sys/fs/tmpfs

2020-05-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun May 17 19:43:31 UTC 2020

Modified Files:
src/sys/fs/tmpfs: tmpfs_vnops.c

Log Message:
Minor correction to previous.


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/sys/fs/tmpfs/tmpfs_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/fs/tmpfs/tmpfs_vnops.c
diff -u src/sys/fs/tmpfs/tmpfs_vnops.c:1.139 src/sys/fs/tmpfs/tmpfs_vnops.c:1.140
--- src/sys/fs/tmpfs/tmpfs_vnops.c:1.139	Sun May 17 19:39:15 2020
+++ src/sys/fs/tmpfs/tmpfs_vnops.c	Sun May 17 19:43:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_vnops.c,v 1.139 2020/05/17 19:39:15 ad Exp $	*/
+/*	$NetBSD: tmpfs_vnops.c,v 1.140 2020/05/17 19:43:31 ad Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007, 2020 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.139 2020/05/17 19:39:15 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.140 2020/05/17 19:43:31 ad Exp $");
 
 #include 
 #include 
@@ -1201,7 +1201,7 @@ tmpfs_getpages(void *v)
 	 * VI_DEADCHECK is set with vmobjlock held.
 	 */
 	iflag = atomic_load_relaxed(>v_iflag);
-	if (__predict_false((iflag & VI_DEADCHECK) != 0) {
+	if (__predict_false((iflag & VI_DEADCHECK) != 0)) {
 		mutex_enter(vp->v_interlock);
 		error = vdead_check(vp, VDEAD_NOWAIT);
 		mutex_exit(vp->v_interlock);



CVS commit: src/sys/fs/tmpfs

2020-05-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun May 17 19:39:15 UTC 2020

Modified Files:
src/sys/fs/tmpfs: tmpfs.h tmpfs_subr.c tmpfs_vnops.c

Log Message:
PR kern/55268: tmpfs is slow

tmpfs_getpages(): handle the PGO_LOCKED case and implement lazy update of
atime/mtime.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/fs/tmpfs/tmpfs.h
cvs rdiff -u -r1.111 -r1.112 src/sys/fs/tmpfs/tmpfs_subr.c
cvs rdiff -u -r1.138 -r1.139 src/sys/fs/tmpfs/tmpfs_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/fs/tmpfs/tmpfs.h
diff -u src/sys/fs/tmpfs/tmpfs.h:1.55 src/sys/fs/tmpfs/tmpfs.h:1.56
--- src/sys/fs/tmpfs/tmpfs.h:1.55	Thu Apr 19 21:50:09 2018
+++ src/sys/fs/tmpfs/tmpfs.h	Sun May 17 19:39:15 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: tmpfs.h,v 1.55 2018/04/19 21:50:09 christos Exp $	*/
+/*	$NetBSD: tmpfs.h,v 1.56 2020/05/17 19:39:15 ad Exp $	*/
 
 /*
- * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
+ * Copyright (c) 2005, 2006, 2007, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -112,10 +112,12 @@ typedef struct tmpfs_node {
 	mode_t			tn_mode;
 	int			tn_flags;
 	nlink_t			tn_links;
+	unsigned		tn_tflags;
 	struct timespec		tn_atime;
 	struct timespec		tn_mtime;
 	struct timespec		tn_ctime;
 	struct timespec		tn_birthtime;
+	kmutex_t		tn_timelock;
 
 	/* Head of byte-level lock list (used by tmpfs_advlock). */
 	struct lockf *		tn_lockf;
@@ -274,6 +276,8 @@ int		tmpfs_chtimes(vnode_t *, const stru
 		const struct timespec *, const struct timespec *, int,
 		kauth_cred_t, lwp_t *);
 void		tmpfs_update(vnode_t *, unsigned);
+void		tmpfs_update_locked(vnode_t *, unsigned);
+void		tmpfs_update_lazily(vnode_t *, unsigned);
 
 /*
  * Prototypes for tmpfs_mem.c.

Index: src/sys/fs/tmpfs/tmpfs_subr.c
diff -u src/sys/fs/tmpfs/tmpfs_subr.c:1.111 src/sys/fs/tmpfs/tmpfs_subr.c:1.112
--- src/sys/fs/tmpfs/tmpfs_subr.c:1.111	Sat May 16 18:31:49 2020
+++ src/sys/fs/tmpfs/tmpfs_subr.c	Sun May 17 19:39:15 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: tmpfs_subr.c,v 1.111 2020/05/16 18:31:49 christos Exp $	*/
+/*	$NetBSD: tmpfs_subr.c,v 1.112 2020/05/17 19:39:15 ad Exp $	*/
 
 /*
- * Copyright (c) 2005-2013 The NetBSD Foundation, Inc.
+ * Copyright (c) 2005-2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.111 2020/05/16 18:31:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.112 2020/05/17 19:39:15 ad Exp $");
 
 #include 
 #include 
@@ -230,10 +230,12 @@ tmpfs_newvnode(struct mount *mp, struct 
 	node->tn_flags = 0;
 	node->tn_lockf = NULL;
 
+	node->tn_tflags = 0;
 	vfs_timestamp(>tn_atime);
 	node->tn_birthtime = node->tn_atime;
 	node->tn_ctime = node->tn_atime;
 	node->tn_mtime = node->tn_atime;
+	mutex_init(>tn_timelock, MUTEX_DEFAULT, IPL_NONE);
 
 	if (dvp == NULL) {
 		KASSERT(vap->va_uid != VNOVAL && vap->va_gid != VNOVAL);
@@ -350,6 +352,7 @@ tmpfs_free_node(tmpfs_mount_t *tmp, tmpf
 	KASSERT(node->tn_vnode == NULL);
 	KASSERT(node->tn_links == 0);
 
+	mutex_destroy(>tn_timelock);
 	tmpfs_node_put(tmp, node);
 }
 
@@ -1167,29 +1170,35 @@ tmpfs_chtimes(vnode_t *vp, const struct 
 	if (error)
 		return error;
 
+	mutex_enter(>tn_timelock);
 	if (atime->tv_sec != VNOVAL) {
+		atomic_and_uint(>tn_tflags, ~TMPFS_UPDATE_ATIME);
 		node->tn_atime = *atime;
 	}
 	if (mtime->tv_sec != VNOVAL) {
+		atomic_and_uint(>tn_tflags, ~TMPFS_UPDATE_MTIME);
 		node->tn_mtime = *mtime;
 	}
 	if (btime->tv_sec != VNOVAL) {
 		node->tn_birthtime = *btime;
 	}
+	mutex_exit(>tn_timelock);
 	VN_KNOTE(vp, NOTE_ATTRIB);
 	return 0;
 }
 
 /*
- * tmpfs_update: update the timestamps as indicated by the flags.
+ * tmpfs_update_locked: update the timestamps as indicated by the flags.
  */
 void
-tmpfs_update(vnode_t *vp, unsigned tflags)
+tmpfs_update_locked(vnode_t *vp, unsigned tflags)
 {
 	tmpfs_node_t *node = VP_TO_TMPFS_NODE(vp);
 	struct timespec nowtm;
 
-	if (tflags == 0) {
+	KASSERT(mutex_owned(>tn_timelock));
+
+	if ((tflags |= atomic_swap_uint(>tn_tflags, 0)) == 0) {
 		return;
 	}
 	vfs_timestamp();
@@ -1204,3 +1213,36 @@ tmpfs_update(vnode_t *vp, unsigned tflag
 		node->tn_ctime = nowtm;
 	}
 }
+
+/*
+ * tmpfs_update: update the timestamps as indicated by the flags.
+ */
+void
+tmpfs_update(vnode_t *vp, unsigned tflags)
+{
+	tmpfs_node_t *node = VP_TO_TMPFS_NODE(vp);
+
+	if ((tflags | atomic_load_relaxed(>tn_tflags)) == 0) {
+		return;
+	}
+
+	mutex_enter(>tn_timelock);
+	tmpfs_update_locked(vp, tflags);
+	mutex_exit(>tn_timelock);
+}
+
+/*
+ * tmpfs_update_lazily: schedule a deferred timestamp update.
+ */
+void
+tmpfs_update_lazily(vnode_t *vp, unsigned tflags)
+{
+	tmpfs_node_t *node = VP_TO_TMPFS_NODE(vp);
+	

CVS commit: src/sys

2020-05-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun May 17 19:38:17 UTC 2020

Modified Files:
src/sys/miscfs/genfs: genfs_io.c
src/sys/nfs: nfs_bio.c
src/sys/uvm: uvm_aobj.c uvm_fault.c uvm_loan.c uvm_page.h uvm_pager.h
uvm_pdpolicy.h uvm_pdpolicy_clock.c uvm_pdpolicy_clockpro.c

Log Message:
Start trying to reduce cache misses on vm_page during fault processing.

- Make PGO_LOCKED getpages imply PGO_NOBUSY and remove the latter.  Mark
  pages busy only when there's actually I/O to do.

- When doing COW on a uvm_object, don't mess with neighbouring pages.  In
  all likelyhood they're already entered.

- Don't mess with neighbouring VAs that have existing mappings as replacing
  those mappings with same can be quite costly.

- Don't enqueue pages for neighbour faults unless not enqueued already, and
  don't activate centre pages unless uvmpdpol says its useful.

Also:

- Make PGO_LOCKED getpages on UAOs work more like vnodes: do gang lookup in
  the radix tree, and don't allocate new pages.

- Fix many assertion failures around faults/loans with tmpfs.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/miscfs/genfs/genfs_io.c
cvs rdiff -u -r1.196 -r1.197 src/sys/nfs/nfs_bio.c
cvs rdiff -u -r1.140 -r1.141 src/sys/uvm/uvm_aobj.c
cvs rdiff -u -r1.226 -r1.227 src/sys/uvm/uvm_fault.c
cvs rdiff -u -r1.100 -r1.101 src/sys/uvm/uvm_loan.c
cvs rdiff -u -r1.102 -r1.103 src/sys/uvm/uvm_page.h
cvs rdiff -u -r1.47 -r1.48 src/sys/uvm/uvm_pager.h
cvs rdiff -u -r1.7 -r1.8 src/sys/uvm/uvm_pdpolicy.h
cvs rdiff -u -r1.36 -r1.37 src/sys/uvm/uvm_pdpolicy_clock.c
cvs rdiff -u -r1.25 -r1.26 src/sys/uvm/uvm_pdpolicy_clockpro.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/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.95 src/sys/miscfs/genfs/genfs_io.c:1.96
--- src/sys/miscfs/genfs/genfs_io.c:1.95	Sun Mar 22 18:32:41 2020
+++ src/sys/miscfs/genfs/genfs_io.c	Sun May 17 19:38:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.95 2020/03/22 18:32:41 ad Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.96 2020/05/17 19:38:16 ad Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.95 2020/03/22 18:32:41 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.96 2020/05/17 19:38:16 ad Exp $");
 
 #include 
 #include 
@@ -128,12 +128,12 @@ genfs_getpages(void *v)
 
 	/*
 	 * the object must be locked.  it can only be a read lock when
-	 * processing a read fault with PGO_LOCKED | PGO_NOBUSY.
+	 * processing a read fault with PGO_LOCKED.
 	 */
 
 	KASSERT(rw_lock_held(uobj->vmobjlock));
 	KASSERT(rw_write_held(uobj->vmobjlock) ||
-	   ((~flags & (PGO_LOCKED | PGO_NOBUSY)) == 0 && !memwrite));
+	   ((flags & PGO_LOCKED) != 0 && !memwrite));
 
 #ifdef DIAGNOSTIC
 	if ((flags & PGO_JOURNALLOCKED) && vp->v_mount->mnt_wapbl)
@@ -237,9 +237,8 @@ startover:
 #endif /* defined(DEBUG) */
  		nfound = uvn_findpages(uobj, origoffset, ,
 		ap->a_m, NULL,
-		UFP_NOWAIT | UFP_NOALLOC |
-		(memwrite ? UFP_NORDONLY : 0) |
-		((flags & PGO_NOBUSY) != 0 ? UFP_NOBUSY : 0));
+		UFP_NOWAIT | UFP_NOALLOC | UFP_NOBUSY |
+		(memwrite ? UFP_NORDONLY : 0));
 		KASSERT(npages == *ap->a_count);
 		if (nfound == 0) {
 			error = EBUSY;
@@ -250,10 +249,6 @@ startover:
 		 * the file behind us.
 		 */
 		if (!genfs_node_rdtrylock(vp)) {
-			if ((flags & PGO_NOBUSY) == 0) {
-genfs_rel_pages(ap->a_m, npages);
-			}
-
 			/*
 			 * restore the array.
 			 */

Index: src/sys/nfs/nfs_bio.c
diff -u src/sys/nfs/nfs_bio.c:1.196 src/sys/nfs/nfs_bio.c:1.197
--- src/sys/nfs/nfs_bio.c:1.196	Thu Apr 23 21:47:08 2020
+++ src/sys/nfs/nfs_bio.c	Sun May 17 19:38:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_bio.c,v 1.196 2020/04/23 21:47:08 ad Exp $	*/
+/*	$NetBSD: nfs_bio.c,v 1.197 2020/05/17 19:38:16 ad Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.196 2020/04/23 21:47:08 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_bio.c,v 1.197 2020/05/17 19:38:16 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -1260,7 +1260,6 @@ nfs_getpages(void *v)
 	bool v3 = NFS_ISV3(vp);
 	bool write = (ap->a_access_type & VM_PROT_WRITE) != 0;
 	bool locked = (ap->a_flags & PGO_LOCKED) != 0;
-	bool nobusy = (ap->a_flags & PGO_NOBUSY);
 
 	/*
 	 * XXX NFS wants to modify the pages below and that can't be done
@@ -1348,14 +1347,10 @@ nfs_getpages(void *v)
 			if (!mutex_tryenter(>n_commitlock)) {
 
 /*
- * Since PGO_LOCKED is set, we need to unbusy
- * all pages fetched by genfs_getpages() above,
  * tell the caller that there are no pages
  * available and put back original pgs array.
  */
 
-if (nobusy == false)
-	uvm_page_unbusy(pgs, npages);
 *ap->a_count = 0;
 memcpy(pgs, opgs,
 npages * sizeof(struct 

CVS commit: src/usr.bin/rump_allserver

2020-05-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 17 19:37:16 UTC 2020

Modified Files:
src/usr.bin/rump_allserver: Makefile

Log Message:
fix sun2 build


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/rump_allserver/Makefile

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/rump_allserver/Makefile
diff -u src/usr.bin/rump_allserver/Makefile:1.12 src/usr.bin/rump_allserver/Makefile:1.13
--- src/usr.bin/rump_allserver/Makefile:1.12	Sun Mar  1 13:30:05 2020
+++ src/usr.bin/rump_allserver/Makefile	Sun May 17 15:37:15 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.12 2020/03/01 18:30:05 christos Exp $
+#	$NetBSD: Makefile,v 1.13 2020/05/17 19:37:15 christos Exp $
 #
 
 PROG=	rump_allserver
@@ -12,6 +12,6 @@ RUMPTOP=${.CURDIR}/../../sys/rump
 .include "${RUMPTOP}/net/Makefile.rumpnetcomp"
 
 LDADD+=	${RUMPDEVLDADD} ${RUMPFSLDADD} ${RUMPKERNLDADD} ${RUMPNETLDADD}
-LDADD+= -lrumpdev -lrumpnet -lrumpvfs -lrump -lrumpvfs -lrump -lrumpuser -lpthread
+LDADD+= -lrumpdev -lrumpnet -lrumpvfs -lrump -lrumpvfs -lrumpvfs_nofifofs -lrump -lrumpuser -lpthread
 
 .include 



CVS commit: src/sys/kern

2020-05-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun May 17 19:34:07 UTC 2020

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

Log Message:
Reorganise the locking and allocation of fstrans_lwp_info slightly, to
reduce contention.  "please go ahead" hannken@.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/kern/vfs_trans.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/vfs_trans.c
diff -u src/sys/kern/vfs_trans.c:1.62 src/sys/kern/vfs_trans.c:1.63
--- src/sys/kern/vfs_trans.c:1.62	Wed May 13 09:21:30 2020
+++ src/sys/kern/vfs_trans.c	Sun May 17 19:34:07 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: vfs_trans.c,v 1.62 2020/05/13 09:21:30 hannken Exp $	*/
+/*	$NetBSD: vfs_trans.c,v 1.63 2020/05/17 19:34:07 ad Exp $	*/
 
 /*-
- * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * Copyright (c) 2007, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,v 1.62 2020/05/13 09:21:30 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,v 1.63 2020/05/17 19:34:07 ad Exp $");
 
 /*
  * File system transaction operations.
@@ -50,6 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -85,14 +86,17 @@ struct fstrans_mount_info {
 	struct lwp *fmi_owner;
 };
 
-static kmutex_t vfs_suspend_lock;	/* Serialize suspensions. */
-static kmutex_t fstrans_lock;		/* Fstrans big lock. */
-static kmutex_t fstrans_mount_lock;	/* Fstrans mount big lock. */
+static kmutex_t vfs_suspend_lock	/* Serialize suspensions. */
+__cacheline_aligned;
+static kmutex_t fstrans_lock		/* Fstrans big lock. */
+__cacheline_aligned;
 static kcondvar_t fstrans_state_cv;	/* Fstrans or cow state changed. */
 static kcondvar_t fstrans_count_cv;	/* Fstrans or cow count changed. */
 static pserialize_t fstrans_psz;	/* Pserialize state. */
 static LIST_HEAD(fstrans_lwp_head, fstrans_lwp_info) fstrans_fli_head;
 	/* List of all fstrans_lwp_info. */
+static pool_cache_t fstrans_lwp_cache;	/* Cache of fstrans_lwp_info. */
+
 static int fstrans_gone_count;		/* Number of fstrans_mount_info gone. */
 
 static void fstrans_mount_dtor(struct fstrans_mount_info *);
@@ -100,6 +104,8 @@ static void fstrans_clear_lwp_info(void)
 static inline struct fstrans_lwp_info *
 fstrans_get_lwp_info(struct mount *, bool);
 static struct fstrans_lwp_info *fstrans_alloc_lwp_info(struct mount *);
+static int fstrans_lwp_pcc(void *, void *, int);
+static void fstrans_lwp_pcd(void *, void *);
 static inline int _fstrans_start(struct mount *, enum fstrans_lock_type, int);
 static bool grant_lock(const struct fstrans_mount_info *,
 const enum fstrans_lock_type);
@@ -125,12 +131,12 @@ fstrans_debug_mount(struct mount *mp)
 {
 	struct fstrans_debug_mount *fdm, *new;
 
-	KASSERT(mutex_owned(_mount_lock));
+	KASSERT(mutex_owned(_lock));
 
-	mutex_exit(_mount_lock);
+	mutex_exit(_lock);
 	new = kmem_alloc(sizeof(*new), KM_SLEEP);
 	new->fdm_mount = mp;
-	mutex_enter(_mount_lock);
+	mutex_enter(_lock);
 
 	SLIST_FOREACH(fdm, _debug_mount_head, fdm_list)
 		KASSERT(fdm->fdm_mount != mp);
@@ -142,7 +148,7 @@ fstrans_debug_unmount(struct mount *mp)
 {
 	struct fstrans_debug_mount *fdm;
 
-	KASSERT(mutex_owned(_mount_lock));
+	KASSERT(mutex_owned(_lock));
 
 	SLIST_FOREACH(fdm, _debug_mount_head, fdm_list)
 		if (fdm->fdm_mount == mp)
@@ -158,7 +164,7 @@ fstrans_debug_validate_mount(struct moun
 {
 	struct fstrans_debug_mount *fdm;
 
-	KASSERT(mutex_owned(_mount_lock));
+	KASSERT(mutex_owned(_lock));
 
 	SLIST_FOREACH(fdm, _debug_mount_head, fdm_list)
 		if (fdm->fdm_mount == mp)
@@ -183,11 +189,45 @@ fstrans_init(void)
 
 	mutex_init(_suspend_lock, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(_lock, MUTEX_DEFAULT, IPL_NONE);
-	mutex_init(_mount_lock, MUTEX_DEFAULT, IPL_NONE);
 	cv_init(_state_cv, "fstchg");
 	cv_init(_count_cv, "fstcnt");
 	fstrans_psz = pserialize_create();
 	LIST_INIT(_fli_head);
+	fstrans_lwp_cache = pool_cache_init(sizeof(struct fstrans_lwp_info),
+	coherency_unit, 0, 0, "fstlwp", NULL, IPL_NONE,
+	fstrans_lwp_pcc, fstrans_lwp_pcd, NULL);
+	KASSERT(fstrans_lwp_cache != NULL);
+}
+
+/*
+ * pool_cache constructor for fstrans_lwp_info.  Updating the global list
+ * produces cache misses on MP.  Minimise by keeping free entries on list.
+ */
+int
+fstrans_lwp_pcc(void *arg, void *obj, int flags)
+{
+	struct fstrans_lwp_info *fli = obj;
+
+	memset(fli, 0, sizeof(*fli));
+
+	mutex_enter(_lock);
+	LIST_INSERT_HEAD(_fli_head, fli, fli_list);
+	mutex_exit(_lock);
+
+	return 0;
+}
+
+/*
+ * pool_cache destructor
+ */
+void
+fstrans_lwp_pcd(void *arg, void *obj)
+{
+	struct fstrans_lwp_info *fli = obj;
+
+	mutex_enter(_lock);
+	LIST_REMOVE(fli, fli_list);
+	mutex_exit(_lock);
 }
 
 /*
@@ -198,6 +238,10 @@ 

CVS commit: src/usr.sbin/puffs

2020-05-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 17 18:59:02 UTC 2020

Modified Files:
src/usr.sbin/puffs: Makefile.inc

Log Message:
reverse the order for sun2


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/puffs/Makefile.inc

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

Modified files:

Index: src/usr.sbin/puffs/Makefile.inc
diff -u src/usr.sbin/puffs/Makefile.inc:1.16 src/usr.sbin/puffs/Makefile.inc:1.17
--- src/usr.sbin/puffs/Makefile.inc:1.16	Sat May 16 08:30:35 2020
+++ src/usr.sbin/puffs/Makefile.inc	Sun May 17 14:59:02 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.16 2020/05/16 12:30:35 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.17 2020/05/17 18:59:02 christos Exp $
 
 WARNS?=	4
 
@@ -43,7 +43,7 @@ LDADD+=		-lrumpfs_${MOUNTNAME}
 LDADD+=		-lrumpdev_disk -lrumpdev
 .endif
 
-LDADD+=		-lp2k -lukfs -lrumpvfs_nofifofs -lrumpvfs -lrump -lrumpuser -lpuffs -lutil
+LDADD+=		-lp2k -lukfs -lrumpvfs -lrumpvfs_nofifofs -lrump -lrumpuser -lpuffs -lutil
 LDADD+=		-lpthread
 
 DPADD+=		${LIBP2K} ${LIBUKFS} ${LIBRUMPVFS} ${LIBRUMP} ${LIBRUMPUSER}



CVS commit: src/tests

2020-05-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 17 18:52:43 UTC 2020

Modified Files:
src/tests: Makefile.inc

Log Message:
Fix sun2 build. Still there are some duplicate symbols in the rump libraries
that make this awkward.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/Makefile.inc

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

Modified files:

Index: src/tests/Makefile.inc
diff -u src/tests/Makefile.inc:1.8 src/tests/Makefile.inc:1.9
--- src/tests/Makefile.inc:1.8	Sun May 17 14:25:11 2020
+++ src/tests/Makefile.inc	Sun May 17 14:52:43 2020
@@ -1,12 +1,11 @@
-# $NetBSD: Makefile.inc,v 1.8 2020/05/17 18:25:11 christos Exp $
+# $NetBSD: Makefile.inc,v 1.9 2020/05/17 18:52:43 christos Exp $
 WARNS ?= 4
 CWARNFLAGS+= -Wno-missing-noreturn
 TOOLSSRCDIR:= ${.PARSEDIR}
 CPPFLAGS+= -I${TOOLSSRCDIR}
 .if ${RUMPFIFO:Uno} == "yes"
-LIBRUMPFIFO = -lrumpvfs_fifofs -lrumpnet_local -lrumpnet_net -lrumpnet
-.else
-LIBRUMPFIFO = -lrumpvfs_nofifofs 
+LIBRUMPFIFO_PRE = -lrumpvfs_fifofs -lrumpnet_local -lrumpnet_net -lrumpnet
 .endif
-LIBRUMPBASE = -lrumpvfs -lrump -lrumpvfs ${LIBRUMPFIFO} -lrumpuser -lrump -lpthread
+LIBRUMPFIFO = -lrumpvfs_nofifofs 
+LIBRUMPBASE = ${LIBRUMPFIFO_PRE} -lrumpvfs -lrump -lrumpvfs -lrumpvfs_nofifofs -lrumpuser -lrump -lpthread
 



CVS commit: src/tests

2020-05-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 17 18:25:11 UTC 2020

Modified Files:
src/tests: Makefile.inc

Log Message:
put librumpvfs_nofifofs after librumpvfs for the benefit of sun2


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/Makefile.inc

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

Modified files:

Index: src/tests/Makefile.inc
diff -u src/tests/Makefile.inc:1.7 src/tests/Makefile.inc:1.8
--- src/tests/Makefile.inc:1.7	Fri May 15 19:32:28 2020
+++ src/tests/Makefile.inc	Sun May 17 14:25:11 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.7 2020/05/15 23:32:28 christos Exp $
+# $NetBSD: Makefile.inc,v 1.8 2020/05/17 18:25:11 christos Exp $
 WARNS ?= 4
 CWARNFLAGS+= -Wno-missing-noreturn
 TOOLSSRCDIR:= ${.PARSEDIR}
@@ -8,5 +8,5 @@ LIBRUMPFIFO = -lrumpvfs_fifofs -lrumpnet
 .else
 LIBRUMPFIFO = -lrumpvfs_nofifofs 
 .endif
-LIBRUMPBASE = -lrumpvfs -lrump ${LIBRUMPFIFO} -lrumpvfs -lrumpuser -lrump -lpthread
+LIBRUMPBASE = -lrumpvfs -lrump -lrumpvfs ${LIBRUMPFIFO} -lrumpuser -lrump -lpthread
 



CVS commit: src/sys/uvm

2020-05-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun May 17 17:12:28 UTC 2020

Modified Files:
src/sys/uvm: uvm_page.c

Log Message:
Don't set PG_AOBJ on a page unless UVM_OBJ_IS_AOBJ(), otherwise it can
catch pages from e.g. uvm_loanzero_object.


To generate a diff of this commit:
cvs rdiff -u -r1.235 -r1.236 src/sys/uvm/uvm_page.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/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.235 src/sys/uvm/uvm_page.c:1.236
--- src/sys/uvm/uvm_page.c:1.235	Sun May 17 15:11:57 2020
+++ src/sys/uvm/uvm_page.c	Sun May 17 17:12:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.235 2020/05/17 15:11:57 ad Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.236 2020/05/17 17:12:28 ad Exp $	*/
 
 /*-
  * Copyright (c) 2019, 2020 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.235 2020/05/17 15:11:57 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.236 2020/05/17 17:12:28 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvm.h"
@@ -220,10 +220,8 @@ uvm_pageinsert_object(struct uvm_object 
 	if ((pg->flags & PG_STAT) != 0) {
 		/* Cannot use uvm_pagegetdirty(): not yet in radix tree. */
 		const unsigned int status = pg->flags & (PG_CLEAN | PG_DIRTY);
-		const bool isaobj = (pg->flags & PG_AOBJ) != 0;
 
-		if (!isaobj) {
-			KASSERT((pg->flags & PG_FILE) != 0);
+		if ((pg->flags & PG_FILE) != 0) {
 			if (uobj->uo_npages == 0) {
 struct vnode *vp = (struct vnode *)uobj;
 mutex_enter(vp->v_interlock);
@@ -285,10 +283,8 @@ uvm_pageremove_object(struct uvm_object 
 	if ((pg->flags & PG_STAT) != 0) {
 		/* Cannot use uvm_pagegetdirty(): no longer in radix tree. */
 		const unsigned int status = pg->flags & (PG_CLEAN | PG_DIRTY);
-		const bool isaobj = (pg->flags & PG_AOBJ) != 0;
 
-		if (!isaobj) {
-			KASSERT((pg->flags & PG_FILE) != 0);
+		if ((pg->flags & PG_FILE) != 0) {
 			if (uobj->uo_npages == 1) {
 struct vnode *vp = (struct vnode *)uobj;
 mutex_enter(vp->v_interlock);
@@ -1336,7 +1332,7 @@ uvm_pagealloc_strat(struct uvm_object *o
 		 */
 		if (UVM_OBJ_IS_VNODE(obj)) {
 			pg->flags |= PG_FILE;
-		} else {
+		} else if (UVM_OBJ_IS_AOBJ(obj)) {
 			pg->flags |= PG_AOBJ;
 		}
 		uvm_pageinsert_object(obj, pg);



CVS commit: src/sys/dev/pci

2020-05-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun May 17 16:01:06 UTC 2020

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

Log Message:
pool_cache_prime, not pool_cache_lowat, as suggested by nick.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/hifn7751.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/hifn7751.c
diff -u src/sys/dev/pci/hifn7751.c:1.73 src/sys/dev/pci/hifn7751.c:1.74
--- src/sys/dev/pci/hifn7751.c:1.73	Sun May 17 15:42:10 2020
+++ src/sys/dev/pci/hifn7751.c	Sun May 17 16:01:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hifn7751.c,v 1.73 2020/05/17 15:42:10 riastradh Exp $	*/
+/*	$NetBSD: hifn7751.c,v 1.74 2020/05/17 16:01:06 riastradh Exp $	*/
 /*	$OpenBSD: hifn7751.c,v 1.179 2020/01/11 21:34:03 cheloha Exp $	*/
 
 /*
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.73 2020/05/17 15:42:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.74 2020/05/17 16:01:06 riastradh Exp $");
 
 #include 
 #include 
@@ -405,7 +405,7 @@ hifn_attach(device_t parent, device_t se
 	sc->sc_cmd_cache = pool_cache_init(sizeof(struct hifn_command),
 	0, 0, 0, "hifncmd", NULL, IPL_VM,
 	_cmd_ctor, _cmd_dtor, sc);
-	pool_cache_setlowat(sc->sc_cmd_cache, sc->sc_maxses);
+	pool_cache_prime(sc->sc_cmd_cache, sc->sc_maxses);
 
 	WRITE_REG_0(sc, HIFN_0_PUCNFG,
 	READ_REG_0(sc, HIFN_0_PUCNFG) | HIFN_PUCNFG_CHIPID);



CVS commit: src/sys/dev/pci

2020-05-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun May 17 15:42:10 UTC 2020

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

Log Message:
Missed a spot.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/pci/hifn7751.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/hifn7751.c
diff -u src/sys/dev/pci/hifn7751.c:1.72 src/sys/dev/pci/hifn7751.c:1.73
--- src/sys/dev/pci/hifn7751.c:1.72	Sun May 17 00:54:05 2020
+++ src/sys/dev/pci/hifn7751.c	Sun May 17 15:42:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hifn7751.c,v 1.72 2020/05/17 00:54:05 riastradh Exp $	*/
+/*	$NetBSD: hifn7751.c,v 1.73 2020/05/17 15:42:10 riastradh Exp $	*/
 /*	$OpenBSD: hifn7751.c,v 1.179 2020/01/11 21:34:03 cheloha Exp $	*/
 
 /*
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.72 2020/05/17 00:54:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.73 2020/05/17 15:42:10 riastradh Exp $");
 
 #include 
 #include 
@@ -2409,9 +2409,9 @@ hifn_process(void *arg, struct cryptop *
 		if (hifn_debug)
 			printf("%s: requeue request\n", device_xname(sc->sc_dv));
 #endif
-		free(cmd, M_DEVBUF);
 		sc->sc_needwakeup |= CRYPTO_SYMQ;
 		mutex_spin_exit(>sc_mtx);
+		pool_cache_put(sc->sc_cmd_cache, cmd);
 		return (err);
 	}
 



CVS commit: src/distrib/sets/lists

2020-05-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun May 17 15:28:27 UTC 2020

Modified Files:
src/distrib/sets/lists/debug: md.amd64
src/distrib/sets/lists/tests: md.amd64 module.mi

Log Message:
Fix lists for RUMP-less builds


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/distrib/sets/lists/debug/md.amd64
cvs rdiff -u -r1.11 -r1.12 src/distrib/sets/lists/tests/md.amd64
cvs rdiff -u -r1.18 -r1.19 src/distrib/sets/lists/tests/module.mi

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/md.amd64
diff -u src/distrib/sets/lists/debug/md.amd64:1.109 src/distrib/sets/lists/debug/md.amd64:1.110
--- src/distrib/sets/lists/debug/md.amd64:1.109	Mon May 11 21:51:25 2020
+++ src/distrib/sets/lists/debug/md.amd64	Sun May 17 15:28:27 2020
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.109 2020/05/11 21:51:25 yhardy Exp $
+# $NetBSD: md.amd64,v 1.110 2020/05/17 15:28:27 martin Exp $
 ./usr/lib/i386/12.202++_g.a			comp-c-debuglib		debuglib,compat,12.202xx
 ./usr/lib/i386/libi386_g.a			comp-c-debuglib		debuglib,compat
 ./usr/lib/i386/libiberty_g.a			comp-obsolete		obsolete
@@ -28,4 +28,4 @@
 ./usr/libdata/debug/usr/tests/lib/libi386/t_user_ldt.debug	tests-lib-debug	debug,atf,compat
 ./usr/libdata/debug/usr/tests/lib/libnvmm/h_io_assist.debug	tests-lib-debug	debug,atf
 ./usr/libdata/debug/usr/tests/lib/libnvmm/h_mem_assist.debug	tests-lib-debug	debug,atf
-./usr/libdata/debug/usr/tests/modules/t_x86_pte.debug	tests-sys-debug		debug,atf
+./usr/libdata/debug/usr/tests/modules/t_x86_pte.debug	tests-sys-debug		debug,atf,rump

Index: src/distrib/sets/lists/tests/md.amd64
diff -u src/distrib/sets/lists/tests/md.amd64:1.11 src/distrib/sets/lists/tests/md.amd64:1.12
--- src/distrib/sets/lists/tests/md.amd64:1.11	Mon May 11 21:51:25 2020
+++ src/distrib/sets/lists/tests/md.amd64	Sun May 17 15:28:27 2020
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.11 2020/05/11 21:51:25 yhardy Exp $
+# $NetBSD: md.amd64,v 1.12 2020/05/17 15:28:27 martin Exp $
 ./usr/tests/kernel/arch/x86/Atffile		tests-obsolete	obsolete
 ./usr/tests/kernel/arch/x86/Kyuafile		tests-obsolete	obsolete
 ./usr/tests/kernel/arch/x86/t_ptrace_wait	tests-obsolete	obsolete
@@ -12,6 +12,6 @@
 ./usr/tests/lib/libnvmm/t_io_assist		tests-lib-tests	compattestfile,atf
 ./usr/tests/lib/libnvmm/h_mem_assist		tests-lib-tests	compattestfile,atf
 ./usr/tests/lib/libnvmm/t_mem_assist		tests-lib-tests	compattestfile,atf
-./usr/tests/modules/t_x86_pte			tests-sys-tests	atf,kmod
-./usr/tests/modules/x86_pte_tester		tests-sys-tests	atf,kmod
-./usr/tests/modules/x86_pte_tester/x86_pte_tester.kmod tests-sys-tests	atf,kmod
+./usr/tests/modules/t_x86_pte			tests-sys-tests	atf,kmod,rump
+./usr/tests/modules/x86_pte_tester		tests-sys-tests	atf,kmod,rump
+./usr/tests/modules/x86_pte_tester/x86_pte_tester.kmod tests-sys-tests	atf,kmod,rump

Index: src/distrib/sets/lists/tests/module.mi
diff -u src/distrib/sets/lists/tests/module.mi:1.18 src/distrib/sets/lists/tests/module.mi:1.19
--- src/distrib/sets/lists/tests/module.mi:1.18	Sat Apr  6 03:06:24 2019
+++ src/distrib/sets/lists/tests/module.mi	Sun May 17 15:28:27 2020
@@ -1,4 +1,4 @@
-# $NetBSD: module.mi,v 1.18 2019/04/06 03:06:24 thorpej Exp $
+# $NetBSD: module.mi,v 1.19 2020/05/17 15:28:27 martin Exp $
 #
 # These are only made for ports doing modules.
 #
@@ -17,7 +17,7 @@
 ./usr/tests/modules/k_uvm/k_uvm.kmod		tests-sys-tests		atf,rump
 ./usr/tests/modules/t_abi_uvm			tests-sys-tests		atf,rump
 ./usr/tests/modules/t_builtin			tests-sys-tests		atf,rump
-./usr/tests/modules/t_kcov			tests-sys-tests		atf
+./usr/tests/modules/t_kcov			tests-sys-tests		atf,rump
 ./usr/tests/modules/t_klua_pr_52864 		tests-sys-tests		atf,rump
 ./usr/tests/modules/t_modctl			tests-sys-tests		atf,rump
 ./usr/tests/modules/t_modload			tests-sys-tests		atf,rump



CVS commit: src/sys/uvm

2020-05-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun May 17 15:11:57 UTC 2020

Modified Files:
src/sys/uvm: uvm.h uvm_page.c

Log Message:
- If the hardware provided NUMA info, then use it to decide how to set up
  the allocator's buckets, instead of doing round robin distribution.  There
  are open questions here but this is better than doing nothing.

- Kernel reserve pages are for the kernel not realtime threads.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/uvm/uvm.h
cvs rdiff -u -r1.234 -r1.235 src/sys/uvm/uvm_page.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/uvm.h
diff -u src/sys/uvm/uvm.h:1.76 src/sys/uvm/uvm.h:1.77
--- src/sys/uvm/uvm.h:1.76	Sat Mar 14 20:23:51 2020
+++ src/sys/uvm/uvm.h	Sun May 17 15:11:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm.h,v 1.76 2020/03/14 20:23:51 ad Exp $	*/
+/*	$NetBSD: uvm.h,v 1.77 2020/05/17 15:11:57 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -107,7 +107,6 @@ struct uvm {
 	struct pgfreelist page_free[VM_NFREELIST]; /* unallocated pages */
 	u_int	bucketcount;
 	bool	page_init_done;		/* true if uvm_page_init() finished */
-	bool	numa_alloc;		/* use NUMA page allocation strategy */
 
 		/* page daemon trigger */
 	int pagedaemon;			/* daemon sleeps on this */

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.234 src/sys/uvm/uvm_page.c:1.235
--- src/sys/uvm/uvm_page.c:1.234	Tue Mar 17 18:31:39 2020
+++ src/sys/uvm/uvm_page.c	Sun May 17 15:11:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.234 2020/03/17 18:31:39 ad Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.235 2020/05/17 15:11:57 ad Exp $	*/
 
 /*-
  * Copyright (c) 2019, 2020 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.234 2020/03/17 18:31:39 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.235 2020/05/17 15:11:57 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvm.h"
@@ -749,7 +749,6 @@ uvm_page_numa_lookup(struct vm_page *pg)
 	static bool warned;
 	paddr_t pa;
 
-	KASSERT(uvm.numa_alloc);
 	KASSERT(uvm_page_numa_region != NULL);
 
 	pa = VM_PAGE_TO_PHYS(pg);
@@ -852,7 +851,7 @@ uvm_page_redim(int newncolors, int newnb
 	uvm_page_get_bucket(pg) == ob);
 	KASSERT(fl ==
 	uvm_page_get_freelist(pg));
-	if (uvm.numa_alloc) {
+	if (uvm_page_numa_region != NULL) {
 		nb = uvm_page_numa_lookup(pg);
 	} else {
 		nb = atop(VM_PAGE_TO_PHYS(pg))
@@ -919,8 +918,7 @@ uvm_page_rebucket(void)
 	/*
 	 * If we have more than one NUMA node, and the maximum NUMA node ID
 	 * is less than PGFL_MAX_BUCKETS, then we'll use NUMA distribution
-	 * for free pages.  uvm_pagefree() will not reassign pages to a
-	 * different bucket on free.
+	 * for free pages.
 	 */
 	min_numa = (u_int)-1;
 	max_numa = 0;
@@ -933,28 +931,19 @@ uvm_page_rebucket(void)
 		}
 	}
 	if (min_numa != max_numa && max_numa < PGFL_MAX_BUCKETS) {
-#ifdef NUMA
-		/*
-		 * We can do this, and it seems to work well, but until
-		 * further experiments are done we'll stick with the cache
-		 * locality strategy.
-		 */
 		aprint_debug("UVM: using NUMA allocation scheme\n");
 		for (CPU_INFO_FOREACH(cii, ci)) {
 			ci->ci_data.cpu_uvm->pgflbucket = ci->ci_numa_id;
 		}
-		uvm.numa_alloc = true;
 	 	uvm_page_redim(uvmexp.ncolors, max_numa + 1);
 	 	return;
-#endif
 	}
 
 	/*
 	 * Otherwise we'll go with a scheme to maximise L2/L3 cache locality
 	 * and minimise lock contention.  Count the total number of CPU
 	 * packages, and then try to distribute the buckets among CPU
-	 * packages evenly.  uvm_pagefree() will reassign pages to the
-	 * freeing CPU's preferred bucket on free.
+	 * packages evenly.
 	 */
 	npackage = curcpu()->ci_nsibling[CPUREL_PACKAGE1ST];
 
@@ -1220,18 +1209,13 @@ uvm_pagealloc_strat(struct uvm_object *o
 	 * [3]  only pagedaemon "reserved" pages remain and
 	 *the requestor isn't the pagedaemon.
 	 * we make kernel reserve pages available if called by a
-	 * kernel thread or a realtime thread.
+	 * kernel thread.
 	 */
 	l = curlwp;
-	if (__predict_true(l != NULL) && lwp_eprio(l) >= PRI_KTHREAD) {
+	if (__predict_true(l != NULL) && (l->l_flag & LW_SYSTEM) != 0) {
 		flags |= UVM_PGA_USERESERVE;
 	}
 
-	/* If the allocator's running in NUMA mode, go with NUMA strategy. */
-	if (uvm.numa_alloc && strat == UVM_PGA_STRAT_NORMAL) {
-		strat = UVM_PGA_STRAT_NUMA;
-	}
-
  again:
 	switch (strat) {
 	case UVM_PGA_STRAT_NORMAL:
@@ -1270,10 +1254,11 @@ uvm_pagealloc_strat(struct uvm_object *o
 
 	case UVM_PGA_STRAT_NUMA:
 		/*
-		 * NUMA strategy: allocating from the correct bucket is more
-		 * important than observing freelist priority.  Look only to
-		 * the current NUMA node; if that fails, we need to look to
-		 * other NUMA nodes, so retry with the normal strategy.
+		 * NUMA strategy (experimental): allocating from the correct
+		 * 

CVS commit: src/sys/uvm

2020-05-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun May 17 15:07:22 UTC 2020

Modified Files:
src/sys/uvm: uvm_amap.c

Log Message:
Mark amappl with PR_LARGECACHE.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/uvm/uvm_amap.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/uvm_amap.c
diff -u src/sys/uvm/uvm_amap.c:1.119 src/sys/uvm/uvm_amap.c:1.120
--- src/sys/uvm/uvm_amap.c:1.119	Fri Mar 20 19:08:54 2020
+++ src/sys/uvm/uvm_amap.c	Sun May 17 15:07:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_amap.c,v 1.119 2020/03/20 19:08:54 ad Exp $	*/
+/*	$NetBSD: uvm_amap.c,v 1.120 2020/05/17 15:07:22 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_amap.c,v 1.119 2020/03/20 19:08:54 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_amap.c,v 1.120 2020/05/17 15:07:22 ad Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -305,8 +305,9 @@ uvm_amap_init(void)
 
 	mutex_init(_list_lock, MUTEX_DEFAULT, IPL_NONE);
 
-	pool_cache_bootstrap(_amap_cache, sizeof(struct vm_amap), 0, 0, 0,
-	"amappl", NULL, IPL_NONE, amap_ctor, amap_dtor, NULL);
+	pool_cache_bootstrap(_amap_cache, sizeof(struct vm_amap), 0, 0,
+	PR_LARGECACHE, "amappl", NULL, IPL_NONE, amap_ctor, amap_dtor,
+	NULL);
 }
 
 /*



CVS commit: src/sys/arch

2020-05-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun May 17 14:15:55 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64: vector.S
src/sys/arch/i386/i386: vector.S

Log Message:
Flag EOI on TLB shootdown IPIs after the shootdown has been processed.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/i386/i386/vector.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/amd64/amd64/vector.S
diff -u src/sys/arch/amd64/amd64/vector.S:1.76 src/sys/arch/amd64/amd64/vector.S:1.77
--- src/sys/arch/amd64/amd64/vector.S:1.76	Fri May  1 07:03:02 2020
+++ src/sys/arch/amd64/amd64/vector.S	Sun May 17 14:15:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.76 2020/05/01 07:03:02 maxv Exp $	*/
+/*	$NetBSD: vector.S,v 1.77 2020/05/17 14:15:55 ad Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -314,21 +314,21 @@ IDTVEC_END(intr_hyperv_hypercall)
  * TLB shootdown handler.
  */
 IDTVEC(handle_lapic_tlb)
-	movq	_C_LABEL(local_apic_va),%rax
-	movl	$0,LAPIC_EOI(%rax)
 	KCOV_DISABLE
 	callq	_C_LABEL(pmap_tlb_intr)
 	KCOV_ENABLE
+	movq	_C_LABEL(local_apic_va),%rax
+	movl	$0,LAPIC_EOI(%rax)
 	INTRFASTEXIT
 IDTVEC_END(handle_lapic_tlb)
 IDTVEC(handle_x2apic_tlb)
+	KCOV_DISABLE
+	callq	_C_LABEL(pmap_tlb_intr)
+	KCOV_ENABLE
 	movl	$(MSR_X2APIC_BASE + MSR_X2APIC_EOI),%ecx
 	xorl	%eax,%eax
 	xorl	%edx,%edx
 	wrmsr
-	KCOV_DISABLE
-	callq	_C_LABEL(pmap_tlb_intr)
-	KCOV_ENABLE
 	INTRFASTEXIT
 IDTVEC_END(handle_x2apic_tlb)
 

Index: src/sys/arch/i386/i386/vector.S
diff -u src/sys/arch/i386/i386/vector.S:1.86 src/sys/arch/i386/i386/vector.S:1.87
--- src/sys/arch/i386/i386/vector.S:1.86	Sat Apr 25 15:26:17 2020
+++ src/sys/arch/i386/i386/vector.S	Sun May 17 14:15:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.86 2020/04/25 15:26:17 bouyer Exp $	*/
+/*	$NetBSD: vector.S,v 1.87 2020/05/17 14:15:55 ad Exp $	*/
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.86 2020/04/25 15:26:17 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.87 2020/05/17 14:15:55 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -201,9 +201,9 @@ IDTVEC(intr_lapic_tlb)
 	pushl	$0
 	pushl	$T_ASTFLT
 	INTRENTRY
+	call	_C_LABEL(pmap_tlb_intr)
 	movl	_C_LABEL(local_apic_va),%eax
 	movl	$0,LAPIC_EOI(%eax)
-	call	_C_LABEL(pmap_tlb_intr)
 	INTRFASTEXIT
 IDTVEC_END(intr_lapic_tlb)
 
@@ -211,11 +211,11 @@ IDTVEC(intr_x2apic_tlb)
 	pushl	$0
 	pushl	$T_ASTFLT
 	INTRENTRY
+	call	_C_LABEL(pmap_tlb_intr)
 	movl	$(MSR_X2APIC_BASE + MSR_X2APIC_EOI),%ecx
 	xorl	%eax,%eax
 	xorl	%edx,%edx
 	wrmsr
-	call	_C_LABEL(pmap_tlb_intr)
 	INTRFASTEXIT
 IDTVEC_END(intr_x2apic_tlb)
 



CVS commit: src/sys

2020-05-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun May 17 14:11:30 UTC 2020

Modified Files:
src/sys/kern: kern_softint.c
src/sys/sys: intr.h

Log Message:
softint_disestablish(): use a high priority xcall to determine that the
handler is no longer running.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/kern/kern_softint.c
cvs rdiff -u -r1.20 -r1.21 src/sys/sys/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/kern/kern_softint.c
diff -u src/sys/kern/kern_softint.c:1.65 src/sys/kern/kern_softint.c:1.66
--- src/sys/kern/kern_softint.c:1.65	Thu Apr 30 20:54:27 2020
+++ src/sys/kern/kern_softint.c	Sun May 17 14:11:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_softint.c,v 1.65 2020/04/30 20:54:27 skrll Exp $	*/
+/*	$NetBSD: kern_softint.c,v 1.66 2020/05/17 14:11:30 ad Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -170,7 +170,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.65 2020/04/30 20:54:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_softint.c,v 1.66 2020/05/17 14:11:30 ad Exp $");
 
 #include 
 #include 
@@ -197,6 +197,7 @@ typedef struct softint {
 	struct evcnt		si_evcnt;
 	struct evcnt		si_evcnt_block;
 	volatile int		si_active;
+	int			si_ipl;
 	char			si_name[8];
 	char			si_name_block[8+6];
 } softint_t;
@@ -230,7 +231,8 @@ static void	*softint_netisrs[NETISR_MAX]
  *	Initialize a single interrupt level for a single CPU.
  */
 static void
-softint_init_isr(softcpu_t *sc, const char *desc, pri_t pri, u_int level)
+softint_init_isr(softcpu_t *sc, const char *desc, pri_t pri, u_int level,
+int ipl)
 {
 	struct cpu_info *ci;
 	softint_t *si;
@@ -257,6 +259,7 @@ softint_init_isr(softcpu_t *sc, const ch
 	evcnt_attach_dynamic(>si_evcnt_block, EVCNT_TYPE_MISC, NULL,
 	   "softint", si->si_name_block);
 
+	si->si_ipl = ipl;
 	si->si_lwp->l_private = si;
 	softint_init_md(si->si_lwp, level, >si_machdep);
 }
@@ -292,10 +295,14 @@ softint_init(struct cpu_info *ci)
 	ci->ci_data.cpu_softints = 0;
 	sc->sc_cpu = ci;
 
-	softint_init_isr(sc, "net", PRI_SOFTNET, SOFTINT_NET);
-	softint_init_isr(sc, "bio", PRI_SOFTBIO, SOFTINT_BIO);
-	softint_init_isr(sc, "clk", PRI_SOFTCLOCK, SOFTINT_CLOCK);
-	softint_init_isr(sc, "ser", PRI_SOFTSERIAL, SOFTINT_SERIAL);
+	softint_init_isr(sc, "net", PRI_SOFTNET, SOFTINT_NET,
+	IPL_SOFTNET);
+	softint_init_isr(sc, "bio", PRI_SOFTBIO, SOFTINT_BIO,
+	IPL_SOFTBIO);
+	softint_init_isr(sc, "clk", PRI_SOFTCLOCK, SOFTINT_CLOCK,
+	IPL_SOFTCLOCK);
+	softint_init_isr(sc, "ser", PRI_SOFTSERIAL, SOFTINT_SERIAL,
+	IPL_SOFTSERIAL);
 
 	if (first != ci) {
 		mutex_enter(_lock);
@@ -407,15 +414,14 @@ softint_disestablish(void *arg)
 	softcpu_t *sc;
 	softhand_t *sh;
 	uintptr_t offset;
-	u_int flags;
 
 	offset = (uintptr_t)arg;
 	KASSERTMSG(offset != 0 && offset < softint_bytes, "%"PRIuPTR" %u",
 	offset, softint_bytes);
 
 	/*
-	 * Unregister an IPI handler if there is any.  Note: there is
-	 * no need to disable preemption here - ID is stable.
+	 * Unregister IPI handler if there is any.  Note: there is no need
+	 * to disable preemption here - ID is stable.
 	 */
 	sc = curcpu()->ci_data.cpu_softcpu;
 	sh = (softhand_t *)((uint8_t *)sc + offset);
@@ -424,32 +430,11 @@ softint_disestablish(void *arg)
 	}
 
 	/*
-	 * Run a cross call so we see up to date values of sh_flags from
-	 * all CPUs.  Once softint_disestablish() is called, the caller
-	 * commits to not trigger the interrupt and set SOFTINT_ACTIVE on
-	 * it again.  So, we are only looking for handler records with
-	 * SOFTINT_ACTIVE already set.
+	 * Run a dummy softint at the same level on all CPUs and wait for
+	 * completion, to make sure this softint is no longer running
+	 * anywhere.
 	 */
-	if (__predict_true(mp_online)) {
-		xc_barrier(0);
-	}
-
-	for (;;) {
-		/* Collect flag values from each CPU. */
-		flags = 0;
-		for (CPU_INFO_FOREACH(cii, ci)) {
-			sc = ci->ci_data.cpu_softcpu;
-			sh = (softhand_t *)((uint8_t *)sc + offset);
-			KASSERT(sh->sh_func != NULL);
-			flags |= sh->sh_flags;
-		}
-		/* Inactive on all CPUs? */
-		if ((flags & SOFTINT_ACTIVE) == 0) {
-			break;
-		}
-		/* Oops, still active.  Wait for it to clear. */
-		(void)kpause("softdis", false, 1, NULL);
-	}
+	xc_barrier(XC_HIGHPRI_IPL(sh->sh_isr->si_ipl));
 
 	/* Clear the handler on each CPU. */
 	mutex_enter(_lock);
@@ -547,8 +532,9 @@ softint_schedule_cpu(void *arg, struct c
  *	to the level specified, but returns back at splhigh.
  */
 static inline void
-softint_execute(softint_t *si, lwp_t *l, int s)
+softint_execute(lwp_t *l, int s)
 {
+	softint_t *si = l->l_private;
 	softhand_t *sh;
 
 	KASSERT(si->si_lwp == curlwp);
@@ -571,8 +557,7 @@ softint_execute(softint_t *si, lwp_t *l,
 		sh = SIMPLEQ_FIRST(>si_q);
 		SIMPLEQ_REMOVE_HEAD(>si_q, sh_q);
 		KASSERT((sh->sh_flags & SOFTINT_PENDING) != 0);
-		

CVS commit: src

2020-05-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun May 17 13:49:37 UTC 2020

Modified Files:
src/distrib/sets/lists/comp: md.sparc md.sparc64
src/sys/arch/sparc/include: Makefile

Log Message:
Install sparc/intr.h


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/distrib/sets/lists/comp/md.sparc
cvs rdiff -u -r1.210 -r1.211 src/distrib/sets/lists/comp/md.sparc64
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sparc/include/Makefile

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

Modified files:

Index: src/distrib/sets/lists/comp/md.sparc
diff -u src/distrib/sets/lists/comp/md.sparc:1.98 src/distrib/sets/lists/comp/md.sparc:1.99
--- src/distrib/sets/lists/comp/md.sparc:1.98	Thu Oct  3 00:59:50 2019
+++ src/distrib/sets/lists/comp/md.sparc	Sun May 17 13:49:37 2020
@@ -1,4 +1,4 @@
-# $NetBSD: md.sparc,v 1.98 2019/10/03 00:59:50 mrg Exp $
+# $NetBSD: md.sparc,v 1.99 2020/05/17 13:49:37 ad Exp $
 ./usr/include/gcc-4.5/tgmath.h			comp-obsolete		obsolete
 ./usr/include/gcc-4.8/tgmath.h			comp-obsolete		obsolete
 ./usr/include/gcc-4.8/visintrin.h		comp-obsolete		obsolete
@@ -44,6 +44,7 @@
 ./usr/include/sparc/int_limits.h		comp-c-include
 ./usr/include/sparc/int_mwgwtypes.h		comp-c-include
 ./usr/include/sparc/int_types.h			comp-c-include
+./usr/include/sparc/intr.h			comp-c-include
 ./usr/include/sparc/kbd.h			comp-c-include
 ./usr/include/sparc/kbio.h			comp-c-include
 ./usr/include/sparc/kcore.h			comp-c-include

Index: src/distrib/sets/lists/comp/md.sparc64
diff -u src/distrib/sets/lists/comp/md.sparc64:1.210 src/distrib/sets/lists/comp/md.sparc64:1.211
--- src/distrib/sets/lists/comp/md.sparc64:1.210	Thu Oct  3 00:59:50 2019
+++ src/distrib/sets/lists/comp/md.sparc64	Sun May 17 13:49:37 2020
@@ -1,4 +1,4 @@
-# $NetBSD: md.sparc64,v 1.210 2019/10/03 00:59:50 mrg Exp $
+# $NetBSD: md.sparc64,v 1.211 2020/05/17 13:49:37 ad Exp $
 ./usr/include/g++/bits/sparc			comp-c-include		compat
 ./usr/include/g++/bits/sparc/c++config.h	comp-c-include		gcc,compat
 ./usr/include/g++/bits/sparc64			comp-c-include		compat
@@ -48,6 +48,7 @@
 ./usr/include/sparc/int_limits.h		comp-c-include
 ./usr/include/sparc/int_mwgwtypes.h		comp-c-include
 ./usr/include/sparc/int_types.h			comp-c-include
+./usr/include/sparc/intr.h			comp-c-include
 ./usr/include/sparc/kbd.h			comp-c-include
 ./usr/include/sparc/kbio.h			comp-c-include
 ./usr/include/sparc/kcore.h			comp-c-include

Index: src/sys/arch/sparc/include/Makefile
diff -u src/sys/arch/sparc/include/Makefile:1.35 src/sys/arch/sparc/include/Makefile:1.36
--- src/sys/arch/sparc/include/Makefile:1.35	Thu Jul 12 10:46:47 2018
+++ src/sys/arch/sparc/include/Makefile	Sun May 17 13:49:37 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.35 2018/07/12 10:46:47 maxv Exp $
+#	$NetBSD: Makefile,v 1.36 2020/05/17 13:49:37 ad Exp $
 
 INCSDIR= /usr/include/sparc
 
@@ -10,6 +10,7 @@ INCS=	ansi.h aout_machdep.h apmvar.h asm
 	fenv.h float.h frame.h fsr.h \
 	idprom.h ieee.h ieeefp.h \
 	int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
+	intr.h \
 	kbd.h kbio.h kcore.h \
 	limits.h lock.h \
 	math.h mcontext.h mutex.h \



CVS commit: src

2020-05-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 17 12:36:26 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: include-main.exp include-main.mk
include-sub.mk include-subsub.mk

Log Message:
usr.bin/make: demonstrate actual behavior of .INCLUDEDFROMFILE


To generate a diff of this commit:
cvs rdiff -u -r1.840 -r1.841 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/include-main.exp \
src/usr.bin/make/unit-tests/include-main.mk \
src/usr.bin/make/unit-tests/include-sub.mk \
src/usr.bin/make/unit-tests/include-subsub.mk

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.840 src/distrib/sets/lists/tests/mi:1.841
--- src/distrib/sets/lists/tests/mi:1.840	Sun May 10 12:34:01 2020
+++ src/distrib/sets/lists/tests/mi	Sun May 17 12:36:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.840 2020/05/10 12:34:01 rillig Exp $
+# $NetBSD: mi,v 1.841 2020/05/17 12:36:26 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4493,6 +4493,10 @@
 ./usr/tests/usr.bin/make/unit-tests/hash.mk	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/impsrc.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/impsrc.mk	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/include-main.exp	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/include-main.mk	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/include-sub.mk	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/include-subsub.mk	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/misc.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/misc.mk	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/moderrs.exp	tests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.57 src/usr.bin/make/unit-tests/Makefile:1.58
--- src/usr.bin/make/unit-tests/Makefile:1.57	Sun May 10 12:42:11 2020
+++ src/usr.bin/make/unit-tests/Makefile	Sun May 17 12:36:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.57 2020/05/10 12:42:11 rillig Exp $
+# $NetBSD: Makefile,v 1.58 2020/05/17 12:36:26 rillig Exp $
 #
 # Unit tests for make(1)
 # The main targets are:
@@ -35,6 +35,7 @@ TESTNAMES= \
 	forloop \
 	forsubst \
 	hash \
+	include-main \
 	misc \
 	moderrs \
 	modmatch \

Added files:

Index: src/usr.bin/make/unit-tests/include-main.exp
diff -u /dev/null src/usr.bin/make/unit-tests/include-main.exp:1.1
--- /dev/null	Sun May 17 12:36:26 2020
+++ src/usr.bin/make/unit-tests/include-main.exp	Sun May 17 12:36:26 2020
@@ -0,0 +1,6 @@
+main-before-ok
+sub-before-ok
+subsub-ok
+sub-after-fail(include-sub.mk)
+main-after-fail(include-sub.mk)
+exit status 0
Index: src/usr.bin/make/unit-tests/include-main.mk
diff -u /dev/null src/usr.bin/make/unit-tests/include-main.mk:1.1
--- /dev/null	Sun May 17 12:36:26 2020
+++ src/usr.bin/make/unit-tests/include-main.mk	Sun May 17 12:36:26 2020
@@ -0,0 +1,30 @@
+# $NetBSD: include-main.mk,v 1.1 2020/05/17 12:36:26 rillig Exp $
+#
+# Demonstrates that the .INCLUDEDFROMFILE magic variable does not behave
+# as described in the manual page.
+#
+# The manual page says that it is the "filename of the file this Makefile
+# was included from", while in reality it is the "filename in which the
+# latest .include happened".
+#
+
+.if !defined(.INCLUDEDFROMFILE)
+LOG+=		main-before-ok
+.else
+.  for f in ${.INCLUDEDFROMFILE}
+LOG+=		main-before-fail\(${f:Q}\)
+.  endfor
+.endif
+
+.include "include-sub.mk"
+
+.if !defined(.INCLUDEDFROMFILE)
+LOG+=		main-after-ok
+.else
+.  for f in ${.INCLUDEDFROMFILE}
+LOG+=		main-after-fail\(${f:Q}\)
+.  endfor
+.endif
+
+all:
+	@printf '%s\n' ${LOG}
Index: src/usr.bin/make/unit-tests/include-sub.mk
diff -u /dev/null src/usr.bin/make/unit-tests/include-sub.mk:1.1
--- /dev/null	Sun May 17 12:36:26 2020
+++ src/usr.bin/make/unit-tests/include-sub.mk	Sun May 17 12:36:26 2020
@@ -0,0 +1,17 @@
+# $NetBSD: include-sub.mk,v 1.1 2020/05/17 12:36:26 rillig Exp $
+
+.if ${.INCLUDEDFROMFILE} == "include-main.mk"
+LOG+=		sub-before-ok
+.else
+LOG+=		sub-before-fail
+.endif
+
+.include "include-subsub.mk"
+
+.if ${.INCLUDEDFROMFILE} == "include-main.mk"
+LOG+=		sub-after-ok
+.else
+.  for f in ${.INCLUDEDFROMFILE}
+LOG+=		sub-after-fail\(${f:Q}\)
+.  endfor
+.endif
Index: src/usr.bin/make/unit-tests/include-subsub.mk
diff -u /dev/null src/usr.bin/make/unit-tests/include-subsub.mk:1.1
--- /dev/null	Sun May 17 12:36:26 2020
+++ 

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

2020-05-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun May 17 12:12:22 UTC 2020

Modified Files:
src/sys/arch/i386/i386: spl.S

Log Message:
comments


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/i386/i386/spl.S

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

Modified files:

Index: src/sys/arch/i386/i386/spl.S
diff -u src/sys/arch/i386/i386/spl.S:1.54 src/sys/arch/i386/i386/spl.S:1.55
--- src/sys/arch/i386/i386/spl.S:1.54	Fri May  1 09:40:47 2020
+++ src/sys/arch/i386/i386/spl.S	Sun May 17 12:12:22 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: spl.S,v 1.54 2020/05/01 09:40:47 maxv Exp $	*/
+/*	$NetBSD: spl.S,v 1.55 2020/05/17 12:12:22 ad Exp $	*/
 
 /*
- * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 2007, 2008, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.54 2020/05/01 09:40:47 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.55 2020/05/17 12:12:22 ad Exp $");
 
 #include "opt_ddb.h"
 #include "opt_spldebug.h"
@@ -359,7 +359,13 @@ IDTVEC(softintr)
 	CLI(%ecx)
 	movl	L_PCB(%esi),%ecx
 	movl	PCB_ESP(%ecx),%esp
-	xchgl	%esi,CPUVAR(CURLWP)	/* must be globally visible */
+
+	/*
+	 * for non-interlocked mutex release to work safely the change
+	 * to ci_curlwp must not languish in the store buffer. therefore
+	 * we use XCHG and not MOV here.  see kern_mutex.c.
+	 */
+	xchgl	%esi,CPUVAR(CURLWP)	/* restore ci_curlwp */
 	popl	%edi			/* unwind switchframe */
 	popl	%esi
 	addl	$8,%esp



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

2020-05-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun May 17 12:11:11 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64: spl.S

Log Message:
comments


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amd64/amd64/spl.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/amd64/amd64/spl.S
diff -u src/sys/arch/amd64/amd64/spl.S:1.45 src/sys/arch/amd64/amd64/spl.S:1.46
--- src/sys/arch/amd64/amd64/spl.S:1.45	Sat May  2 11:12:49 2020
+++ src/sys/arch/amd64/amd64/spl.S	Sun May 17 12:11:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.45 2020/05/02 11:12:49 maxv Exp $	*/
+/*	$NetBSD: spl.S,v 1.46 2020/05/17 12:11:11 ad Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -157,7 +157,12 @@ IDTVEC(softintr)
 	movq	L_PCB(%r15),%rcx
 	movq	PCB_RSP(%rcx),%rsp
 
-	xchgq	%r15,CPUVAR(CURLWP)	/* must be globally visible */
+	/*
+	 * for non-interlocked mutex release to work safely the change
+	 * to ci_curlwp must not languish in the store buffer. therefore
+	 * we use XCHG and not MOV here.  see kern_mutex.c.
+	 */
+	xchgq	%r15,CPUVAR(CURLWP)	/* restore curlwp */
 	popq	%r15			/* unwind switchframe */
 	addq	$(5 * 8),%rsp
 	jmp	*%r13			/* back to Xspllower/Xdoreti */



CVS commit: src/sys/arch/x86/x86

2020-05-17 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Sun May 17 11:54:40 UTC 2020

Modified Files:
src/sys/arch/x86/x86: hyperv.c

Log Message:
Fixed a problem that caused a page fault when attaching vmbus(4).

Dynamically allocate a page of memory with uvm_km_alloc(kernel_map, ...)
for Hyper-V hypercall.  However, this method can no longer be used to
make an executable page.
So we prevent it by using statically allocated memory for text segment.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/x86/hyperv.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/x86/hyperv.c
diff -u src/sys/arch/x86/x86/hyperv.c:1.8 src/sys/arch/x86/x86/hyperv.c:1.9
--- src/sys/arch/x86/x86/hyperv.c:1.8	Sat Apr 25 15:26:18 2020
+++ src/sys/arch/x86/x86/hyperv.c	Sun May 17 11:54:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hyperv.c,v 1.8 2020/04/25 15:26:18 bouyer Exp $	*/
+/*	$NetBSD: hyperv.c,v 1.9 2020/05/17 11:54:39 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 2009-2012,2016-2017 Microsoft Corp.
@@ -33,7 +33,7 @@
  */
 #include 
 #ifdef __KERNEL_RCSID
-__KERNEL_RCSID(0, "$NetBSD: hyperv.c,v 1.8 2020/04/25 15:26:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hyperv.c,v 1.9 2020/05/17 11:54:39 nonaka Exp $");
 #endif
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: head/sys/dev/hyperv/vmbus/hyperv.c 331757 2018-03-30 02:25:12Z emaste $");
@@ -97,6 +97,9 @@ struct hyperv_hypercall_ctx {
 
 static struct hyperv_hypercall_ctx hyperv_hypercall_ctx;
 
+static char hyperv_hypercall_page[PAGE_SIZE]
+__section(".text") __aligned(PAGE_SIZE) = { 0xcc };
+
 static u_int	hyperv_get_timecount(struct timecounter *);
 
 static u_int hyperv_ver_major;
@@ -703,11 +706,7 @@ static void
 hyperv_hypercall_memfree(void)
 {
 
-	if (hyperv_hypercall_ctx.hc_addr != NULL) {
-		uvm_km_free(kernel_map, (vaddr_t)hyperv_hypercall_ctx.hc_addr,
-		PAGE_SIZE, UVM_KMF_WIRED);
-		hyperv_hypercall_ctx.hc_addr = NULL;
-	}
+	hyperv_hypercall_ctx.hc_addr = NULL;
 }
 
 static bool
@@ -715,30 +714,9 @@ hyperv_init_hypercall(void)
 {
 	uint64_t hc, hc_orig;
 
-	hyperv_hypercall_ctx.hc_addr = (void *)uvm_km_alloc(kernel_map,
-	PAGE_SIZE, PAGE_SIZE,
-	UVM_KMF_WIRED | UVM_KMF_EXEC | (cold ? UVM_KMF_NOWAIT : 0));
-	if (hyperv_hypercall_ctx.hc_addr == NULL) {
-		aprint_error("Hyper-V: Hypercall page allocation failed\n");
-		return false;
-	}
-
-	memset(hyperv_hypercall_ctx.hc_addr, 0xcc, PAGE_SIZE);
-	wbinvd();
-	x86_flush();
-
-	/* The hypercall page must be both readable and executable */
-	uvm_km_protect(kernel_map, (vaddr_t)hyperv_hypercall_ctx.hc_addr,
-	PAGE_SIZE, VM_PROT_READ | VM_PROT_EXECUTE);
-
-	if (!pmap_extract(pmap_kernel(), (vaddr_t)hyperv_hypercall_ctx.hc_addr,
-	_hypercall_ctx.hc_paddr)) {
-		aprint_error("Hyper-V: Hypercall page setup failed\n");
-		hyperv_hypercall_memfree();
-		/* Can't perform any Hyper-V specific actions */
-		vm_guest = VM_GUEST_VM;
-		return false;
-	}
+	hyperv_hypercall_ctx.hc_addr = hyperv_hypercall_page;
+	hyperv_hypercall_ctx.hc_paddr = vtophys((vaddr_t)hyperv_hypercall_page);
+	KASSERT(hyperv_hypercall_ctx.hc_paddr != 0);
 
 	/* Get the 'reserved' bits, which requires preservation. */
 	hc_orig = rdmsr(MSR_HV_HYPERCALL);



CVS commit: src/sys/dev/acpi

2020-05-17 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun May 17 11:32:51 UTC 2020

Modified Files:
src/sys/dev/acpi: thinkpad_acpi.c

Log Message:
With the recent change of the EC address space handler, we no longer get
an ACPI_INTEGER in host byte order but a byte sized buffer with little
endian data.

Extract only the low 8 bits from buffer to get the fan speed again.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/acpi/thinkpad_acpi.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/acpi/thinkpad_acpi.c
diff -u src/sys/dev/acpi/thinkpad_acpi.c:1.47 src/sys/dev/acpi/thinkpad_acpi.c:1.48
--- src/sys/dev/acpi/thinkpad_acpi.c:1.47	Mon Aug  5 10:09:35 2019
+++ src/sys/dev/acpi/thinkpad_acpi.c	Sun May 17 11:32:51 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: thinkpad_acpi.c,v 1.47 2019/08/05 10:09:35 msaitoh Exp $ */
+/* $NetBSD: thinkpad_acpi.c,v 1.48 2020/05/17 11:32:51 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.47 2019/08/05 10:09:35 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.48 2020/05/17 11:32:51 mlelstv Exp $");
 
 #include 
 #include 
@@ -702,6 +702,13 @@ thinkpad_fan_refresh(struct sysmon_envsy
 		edata->state = ENVSYS_SINVALID;
 		return;
 	}
+
+	/*
+	 * Extract the low bytes from buffers
+	 */
+	lo = ((uint8_t *))[0];
+	hi = ((uint8_t *))[0];
+
 	rpm = int)hi) << 8) | ((int)lo));
 	if (rpm < 0) {
 		edata->state = ENVSYS_SINVALID;



CVS commit: src/usr.bin/make/unit-tests

2020-05-17 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 17 09:37:48 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: dollar.exp dollar.mk

Log Message:
usr.bin/make: fix test for dollar and backslash at eol

The previous version of this test relied on the way how the shell
interprets a lonely backslash at the end of the line.  The NetBSD and
FreeBSD shells print the backslash, while Bash doesn't.

While here, make the escaping a bit simpler and align the test
descriptions with the actual test data.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/dollar.exp \
src/usr.bin/make/unit-tests/dollar.mk

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/make/unit-tests/dollar.exp
diff -u src/usr.bin/make/unit-tests/dollar.exp:1.2 src/usr.bin/make/unit-tests/dollar.exp:1.3
--- src/usr.bin/make/unit-tests/dollar.exp:1.2	Sun May 10 13:03:40 2020
+++ src/usr.bin/make/unit-tests/dollar.exp	Sun May 17 09:37:48 2020
@@ -2,7 +2,8 @@
 Printing dollar from literals and variables
 
 To survive the parser, a dollar character must be doubled.
-   1 dollar literal => <\>
+   1 dollar literal => 
+   1 dollar literal eol => <>
2 dollar literal => <$>
4 dollar literal => <$$>
 Some hungry part of make eats all the dollars after a :U modifier.
@@ -33,13 +34,13 @@ Dollar in :C character class
 The A is replaced because the $$ is reduced to a single $,
 which is then resolved to the variable X with the value VAR_X.
 The effective character class becomes [VAR_XY].
-  C,[$XY],<&>,g => <$>
+ C,[$$XY],<&>,g => <$>
 
 Dollar in :C pattern
 
 For some reason, multiple dollars are folded into one.
-  C,$,word, => <>
- C,$$,word, => <>
+   C,$,dollar,g => <>
+  C,$$,dollar,g => <>
 
 Dollar in :S replacement
 
Index: src/usr.bin/make/unit-tests/dollar.mk
diff -u src/usr.bin/make/unit-tests/dollar.mk:1.2 src/usr.bin/make/unit-tests/dollar.mk:1.3
--- src/usr.bin/make/unit-tests/dollar.mk:1.2	Sun May 10 13:03:40 2020
+++ src/usr.bin/make/unit-tests/dollar.mk	Sun May 17 09:37:48 2020
@@ -1,4 +1,4 @@
-# $NetBSD: dollar.mk,v 1.2 2020/05/10 13:03:40 rillig Exp $
+# $NetBSD: dollar.mk,v 1.3 2020/05/17 09:37:48 rillig Exp $
 #
 # Test the various places where a dollar character can appear and
 # see what happens.  There are lots of surprises here.
@@ -19,13 +19,22 @@ H=	@header()	{ printf '\n%s\n\n' "$$*"; 
 T=	@testcase()	{ printf '%23s => <%s>\n' "$$@"; }; testcase
 C=	@comment()	{ printf '%s\n' "$$*"; }; comment
 
+# These variable values are not accessed.
+# The trailing dollar in the '1 dollar literal eol' test case accesses
+# the empty variable instead, which is always guaranteed to be empty.
+${:U }=			space-var-value
+${:U${.newline}}=	newline-var-value
+# But this one is accessed.
+${:U'}=			single-quote-var-value'
+
 all:
 	$H 'Printing dollar from literals and variables'
 
 	$C 'To survive the parser, a dollar character must be doubled.'
-	$T	'1 dollar literal'	''\$
-	$T	'2 dollar literal'	''\$$
-	$T	'4 dollar literal'	''\$$\$$
+	$T	'1 dollar literal'	'$'
+	$T	'1 dollar literal eol'	''$
+	$T	'2 dollar literal'	'$$'
+	$T	'4 dollar literal'	''
 
 	$C 'Some hungry part of make eats all the dollars after a :U modifier.'
 	$T	'1 dollar default'	''${:U$:Q}
@@ -58,12 +67,12 @@ all:
 	$C 'The A is replaced because the  is reduced to a single $$,'
 	$C 'which is then resolved to the variable X with the value VAR_X.'
 	$C 'The effective character class becomes [VAR_XY].'
-	$T	'C,[$$XY],<&>,g'	''${DOLLAR_AXY:C,[$$XY],<&>,g:Q}
+	$T	'C,[XY],<&>,g'	''${DOLLAR_AXY:C,[$$XY],<&>,g:Q}
 
 	$H 'Dollar in :C pattern'
 	$C 'For some reason, multiple dollars are folded into one.'
-	$T	'C,$$,word,'		''${DOLLAR:C,$,dollar,g:Q}
-	$T	'C,,word,'		''${DOLLAR:C,$$,dollar,g:Q}
+	$T	'C,$$,dollar,g'		''${DOLLAR:C,$,dollar,g:Q}
+	$T	'C,,dollar,g'	''${DOLLAR:C,$$,dollar,g:Q}
 
 	$H 'Dollar in :S replacement'
 	$C 'For some reason, multiple dollars are folded into one.'



CVS commit: src/sys/dev/usb

2020-05-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun May 17 08:38:38 UTC 2020

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

Log Message:
Copyright maintenance


To generate a diff of this commit:
cvs rdiff -u -r1.280 -r1.281 src/sys/dev/usb/ehci.c

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.280 src/sys/dev/usb/ehci.c:1.281
--- src/sys/dev/usb/ehci.c:1.280	Sun May 17 08:35:15 2020
+++ src/sys/dev/usb/ehci.c	Sun May 17 08:38:37 2020
@@ -1,13 +1,14 @@
-/*	$NetBSD: ehci.c,v 1.280 2020/05/17 08:35:15 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.281 2020/05/17 08:38:37 skrll Exp $ */
 
 /*
- * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
+ * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
  * by Lennart Augustsson (lenn...@augustsson.net), Charles M. Hannum,
  * Jeremy Morse (jeremy.mo...@gmail.com), Jared D. McNeill
- * (jmcne...@invisible.ca) and Matthew R. Green (m...@eterna.com.au).
+ * (jmcne...@invisible.ca). Matthew R. Green (m...@eterna.com.au), and
+ * Nick Hudson .
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -53,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.280 2020/05/17 08:35:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.281 2020/05/17 08:38:37 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"



CVS commit: src/sys/dev/usb

2020-05-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun May 17 08:35:15 UTC 2020

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

Log Message:
Use BUS_ADDR_{LO,HI}32.  NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.279 -r1.280 src/sys/dev/usb/ehci.c

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.279 src/sys/dev/usb/ehci.c:1.280
--- src/sys/dev/usb/ehci.c:1.279	Fri May 15 06:15:42 2020
+++ src/sys/dev/usb/ehci.c	Sun May 17 08:35:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.279 2020/05/15 06:15:42 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.280 2020/05/17 08:35:15 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.279 2020/05/15 06:15:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.280 2020/05/17 08:35:15 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -3038,11 +3038,10 @@ ehci_reset_sqtd_chain(ehci_softc_t *sc, 
 		KASSERT(pages <= EHCI_QTD_NBUFFERS);
 		size_t pageoffs = EHCI_PAGE(curoffs);
 		for (size_t i = 0; i < pages; i++) {
-			paddr_t a = DMAADDR(dma,
-			pageoffs + i * EHCI_PAGE_SIZE);
-			sqtd->qtd.qtd_buffer[i] = htole32(EHCI_PAGE(a));
-			/* Cast up to avoid compiler warnings */
-			sqtd->qtd.qtd_buffer_hi[i] = htole32((uint64_t)a >> 32);
+			paddr_t a = EHCI_PAGE(DMAADDR(dma,
+			pageoffs + i * EHCI_PAGE_SIZE));
+			sqtd->qtd.qtd_buffer[i] = htole32(BUS_ADDR_LO32(a));
+			sqtd->qtd.qtd_buffer_hi[i] = htole32(BUS_ADDR_HI32(a));
 			DPRINTF("  buffer[%jd/%jd] 0x%08jx 0x%08jx",
 			i, pages,
 			le32toh(sqtd->qtd.qtd_buffer_hi[i]),
@@ -3496,8 +3495,10 @@ ehci_device_ctrl_init(struct usbd_xfer *
 	EHCI_QTD_SET_TOGGLE(0) |
 	EHCI_QTD_SET_BYTES(sizeof(*req))
 	);
-	setup->qtd.qtd_buffer[0] = htole32(DMAADDR(>ctrl.reqdma, 0));
-	setup->qtd.qtd_buffer_hi[0] = 0;
+
+	const bus_addr_t ba = DMAADDR(>ctrl.reqdma, 0);
+	setup->qtd.qtd_buffer[0] = htole32(BUS_ADDR_LO32(ba));
+	setup->qtd.qtd_buffer_hi[0] = htole32(BUS_ADDR_HI32(ba));
 	setup->qtd.qtd_next = setup->qtd.qtd_altnext = htole32(next->physaddr);
 	setup->nextqtd = next;
 	setup->xfer = xfer;
@@ -3622,8 +3623,10 @@ ehci_device_ctrl_start(struct usbd_xfer 
 	EHCI_QTD_SET_TOGGLE(0) |
 	EHCI_QTD_SET_BYTES(sizeof(*req))
 	);
-	setup->qtd.qtd_buffer[0] = htole32(DMAADDR(>ctrl.reqdma, 0));
-	setup->qtd.qtd_buffer_hi[0] = 0;
+
+	const bus_addr_t ba = DMAADDR(>ctrl.reqdma, 0);
+	setup->qtd.qtd_buffer[0] = htole32(BUS_ADDR_LO32(ba));
+	setup->qtd.qtd_buffer_hi[0] = htole32(BUS_ADDR_HI32(ba));
 
 	next = status;
 	status->qtd.qtd_status &= ~htole32(



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

2020-05-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun May 17 06:30:44 UTC 2020

Modified Files:
src/sys/arch/sparc/include: types.h

Log Message:
__HAVE_CPU_DATA_FIRST is still true for sparc64 (which shares this file)


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/sparc/include/types.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/sparc/include/types.h
diff -u src/sys/arch/sparc/include/types.h:1.67 src/sys/arch/sparc/include/types.h:1.68
--- src/sys/arch/sparc/include/types.h:1.67	Sat May 16 17:52:42 2020
+++ src/sys/arch/sparc/include/types.h	Sun May 17 06:30:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.67 2020/05/16 17:52:42 ad Exp $ */
+/*	$NetBSD: types.h,v 1.68 2020/05/17 06:30:44 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -127,6 +127,7 @@ typedef unsigned long int	__register_t;
 #define	__HAVE_RAS
 
 #ifdef __sparc_v9__
+#define	__HAVE_CPU_DATA_FIRST
 #define	__HAVE_DEVICE_REGISTER_POSTCONFIG
 #define	__HAVE_ATOMIC64_OPS
 #define	__HAVE_CPU_COUNTER	/* sparc v9 CPUs have %tick */