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

2020-06-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jun 23 05:50:01 UTC 2020

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

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 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.



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

2020-06-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jun 23 05:50:01 UTC 2020

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

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 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.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.65 src/sys/dev/pci/ixgbe/ixgbe.h:1.66
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.65	Thu Feb  6 06:28:49 2020
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Tue Jun 23 05:50:01 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.65 2020/02/06 06:28:49 thorpej Exp $ */
+/* $NetBSD: ixgbe.h,v 1.66 2020/06/23 05:50:01 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -268,10 +268,10 @@ typedef struct _ixgbe_vendor_info_t {
 
 /* This is used to get SFP+ module data */
 struct ixgbe_i2c_req {
-u8 dev_addr;
-u8 offset;
-u8 len;
-u8 data[8];
+	u8 dev_addr;
+	u8 offset;
+	u8 len;
+	u8 data[8];
 };
 
 struct ixgbe_bp_data {
@@ -334,13 +334,15 @@ struct ix_queue {
 	char namebuf[32];
 	char evnamebuf[32];
 
-	kmutex_t dc_mtx;	/* lock for disabled_count and this queue's EIMS/EIMC bit */
-	int  disabled_count;/*
-	 * means
-	 * 0   : this queue is enabled
-	 * > 0 : this queue is disabled
-	 *   the value is ixgbe_disable_queue() called count
-	 */
+	/* Lock for disabled_count and this queue's EIMS/EIMC bit */
+	kmutex_t dc_mtx;
+	/*
+	 * disabled_count means:
+	 * 0   : this queue is enabled
+	 * > 0 : this queue is disabled
+	 *   the value is ixgbe_disable_queue() called count
+	 */
+	int  disabled_count;
 	bool txrx_use_workqueue;
 };
 
@@ -373,10 +375,10 @@ struct tx_ring {
 	u16			atr_sample;
 	u16			atr_count;
 
-	u64			bytes;  /* used for AIM */
+	u64			bytes;  /* Used for AIM */
 	u64			packets;
 	/* Soft Stats */
-	struct evcnt	   	tso_tx;
+	struct evcnt		tso_tx;
 	struct evcnt		no_desc_avail;
 	struct evcnt		total_packets;
 	struct evcnt		pcq_drops;
@@ -409,7 +411,7 @@ struct rx_ring {
 	bool			hw_rsc;
 	bool			vtag_strip;
 	u16			next_to_refresh;
-	u16 			next_to_check;
+	u16			next_to_check;
 	u16			num_desc;
 	u16			mbuf_sz;
 #if 0
@@ -417,8 +419,8 @@ struct rx_ring {
 #endif
 	struct ixgbe_rx_buf	*rx_buffers;
 	ixgbe_dma_tag_t		*ptag;
-	u16	last_rx_mbuf_sz;
-	u32	last_num_rx_desc;
+	u16			last_rx_mbuf_sz;
+	u32			last_num_rx_desc;
 	ixgbe_extmem_head_t	jcl_head;
 
 	u64			bytes; /* Used for AIM calc */
@@ -427,10 +429,10 @@ struct rx_ring {
 	/* Soft stats */
 	struct evcnt		rx_copies;
 	struct evcnt		rx_packets;
-	struct evcnt 		rx_bytes;
-	struct evcnt 		rx_discarded;
-	struct evcnt 		no_jmbuf;
-	u64 			rsc_num;
+	struct evcnt		rx_bytes;
+	struct evcnt		rx_discarded;
+	struct evcnt		no_jmbuf;
+	u64			rsc_num;
 
 	/* Flow Director */
 	u64			flm;
@@ -496,7 +498,7 @@ struct adapter {
 	u16			num_segs;
 	u32			link_speed;
 	bool			link_up;
-	u32 			vector;
+	u32			vector;
 	u16			dmac;
 	u32			phy_layer;
 
@@ -525,15 +527,17 @@ struct adapter {
 	void			*phy_si;   /* PHY intr tasklet */
 
 	bool			txrx_use_workqueue;
-	struct workqueue	*que_wq;/* workqueue for ixgbe_handle_que_work() */
-	/*
-	 * que_wq's "enqueued flag" is not required,
-	 * because twice workqueue_enqueue() for
-	 * ixgbe_handle_que_work() is avoided by masking
-	 * the queue's interrupt by EIMC.
-	 * See also ixgbe_msix_que().
-	 */
-	struct workqueue	*txr_wq;/* workqueue for ixgbe_deferred_mq_start_work() */
+
+	/*
+	 * Workqueue for ixgbe_handle_que_work().
+	 *
+	 * que_wq's "enqueued flag" is not required, because twice
+	 * workqueue_enqueue() for ixgbe_handle_que_work() is avoided by
+	 * masking the queue's interrupt by EIMC. See also ixgbe_msix_que().
+	 */
+	struct workqueue	*que_wq;
+	/* Workqueue for ixgbe_deferred_mq_start_work() */
+	struct workqueue	*txr_wq;
 	percpu_t		*txr_wq_enqueued;
 
 	/*
@@ -574,23 +578,23 @@ struct adapter {
 	struct ixgbe_bp_databypass;
 
 	/* Netmap */
-	void 			(*init_locked)(struct adapter *);
-	void 			(*stop_locked)(void *);
+	void			(*init_locked)(struct adapter *);
+	void			(*stop_locked)(void *);
 
 	/* Firmware error check */
 	u_int   recovery_mode;
 	struct callout  recovery_mode_timer;
 
 	/* Misc stats maintained by the driver */
-	struct evcnt	   	efbig_tx_dma_setup;
-	struct evcnt   		mbuf_defrag_failed;
-	struct evcnt	   	efbig2_tx_dma_setup;
-	struct evcnt	   	einval_tx_dma_setup;
-	struct evcnt	   	other_tx_dma_setup;
-	struct evcnt	   	eagain_tx_dma_setup;
-	struct evcnt	   	enomem_tx_dma_setup;
-	struct evcnt	   	tso_err;
-	struct evcnt	   	

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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:19:12 UTC 2020

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

Log Message:
Support EdgeRouter 4.
Only set RGMII timing params on boards with RGMII.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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.



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:18:43 UTC 2020

Modified Files:
src/sys/arch/mips/cavium/dev: octeon_uart.c

Log Message:
Add support for a very simple output-only console so early printf() can work.
Minor tweaks, remove some unused code.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/cavium/dev/octeon_uart.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/dev/octeon_uart.c
diff -u src/sys/arch/mips/cavium/dev/octeon_uart.c:1.8 src/sys/arch/mips/cavium/dev/octeon_uart.c:1.9
--- src/sys/arch/mips/cavium/dev/octeon_uart.c:1.8	Fri Jun 19 02:23:43 2020
+++ src/sys/arch/mips/cavium/dev/octeon_uart.c	Tue Jun 23 05:18:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon_uart.c,v 1.8 2020/06/19 02:23:43 simonb Exp $	*/
+/*	$NetBSD: octeon_uart.c,v 1.9 2020/06/23 05:18:43 simonb Exp $	*/
 
 /*
  * Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -27,9 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: octeon_uart.c,v 1.8 2020/06/19 02:23:43 simonb Exp $");
-
-#include "opt_octeon.h"
+__KERNEL_RCSID(0, "$NetBSD: octeon_uart.c,v 1.9 2020/06/23 05:18:43 simonb Exp $");
 
 #include 
 #include 
@@ -41,11 +39,13 @@ __KERNEL_RCSID(0, "$NetBSD: octeon_uart.
 #include 
 #include 
 
+#include 
 #include 
 #include 
 
 #include 
 #include 
+#include 
 #include 
 
 struct octuart_iobus_softc {
@@ -59,9 +59,8 @@ static void	octuart_iobus_attach(device_
 static int	octuart_com_enable(struct com_softc *);
 static void	octuart_com_disable(struct com_softc *);
 
-
-/* XXX */
-int		octuart_com_cnattach(bus_space_tag_t, int, int);
+/* octputc() is not declared static so it can be used for debugging elsewhere */
+void		octputc(dev_t, int);
 
 /* XXX */
 const bus_addr_t octuart_com_bases[] = {
@@ -93,7 +92,7 @@ const struct com_regs octuart_com_regs =
 CFATTACH_DECL_NEW(com_iobus, sizeof(struct octuart_iobus_softc),
 octuart_iobus_match, octuart_iobus_attach, NULL, NULL);
 
-int
+static int
 octuart_iobus_match(device_t parent, struct cfdata *cf, void *aux)
 {
 	struct iobus_attach_args *aa = aux;
@@ -109,7 +108,7 @@ out:
 	return result;
 }
 
-void
+static void
 octuart_iobus_attach(device_t parent, device_t self, void *aux)
 {
 	struct octuart_iobus_softc *sc = device_private(self);
@@ -154,17 +153,7 @@ octuart_iobus_attach(device_t parent, de
 	/* XXX disable if kgdb? */
 }
 
-#if 0
-void
-octuart_iobus_detach(device_t self, ...)
-{
-	struct octuart_iobus_softc *sc = (void *)self;
-
-	octeon_intr_disestablish(sc->ih);
-}
-#endif
-
-int
+static int
 octuart_com_enable(struct com_softc *sc_com)
 {
 	struct com_regs *regsp = _com->sc_regs;
@@ -176,7 +165,7 @@ octuart_com_enable(struct com_softc *sc_
 	return 0;
 }
 
-void
+static void
 octuart_com_disable(struct com_softc *sc_com)
 {
 	/*
@@ -205,3 +194,31 @@ octuart_com_cnattach(bus_space_tag_t bus
 		COM_TYPE_16550_NOERS,
 		CONMODE);
 }
+
+
+/*
+ * A very simple output-only console so early printf() can work.
+ */
+struct consdev early_console = {
+	.cn_putc = octputc,
+	.cn_pollc = nullcnpollc,
+	.cn_dev = makedev(0, 0),
+	.cn_pri = CN_DEAD
+};
+static int early_comcnrate;
+
+void
+octputc(dev_t dev, int c)
+{
+
+	octeon_xkphys_write_8(MIO_UART0_RBR, (uint8_t)c);
+	delay(100 / (early_comcnrate / 10)); /* wait for char to drain */
+}
+
+void
+octuart_early_cnattach(int rate)
+{
+
+	early_comcnrate = rate;
+	cn_tab = _console;
+}



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:19:12 UTC 2020

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

Log Message:
Support EdgeRouter 4.
Only set RGMII timing params on boards with RGMII.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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.7 src/sys/arch/evbmips/cavium/autoconf.c:1.8
--- src/sys/arch/evbmips/cavium/autoconf.c:1.7	Sat Jun 20 02:27:55 2020
+++ src/sys/arch/evbmips/cavium/autoconf.c	Tue Jun 23 05:19:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.7 2020/06/20 02:27:55 simonb Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.8 2020/06/23 05:19:12 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.7 2020/06/20 02:27:55 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.8 2020/06/23 05:19:12 simonb Exp $");
 
 #include 
 #include 
@@ -156,7 +156,11 @@ prop_set_cnmac(device_t dev)
 	/* ethernet phy address */
 	switch (octeon_btinfo.obt_board_type) {
 	case BOARD_TYPE_UBIQUITI_E100:
-		pn = prop_number_create_signed(0x07 - unit);
+	case BOARD_TYPE_UBIQUITI_E120:
+		pn = prop_number_create_signed(7 - unit);
+		break;
+	case BOARD_TYPE_UBIQUITI_E300:
+		pn = prop_number_create_signed(4 + dev->dv_unit);
 		break;
 	default:
 		pn = prop_number_create_signed(-1);
@@ -172,21 +176,19 @@ prop_set_octeon_gmx(device_t dev)
 	prop_dictionary_t dict = device_properties(dev);
 	prop_number_t tx, rx;
 
-	/* ethernet rgmii phy dependent timing parameter. */
+	/* ethernet rgmii phy dependent timing parameters. */
+	tx = rx = NULL;
 	switch (octeon_btinfo.obt_board_type) {
 	case BOARD_TYPE_UBIQUITI_E100:
+	case BOARD_TYPE_UBIQUITI_E120:
 		tx = prop_number_create_signed(16);
 		rx = prop_number_create_signed(0);
 		break;
-	default:
-		tx = prop_number_create_signed(0);
-		rx = prop_number_create_signed(0);
-		break;
 	}
-	KASSERT(tx != NULL);
-	KASSERT(rx != NULL);
-	prop_dictionary_set_and_rel(dict, "rgmii-tx", tx);
-	prop_dictionary_set_and_rel(dict, "rgmii-rx", rx);
+	if (tx)
+		prop_dictionary_set_and_rel(dict, "rgmii-tx", tx);
+	if (rx)
+		prop_dictionary_set_and_rel(dict, "rgmii-rx", rx);
 }
 
 void



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:18:43 UTC 2020

Modified Files:
src/sys/arch/mips/cavium/dev: octeon_uart.c

Log Message:
Add support for a very simple output-only console so early printf() can work.
Minor tweaks, remove some unused code.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/cavium/dev/octeon_uart.c

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



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:18:28 UTC 2020

Modified Files:
src/sys/arch/mips/cavium/dev: octeon_dwctwo.c

Log Message:
Make sure we only attach to CN3xxx/CN5xxx.
Cleanup - mostly removing unused code.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/cavium/dev/octeon_dwctwo.c

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



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:18:28 UTC 2020

Modified Files:
src/sys/arch/mips/cavium/dev: octeon_dwctwo.c

Log Message:
Make sure we only attach to CN3xxx/CN5xxx.
Cleanup - mostly removing unused code.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/cavium/dev/octeon_dwctwo.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/dev/octeon_dwctwo.c
diff -u src/sys/arch/mips/cavium/dev/octeon_dwctwo.c:1.12 src/sys/arch/mips/cavium/dev/octeon_dwctwo.c:1.13
--- src/sys/arch/mips/cavium/dev/octeon_dwctwo.c:1.12	Tue Jun 23 03:07:47 2020
+++ src/sys/arch/mips/cavium/dev/octeon_dwctwo.c	Tue Jun 23 05:18:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon_dwctwo.c,v 1.12 2020/06/23 03:07:47 simonb Exp $	*/
+/*	$NetBSD: octeon_dwctwo.c,v 1.13 2020/06/23 05:18:28 simonb Exp $	*/
 
 /*
  * Copyright (c) 2015 Masao Uebayashi 
@@ -43,9 +43,8 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: octeon_dwctwo.c,v 1.12 2020/06/23 03:07:47 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon_dwctwo.c,v 1.13 2020/06/23 05:18:28 simonb Exp $");
 
-#include "opt_octeon.h"
 #include "opt_usb.h"
 
 #include 
@@ -83,29 +82,21 @@ struct octeon_dwc2_softc {
 	void *sc_ih;
 };
 
-static int		octeon_dwc2_match(device_t, struct cfdata *, void *);
-static void		octeon_dwc2_attach(device_t, device_t, void *);
-static uint32_t		octeon_dwc2_rd_4(void *, bus_space_handle_t,
-			bus_size_t);
-static void		octeon_dwc2_wr_4(void *, bus_space_handle_t,
-			bus_size_t, uint32_t);
-int			octeon_dwc2_set_dma_addr(device_t, bus_addr_t, int);
-static inline void	octeon_dwc2_reg_assert(struct octeon_dwc2_softc *,
-			bus_size_t, uint64_t);
-static inline void 	octeon_dwc2_reg_deassert(struct octeon_dwc2_softc *,
-			bus_size_t, uint64_t);
-static inline uint64_t	octeon_dwc2_reg_rd(struct octeon_dwc2_softc *,
-			bus_size_t);
-static inline void	octeon_dwc2_reg_wr(struct octeon_dwc2_softc *,
-			bus_size_t, uint64_t);
-static inline void 	octeon_dwc2_reg2_assert(struct octeon_dwc2_softc *,
-			bus_size_t, uint64_t);
-static inline void 	octeon_dwc2_reg2_deassert(struct octeon_dwc2_softc *,
-			bus_size_t, uint64_t);
-static inline uint64_t	octeon_dwc2_reg2_rd(struct octeon_dwc2_softc *,
-			bus_size_t);
-static inline void	octeon_dwc2_reg2_wr(struct octeon_dwc2_softc *,
-			bus_size_t, uint64_t);
+static int	octeon_dwc2_match(device_t, struct cfdata *, void *);
+static void	octeon_dwc2_attach(device_t, device_t, void *);
+static uint32_t	octeon_dwc2_rd_4(void *, bus_space_handle_t, bus_size_t);
+static void	octeon_dwc2_wr_4(void *, bus_space_handle_t, bus_size_t,
+		uint32_t);
+static int	octeon_dwc2_set_dma_addr(device_t, bus_addr_t, int);
+static void	octeon_dwc2_reg_assert(struct octeon_dwc2_softc *, bus_size_t,
+		uint64_t);
+static void 	octeon_dwc2_reg_deassert(struct octeon_dwc2_softc *, bus_size_t,
+		uint64_t);
+static uint64_t	octeon_dwc2_reg_rd(struct octeon_dwc2_softc *, bus_size_t);
+static void	octeon_dwc2_reg_wr(struct octeon_dwc2_softc *, bus_size_t,
+		uint64_t);
+static void	octeon_dwc2_reg2_wr(struct octeon_dwc2_softc *, bus_size_t,
+		uint64_t);
 
 static struct dwc2_core_params octeon_dwc2_params = {
 	.otg_cap			= 2,	/* 2 - No HNP/SRP capable */
@@ -143,12 +134,20 @@ CFATTACH_DECL_NEW(octdwctwo, sizeof(stru
 static int
 octeon_dwc2_match(device_t parent, struct cfdata *cf, void *aux)
 {
+	const mips_prid_t cpu_id = mips_options.mips_cpu_id;
 	struct iobus_attach_args *aa = aux;
 
 	if (strcmp(cf->cf_name, aa->aa_name) != 0)
 		return 0;
 
-	return 1;
+	switch (MIPS_PRID_IMPL(cpu_id)) {
+	case MIPS_CN31XX:
+	case MIPS_CN30XX:
+	case MIPS_CN50XX:
+		return 1;
+	default:
+		return 0;
+	}
 }
 
 static void
@@ -214,8 +213,8 @@ octeon_dwc2_attach(device_t parent, devi
 		 */
 		/* XXX board specific */
 		clk &= ~(USBN_CLK_CTL_DIVIDE | USBN_CLK_CTL_DIVIDE2);
-		clk |= SET_USBN_CLK_CTL_DIVIDE(0x4ULL)
-			| SET_USBN_CLK_CTL_DIVIDE2(0x0ULL);
+		clk |= __SHIFTIN(0x4, USBN_CLK_CTL_DIVIDE) |	/* XX magic 0x4 */
+		   __SHIFTIN(0x0, USBN_CLK_CTL_DIVIDE2);
 		octeon_dwc2_reg_wr(sc, USBN_CLK_CTL_OFFSET, clk);
 		/*
 		 * d. Write USBN_CLK_CTL[HCLK_RST] = 1.
@@ -233,7 +232,7 @@ octeon_dwc2_attach(device_t parent, devi
 		 * a. write USBN_CLK_CTL[DIVIDE] with the new divide value.
 		 */
 		clk = octeon_dwc2_reg_rd(sc, USBN_CLK_CTL_OFFSET);
-		clk |= 0x4ULL & USBN_CLK_CTL_DIVIDE;
+		clk |= __SHIFTIN(0x4, USBN_CLK_CTL_DIVIDE);	/* XX magic 0x4 */
 		octeon_dwc2_reg_wr(sc, USBN_CLK_CTL_OFFSET, clk);
 		/*
 		 * b. Wait 64 core-clock cycles for HCLK to stabilize.
@@ -241,7 +240,7 @@ octeon_dwc2_attach(device_t parent, devi
 		delay(1);
 		break;
 	default:
-		panic("unknown H/W type"); /* XXX */
+		panic("unknown H/W type"); /* shouldn't get here */
 	}
 
 	/*
@@ -330,7 +329,7 @@ 

CVS commit: src/sys/arch

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:18:02 UTC 2020

Modified Files:
src/sys/arch/evbmips/conf: ERLITE
src/sys/arch/mips/cavium: octeon1p_iobus.c
src/sys/arch/mips/cavium/dev: octeon_pip.c octeon_pipreg.h
octeon_pipvar.h octeon_smi.c octeon_smireg.h octeon_smivar.h

Log Message:
Redo cnmac attachments - cnmacM @ gmxN @ pip0 @ iobus


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbmips/conf/ERLITE
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/cavium/octeon1p_iobus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/cavium/dev/octeon_pip.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/cavium/dev/octeon_pipreg.h \
src/sys/arch/mips/cavium/dev/octeon_pipvar.h \
src/sys/arch/mips/cavium/dev/octeon_smi.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/mips/cavium/dev/octeon_smireg.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/cavium/dev/octeon_smivar.h

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



CVS commit: src/sys/arch

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:18:02 UTC 2020

Modified Files:
src/sys/arch/evbmips/conf: ERLITE
src/sys/arch/mips/cavium: octeon1p_iobus.c
src/sys/arch/mips/cavium/dev: octeon_pip.c octeon_pipreg.h
octeon_pipvar.h octeon_smi.c octeon_smireg.h octeon_smivar.h

Log Message:
Redo cnmac attachments - cnmacM @ gmxN @ pip0 @ iobus


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbmips/conf/ERLITE
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/cavium/octeon1p_iobus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/cavium/dev/octeon_pip.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/cavium/dev/octeon_pipreg.h \
src/sys/arch/mips/cavium/dev/octeon_pipvar.h \
src/sys/arch/mips/cavium/dev/octeon_smi.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/mips/cavium/dev/octeon_smireg.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/cavium/dev/octeon_smivar.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/evbmips/conf/ERLITE
diff -u src/sys/arch/evbmips/conf/ERLITE:1.26 src/sys/arch/evbmips/conf/ERLITE:1.27
--- src/sys/arch/evbmips/conf/ERLITE:1.26	Fri Jun  5 07:17:38 2020
+++ src/sys/arch/evbmips/conf/ERLITE	Tue Jun 23 05:18:02 2020
@@ -1,11 +1,11 @@
-#	$NetBSD: ERLITE,v 1.26 2020/06/05 07:17:38 simonb Exp $
+#	$NetBSD: ERLITE,v 1.27 2020/06/23 05:18:02 simonb Exp $
 
 include 	"arch/mips/conf/std.octeon"
 include 	"arch/evbmips/conf/files.octeon"
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"ERLITE-$Revision: 1.26 $"
+#ident 		"ERLITE-$Revision: 1.27 $"
 
 maxusers	32
 
@@ -116,12 +116,16 @@ bootbus0	at mainbus?
 
 com*		at iobus?
 
-octrnm*		at iobus?
+octsmi*		at iobus?		# MDIO controller
+octpip*		at iobus?		# PIP packet processing controller
 
-octgmx*		at iobus?
+octgmx*		at octpip?
 cnmac*		at octgmx?
 
+octrnm*		at iobus?		# Random Number Memory (and generator)
+
 dwctwo*		at iobus?
+
 usb*		at dwctwo?
 
 uhub*		at usb?
@@ -131,6 +135,7 @@ umass*		at uhub? port ? configuration ? 
 scsibus*	at umass? channel ?
 sd*		at scsibus? target ? lun ?	# SCSI disk drives
 
+# Ethernet PHYs
 atphy*		at mii? phy ?		# Attansic/Atheros PHYs
 ukphy*		at mii? phy ?		# generic unknown PHYs
 
@@ -173,4 +178,3 @@ pseudo-device	drvctl# driver control
 include "dev/veriexec.config"
 
 cinclude 	"arch/evbmips/conf/ERLITE.local"
-

Index: src/sys/arch/mips/cavium/octeon1p_iobus.c
diff -u src/sys/arch/mips/cavium/octeon1p_iobus.c:1.4 src/sys/arch/mips/cavium/octeon1p_iobus.c:1.5
--- src/sys/arch/mips/cavium/octeon1p_iobus.c:1.4	Sun May 31 14:05:21 2020
+++ src/sys/arch/mips/cavium/octeon1p_iobus.c	Tue Jun 23 05:18:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon1p_iobus.c,v 1.4 2020/05/31 14:05:21 simonb Exp $	*/
+/*	$NetBSD: octeon1p_iobus.c,v 1.5 2020/06/23 05:18:02 simonb Exp $	*/
 
 /*
  * Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: octeon1p_iobus.c,v 1.4 2020/05/31 14:05:21 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon1p_iobus.c,v 1.5 2020/06/23 05:18:02 simonb Exp $");
 
 #include 
 #include 
@@ -41,7 +41,6 @@ __KERNEL_RCSID(0, "$NetBSD: octeon1p_iob
 #include 
 
 /*  UART */
-
 #include 
 static const struct iobus_unit iobus_units_octuart[] = {
 	{
@@ -59,7 +58,6 @@ static const struct iobus_dev iobus_dev_
 };
 
 /*  RNM */
-
 #include 
 static const struct iobus_unit iobus_units_octrnm[] = {
 	{
@@ -74,7 +72,6 @@ static const struct iobus_dev iobus_dev_
 };
 
 /*  TWSI */
-
 #include 
 static const struct iobus_unit iobus_units_octtwsi[] = {
 	{
@@ -89,7 +86,6 @@ static const struct iobus_dev iobus_dev_
 };
 
 /*  MPI/SPI */
-
 #include 
 static const struct iobus_unit	iobus_units_octmpi[] = {
 	{
@@ -102,19 +98,33 @@ static const struct iobus_dev iobus_dev_
 	.nunits = MPI_NUNITS,
 	.units = iobus_units_octmpi
 };
-/*  GMX */
 
-#include 
-static const struct iobus_unit	iobus_units_octgmx[] = {
+/*  SMI */
+#include 
+static const struct iobus_unit	iobus_units_octsmi[] = {
+	{
+		.addr = SMI_BASE
+	}
+};
+
+static const struct iobus_dev iobus_dev_octsmi = {
+	.name = "octsmi",
+	.nunits = SMI_NUNITS,
+	.units = iobus_units_octsmi
+};
+
+/*  PIP */
+#include 
+static const struct iobus_unit	iobus_units_octpip[] = {
 	{
-		.addr = GMX0_BASE_IF0
+		.addr = PIP_BASE
 	}
 };
 
-static const struct iobus_dev iobus_dev_octgmx = {
-	.name = "octgmx",
-	.nunits = GMX_IF_NUNITS,
-	.units = iobus_units_octgmx
+static const struct iobus_dev iobus_dev_octpip = {
+	.name = "octpip",
+	.nunits = 1,
+	.units = iobus_units_octpip
 };
 
 
@@ -139,7 +149,8 @@ const struct iobus_dev * const iobus_dev
 	_dev_octrnm,
 	_dev_octtwsi,
 	_dev_octmpi,
-	_dev_octgmx,
+	_dev_octsmi,
+	_dev_octpip,
 	_dev_octusbn,
 };
 

Index: src/sys/arch/mips/cavium/dev/octeon_pip.c
diff -u src/sys/arch/mips/cavium/dev/octeon_pip.c:1.7 

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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:17:13 UTC 2020

Modified Files:
src/sys/arch/mips/cavium/dev: if_cnmac.c if_cnmacvar.h octeon_gmx.c
octeon_gmxreg.h octeon_gmxvar.h

Log Message:
Redo cnmac attachments - cnmacM @ gmxN @ pip0 @ iobus
Support SGMII mode used on CN70XX.
Most functional changes from OpenBSD octeon port.  Still more to come from
the OpenBSD driver.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mips/cavium/dev/if_cnmac.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/cavium/dev/if_cnmacvar.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/mips/cavium/dev/octeon_gmx.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/cavium/dev/octeon_gmxreg.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/cavium/dev/octeon_gmxvar.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/dev/if_cnmac.c
diff -u src/sys/arch/mips/cavium/dev/if_cnmac.c:1.23 src/sys/arch/mips/cavium/dev/if_cnmac.c:1.24
--- src/sys/arch/mips/cavium/dev/if_cnmac.c:1.23	Mon Jun 22 02:26:19 2020
+++ src/sys/arch/mips/cavium/dev/if_cnmac.c	Tue Jun 23 05:17:13 2020
@@ -1,11 +1,33 @@
-/*	$NetBSD: if_cnmac.c,v 1.23 2020/06/22 02:26:19 simonb Exp $	*/
+/*	$NetBSD: if_cnmac.c,v 1.24 2020/06/23 05:17:13 simonb Exp $	*/
 
-#include 
-#if 0
-__KERNEL_RCSID(0, "$NetBSD: if_cnmac.c,v 1.23 2020/06/22 02:26:19 simonb Exp $");
-#endif
+/*
+ * Copyright (c) 2007 Internet Initiative Japan, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
 
-#include "opt_octeon.h"
+#include 
+__KERNEL_RCSID(0, "$NetBSD: if_cnmac.c,v 1.24 2020/06/23 05:17:13 simonb Exp $");
 
 /*
  * If no free send buffer is available, free all the sent buffers and bail out.
@@ -30,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_cnmac.c,v
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -52,23 +73,24 @@ __KERNEL_RCSID(0, "$NetBSD: if_cnmac.c,v
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
+
 #include 
 
 /*
@@ -86,8 +108,6 @@ static void	cnmac_attach(device_t, devic
 static void	cnmac_pip_init(struct cnmac_softc *);
 static void	cnmac_ipd_init(struct cnmac_softc *);
 static void	cnmac_pko_init(struct cnmac_softc *);
-static void	cnmac_asx_init(struct cnmac_softc *);
-static void	cnmac_smi_init(struct cnmac_softc *);
 
 static void	cnmac_board_mac_addr(uint8_t *, size_t, struct cnmac_softc *);
 
@@ -107,11 +127,8 @@ static inline void cnmac_send_queue_add(
 uint64_t *);
 static inline void cnmac_send_queue_del(struct cnmac_softc *, struct mbuf **,
 uint64_t **);
-static inline int cnmac_buf_free_work(struct cnmac_softc *, uint64_t *,
-uint64_t);
-static inline void cnmac_buf_ext_free_m(struct mbuf *, void *, size_t, void *);
-static inline void cnmac_buf_ext_free_ext(struct mbuf *, void *, size_t,
-void *);
+static inline int cnmac_buf_free_work(struct cnmac_softc *, uint64_t *);
+static inline void cnmac_buf_ext_free(struct mbuf *, void *, size_t, void *);
 
 static int	cnmac_ioctl(struct ifnet *, u_long, void *);
 static void	cnmac_watchdog(struct ifnet *);
@@ -122,7 +139,8 @@ static void	cnmac_start(struct ifnet *);
 static inline int cnmac_send_cmd(struct cnmac_softc *, uint64_t, uint64_t,
 int *);
 static inline uint64_t	cnmac_send_makecmd_w1(int, paddr_t);
-static inline uint64_t	cnmac_send_makecmd_w0(uint64_t, uint64_t, size_t, int);
+static inline uint64_t	cnmac_send_makecmd_w0(uint64_t, 

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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:17:13 UTC 2020

Modified Files:
src/sys/arch/mips/cavium/dev: if_cnmac.c if_cnmacvar.h octeon_gmx.c
octeon_gmxreg.h octeon_gmxvar.h

Log Message:
Redo cnmac attachments - cnmacM @ gmxN @ pip0 @ iobus
Support SGMII mode used on CN70XX.
Most functional changes from OpenBSD octeon port.  Still more to come from
the OpenBSD driver.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mips/cavium/dev/if_cnmac.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/cavium/dev/if_cnmacvar.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/mips/cavium/dev/octeon_gmx.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/cavium/dev/octeon_gmxreg.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/cavium/dev/octeon_gmxvar.h

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



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:15:33 UTC 2020

Modified Files:
src/sys/arch/mips/cavium: octeonvar.h
src/sys/arch/mips/cavium/dev: octeon_ipd.c octeon_ipdvar.h octeon_pko.c
octeon_pkovar.h octeon_pow.c octeon_powreg.h octeon_powvar.h

Log Message:
Cleanup - mostly removing unused code and defines.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/cavium/octeonvar.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/cavium/dev/octeon_ipd.c \
src/sys/arch/mips/cavium/dev/octeon_powvar.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/cavium/dev/octeon_ipdvar.h \
src/sys/arch/mips/cavium/dev/octeon_pko.c \
src/sys/arch/mips/cavium/dev/octeon_powreg.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/cavium/dev/octeon_pkovar.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mips/cavium/dev/octeon_pow.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/octeonvar.h
diff -u src/sys/arch/mips/cavium/octeonvar.h:1.12 src/sys/arch/mips/cavium/octeonvar.h:1.13
--- src/sys/arch/mips/cavium/octeonvar.h:1.12	Mon Jun 22 02:26:19 2020
+++ src/sys/arch/mips/cavium/octeonvar.h	Tue Jun 23 05:15:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeonvar.h,v 1.12 2020/06/22 02:26:19 simonb Exp $	*/
+/*	$NetBSD: octeonvar.h,v 1.13 2020/06/23 05:15:33 simonb Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -52,18 +52,6 @@
 		"	.set arch=octeon		\n"
 #define	_ASM_EPILOGUE \
 		"	.set pop			\n"
-/*
- * subbits = __BITS64_GET(XXX, bits);
- * bits = __BITS64_SET(XXX, subbits);
- */
-#ifndef	__BITS64_GET
-#define	__BITS64_GET(name, bits)	\
-	(((uint64_t)(bits) & name) >> name##_SHIFT)
-#endif
-#ifndef	__BITS64_SET
-#define	__BITS64_SET(name, subbits)	\
-	(((uint64_t)(subbits) << name##_SHIFT) & name)
-#endif
 
 #ifdef _KERNEL
 extern int	octeon_core_ver;
@@ -211,22 +199,7 @@ struct octfau_map {
 #define	OCTEON_POW_QOS_XXX_6		6
 #define	OCTEON_POW_QOS_XXX_7		7
 
-#define	OCTEON_POW_GROUP_PIP		0
-#define	OCTEON_POW_GROUP_XXX_1		1
-#define	OCTEON_POW_GROUP_XXX_2		2
-#define	OCTEON_POW_GROUP_XXX_3		3
-#define	OCTEON_POW_GROUP_XXX_4		4
-#define	OCTEON_POW_GROUP_XXX_5		5
-#define	OCTEON_POW_GROUP_XXX_6		6
-#define	OCTEON_POW_GROUP_CORE1_SEND	7
-#define	OCTEON_POW_GROUP_CORE1_TASK_0	8
-#define	OCTEON_POW_GROUP_CORE1_TASK_1	9
-#define	OCTEON_POW_GROUP_CORE1_TASK_2	10
-#define	OCTEON_POW_GROUP_CORE1_TASK_3	11
-#define	OCTEON_POW_GROUP_CORE1_TASK_4	12
-#define	OCTEON_POW_GROUP_CORE1_TASK_5	13
-#define	OCTEON_POW_GROUP_CORE1_TASK_6	14
-#define	OCTEON_POW_GROUP_CORE1_TASK_7	15
+#define	OCTEON_POW_GROUP_MAX		16
 
 #ifdef _KERNEL
 extern struct octeon_config	octeon_configuration;
@@ -305,14 +278,6 @@ void		mips_cp0_cvmctl_write(uint64_t);
 #define OCTEON_SYNC		OCTEON_SYNCCOMMON(sync)
 #define OCTEON_SYNCWS		OCTEON_SYNCCOMMON(syncws)
 #define OCTEON_SYNCS		OCTEON_SYNCCOMMON(syncs)
-/* XXX backward compatibility */
-#if 1
-#define	OCT_SYNCIOBDMA		OCTEON_SYNCIOBDMA
-#define	OCT_SYNCW		OCTEON_SYNCW
-#define	OCT_SYNC		OCTEON_SYNC
-#define	OCT_SYNCWS		OCTEON_SYNCWS
-#define	OCT_SYNCS		OCTEON_SYNCS
-#endif
 
 /* octeon core does not use cca to determine cacheability */
 #define OCTEON_CCA_NONE UINT64_C(0)
@@ -329,14 +294,6 @@ octeon_xkphys_write_8(paddr_t address, u
 	mips3_sd(MIPS_PHYS_TO_XKPHYS(OCTEON_CCA_NONE, address), value);
 }
 
-/* XXX backward compatibility */
-#if 1
-#define octeon_read_csr(address) \
-	octeon_xkphys_read_8(address)
-#define octeon_write_csr(address, value) \
-	octeon_xkphys_write_8(address, value)
-#endif
-
 static __inline void
 octeon_iobdma_write_8(uint64_t value)
 {
@@ -347,72 +304,15 @@ octeon_iobdma_write_8(uint64_t value)
 static __inline uint64_t
 octeon_cvmseg_read_8(size_t offset)
 {
+
 	return octeon_xkphys_read_8(OCTEON_CVMSEG_LM + offset);
 }
 
 static __inline void
 octeon_cvmseg_write_8(size_t offset, uint64_t value)
 {
-	octeon_xkphys_write_8(OCTEON_CVMSEG_LM + offset, value);
-}
-
-/* XXX */
-static __inline uint32_t
-octeon_disable_interrupt(uint32_t *new)
-{
-	uint32_t s, tmp;
-
-	__asm __volatile (
-		_ASM_PROLOGUE
-		"	mfc0	%[s], $12		\n"
-		"	and	%[tmp], %[s], ~1	\n"
-		"	mtc0	%[tmp], $12		\n"
-		_ASM_EPILOGUE
-		: [s]"="(s), [tmp]"="(tmp));
-	if (new)
-		*new = tmp;
-	return s;
-}
-
-/* XXX */
-static __inline void
-octeon_restore_status(uint32_t s)
-{
-	__asm __volatile (
-		_ASM_PROLOGUE
-		"	mtc0	%[s], $12		\n"
-		_ASM_EPILOGUE
-		:: [s]"r"(s));
-}
 
-static __inline uint64_t
-octeon_get_cycles(void)
-{ 
-#if defined(__mips_o32)
-	uint32_t s, lo, hi;
-  
-	s = octeon_disable_interrupt((void *)0);
-	__asm __volatile (
-		_ASM_PROLOGUE_MIPS64
-		"	dmfc0	%[lo], $9, 6		\n"
-		"	add	%[hi], %[lo], $0	\n"
-		"	srl	%[hi], 32		\n"
-		"	sll	%[lo], 32		\n"
-		"	srl	%[lo], 32		\n"
-		_ASM_EPILOGUE
-		: [lo]"="(lo), [hi]"="(hi));
-	octeon_restore_status(s);
-	return ((uint64_t)hi << 32) + 

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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:15:33 UTC 2020

Modified Files:
src/sys/arch/mips/cavium: octeonvar.h
src/sys/arch/mips/cavium/dev: octeon_ipd.c octeon_ipdvar.h octeon_pko.c
octeon_pkovar.h octeon_pow.c octeon_powreg.h octeon_powvar.h

Log Message:
Cleanup - mostly removing unused code and defines.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/cavium/octeonvar.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/cavium/dev/octeon_ipd.c \
src/sys/arch/mips/cavium/dev/octeon_powvar.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/cavium/dev/octeon_ipdvar.h \
src/sys/arch/mips/cavium/dev/octeon_pko.c \
src/sys/arch/mips/cavium/dev/octeon_powreg.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/cavium/dev/octeon_pkovar.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mips/cavium/dev/octeon_pow.c

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



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:14:39 UTC 2020

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

Log Message:
Don't include "opt_octeon.h" any more.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 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.13 src/sys/arch/mips/cavium/octeon_intr.c:1.14
--- src/sys/arch/mips/cavium/octeon_intr.c:1.13	Sat Jun 20 18:48:28 2020
+++ src/sys/arch/mips/cavium/octeon_intr.c	Tue Jun 23 05:14:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon_intr.c,v 1.13 2020/06/20 18:48:28 riastradh Exp $	*/
+/*	$NetBSD: octeon_intr.c,v 1.14 2020/06/23 05:14:39 simonb Exp $	*/
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
  * All rights reserved.
@@ -38,14 +38,13 @@
  * Platform-specific interrupt support for the MIPS Malta.
  */
 
-#include "opt_octeon.h"
 #include "opt_multiprocessor.h"
 
 #include "cpunode.h"
 #define __INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: octeon_intr.c,v 1.13 2020/06/20 18:48:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon_intr.c,v 1.14 2020/06/23 05:14:39 simonb Exp $");
 
 #include 
 #include 



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:14:18 UTC 2020

Modified Files:
src/sys/arch/mips/cavium: octeon_cpunode.c octeon_iobus.c
src/sys/arch/mips/cavium/dev: octeon_asx.c octeon_ciu.c octeon_fau.c
octeon_fauvar.h octeon_fpa.c octeon_fpareg.h octeon_fpavar.h
octeon_usbnreg.h

Log Message:
Minor tweaks and cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/cavium/octeon_cpunode.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/cavium/octeon_iobus.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/cavium/dev/octeon_asx.c \
src/sys/arch/mips/cavium/dev/octeon_ciu.c \
src/sys/arch/mips/cavium/dev/octeon_fau.c \
src/sys/arch/mips/cavium/dev/octeon_fauvar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/cavium/dev/octeon_fpa.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/cavium/dev/octeon_fpareg.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/cavium/dev/octeon_fpavar.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/mips/cavium/dev/octeon_usbnreg.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/octeon_cpunode.c
diff -u src/sys/arch/mips/cavium/octeon_cpunode.c:1.12 src/sys/arch/mips/cavium/octeon_cpunode.c:1.13
--- src/sys/arch/mips/cavium/octeon_cpunode.c:1.12	Tue Jan 23 06:57:49 2018
+++ src/sys/arch/mips/cavium/octeon_cpunode.c	Tue Jun 23 05:14:18 2020
@@ -29,7 +29,7 @@
 #define __INTR_PRIVATE
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: octeon_cpunode.c,v 1.12 2018/01/23 06:57:49 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon_cpunode.c,v 1.13 2020/06/23 05:14:18 simonb Exp $");
 
 #include "locators.h"
 #include "cpunode.h"
@@ -63,7 +63,6 @@ struct cpunode_attach_args {
 struct cpunode_softc {
 	device_t sc_dev;
 	device_t sc_wdog_dev;
-	uint64_t sc_fuse;
 };
 
 static int cpunode_mainbus_match(device_t, cfdata_t, void *);
@@ -80,8 +79,6 @@ CFATTACH_DECL_NEW(cpu_cpunode, 0,
 
 kcpuset_t *cpus_booted;
 
-void octeon_reset_vector(void);
-
 static void wdog_cpunode_poke(void *arg);
 
 static int
@@ -109,18 +106,14 @@ void
 cpunode_mainbus_attach(device_t parent, device_t self, void *aux)
 {
 	struct cpunode_softc * const sc = device_private(self);
+	const uint64_t fuse = octeon_xkphys_read_8(CIU_FUSE);
 	int cpunum = 0;
 
 	sc->sc_dev = self;
-	sc->sc_fuse = octeon_xkphys_read_8(CIU_FUSE);
 
-	aprint_naive(": %u core%s\n",
-	popcount32((uint32_t)sc->sc_fuse),
-	sc->sc_fuse == 1 ? "" : "s");
-
-	aprint_normal(": %u core%s",
-	popcount32((uint32_t)sc->sc_fuse),
-	sc->sc_fuse == 1 ? "" : "s");
+	aprint_naive(": %u core%s\n", popcount64(fuse), fuse == 1 ? "" : "s");
+	aprint_normal(": %u core%s", popcount64(fuse), fuse == 1 ? "" : "s");
+
 	const uint64_t cvmctl = mips_cp0_cvmctl_read();
 	aprint_normal(", %scrypto", (cvmctl & CP0_CVMCTL_NOCRYPTO) ? "no " : "");
 	aprint_normal((cvmctl & CP0_CVMCTL_KASUMI) ? "+kasumi" : "");
@@ -134,7 +127,7 @@ cpunode_mainbus_attach(device_t parent, 
 #endif
 	aprint_normal("\n");
 
-	for (uint64_t fuse = sc->sc_fuse; fuse != 0; fuse >>= 1, cpunum++) {
+	for (uint64_t f = fuse; f != 0; f >>= 1, cpunum++) {
 		struct cpunode_attach_args cnaa = {
 			.cnaa_name = "cpu",
 			.cnaa_cpunum = cpunum,
@@ -250,6 +243,7 @@ cpu_cpunode_attach_common(device_t self,
 	KASSERTMSG(cpu != NULL, "ci %p index %d", ci, cpu_index(ci));
 
 #if NWDOG > 0 || defined(DDB)
+	/* XX __mips_n32 and MIPS_PHYS_TO_XKPHYS_CACHED needed here?? */
 	void **nmi_vector = (void *)MIPS_PHYS_TO_KSEG0(0x800 + 32*ci->ci_cpuid);
 	*nmi_vector = octeon_reset_vector;
 
@@ -266,9 +260,10 @@ cpu_cpunode_attach_common(device_t self,
 	KASSERT(cpu->cpu_wdog_sih != NULL);
 #endif
 
-	aprint_normal(": %lu.%02luMHz (hz cycles = %lu, delay divisor = %lu)\n",
-	ci->ci_cpu_freq / 100,
-	(ci->ci_cpu_freq % 100) / 1,
+	aprint_normal(": %lu.%02luMHz\n",
+	(ci->ci_cpu_freq + 5000) / 100,
+	((ci->ci_cpu_freq + 5000) % 100) / 1);
+	aprint_debug_dev(self, "hz cycles = %lu, delay divisor = %lu\n",
 	ci->ci_cycles_per_hz, ci->ci_divisor_delay);
 
 	if (CPU_IS_PRIMARY(ci)) {

Index: src/sys/arch/mips/cavium/octeon_iobus.c
diff -u src/sys/arch/mips/cavium/octeon_iobus.c:1.3 src/sys/arch/mips/cavium/octeon_iobus.c:1.4
--- src/sys/arch/mips/cavium/octeon_iobus.c:1.3	Sun May 31 06:27:06 2020
+++ src/sys/arch/mips/cavium/octeon_iobus.c	Tue Jun 23 05:14:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon_iobus.c,v 1.3 2020/05/31 06:27:06 simonb Exp $	*/
+/*	$NetBSD: octeon_iobus.c,v 1.4 2020/06/23 05:14:18 simonb Exp $	*/
 
 /*
  * Copyright (c) 2007
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: octeon_iobus.c,v 1.3 2020/05/31 06:27:06 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon_iobus.c,v 1.4 2020/06/23 05:14:18 simonb Exp $");
 
 #include "locators.h"
 
@@ -47,18 +47,17 @@ struct iobus_softc {
 	bus_space_handle_t	sc_ops_bush;
 };
 
-static int		

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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:14:39 UTC 2020

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

Log Message:
Don't include "opt_octeon.h" any more.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 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.



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 05:14:18 UTC 2020

Modified Files:
src/sys/arch/mips/cavium: octeon_cpunode.c octeon_iobus.c
src/sys/arch/mips/cavium/dev: octeon_asx.c octeon_ciu.c octeon_fau.c
octeon_fauvar.h octeon_fpa.c octeon_fpareg.h octeon_fpavar.h
octeon_usbnreg.h

Log Message:
Minor tweaks and cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/cavium/octeon_cpunode.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/cavium/octeon_iobus.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/cavium/dev/octeon_asx.c \
src/sys/arch/mips/cavium/dev/octeon_ciu.c \
src/sys/arch/mips/cavium/dev/octeon_fau.c \
src/sys/arch/mips/cavium/dev/octeon_fauvar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/cavium/dev/octeon_fpa.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mips/cavium/dev/octeon_fpareg.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/cavium/dev/octeon_fpavar.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/mips/cavium/dev/octeon_usbnreg.h

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



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 03:09:35 UTC 2020

Removed Files:
src/sys/arch/mips/cavium/dev: octeon_usbcvar.h octeon_usbnvar.h

Log Message:
Remove unused include files.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r0 src/sys/arch/mips/cavium/dev/octeon_usbcvar.h
cvs rdiff -u -r1.1 -r0 src/sys/arch/mips/cavium/dev/octeon_usbnvar.h

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



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 03:09:35 UTC 2020

Removed Files:
src/sys/arch/mips/cavium/dev: octeon_usbcvar.h octeon_usbnvar.h

Log Message:
Remove unused include files.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r0 src/sys/arch/mips/cavium/dev/octeon_usbcvar.h
cvs rdiff -u -r1.1 -r0 src/sys/arch/mips/cavium/dev/octeon_usbnvar.h

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



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 03:08:11 UTC 2020

Modified Files:
src/sys/arch/mips/cavium/dev: octeon_usbcreg.h

Log Message:
Remove USB controller register definitions, these match dwc2 core and
weren't used anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/cavium/dev/octeon_usbcreg.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/dev/octeon_usbcreg.h
diff -u src/sys/arch/mips/cavium/dev/octeon_usbcreg.h:1.3 src/sys/arch/mips/cavium/dev/octeon_usbcreg.h:1.4
--- src/sys/arch/mips/cavium/dev/octeon_usbcreg.h:1.3	Mon Jun 22 12:26:11 2020
+++ src/sys/arch/mips/cavium/dev/octeon_usbcreg.h	Tue Jun 23 03:08:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon_usbcreg.h,v 1.3 2020/06/22 12:26:11 simonb Exp $	*/
+/*	$NetBSD: octeon_usbcreg.h,v 1.4 2020/06/23 03:08:11 simonb Exp $	*/
 
 /*
  * Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -33,671 +33,9 @@
 #ifndef _OCTEON_USBCREG_H_
 #define _OCTEON_USBCREG_H_
 
-/*  register addresses */
-
-#define USBC_GOTGCTL0x00016F001000ULL
-#define USBC_GOTGINT0x00016F001004ULL
-#define USBC_GAHBCFG0x00016F001008ULL
-#define USBC_GUSBCFG0x00016F00100CULL
-#define USBC_GRSTCTL0x00016F001010ULL
-#define USBC_GINTSTS0x00016F001014ULL
-#define USBC_GINTMSK0x00016F001018ULL
-#define USBC_GRXSTSRH0x00016F00101CULL
-#define USBC_GRXSTSPH0x00016F001020ULL
-#define USBC_GRXFSIZ0x00016F001024ULL
-#define USBC_GNPTXFSIZ0x00016F001028ULL
-#define USBC_GNPTXSTS0x00016F00102CULL
-#define USBC_GSNPSID0x00016F001040ULL
-#define USBC_GHWCFG10x00016F001044ULL
-#define USBC_GHWCFG20x00016F001048ULL
-#define USBC_GHWCFG30x00016F00104CULL
-#define USBC_GHWCFG40x00016F001050ULL
-#define USBC_HPTXFSIZ0x00016F001100ULL
-#define USBC_DPTXFSIZ10x00016F001104ULL
-#define USBC_DPTXFSIZ20x00016F001108ULL
-#define USBC_DPTXFSIZ30x00016F00110CULL
-#define USBC_DPTXFSIZ40x00016F001110ULL
-#define USBC_HCFG0x00016F001400ULL
-#define USBC_HFIR0x00016F001404ULL
-#define USBC_HFNUM0x00016F001408ULL
-#define USBC_HPTXSTS0x00016F001410ULL
-#define USBC_HAINT0x00016F001414ULL
-#define USBC_HAINTMSK0x00016F001418ULL
-#define USBC_HPRT0x00016F001440ULL
-#define USBC_HCCHAR00x00016F001500ULL
-#define USBC_HCCHAR10x00016F001520ULL
-#define USBC_HCCHAR20x00016F001540ULL
-#define USBC_HCCHAR30x00016F001560ULL
-#define USBC_HCCHAR40x00016F001580ULL
-#define USBC_HCCHAR50x00016F0015A0ULL
-#define USBC_HCCHAR60x00016F0015C0ULL
-#define USBC_HCCHAR70x00016F0015E0ULL
-#define USBC_HCSPLT00x00016F001504ULL
-#define USBC_HCSPLT10x00016F001524ULL
-#define USBC_HCSPLT20x00016F001544ULL
-#define USBC_HCSPLT30x00016F001564ULL
-#define USBC_HCSPLT40x00016F001584ULL
-#define USBC_HCSPLT50x00016F0015A4ULL
-#define USBC_HCSPLT60x00016F0015C4ULL
-#define USBC_HCSPLT70x00016F0015E4ULL
-#define USBC_HCINT00x00016F001508ULL
-#define USBC_HCINT10x00016F001528ULL
-#define USBC_HCINT20x00016F001548ULL
-#define USBC_HCINT30x00016F001568ULL
-#define USBC_HCINT40x00016F001588ULL
-#define USBC_HCINT50x00016F0015A8ULL
-#define USBC_HCINT60x00016F0015C8ULL
-#define USBC_HCINT70x00016F0015E8ULL
-#define USBC_HCINTMSK00x00016F00150CULL
-#define USBC_HCINTMSK10x00016F00152CULL
-#define USBC_HCINTMSK20x00016F00154CULL
-#define USBC_HCINTMSK30x00016F00156CULL
-#define USBC_HCINTMSK40x00016F00158CULL
-#define USBC_HCINTMSK50x00016F0015ACULL
-#define USBC_HCINTMSK60x00016F0015CCULL
-#define USBC_HCINTMSK70x00016F0015ECULL
-#define USBC_HCTSIZ00x00016F001510ULL
-#define USBC_HCTSIZ10x00016F001530ULL
-#define USBC_HCTSIZ20x00016F001550ULL
-#define USBC_HCTSIZ30x00016F001570ULL
-#define USBC_HCTSIZ40x00016F001590ULL
-#define USBC_HCTSIZ50x00016F0015B0ULL
-#define USBC_HCTSIZ60x00016F0015D0ULL
-#define USBC_HCTSIZ70x00016F0015F0ULL
-#define USBC_DCFG0x00016F001800ULL
-#define USBC_DCTL0x00016F001804ULL
-#define USBC_DSTS0x00016F001808ULL
-#define USBC_DIEPMSK0x00016F001810ULL
-#define USBC_DOEPMSK0x00016F001814ULL
-#define USBC_DAINT0x00016F001818ULL
-#define USBC_DAINTMSK0x00016F00181CULL
-#define USBC_DTKNQR10x00016F001820ULL
-#define USBC_DTKNQR20x00016F001824ULL
-#define USBC_DTKNQR30x00016F001830ULL
-#define USBC_DTKNQR40x00016F001834ULL
-#define USBC_DIEPCTL00x00016F001900ULL
-#define USBC_DIEPCTL1

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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 03:07:48 UTC 2020

Modified Files:
src/sys/arch/mips/cavium/dev: octeon_dwctwo.c

Log Message:
Remove unused octeon*usb*var*h includes.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/mips/cavium/dev/octeon_dwctwo.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/dev/octeon_dwctwo.c
diff -u src/sys/arch/mips/cavium/dev/octeon_dwctwo.c:1.11 src/sys/arch/mips/cavium/dev/octeon_dwctwo.c:1.12
--- src/sys/arch/mips/cavium/dev/octeon_dwctwo.c:1.11	Fri Jun 19 02:23:43 2020
+++ src/sys/arch/mips/cavium/dev/octeon_dwctwo.c	Tue Jun 23 03:07:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon_dwctwo.c,v 1.11 2020/06/19 02:23:43 simonb Exp $	*/
+/*	$NetBSD: octeon_dwctwo.c,v 1.12 2020/06/23 03:07:47 simonb Exp $	*/
 
 /*
  * Copyright (c) 2015 Masao Uebayashi 
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: octeon_dwctwo.c,v 1.11 2020/06/19 02:23:43 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: octeon_dwctwo.c,v 1.12 2020/06/23 03:07:47 simonb Exp $");
 
 #include "opt_octeon.h"
 #include "opt_usb.h"
@@ -63,9 +63,7 @@ __KERNEL_RCSID(0, "$NetBSD: octeon_dwctw
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
 #include 
 
 #include 



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 03:07:48 UTC 2020

Modified Files:
src/sys/arch/mips/cavium/dev: octeon_dwctwo.c

Log Message:
Remove unused octeon*usb*var*h includes.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/mips/cavium/dev/octeon_dwctwo.c

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



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Jun 23 03:08:11 UTC 2020

Modified Files:
src/sys/arch/mips/cavium/dev: octeon_usbcreg.h

Log Message:
Remove USB controller register definitions, these match dwc2 core and
weren't used anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/cavium/dev/octeon_usbcreg.h

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



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

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 22:43:56 UTC 2020

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

Log Message:
remove unneeded ifdefs


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/crypto/external/bsd/openssl/dist/crypto/armcap.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/armcap.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/armcap.c:1.11 src/crypto/external/bsd/openssl/dist/crypto/armcap.c:1.12
--- src/crypto/external/bsd/openssl/dist/crypto/armcap.c:1.11	Sat Mar 21 20:53:02 2020
+++ src/crypto/external/bsd/openssl/dist/crypto/armcap.c	Mon Jun 22 18:43:56 2020
@@ -41,7 +41,6 @@ static void ill_handler(int sig)
  * Following subroutines could have been inlined, but it's not all
  * ARM compilers support inline assembler...
  */
-#if __ARM_MAX_ARCH__>=7
 void _armv7_neon_probe(void);
 void _armv8_aes_probe(void);
 void _armv8_sha1_probe(void);
@@ -54,11 +53,9 @@ uint32_t _armv7_tick(void);
 
 uint32_t OPENSSL_rdtsc(void)
 {
-#if __ARM_MAX_ARCH__>=7
 if (OPENSSL_armcap_P & ARMV7_TICK)
 return _armv7_tick();
 else
-#endif
 return 0;
 }
 
@@ -210,7 +207,6 @@ void OPENSSL_cpuid_setup(void)
 _armv7_tick();
 OPENSSL_armcap_P |= ARMV7_TICK;
 }
-#endif
 
 sigaction(SIGILL, _oact, NULL);
 sigprocmask(SIG_SETMASK, , NULL);



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

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 22:43:56 UTC 2020

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

Log Message:
remove unneeded ifdefs


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/crypto/external/bsd/openssl/dist/crypto/armcap.c

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



CVS commit: src/usr.bin/make

2020-06-22 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Mon Jun 22 20:15:25 UTC 2020

Modified Files:
src/usr.bin/make: main.c

Log Message:
dieQuietly: ignore OP_SUBMAKE

Stick to OP_MAKE for deciding when to supress noise
as OP_SUBMAKE can be too aggressive.

Reviewed by: gson


To generate a diff of this commit:
cvs rdiff -u -r1.275 -r1.276 src/usr.bin/make/main.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/make/main.c
diff -u src/usr.bin/make/main.c:1.275 src/usr.bin/make/main.c:1.276
--- src/usr.bin/make/main.c:1.275	Fri Jun 19 21:17:48 2020
+++ src/usr.bin/make/main.c	Mon Jun 22 20:15:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.275 2020/06/19 21:17:48 sjg Exp $	*/
+/*	$NetBSD: main.c,v 1.276 2020/06/22 20:15:25 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.275 2020/06/19 21:17:48 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.276 2020/06/22 20:15:25 sjg Exp $";
 #else
 #include 
 #ifndef lint
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.275 2020/06/19 21:17:48 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.276 2020/06/22 20:15:25 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -2027,7 +2027,7 @@ dieQuietly(GNode *gn, int bf)
 	else if (bf >= 0)
 	quietly = bf;
 	else
-	quietly = (gn) ? ((gn->type  & (OP_MAKE|OP_SUBMAKE)) != 0) : 0;
+	quietly = (gn) ? ((gn->type  & (OP_MAKE)) != 0) : 0;
 }
 return quietly;
 }



CVS commit: src/usr.bin/make

2020-06-22 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Mon Jun 22 20:15:25 UTC 2020

Modified Files:
src/usr.bin/make: main.c

Log Message:
dieQuietly: ignore OP_SUBMAKE

Stick to OP_MAKE for deciding when to supress noise
as OP_SUBMAKE can be too aggressive.

Reviewed by: gson


To generate a diff of this commit:
cvs rdiff -u -r1.275 -r1.276 src/usr.bin/make/main.c

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



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 19:56:36 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm: modes.inc

Log Message:
Always compile in v8 support.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/modes.inc

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



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 19:56:36 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm: modes.inc

Log Message:
Always compile in v8 support.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/modes.inc

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/modes.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/modes.inc:1.4 src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/modes.inc:1.5
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/modes.inc:1.4	Wed Mar  7 15:38:39 2018
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/arm/modes.inc	Mon Jun 22 15:56:36 2020
@@ -3,9 +3,8 @@
 .PATH.S: ${.PARSEDIR}
 MODES_SRCS += ghash-armv4.S
 
-.if ${ARM_MAX_ARCH} >= 8
 MODES_SRCS += ghashv8-armx.S
-.endif
+AFLAGS.ghashv8-armx.S = -Wa,-march=armv8.4-a
 
 MODESCPPFLAGS = -DGHASH_ASM
 .include "../../modes.inc"



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

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 19:55:43 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/modes: gcm128.c

Log Message:
reduce diff with upstream. we always compile with v8 assembly and
detect at runtime.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c

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



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

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 19:55:43 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/modes: gcm128.c

Log Message:
reduce diff with upstream. we always compile with v8 assembly and
detect at runtime.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c:1.8 src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c:1.9
--- src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c:1.8	Sun Jun 21 18:17:35 2020
+++ src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c	Mon Jun 22 15:55:43 2020
@@ -668,6 +668,7 @@ void gcm_ghash_4bit_x86(u64 Xi[2], const
 #  if __ARM_MAX_ARCH__>=7
 #   define GHASH_ASM_ARM
 #   define GCM_FUNCREF_4BIT
+#   define PMULL_CAPABLE(OPENSSL_armcap_P & ARMV8_PMULL)
 #   if defined(__arm__) || defined(__arm)
 #define NEON_CAPABLE(OPENSSL_armcap_P & ARMV7_NEON)
 #   endif
@@ -675,18 +676,15 @@ void gcm_init_neon(u128 Htable[16], cons
 void gcm_gmult_neon(u64 Xi[2], const u128 Htable[16]);
 void gcm_ghash_neon(u64 Xi[2], const u128 Htable[16], const u8 *inp,
 size_t len);
-#   if __ARM_MAX_ARCH__>=8
-#define PMULL_CAPABLE(OPENSSL_armcap_P & ARMV8_PMULL)
 void gcm_init_v8(u128 Htable[16], const u64 Xi[2]);
 void gcm_gmult_v8(u64 Xi[2], const u128 Htable[16]);
 void gcm_ghash_v8(u64 Xi[2], const u128 Htable[16], const u8 *inp,
   size_t len);
-#   endif
 #  endif
 # elif defined(__sparc__) || defined(__sparc)
 #  include "sparc_arch.h"
-#   define GHASH_ASM_SPARC
-#   define GCM_FUNCREF_4BIT
+#  define GHASH_ASM_SPARC
+#  define GCM_FUNCREF_4BIT
 extern unsigned int OPENSSL_sparcv9cap_P[];
 void gcm_init_vis3(u128 Htable[16], const u64 Xi[2]);
 void gcm_gmult_vis3(u64 Xi[2], const u128 Htable[16]);



CVS commit: src/sys/dev/scsipi

2020-06-22 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Mon Jun 22 17:38:27 UTC 2020

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

Log Message:
Add sedetach() and also use it to remove duplicate code from seattach().
Correct a comment about sedone().


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/scsipi/if_se.c

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

Modified files:

Index: src/sys/dev/scsipi/if_se.c
diff -u src/sys/dev/scsipi/if_se.c:1.106 src/sys/dev/scsipi/if_se.c:1.107
--- src/sys/dev/scsipi/if_se.c:1.106	Mon Jun 22 16:05:20 2020
+++ src/sys/dev/scsipi/if_se.c	Mon Jun 22 17:38:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_se.c,v 1.106 2020/06/22 16:05:20 jdc Exp $	*/
+/*	$NetBSD: if_se.c,v 1.107 2020/06/22 17:38:27 jdc Exp $	*/
 
 /*
  * Copyright (c) 1997 Ian W. Dall 
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_se.c,v 1.106 2020/06/22 16:05:20 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_se.c,v 1.107 2020/06/22 17:38:27 jdc Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -198,10 +198,12 @@ struct se_softc {
 	int sc_flags;
 	int sc_last_timeout;
 	int sc_enabled;
+	int sc_attach_state;
 };
 
 static int	sematch(device_t, cfdata_t, void *);
 static void	seattach(device_t, device_t, void *);
+static int	sedetach(device_t, int);
 
 static void	se_ifstart(struct ifnet *);
 
@@ -240,7 +242,7 @@ int	se_enable(struct se_softc *);
 void	se_disable(struct se_softc *);
 
 CFATTACH_DECL_NEW(se, sizeof(struct se_softc),
-sematch, seattach, NULL, NULL);
+sematch, seattach, sedetach, NULL);
 
 extern struct cfdriver se_cd;
 
@@ -267,7 +269,7 @@ const struct scsipi_periphsw se_switch =
 	NULL,			/* Use default error handler */
 	NULL,			/* have no queue */
 	NULL,			/* have no async handler */
-	sedone,			/* deal with stats at interrupt time */
+	sedone,			/* deal with send/recv completion */
 };
 
 const struct scsipi_inquiry_pattern se_patterns[] = {
@@ -330,6 +332,7 @@ seattach(device_t parent, device_t self,
 	printf("\n");
 	SC_DEBUG(periph, SCSIPI_DB2, ("seattach: "));
 
+	sc->sc_attach_state = 0;
 	callout_init(>sc_recv_ch, CALLOUT_MPSAFE);
 	mutex_init(>sc_iflock, MUTEX_DEFAULT, IPL_SOFTNET);
 
@@ -363,43 +366,82 @@ seattach(device_t parent, device_t self,
 	IFQ_SET_READY(>if_snd);
 
 	se_get_addr(sc, myaddr);
+	sc->sc_attach_state = 1;
 
 	/* Attach the interface. */
 	rv = if_initialize(ifp);
 	if (rv != 0) {
-		free(sc->sc_tbuf, M_DEVBUF);
-		callout_destroy(>sc_recv_ch);
-		mutex_destroy(>sc_iflock);
+		sedetach(sc->sc_dev, 0);
 		return; /* Error */
 	}
+	
 	snprintf(wqname, sizeof(wqname), "%sRx", device_xname(sc->sc_dev));
 	rv = workqueue_create(>sc_recv_wq, wqname, se_recv_worker, sc,
 	PRI_SOFTNET, IPL_NET, WQ_MPSAFE);
 	if (rv != 0) {
 		aprint_error_dev(sc->sc_dev,
-		"unable to create recv workqueue\n");
-		free(sc->sc_tbuf, M_DEVBUF);
-		callout_destroy(>sc_recv_ch);
-		mutex_destroy(>sc_iflock);
+		"unable to create recv Rx workqueue\n");
+		sedetach(sc->sc_dev, 0);
 		return; /* Error */
 	}
 	sc->sc_recv_work_pending = false;
+	sc->sc_attach_state = 2;
+
 	snprintf(wqname, sizeof(wqname), "%sTx", device_xname(sc->sc_dev));
 	rv = workqueue_create(>sc_send_wq, wqname, se_send_worker, ifp,
 	PRI_SOFTNET, IPL_NET, WQ_MPSAFE);
 	if (rv != 0) {
 		aprint_error_dev(sc->sc_dev,
-		"unable to create send workqueue\n");
-		free(sc->sc_tbuf, M_DEVBUF);
-		callout_destroy(>sc_recv_ch);
-		mutex_destroy(>sc_iflock);
-		workqueue_destroy(sc->sc_send_wq);
+		"unable to create send Tx workqueue\n");
+		sedetach(sc->sc_dev, 0);
 		return; /* Error */
 	}
 	sc->sc_send_work_pending = false;
+	sc->sc_attach_state = 3;
+
 	sc->sc_ipq = if_percpuq_create(>sc_ethercom.ec_if);
 	ether_ifattach(ifp, myaddr);
 	if_register(ifp);
+	sc->sc_attach_state = 4;
+}
+
+static int
+sedetach(device_t self, int flags)
+{
+	struct se_softc *sc = device_private(self);
+	struct ifnet *ifp = >sc_ethercom.ec_if;
+
+	switch(sc->sc_attach_state) {
+	case 4:
+		se_stop(sc);
+		mutex_enter(>sc_iflock);
+		ifp->if_flags &= ~IFF_RUNNING;
+		se_disable(sc);
+		callout_halt(>sc_recv_ch, NULL);
+		ether_ifdetach(ifp);
+		if_detach(ifp);
+		mutex_exit(>sc_iflock);
+		if_percpuq_destroy(sc->sc_ipq);
+		/*FALLTHROUGH*/
+	case 3:
+		workqueue_destroy(sc->sc_send_wq);
+		/*FALLTHROUGH*/
+	case 2:
+		workqueue_destroy(sc->sc_recv_wq);
+		/*FALLTHROUGH*/
+	case 1:
+		free(sc->sc_rbuf, M_DEVBUF);
+		free(sc->sc_tbuf, M_DEVBUF);
+		callout_destroy(>sc_recv_ch);
+		mutex_destroy(>sc_iflock);
+		break;
+	default:
+		aprint_error_dev(sc->sc_dev, "detach failed (state %d)\n",
+		sc->sc_attach_state);
+		return 1;
+		break;
+	}
+	return 0;
 }
 
 /*



CVS commit: src/sys/dev/scsipi

2020-06-22 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Mon Jun 22 17:38:27 UTC 2020

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

Log Message:
Add sedetach() and also use it to remove duplicate code from seattach().
Correct a comment about sedone().


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/scsipi/if_se.c

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



CVS commit: src/sys/net

2020-06-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Jun 22 16:39:56 UTC 2020

Modified Files:
src/sys/net: pfil.c

Log Message:
pfil_psz gets dropped by the compiler because it is unused if !NET_MPSAFE,
so add an #ifdef around it, not to leak memory. Found by kLSan.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/net/pfil.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/net/pfil.c
diff -u src/sys/net/pfil.c:1.38 src/sys/net/pfil.c:1.39
--- src/sys/net/pfil.c:1.38	Mon Apr 27 23:35:40 2020
+++ src/sys/net/pfil.c	Mon Jun 22 16:39:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pfil.c,v 1.38 2020/04/27 23:35:40 nat Exp $	*/
+/*	$NetBSD: pfil.c,v 1.39 2020/06/22 16:39:56 maxv Exp $	*/
 
 /*
  * Copyright (c) 2013 Mindaugas Rasiukevicius 
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pfil.c,v 1.38 2020/04/27 23:35:40 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pfil.c,v 1.39 2020/06/22 16:39:56 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_net_mpsafe.h"
@@ -86,13 +86,17 @@ static LIST_HEAD(, pfil_head) pfil_head_
 
 static kmutex_t pfil_mtx __cacheline_aligned;
 static struct psref_class *pfil_psref_class __read_mostly;
+#ifdef NET_MPSAFE
 static pserialize_t pfil_psz;
+#endif
 
 void
 pfil_init(void)
 {
 	mutex_init(_mtx, MUTEX_DEFAULT, IPL_NONE);
+#ifdef NET_MPSAFE
 	pfil_psz = pserialize_create();
+#endif
 	pfil_psref_class = psref_class_create("pfil", IPL_SOFTNET);
 }
 



CVS commit: src/sys/net

2020-06-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Jun 22 16:39:56 UTC 2020

Modified Files:
src/sys/net: pfil.c

Log Message:
pfil_psz gets dropped by the compiler because it is unused if !NET_MPSAFE,
so add an #ifdef around it, not to leak memory. Found by kLSan.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/net/pfil.c

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



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 16:34:57 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc: sha.inc
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64: sha.inc

Log Message:
use the C version of keccak


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/sha.inc

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc:1.4 src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc:1.5
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc:1.4	Mon Jun 22 12:26:29 2020
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc	Mon Jun 22 12:34:57 2020
@@ -1,7 +1,6 @@
 .PATH.S: ${.PARSEDIR}
 SHA_SRCS = sha1-ppc.S
 SHACPPFLAGS = -DSHA1_ASM
-KECCAKNI = yes
 .if NOT_USING_SHAXXX_FROM_LIBC
 SHA_SRCS += sha512-ppc.S sha512p8-ppc.S
 SHA_SRCS += sha256-ppc.S sha256p8-ppc.S

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/sha.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/sha.inc:1.2 src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/sha.inc:1.3
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/sha.inc:1.2	Wed Apr 15 17:29:28 2020
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/sha.inc	Mon Jun 22 12:34:57 2020
@@ -1,7 +1,6 @@
 .PATH.S: ${.PARSEDIR}
-SHA_SRCS = sha1-ppc.S keccak1600-ppc64.S keccak1600.c
-SHACPPFLAGS = -DSHA1_ASM -DKECCAK1600_ASM
-KECCAKNI = yes
+SHA_SRCS = sha1-ppc.S
+SHACPPFLAGS = -DSHA1_ASM
 .if NOT_USING_SHAXXX_FROM_LIBC
 SHA_SRCS += sha512-ppc.S sha512p8-ppc.S
 SHA_SRCS += sha256-ppc.S sha256p8-ppc.S



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 16:34:57 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc: sha.inc
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64: sha.inc

Log Message:
use the C version of keccak


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/sha.inc

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



CVS commit: src/sys/kern

2020-06-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Jun 22 16:29:24 UTC 2020

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

Log Message:
Don't leak an unused sysctl log. Found by kLSan.


To generate a diff of this commit:
cvs rdiff -u -r1.287 -r1.288 src/sys/kern/tty.c

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



CVS commit: src/sys/kern

2020-06-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Jun 22 16:29:24 UTC 2020

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

Log Message:
Don't leak an unused sysctl log. Found by kLSan.


To generate a diff of this commit:
cvs rdiff -u -r1.287 -r1.288 src/sys/kern/tty.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/tty.c
diff -u src/sys/kern/tty.c:1.287 src/sys/kern/tty.c:1.288
--- src/sys/kern/tty.c:1.287	Sat May 23 23:42:43 2020
+++ src/sys/kern/tty.c	Mon Jun 22 16:29:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty.c,v 1.287 2020/05/23 23:42:43 ad Exp $	*/
+/*	$NetBSD: tty.c,v 1.288 2020/06/22 16:29:24 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.287 2020/05/23 23:42:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.288 2020/06/22 16:29:24 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -297,10 +297,8 @@ static void
 sysctl_kern_tty_setup(void)
 {
 	const struct sysctlnode *rnode, *cnode;
-	struct sysctllog *kern_tkstat_sysctllog, *kern_tty_sysctllog;
 
-	kern_tkstat_sysctllog = NULL;
-	sysctl_createv(_tkstat_sysctllog, 0, NULL, NULL,
+	sysctl_createv(NULL, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT,
 		   CTLTYPE_NODE, "tkstat",
 		   SYSCTL_DESCR("Number of characters sent and received "
@@ -308,38 +306,37 @@ sysctl_kern_tty_setup(void)
 		   NULL, 0, NULL, 0,
 		   CTL_KERN, KERN_TKSTAT, CTL_EOL);
 
-	sysctl_createv(_tkstat_sysctllog, 0, NULL, NULL,
+	sysctl_createv(NULL, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT,
 		   CTLTYPE_QUAD, "nin",
 		   SYSCTL_DESCR("Total number of tty input characters"),
 		   NULL, 0, _nin, 0,
 		   CTL_KERN, KERN_TKSTAT, KERN_TKSTAT_NIN, CTL_EOL);
-	sysctl_createv(_tkstat_sysctllog, 0, NULL, NULL,
+	sysctl_createv(NULL, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT,
 		   CTLTYPE_QUAD, "nout",
 		   SYSCTL_DESCR("Total number of tty output characters"),
 		   NULL, 0, _nout, 0,
 		   CTL_KERN, KERN_TKSTAT, KERN_TKSTAT_NOUT, CTL_EOL);
-	sysctl_createv(_tkstat_sysctllog, 0, NULL, NULL,
+	sysctl_createv(NULL, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT,
 		   CTLTYPE_QUAD, "cancc",
 		   SYSCTL_DESCR("Number of canonical tty input characters"),
 		   NULL, 0, _cancc, 0,
 		   CTL_KERN, KERN_TKSTAT, KERN_TKSTAT_CANCC, CTL_EOL);
-	sysctl_createv(_tkstat_sysctllog, 0, NULL, NULL,
+	sysctl_createv(NULL, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT,
 		   CTLTYPE_QUAD, "rawcc",
 		   SYSCTL_DESCR("Number of raw tty input characters"),
 		   NULL, 0, _rawcc, 0,
 		   CTL_KERN, KERN_TKSTAT, KERN_TKSTAT_RAWCC, CTL_EOL);
 
-	kern_tty_sysctllog = NULL;
-	sysctl_createv(_tty_sysctllog, 0, NULL, ,
+	sysctl_createv(NULL, 0, NULL, ,
 		   CTLFLAG_PERMANENT,
 		   CTLTYPE_NODE, "tty", NULL,
 		   NULL, 0, NULL, 0,
 		   CTL_KERN, CTL_CREATE, CTL_EOL);
-	sysctl_createv(_tty_sysctllog, 0, , ,
+	sysctl_createv(NULL, 0, , ,
 		   CTLFLAG_PERMANENT | CTLFLAG_READWRITE,
 		   CTLTYPE_INT, "qsize",
 		   SYSCTL_DESCR("TTY input and output queue size"),



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 16:26:52 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64:
keccak1600-ppc64.S keccak1600p8-ppc.S

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600-ppc64.S 
\

src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600p8-ppc.S

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



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 16:26:52 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64:
keccak1600-ppc64.S keccak1600p8-ppc.S

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600-ppc64.S 
\

src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600p8-ppc.S

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600-ppc64.S
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600-ppc64.S:1.2 src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600-ppc64.S:1.3
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600-ppc64.S:1.2	Sat Apr 11 18:41:06 2020
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600-ppc64.S	Mon Jun 22 12:26:52 2020
@@ -317,16 +317,16 @@ dword_le_load:
 .long	0
 
 
-.globl	SHA3_absorb_vsx
-.type	SHA3_absorb_vsx,@function
+.globl	SHA3_absorb
+.type	SHA3_absorb,@function
 .section	".opd","aw"
 .align	3
-SHA3_absorb_vsx:
-.quad	.SHA3_absorb_vsx,.TOC.@tocbase,0
+SHA3_absorb:
+.quad	.SHA3_absorb,.TOC.@tocbase,0
 .previous
 
 .align	5
-.SHA3_absorb_vsx:
+.SHA3_absorb:
 	stdu	1,-272(1)
 	mflr	0
 	std	14,128(1)
@@ -546,16 +546,16 @@ SHA3_absorb_vsx:
 .byte	0,12,4,1,0x80,18,4,0
 .long	0
 
-.globl	SHA3_squeeze_vsx
-.type	SHA3_squeeze_vsx,@function
+.globl	SHA3_squeeze
+.type	SHA3_squeeze,@function
 .section	".opd","aw"
 .align	3
-SHA3_squeeze_vsx:
-.quad	.SHA3_squeeze_vsx,.TOC.@tocbase,0
+SHA3_squeeze:
+.quad	.SHA3_squeeze,.TOC.@tocbase,0
 .previous
 
 .align	5
-.SHA3_squeeze_vsx:
+.SHA3_squeeze:
 	stdu	1,-80(1)
 	mflr	0
 	std	28,48(1)
Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600p8-ppc.S
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600p8-ppc.S:1.2 src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600p8-ppc.S:1.3
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600p8-ppc.S:1.2	Sat Apr 11 18:41:06 2020
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc64/keccak1600p8-ppc.S	Mon Jun 22 12:26:52 2020
@@ -288,16 +288,16 @@ KeccakF1600:
 .byte	0,12,0x04,1,0x80,0,1,0
 .long	0
 
-.globl	SHA3_absorb_vsx
-.type	SHA3_absorb_vsx,@function
+.globl	SHA3_absorb
+.type	SHA3_absorb,@function
 .section	".opd","aw"
 .align	3
-SHA3_absorb_vsx:
-.quad	.SHA3_absorb_vsx,.TOC.@tocbase,0
+SHA3_absorb:
+.quad	.SHA3_absorb,.TOC.@tocbase,0
 .previous
 
 .align	5
-.SHA3_absorb_vsx:
+.SHA3_absorb:
 	stdu	1,-256(1)
 	li	10,63
 	li	11,79
@@ -595,16 +595,16 @@ SHA3_absorb_vsx:
 .byte	0,12,0x04,1,0x80,0,4,0
 .long	0
 
-.globl	SHA3_squeeze_vsx
-.type	SHA3_squeeze_vsx,@function
+.globl	SHA3_squeeze
+.type	SHA3_squeeze,@function
 .section	".opd","aw"
 .align	3
-SHA3_squeeze_vsx:
-.quad	.SHA3_squeeze_vsx,.TOC.@tocbase,0
+SHA3_squeeze:
+.quad	.SHA3_squeeze,.TOC.@tocbase,0
 .previous
 
 .align	5
-.SHA3_squeeze_vsx:
+.SHA3_squeeze:
 	mflr	9
 	subi	4,4,1
 	addi	8,3,4



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 16:26:29 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc:
keccak1600p8-ppc.S sha.inc

Log Message:
Regen and disable keccak asm


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/keccak1600p8-ppc.S
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/keccak1600p8-ppc.S
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/keccak1600p8-ppc.S:1.2 src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/keccak1600p8-ppc.S:1.3
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/keccak1600p8-ppc.S:1.2	Sat Apr 11 18:41:06 2020
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/keccak1600p8-ppc.S	Mon Jun 22 12:26:29 2020
@@ -288,11 +288,11 @@ KeccakF1600:
 .byte	0,12,0x04,1,0x80,0,1,0
 .long	0
 
-.globl	SHA3_absorb_vsx
-.type	SHA3_absorb_vsx,@function
+.globl	SHA3_absorb
+.type	SHA3_absorb,@function
 
 .align	5
-SHA3_absorb_vsx:
+SHA3_absorb:
 	stwu	1,-232(1)
 	li	10,39
 	li	11,55
@@ -590,11 +590,11 @@ SHA3_absorb_vsx:
 .byte	0,12,0x04,1,0x80,0,4,0
 .long	0
 
-.globl	SHA3_squeeze_vsx
-.type	SHA3_squeeze_vsx,@function
+.globl	SHA3_squeeze
+.type	SHA3_squeeze,@function
 
 .align	5
-SHA3_squeeze_vsx:
+SHA3_squeeze:
 	mflr	9
 	subi	4,4,1
 	addi	8,3,4

Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc:1.3 src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc:1.4
--- src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc:1.3	Sat Apr 11 18:41:06 2020
+++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc	Mon Jun 22 12:26:29 2020
@@ -1,6 +1,6 @@
 .PATH.S: ${.PARSEDIR}
-SHA_SRCS = sha1-ppc.S keccak1600p8-ppc.S keccak1600.c
-SHACPPFLAGS = -DSHA1_ASM -DKECCAK1600_ASM
+SHA_SRCS = sha1-ppc.S
+SHACPPFLAGS = -DSHA1_ASM
 KECCAKNI = yes
 .if NOT_USING_SHAXXX_FROM_LIBC
 SHA_SRCS += sha512-ppc.S sha512p8-ppc.S



CVS commit: src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 16:26:29 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc:
keccak1600p8-ppc.S sha.inc

Log Message:
Regen and disable keccak asm


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/keccak1600p8-ppc.S
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/powerpc/sha.inc

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



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

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 16:25:08 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto: ppccap.c
src/crypto/external/bsd/openssl/dist/crypto/sha: keccak1600.c
src/crypto/external/bsd/openssl/dist/crypto/sha/asm:
keccak1600-ppc64.pl keccak1600p8-ppc.pl

Log Message:
Revert the conditional use of vsx on keccak. Upstream wants to disable it
instead (dot-asm:
So that both assembly modules export SHA3_absorb_vsx... Either way,
it makes lesser sense to deploy vector keccak1600p8-ppc.pl, because
benefits are not that clear. It's only nominally faster than scalar
module on POWER8 but significantly slower on POWER9. Because POWER9
is better equipped to handle non-vector code. On related note,
there is version optimized for little-endian, as well as 32-bit
version. [And since MIPS was mentioned, there is even MIPS module...]


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/crypto/external/bsd/openssl/dist/crypto/ppccap.c
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/dist/crypto/sha/keccak1600.c
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600-ppc64.pl \
src/crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600p8-ppc.pl

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



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

2020-06-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 22 16:25:08 UTC 2020

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto: ppccap.c
src/crypto/external/bsd/openssl/dist/crypto/sha: keccak1600.c
src/crypto/external/bsd/openssl/dist/crypto/sha/asm:
keccak1600-ppc64.pl keccak1600p8-ppc.pl

Log Message:
Revert the conditional use of vsx on keccak. Upstream wants to disable it
instead (dot-asm:
So that both assembly modules export SHA3_absorb_vsx... Either way,
it makes lesser sense to deploy vector keccak1600p8-ppc.pl, because
benefits are not that clear. It's only nominally faster than scalar
module on POWER8 but significantly slower on POWER9. Because POWER9
is better equipped to handle non-vector code. On related note,
there is version optimized for little-endian, as well as 32-bit
version. [And since MIPS was mentioned, there is even MIPS module...]


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/crypto/external/bsd/openssl/dist/crypto/ppccap.c
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/dist/crypto/sha/keccak1600.c
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600-ppc64.pl \
src/crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600p8-ppc.pl

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/ppccap.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/ppccap.c:1.14 src/crypto/external/bsd/openssl/dist/crypto/ppccap.c:1.15
--- src/crypto/external/bsd/openssl/dist/crypto/ppccap.c:1.14	Tue Jun 16 23:22:06 2020
+++ src/crypto/external/bsd/openssl/dist/crypto/ppccap.c	Mon Jun 22 12:25:08 2020
@@ -160,37 +160,6 @@ void ecp_nistz256_from_mont(unsigned lon
 }
 #endif
 
-size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len,
-size_t r);
-void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r);
-
-size_t SHA3_absorb_default(uint64_t A[5][5], const unsigned char *inp,
-size_t len, size_t r);
-void SHA3_squeeze_default(uint64_t A[5][5], unsigned char *out, size_t len,
-size_t r);
-
-size_t SHA3_absorb_vsx(uint64_t A[5][5], const unsigned char *inp,
-size_t len, size_t r);
-void SHA3_squeeze_vsx(uint64_t A[5][5], unsigned char *out, size_t len,
-size_t r);
-
-size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len,
-size_t r)
-{
-return OPENSSL_ppccap_P & PPC_CRYPTO207
-? SHA3_absorb_vsx(A, inp, len, r)
-: SHA3_absorb_default(A, inp, len, r);
-}
-
-void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r)
-{
-OPENSSL_ppccap_P & PPC_CRYPTO207
-? SHA3_squeeze_vsx(A, out, len, r)
-: SHA3_squeeze_default(A, out, len, r);
-}
-
-
-
 static sigjmp_buf ill_jmp;
 static void ill_handler(int sig)
 {

Index: src/crypto/external/bsd/openssl/dist/crypto/sha/keccak1600.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/sha/keccak1600.c:1.2 src/crypto/external/bsd/openssl/dist/crypto/sha/keccak1600.c:1.3
--- src/crypto/external/bsd/openssl/dist/crypto/sha/keccak1600.c:1.2	Sat Apr 11 18:41:06 2020
+++ src/crypto/external/bsd/openssl/dist/crypto/sha/keccak1600.c	Mon Jun 22 12:25:08 2020
@@ -11,12 +11,6 @@
 #include 
 #include 
 
-#ifdef __powerpc__
-#define SHA3_absorb SHA3_absorb_default
-#define SHA3_squeeze SHA3_squeeze_default
-#undef KECCAK1600_ASM
-#endif
-
 size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len,
size_t r);
 void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r);

Index: src/crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600-ppc64.pl
diff -u src/crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600-ppc64.pl:1.2 src/crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600-ppc64.pl:1.3
--- src/crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600-ppc64.pl:1.2	Sat Apr 11 18:41:06 2020
+++ src/crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600-ppc64.pl	Mon Jun 22 12:25:08 2020
@@ -405,10 +405,10 @@ dword_le_load:
 	.long	0
 .size	dword_le_load,.-dword_le_load
 
-.globl	SHA3_absorb_vsx
-.type	SHA3_absorb_vsx,\@function
+.globl	SHA3_absorb
+.type	SHA3_absorb,\@function
 .align	5
-SHA3_absorb_vsx:
+SHA3_absorb:
 	$STU	$sp,-$FRAME($sp)
 	mflr	r0
 	$PUSH	r14,`$FRAME-$SIZE_T*18`($sp)
@@ -627,15 +627,15 @@ SHA3_absorb_vsx:
 	.long	0
 	.byte	0,12,4,1,0x80,18,4,0
 	.long	0
-.size	SHA3_absorb_vsx,.-SHA3_absorb_vsx
+.size	SHA3_absorb,.-SHA3_absorb
 ___
 {
 my ($A_flat,$out,$len,$bsz) = map("r$_",(28..31));
 $code.=<<___;
-.globl	SHA3_squeeze_vsx
-.type	SHA3_squeeze_vsx,\@function
+.globl	SHA3_squeeze
+.type	SHA3_squeeze,\@function
 .align	5
-SHA3_squeeze_vsx:
+SHA3_squeeze:
 	$STU	$sp,`-10*$SIZE_T`($sp)
 	mflr	r0
 	$PUSH	r28,`6*$SIZE_T`($sp)
@@ -705,7 +705,7 @@ SHA3_squeeze_vsx:
 	.long	0
 	.byte	

CVS commit: src/sys/kern

2020-06-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Jun 22 16:21:29 UTC 2020

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

Log Message:
Permanent node doesn't need a log, plus the log gets leaked anyway. Found
by kLSan.


To generate a diff of this commit:
cvs rdiff -u -r1.241 -r1.242 src/sys/kern/kern_lwp.c

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



CVS commit: src/sys/kern

2020-06-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Jun 22 16:21:29 UTC 2020

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

Log Message:
Permanent node doesn't need a log, plus the log gets leaked anyway. Found
by kLSan.


To generate a diff of this commit:
cvs rdiff -u -r1.241 -r1.242 src/sys/kern/kern_lwp.c

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

Modified files:

Index: src/sys/kern/kern_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.241 src/sys/kern/kern_lwp.c:1.242
--- src/sys/kern/kern_lwp.c:1.241	Sat Jun  6 22:26:47 2020
+++ src/sys/kern/kern_lwp.c	Mon Jun 22 16:21:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.241 2020/06/06 22:26:47 ad Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.242 2020/06/22 16:21:29 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2019, 2020
@@ -217,7 +217,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.241 2020/06/06 22:26:47 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.242 2020/06/22 16:21:29 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -325,9 +325,7 @@ sysctl_kern_maxlwp(SYSCTLFN_ARGS)
 static void
 sysctl_kern_lwp_setup(void)
 {
-	struct sysctllog *clog = NULL;
-
-	sysctl_createv(, 0, NULL, NULL,
+	sysctl_createv(NULL, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT|CTLFLAG_READWRITE,
 		   CTLTYPE_INT, "maxlwp",
 		   SYSCTL_DESCR("Maximum number of simultaneous threads"),



CVS commit: src/sys/dev/acpi

2020-06-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Jun 22 16:14:18 UTC 2020

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

Log Message:
Fix memory leak. Found by kLSan.


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/sys/dev/acpi/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/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.284 src/sys/dev/acpi/acpi.c:1.285
--- src/sys/dev/acpi/acpi.c:1.284	Thu Apr  9 10:46:19 2020
+++ src/sys/dev/acpi/acpi.c	Mon Jun 22 16:14:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.284 2020/04/09 10:46:19 jmcneill Exp $	*/
+/*	$NetBSD: acpi.c,v 1.285 2020/06/22 16:14:18 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,7 +100,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.284 2020/04/09 10:46:19 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.285 2020/06/22 16:14:18 maxv Exp $");
 
 #include "pci.h"
 #include "opt_acpi.h"
@@ -792,6 +792,11 @@ acpi_make_devnode(ACPI_HANDLE handle, ui
 		}
 
 		awc->aw_parent = ad;
+		break;
+
+	default:
+		ACPI_FREE(devinfo);
+		break;
 	}
 
 	return AE_OK;



CVS commit: src/sys/dev/acpi

2020-06-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Jun 22 16:14:18 UTC 2020

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

Log Message:
Fix memory leak. Found by kLSan.


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/sys/dev/acpi/acpi.c

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



CVS commit: src/sys/dev/scsipi

2020-06-22 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Mon Jun 22 16:05:20 UTC 2020

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

Log Message:
Use workqueues so that we don't call into the scsipi subsystem via
a softint from the network stack.
Don't recurse through scsipi_command() when we have multiple packets
in the send queue - use a loop instead.  This means that we no longer
need sestart(), as we can now handle everything in sedone().
Fix a couple of XXX's.
Rework the locking logic slightly from the previous revision.
Now this works with DIAGNOSTIC+LOCKDEBUG.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/dev/scsipi/if_se.c

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



CVS commit: src/sys/dev/scsipi

2020-06-22 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Mon Jun 22 16:05:20 UTC 2020

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

Log Message:
Use workqueues so that we don't call into the scsipi subsystem via
a softint from the network stack.
Don't recurse through scsipi_command() when we have multiple packets
in the send queue - use a loop instead.  This means that we no longer
need sestart(), as we can now handle everything in sedone().
Fix a couple of XXX's.
Rework the locking logic slightly from the previous revision.
Now this works with DIAGNOSTIC+LOCKDEBUG.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/dev/scsipi/if_se.c

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

Modified files:

Index: src/sys/dev/scsipi/if_se.c
diff -u src/sys/dev/scsipi/if_se.c:1.105 src/sys/dev/scsipi/if_se.c:1.106
--- src/sys/dev/scsipi/if_se.c:1.105	Fri Jun 19 10:30:27 2020
+++ src/sys/dev/scsipi/if_se.c	Mon Jun 22 16:05:20 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_se.c,v 1.105 2020/06/19 10:30:27 jdc Exp $	*/
+/*	$NetBSD: if_se.c,v 1.106 2020/06/22 16:05:20 jdc Exp $	*/
 
 /*
  * Copyright (c) 1997 Ian W. Dall 
@@ -49,7 +49,7 @@
  * This driver is also a bit unusual. It must look like a network
  * interface and it must also appear to be a scsi device to the scsi
  * system. Hence there are cases where there are two entry points. eg
- * sestart is to be called from the scsi subsytem and se_ifstart from
+ * sedone is to be called from the scsi subsytem and se_ifstart from
  * the network interface subsystem.  In addition, to facilitate scsi
  * commands issued by userland programs, there are open, close and
  * ioctl entry points. This allows a user program to, for example,
@@ -59,10 +59,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_se.c,v 1.105 2020/06/19 10:30:27 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_se.c,v 1.106 2020/06/22 16:05:20 jdc Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
+#include "opt_net_mpsafe.h"
 #include "opt_atalk.h"
 #endif
 
@@ -85,6 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_se.c,v 1.
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -177,10 +179,12 @@ struct se_softc {
 	struct ethercom sc_ethercom;	/* Ethernet common part */
 	struct scsipi_periph *sc_periph;/* contains our targ, lun, etc. */
 
-	struct callout sc_ifstart_ch;
 	struct callout sc_recv_ch;
 	struct kmutex sc_iflock;
 	struct if_percpuq *sc_ipq;
+	struct workqueue *sc_recv_wq, *sc_send_wq;
+	struct work sc_recv_work, sc_send_work;
+	int sc_recv_work_pending, sc_send_work_pending;
 
 	char *sc_tbuf;
 	char *sc_rbuf;
@@ -200,7 +204,6 @@ static int	sematch(device_t, cfdata_t, v
 static void	seattach(device_t, device_t, void *);
 
 static void	se_ifstart(struct ifnet *);
-static void	sestart(struct scsipi_periph *);
 
 static void	sedone(struct scsipi_xfer *, int);
 static int	se_ioctl(struct ifnet *, u_long, void *);
@@ -209,10 +212,12 @@ static void	sewatchdog(struct ifnet *);
 #if 0
 static inline uint16_t ether_cmp(void *, void *);
 #endif
-static void	se_recv(void *);
+static void	se_recv_callout(void *);
+static void	se_recv_worker(struct work *wk, void *cookie);
+static void	se_recv(struct se_softc *);
 static struct mbuf *se_get(struct se_softc *, char *, int);
 static int	se_read(struct se_softc *, char *, int);
-static int	se_reset(struct se_softc *);
+static void	se_reset(struct se_softc *);
 static int	se_add_proto(struct se_softc *, int);
 static int	se_get_addr(struct se_softc *, uint8_t *);
 static int	se_set_media(struct se_softc *, int);
@@ -228,7 +233,7 @@ static inline int se_scsipi_cmd(struct s
 			int cmdlen, u_char *data_addr, int datalen,
 			int retries, int timeout, struct buf *bp,
 			int flags);
-static void	se_delayed_ifstart(void *);
+static void	se_send_worker(struct work *wk, void *cookie);
 static int	se_set_mode(struct se_softc *, int, int);
 
 int	se_enable(struct se_softc *);
@@ -260,7 +265,7 @@ const struct cdevsw se_cdevsw = {
 
 const struct scsipi_periphsw se_switch = {
 	NULL,			/* Use default error handler */
-	sestart,		/* have a queue, served by this */
+	NULL,			/* have no queue */
 	NULL,			/* have no async handler */
 	sedone,			/* deal with stats at interrupt time */
 };
@@ -317,6 +322,7 @@ seattach(device_t parent, device_t self,
 	struct scsipi_periph *periph = sa->sa_periph;
 	struct ifnet *ifp = >sc_ethercom.ec_if;
 	uint8_t myaddr[ETHER_ADDR_LEN];
+	char wqname[MAXCOMLEN];
 	int rv;
 
 	sc->sc_dev = self;
@@ -324,7 +330,6 @@ seattach(device_t parent, device_t self,
 	printf("\n");
 	SC_DEBUG(periph, SCSIPI_DB2, ("seattach: "));
 
-	callout_init(>sc_ifstart_ch, CALLOUT_MPSAFE);
 	callout_init(>sc_recv_ch, CALLOUT_MPSAFE);
 	mutex_init(>sc_iflock, MUTEX_DEFAULT, IPL_SOFTNET);
 
@@ -335,21 +340,17 @@ seattach(device_t parent, device_t self,
 	periph->periph_dev = sc->sc_dev;
 	periph->periph_switch = _switch;
 
-	/* XXX increase openings? */
-
 	

CVS commit: src/share/wscons/fonts

2020-06-22 Thread Frederic Cambus
Module Name:src
Committed By:   fcambus
Date:   Mon Jun 22 15:07:11 UTC 2020

Modified Files:
src/share/wscons/fonts: COPYRIGHT

Log Message:
Fix filenames for vt220* wscons fonts listed in COPYRIGHT.

The extension of uuencoded files on disk is ".uue".


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/wscons/fonts/COPYRIGHT

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

Modified files:

Index: src/share/wscons/fonts/COPYRIGHT
diff -u src/share/wscons/fonts/COPYRIGHT:1.1 src/share/wscons/fonts/COPYRIGHT:1.2
--- src/share/wscons/fonts/COPYRIGHT:1.1	Tue Jul 25 17:13:53 2000
+++ src/share/wscons/fonts/COPYRIGHT	Mon Jun 22 15:07:11 2020
@@ -1,7 +1,7 @@
 The font files:
 
-	vt220h.808.uu, vt220h.810.uu, vt220h.814.uu, vt220h.816.uu,
-	vt220l.808.uu, vt220l.810.uu, vt220l.814.uu and vt220l.816.uu
+	vt220h.808.uue, vt220h.810.uue, vt220h.814.uue, vt220h.816.uue,
+	vt220l.808.uue, vt220l.810.uue, vt220l.814.uue and vt220l.816.uue
 
 in this directory are
 



CVS commit: src/share/wscons/fonts

2020-06-22 Thread Frederic Cambus
Module Name:src
Committed By:   fcambus
Date:   Mon Jun 22 15:07:11 UTC 2020

Modified Files:
src/share/wscons/fonts: COPYRIGHT

Log Message:
Fix filenames for vt220* wscons fonts listed in COPYRIGHT.

The extension of uuencoded files on disk is ".uue".


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/wscons/fonts/COPYRIGHT

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



CVS commit: src/usr.bin/calendar/calendars

2020-06-22 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Jun 22 13:20:15 UTC 2020

Modified Files:
src/usr.bin/calendar/calendars: calendar.computer

Log Message:
Add Quake's birthday
https://twitter.com/romero/status/1275026229524074496


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/calendar/calendars/calendar.computer

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/calendar/calendars/calendar.computer
diff -u src/usr.bin/calendar/calendars/calendar.computer:1.15 src/usr.bin/calendar/calendars/calendar.computer:1.16
--- src/usr.bin/calendar/calendars/calendar.computer:1.15	Sat Jun 20 21:58:17 2020
+++ src/usr.bin/calendar/calendars/calendar.computer	Mon Jun 22 13:20:15 2020
@@ -52,6 +52,7 @@
 	Apple ][e known as the SDF-1, 1987
 06/19	FreeBSD project born, 1993
 06/20	X Window System born, 1984
+06/22	Quake released, 1996
 06/23	IBM unbundles software, 1969
 06/30	First advanced degree on computer related topic: to H. Karamanian,
 	Temple Univ., Phila, 1948, for symbolic differentiation on the ENIAC



CVS commit: src/usr.bin/calendar/calendars

2020-06-22 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Jun 22 13:20:15 UTC 2020

Modified Files:
src/usr.bin/calendar/calendars: calendar.computer

Log Message:
Add Quake's birthday
https://twitter.com/romero/status/1275026229524074496


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/calendar/calendars/calendar.computer

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



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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Jun 22 12:26:11 UTC 2020

Modified Files:
src/sys/arch/mips/cavium/dev: octeon_bootbusreg.h octeon_ciureg.h
octeon_fpareg.h octeon_gmxreg.h octeon_pipreg.h octeon_powreg.h
octeon_usbcreg.h

Log Message:
Remove more snprintb _BITS bits.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/mips/cavium/dev/octeon_bootbusreg.h \
src/sys/arch/mips/cavium/dev/octeon_usbcreg.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/cavium/dev/octeon_ciureg.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/cavium/dev/octeon_fpareg.h \
src/sys/arch/mips/cavium/dev/octeon_gmxreg.h \
src/sys/arch/mips/cavium/dev/octeon_pipreg.h \
src/sys/arch/mips/cavium/dev/octeon_powreg.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/dev/octeon_bootbusreg.h
diff -u src/sys/arch/mips/cavium/dev/octeon_bootbusreg.h:1.2 src/sys/arch/mips/cavium/dev/octeon_bootbusreg.h:1.3
--- src/sys/arch/mips/cavium/dev/octeon_bootbusreg.h:1.2	Mon Jun 22 03:05:07 2020
+++ src/sys/arch/mips/cavium/dev/octeon_bootbusreg.h	Mon Jun 22 12:26:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon_bootbusreg.h,v 1.2 2020/06/22 03:05:07 simonb Exp $	*/
+/*	$NetBSD: octeon_bootbusreg.h,v 1.3 2020/06/22 12:26:11 simonb Exp $	*/
 
 /*
  * Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -116,33 +116,6 @@
 #define	MIO_BOOT_BIST_STAT_LOC			UINT64_C(0x0002)
 #define	MIO_BOOT_BIST_STAT_NCBI			UINT64_C(0x0001)
 
-#define	MIO_BOOT_REG_CFG0_BITS			MIO_BOOT_REG_CFGN_BITS
-#define	MIO_BOOT_REG_CFG1_BITS			MIO_BOOT_REG_CFGN_BITS
-#define	MIO_BOOT_REG_CFG2_BITS			MIO_BOOT_REG_CFGN_BITS
-#define	MIO_BOOT_REG_CFG3_BITS			MIO_BOOT_REG_CFGN_BITS
-#define	MIO_BOOT_REG_CFG4_BITS			MIO_BOOT_REG_CFGN_BITS
-#define	MIO_BOOT_REG_CFG5_BITS			MIO_BOOT_REG_CFGN_BITS
-#define	MIO_BOOT_REG_CFG6_BITS			MIO_BOOT_REG_CFGN_BITS
-#define	MIO_BOOT_REG_CFG7_BITS			MIO_BOOT_REG_CFGN_BITS
-
-#define	MIO_BOOT_REG_TIM0_BITS			MIO_BOOT_REG_TIMN_BITS
-#define	MIO_BOOT_REG_TIM1_BITS			MIO_BOOT_REG_TIMN_BITS
-#define	MIO_BOOT_REG_TIM2_BITS			MIO_BOOT_REG_TIMN_BITS
-#define	MIO_BOOT_REG_TIM3_BITS			MIO_BOOT_REG_TIMN_BITS
-#define	MIO_BOOT_REG_TIM4_BITS			MIO_BOOT_REG_TIMN_BITS
-#define	MIO_BOOT_REG_TIM5_BITS			MIO_BOOT_REG_TIMN_BITS
-#define	MIO_BOOT_REG_TIM6_BITS			MIO_BOOT_REG_TIMN_BITS
-#define	MIO_BOOT_REG_TIM7_BITS			MIO_BOOT_REG_TIMN_BITS
-
-#define	MIO_BOOT_LOC_CFG0_BITS			MIO_BOOT_LOC_CFGN_BITS
-#define	MIO_BOOT_LOC_CFG1_BITS			MIO_BOOT_LOC_CFGN_BITS
-#define	MIO_BOOT_LOC_CFG2_BITS			MIO_BOOT_LOC_CFGN_BITS
-#define	MIO_BOOT_LOC_CFG3_BITS			MIO_BOOT_LOC_CFGN_BITS
-#define	MIO_BOOT_LOC_CFG4_BITS			MIO_BOOT_LOC_CFGN_BITS
-#define	MIO_BOOT_LOC_CFG5_BITS			MIO_BOOT_LOC_CFGN_BITS
-#define	MIO_BOOT_LOC_CFG6_BITS			MIO_BOOT_LOC_CFGN_BITS
-#define	MIO_BOOT_LOC_CFG7_BITS			MIO_BOOT_LOC_CFGN_BITS
-
 /*  bus_space */
 
 #define	MIO_BOOT_REG_CFG0_OFFSET		0x
Index: src/sys/arch/mips/cavium/dev/octeon_usbcreg.h
diff -u src/sys/arch/mips/cavium/dev/octeon_usbcreg.h:1.2 src/sys/arch/mips/cavium/dev/octeon_usbcreg.h:1.3
--- src/sys/arch/mips/cavium/dev/octeon_usbcreg.h:1.2	Mon Jun 22 03:05:07 2020
+++ src/sys/arch/mips/cavium/dev/octeon_usbcreg.h	Mon Jun 22 12:26:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: octeon_usbcreg.h,v 1.2 2020/06/22 03:05:07 simonb Exp $	*/
+/*	$NetBSD: octeon_usbcreg.h,v 1.3 2020/06/22 12:26:11 simonb Exp $	*/
 
 /*
  * Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -573,42 +573,6 @@
 /* for USBC_NPTXDFIFO(0..7) */
 #define USBC_NPTXDFIFOX_DATA			0x
 
-#define USBC_HCINT0_BITS	USBC_HCINTX_BITS
-#define USBC_HCINT1_BITS	USBC_HCINTX_BITS
-#define USBC_HCINT2_BITS	USBC_HCINTX_BITS
-#define USBC_HCINT3_BITS	USBC_HCINTX_BITS
-#define USBC_HCINT4_BITS	USBC_HCINTX_BITS
-#define USBC_HCINT5_BITS	USBC_HCINTX_BITS
-#define USBC_HCINT6_BITS	USBC_HCINTX_BITS
-#define USBC_HCINT7_BITS	USBC_HCINTX_BITS
-
-#define USBC_HCINTMSK0_BITS	USBC_HCINTMSKX_BITS
-#define USBC_HCINTMSK1_BITS	USBC_HCINTMSKX_BITS
-#define USBC_HCINTMSK2_BITS	USBC_HCINTMSKX_BITS
-#define USBC_HCINTMSK3_BITS	USBC_HCINTMSKX_BITS
-#define USBC_HCINTMSK4_BITS	USBC_HCINTMSKX_BITS
-#define USBC_HCINTMSK5_BITS	USBC_HCINTMSKX_BITS
-#define USBC_HCINTMSK6_BITS	USBC_HCINTMSKX_BITS
-#define USBC_HCINTMSK7_BITS	USBC_HCINTMSKX_BITS
-
-#define USBC_HCCHAR0_BITS	USBC_HCCHARX_BITS
-#define USBC_HCCHAR1_BITS	USBC_HCCHARX_BITS
-#define USBC_HCCHAR2_BITS	USBC_HCCHARX_BITS
-#define USBC_HCCHAR3_BITS	USBC_HCCHARX_BITS
-#define USBC_HCCHAR4_BITS	USBC_HCCHARX_BITS
-#define USBC_HCCHAR5_BITS	USBC_HCCHARX_BITS
-#define USBC_HCCHAR6_BITS	USBC_HCCHARX_BITS
-#define USBC_HCCHAR7_BITS	USBC_HCCHARX_BITS
-
-#define USBC_HCTSIZ0_BITS	USBC_HCTSIZX_BITS
-#define USBC_HCTSIZ1_BITS	USBC_HCTSIZX_BITS
-#define USBC_HCTSIZ2_BITS	USBC_HCTSIZX_BITS
-#define USBC_HCTSIZ3_BITS	USBC_HCTSIZX_BITS
-#define 

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

2020-06-22 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Jun 22 12:26:11 UTC 2020

Modified Files:
src/sys/arch/mips/cavium/dev: octeon_bootbusreg.h octeon_ciureg.h
octeon_fpareg.h octeon_gmxreg.h octeon_pipreg.h octeon_powreg.h
octeon_usbcreg.h

Log Message:
Remove more snprintb _BITS bits.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/mips/cavium/dev/octeon_bootbusreg.h \
src/sys/arch/mips/cavium/dev/octeon_usbcreg.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/cavium/dev/octeon_ciureg.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/cavium/dev/octeon_fpareg.h \
src/sys/arch/mips/cavium/dev/octeon_gmxreg.h \
src/sys/arch/mips/cavium/dev/octeon_pipreg.h \
src/sys/arch/mips/cavium/dev/octeon_powreg.h

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



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

2020-06-22 Thread Rin Okuyama

Committed. Thank you for your comment!

rin

On 2020/06/22 20:09, Kamil Rytarowski wrote:

On 22.06.2020 04:51, Rin Okuyama wrote:

Module Name:src
Committed By:   rin
Date:   Mon Jun 22 02:51:07 UTC 2020

Modified Files:
src/tests/lib/libc/sys: t_ptrace_signal_wait.h t_ptrace_wait.h

Log Message:
Turn trigger_fpe() back to integer division by zero for a while
until QEMU bug #1668041 is fixed:

https://bugs.launchpad.net/qemu/+bug/1668041

by which floating-point division by zero is not trapped correctly
both on amd64 and i386.

Skip *_crash_fpe tests on powerpc, where integer division by zero
is never trapped.




The intention of this test is just detecting SIGFPE. If the si_code
value is various on different architectures (like one traps on integers
other one on floats), we shall just drop the asserts for si_code and
adapt the trigger_fpe() function to cover promptly more ports.

The qemu bug should be fixed nonetheless.




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

2020-06-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jun 22 12:21:03 UTC 2020

Modified Files:
src/tests/lib/libc/sys: t_ptrace_signal_wait.h t_ptrace_wait.h

Log Message:
Work around QEMU bug #1668041 differently, by which floating-point
division by zero is not correctly trapped for i386 and amd64:

https://bugs.launchpad.net/qemu/+bug/1668041

Make trigger_fpe() cause integer division by zero for x86, and
floating-point one for other architectures. Also, assertions for
si_code in *_crash_fpe tests are commented out for now. They
should be cleaned up after the bug is fixed.

Now, *_crash_fpe tests are working also on powerpc.

Suggested by kamil.


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

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_signal_wait.h
diff -u src/tests/lib/libc/sys/t_ptrace_signal_wait.h:1.3 src/tests/lib/libc/sys/t_ptrace_signal_wait.h:1.4
--- src/tests/lib/libc/sys/t_ptrace_signal_wait.h:1.3	Mon Jun 22 02:51:06 2020
+++ src/tests/lib/libc/sys/t_ptrace_signal_wait.h	Mon Jun 22 12:21:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_signal_wait.h,v 1.3 2020/06/22 02:51:06 rin Exp $	*/
+/*	$NetBSD: t_ptrace_signal_wait.h,v 1.4 2020/06/22 12:21:02 rin Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019, 2020 The NetBSD Foundation, Inc.
@@ -423,7 +423,7 @@ traceme_crash(int sig)
 		info.psi_siginfo.si_code <= ILL_BADSTK);
 		break;
 	case SIGFPE:
-		ATF_REQUIRE_EQ(info.psi_siginfo.si_code, FPE_INTDIV);
+// XXXQEMU	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, FPE_FLTDIV);
 		break;
 	case SIGBUS:
 		ATF_REQUIRE_EQ(info.psi_siginfo.si_code, BUS_ADRERR);
@@ -603,7 +603,7 @@ traceme_signalmasked_crash(int sig)
 		info.psi_siginfo.si_code <= ILL_BADSTK);
 		break;
 	case SIGFPE:
-		ATF_REQUIRE_EQ(info.psi_siginfo.si_code, FPE_INTDIV);
+// XXXQEMU	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, FPE_FLTDIV);
 		break;
 	case SIGBUS:
 		ATF_REQUIRE_EQ(info.psi_siginfo.si_code, BUS_ADRERR);
@@ -786,7 +786,7 @@ traceme_signalignored_crash(int sig)
 		info.psi_siginfo.si_code <= ILL_BADSTK);
 		break;
 	case SIGFPE:
-		ATF_REQUIRE_EQ(info.psi_siginfo.si_code, FPE_INTDIV);
+// XXXQEMU	ATF_REQUIRE_EQ(info.psi_siginfo.si_code, FPE_FLTDIV);
 		break;
 	case SIGBUS:
 		ATF_REQUIRE_EQ(info.psi_siginfo.si_code, BUS_ADRERR);
@@ -1890,7 +1890,7 @@ unrelated_tracer_sees_crash(int sig, boo
 			info.psi_siginfo.si_code <= ILL_BADSTK);
 			break;
 		case SIGFPE:
-			FORKEE_ASSERT_EQ(info.psi_siginfo.si_code, FPE_INTDIV);
+// XXXQEMU		FORKEE_ASSERT_EQ(info.psi_siginfo.si_code, FPE_FLTDIV);
 			break;
 		case SIGBUS:
 			FORKEE_ASSERT_EQ(info.psi_siginfo.si_code, BUS_ADRERR);

Index: src/tests/lib/libc/sys/t_ptrace_wait.h
diff -u src/tests/lib/libc/sys/t_ptrace_wait.h:1.31 src/tests/lib/libc/sys/t_ptrace_wait.h:1.32
--- src/tests/lib/libc/sys/t_ptrace_wait.h:1.31	Mon Jun 22 02:51:06 2020
+++ src/tests/lib/libc/sys/t_ptrace_wait.h	Mon Jun 22 12:21:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.h,v 1.31 2020/06/22 02:51:06 rin Exp $	*/
+/*	$NetBSD: t_ptrace_wait.h,v 1.32 2020/06/22 12:21:02 rin Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -671,9 +671,6 @@ are_fpu_exceptions_supported(void)
 		return false;
 	return true;
 }
-#elif __powerpc__
-/* Integer division by zero do not trap on powerpc. */
-#define are_fpu_exceptions_supported() 0
 #else
 #define are_fpu_exceptions_supported() 1
 #endif
@@ -681,15 +678,28 @@ are_fpu_exceptions_supported(void)
 static void __used
 trigger_fpe(void)
 {
-	volatile int a = getpid();
-	volatile int b = atoi("0");
+#if __i386__ || __x86_64__
+	/*
+	 * XXX
+	 * Hack for QEMU bug #1668041, by which floating-point division by
+	 * zero is not trapped correctly. Also, assertions for si_code in
+	 * ptrace_signal_wait.h are commented out. Clean them up after the
+	 * bug is fixed.
+	 */
+	volatile int a, b;
+#else
+	volatile double a, b;
+#endif
+
+	a = getpid();
+	b = atoi("0");
 
 #ifdef __HAVE_FENV
 	feenableexcept(FE_ALL_EXCEPT);
 #endif
 
 	/* Division by zero causes CPU trap, translated to SIGFPE */
-	usleep(a / b);
+	usleep((int)(a / b));
 }
 
 static void __used



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

2020-06-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jun 22 12:21:03 UTC 2020

Modified Files:
src/tests/lib/libc/sys: t_ptrace_signal_wait.h t_ptrace_wait.h

Log Message:
Work around QEMU bug #1668041 differently, by which floating-point
division by zero is not correctly trapped for i386 and amd64:

https://bugs.launchpad.net/qemu/+bug/1668041

Make trigger_fpe() cause integer division by zero for x86, and
floating-point one for other architectures. Also, assertions for
si_code in *_crash_fpe tests are commented out for now. They
should be cleaned up after the bug is fixed.

Now, *_crash_fpe tests are working also on powerpc.

Suggested by kamil.


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

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



CVS commit: src/distrib/notes

2020-06-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Jun 22 12:03:47 UTC 2020

Modified Files:
src/distrib/notes/alpha: contents
src/distrib/notes/amd64: contents
src/distrib/notes/evbarm: contents
src/distrib/notes/sparc64: contents

Log Message:
Mention that USE_XZ_SETS are either always xzipped, and in evbarm might
be xzipped or gzipped.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/distrib/notes/alpha/contents
cvs rdiff -u -r1.9 -r1.10 src/distrib/notes/amd64/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/evbarm/contents
cvs rdiff -u -r1.9 -r1.10 src/distrib/notes/sparc64/contents

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

Modified files:

Index: src/distrib/notes/alpha/contents
diff -u src/distrib/notes/alpha/contents:1.20 src/distrib/notes/alpha/contents:1.21
--- src/distrib/notes/alpha/contents:1.20	Sun Nov 24 11:15:31 2019
+++ src/distrib/notes/alpha/contents	Mon Jun 22 12:03:46 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: contents,v 1.20 2019/11/24 11:15:31 martin Exp $
+.\"	$NetBSD: contents,v 1.21 2020/06/22 12:03:46 maya Exp $
 .\"
 .\" Copyright (c) 1999-2005 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -309,7 +309,7 @@ The X server.
 .\" XXX: should be in notes/common
 .
 .Pp
-The \*M binary distribution sets are distributed as gzipped tar files
+The \*M binary distribution sets are distributed as xzipped tar files
 named with the extension
 .Sy .\*[setsuffix] ,
 e.g.

Index: src/distrib/notes/amd64/contents
diff -u src/distrib/notes/amd64/contents:1.9 src/distrib/notes/amd64/contents:1.10
--- src/distrib/notes/amd64/contents:1.9	Sun Nov 24 11:15:32 2019
+++ src/distrib/notes/amd64/contents	Mon Jun 22 12:03:47 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: contents,v 1.9 2019/11/24 11:15:32 martin Exp $
+.\"	$NetBSD: contents,v 1.10 2020/06/22 12:03:47 maya Exp $
 .\"
 .\" Copyright (c) 1999-2005 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -245,7 +245,7 @@ This includes the modular X.Org server.
 .\"
 .
 .Pp
-The \*M binary distribution sets are distributed as gzipped tar files
+The \*M binary distribution sets are distributed as xzipped tar files
 named with the extension
 .Sy .\*[setsuffix]
 .Pq e.g., Pa base.\*[setsuffix] .

Index: src/distrib/notes/evbarm/contents
diff -u src/distrib/notes/evbarm/contents:1.6 src/distrib/notes/evbarm/contents:1.7
--- src/distrib/notes/evbarm/contents:1.6	Sun Nov 24 11:15:33 2019
+++ src/distrib/notes/evbarm/contents	Mon Jun 22 12:03:47 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: contents,v 1.6 2019/11/24 11:15:33 martin Exp $
+.\"	$NetBSD: contents,v 1.7 2020/06/22 12:03:47 maya Exp $
 .\"
 .\" Copyright (c) 1999-2005 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -259,8 +259,8 @@ The X server.
 .\" XXX: should be in notes/common
 .
 .Pp
-The \*M binary distribution sets are distributed as gzipped tar files
-named with the extension
+The \*M binary distribution sets are distributed as gzipped or xzipped
+tar files named with the extension
 .Sy .\*[setsuffix] ,
 e.g.
 .Pa base.\*[setsuffix] .

Index: src/distrib/notes/sparc64/contents
diff -u src/distrib/notes/sparc64/contents:1.9 src/distrib/notes/sparc64/contents:1.10
--- src/distrib/notes/sparc64/contents:1.9	Sun Nov 24 11:15:36 2019
+++ src/distrib/notes/sparc64/contents	Mon Jun 22 12:03:47 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: contents,v 1.9 2019/11/24 11:15:36 martin Exp $
+.\"	$NetBSD: contents,v 1.10 2020/06/22 12:03:47 maya Exp $
 .\"
 .\" Copyright (c) 1999-2005 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -295,7 +295,7 @@ This includes the modular Xorg and Xvfb 
 .\" XXX: should be in notes/common
 .
 .Pp
-The \*M binary distribution sets are distributed as gzipped tar files
+The \*M binary distribution sets are distributed as xzipped tar files
 named with the extension
 .Sy .\*[setsuffix] ,
 e.g.,



CVS commit: src/distrib/notes

2020-06-22 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Jun 22 12:03:47 UTC 2020

Modified Files:
src/distrib/notes/alpha: contents
src/distrib/notes/amd64: contents
src/distrib/notes/evbarm: contents
src/distrib/notes/sparc64: contents

Log Message:
Mention that USE_XZ_SETS are either always xzipped, and in evbarm might
be xzipped or gzipped.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/distrib/notes/alpha/contents
cvs rdiff -u -r1.9 -r1.10 src/distrib/notes/amd64/contents
cvs rdiff -u -r1.6 -r1.7 src/distrib/notes/evbarm/contents
cvs rdiff -u -r1.9 -r1.10 src/distrib/notes/sparc64/contents

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



Re: CVS commit: src/sys/arch/powerpc

2020-06-22 Thread Joerg Sonnenberger
On Mon, Jun 22, 2020 at 05:34:57AM +, Rin Okuyama wrote:
> Module Name:  src
> Committed By: rin
> Date: Mon Jun 22 05:34:57 UTC 2020
> 
> Modified Files:
>   src/sys/arch/powerpc/include: mcontext.h types.h
>   src/sys/arch/powerpc/powerpc: sig_machdep.c
> 
> Log Message:
> Fix previous; hide userland ABI details for kernel as suggested by joerg:

Thanks!

Joerg


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

2020-06-22 Thread Kamil Rytarowski
On 22.06.2020 04:51, Rin Okuyama wrote:
> Module Name:  src
> Committed By: rin
> Date: Mon Jun 22 02:51:07 UTC 2020
> 
> Modified Files:
>   src/tests/lib/libc/sys: t_ptrace_signal_wait.h t_ptrace_wait.h
> 
> Log Message:
> Turn trigger_fpe() back to integer division by zero for a while
> until QEMU bug #1668041 is fixed:
> 
> https://bugs.launchpad.net/qemu/+bug/1668041
> 
> by which floating-point division by zero is not trapped correctly
> both on amd64 and i386.
> 
> Skip *_crash_fpe tests on powerpc, where integer division by zero
> is never trapped.
> 


The intention of this test is just detecting SIGFPE. If the si_code
value is various on different architectures (like one traps on integers
other one on floats), we shall just drop the asserts for si_code and
adapt the trigger_fpe() function to cover promptly more ports.

The qemu bug should be fixed nonetheless.




signature.asc
Description: OpenPGP digital signature


CVS commit: src

2020-06-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jun 22 07:50:53 UTC 2020

Modified Files:
src/sbin/init: init.c
src/usr.sbin/ldpd: ldp_peer.c

Log Message:
s/successfuly/successfully/ in comment. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sbin/init/init.c
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/ldpd/ldp_peer.c

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

Modified files:

Index: src/sbin/init/init.c
diff -u src/sbin/init/init.c:1.107 src/sbin/init/init.c:1.108
--- src/sbin/init/init.c:1.107	Wed Oct 14 15:53:24 2015
+++ src/sbin/init/init.c	Mon Jun 22 07:50:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.107 2015/10/14 15:53:24 christos Exp $	*/
+/*	$NetBSD: init.c,v 1.108 2020/06/22 07:50:53 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)init.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: init.c,v 1.107 2015/10/14 15:53:24 christos Exp $");
+__RCSID("$NetBSD: init.c,v 1.108 2020/06/22 07:50:53 msaitoh Exp $");
 #endif
 #endif /* not lint */
 
@@ -945,7 +945,7 @@ runcom(void)
 #endif /* CHROOT */
 
 	/*
-	 * Regardless of whether in chroot or not, we booted successfuly.
+	 * Regardless of whether in chroot or not, we booted successfully.
 	 * It's time to spawn gettys (ie. next_step's value at this point).
 	 */
 	runcom_mode = AUTOBOOT;		/* the default */

Index: src/usr.sbin/ldpd/ldp_peer.c
diff -u src/usr.sbin/ldpd/ldp_peer.c:1.17 src/usr.sbin/ldpd/ldp_peer.c:1.18
--- src/usr.sbin/ldpd/ldp_peer.c:1.17	Wed Apr 22 23:53:27 2020
+++ src/usr.sbin/ldpd/ldp_peer.c	Mon Jun 22 07:50:53 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ldp_peer.c,v 1.17 2020/04/22 23:53:27 joerg Exp $ */
+/* $NetBSD: ldp_peer.c,v 1.18 2020/06/22 07:50:53 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -301,7 +301,7 @@ get_ldp_peer_by_socket(int s)
 
 /*
  * Adds address list bounded to a specific peer
- * Returns the number of addresses inserted successfuly
+ * Returns the number of addresses inserted successfully
  */
 int 
 add_ifaddresses(struct ldp_peer * p, const struct al_tlv * a)



CVS commit: src

2020-06-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Jun 22 07:50:53 UTC 2020

Modified Files:
src/sbin/init: init.c
src/usr.sbin/ldpd: ldp_peer.c

Log Message:
s/successfuly/successfully/ in comment. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sbin/init/init.c
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/ldpd/ldp_peer.c

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



CVS commit: src/usr.sbin/postinstall

2020-06-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jun 22 06:55:41 UTC 2020

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
Fix do_blocklist:
- Respect destination directory specified by -d option.
- Accept check and fix options. For the former, do not modify anything as
  users normally expect.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/postinstall/postinstall.in

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/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.28 src/usr.sbin/postinstall/postinstall.in:1.29
--- src/usr.sbin/postinstall/postinstall.in:1.28	Sat Jun 20 18:30:53 2020
+++ src/usr.sbin/postinstall/postinstall.in	Mon Jun 22 06:55:41 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.28 2020/06/20 18:30:53 riastradh Exp $
+# $NetBSD: postinstall.in,v 1.29 2020/06/22 06:55:41 rin Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -845,15 +845,24 @@ do_bluetooth()
 }
 
 fixblock() {
-	for i; do
-		if [ ! -f "$i" ]; then
-			continue
+	local op="$1"
+	local target="${DEST_DIR}$2"
+
+	if [ ! -f "${target}" ]; then
+		continue
+	fi
+
+	if ${GREP} '[bB]lack' "${target}" > /dev/null; then
+		if [ "$1" = "check" ]; then
+			msg "Fix old configuration file(s)."
+			return 1
+		else
+			local p=$(${STAT} -f %Lp "${target}")
+			chmod u+w "${target}" || return 1
+			${SED} -i -e 's/\([bB]\)lack/\1lock/g' "${target}"
+			chmod "${p}" "${target}"
 		fi
-		local p=$(stat -f %Lp "$i")
-		chmod u+w "$i"
-		sed -i -e 's/\([bB]\)lack/\1lock/g' "$i"
-		chmod "$p" "$i"
-	done
+	fi
 }
 
 #
@@ -862,23 +871,26 @@ fixblock() {
 additem blocklist "rename old files to blocklist"
 do_blocklist()
 {
-	local rcfiles="/etc/rc.conf /etc/npf.conf /etc/defaults/rc.conf"
-
+	[ -n "$1" ] || err 3 "USAGE: do_blocklist  fix|check"
+	local op="$1"
+	
 	# if we are actually using blocklistd
-	if [ -f /var/db/blacklist.db ]; then
-		mv /var/db/blacklist.db /var/db/blocklist.db
-	fi
-	if [ -f /etc/blacklistd.conf ]; then
-		mv /etc/blacklistd.conf /etc/blocklistd.conf
-		fixblock /etc/blocklistd.conf
-	fi
-
-	# if we have fixed the rc files we are done
-	if ! grep -qs $rcfiles; then
-		return
-	fi
+	for i in /var/db/blacklist.db /etc/blacklistd.conf; do
+		local old="${DEST_DIR}${i}"
+		if [ ! -f "${old}" ]; then
+			continue
+		elif [ "$1" = "check" ]; then
+			msg "Rename old file(s)."
+			return 1
+		fi
+		local new=$(echo "${old}" | ${SED} s/black/block/)
+		mv "${old}" "${new}" || return 1
+	done
 
-	fixblock $rcfiles
+	for i in /etc/rc.conf /etc/npf.conf /etc/blocklistd.conf \
+	/etc/defaults/rc.conf; do
+		fixblock "${op}" "${i}" || return 1
+	done
 }
 
 #



CVS commit: src/usr.sbin/postinstall

2020-06-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jun 22 06:55:41 UTC 2020

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
Fix do_blocklist:
- Respect destination directory specified by -d option.
- Accept check and fix options. For the former, do not modify anything as
  users normally expect.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/postinstall/postinstall.in

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



CVS commit: src/lib/libc/arch/powerpc/gen

2020-06-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jun 22 06:49:04 UTC 2020

Modified Files:
src/lib/libc/arch/powerpc/gen: _lwp.c

Log Message:
Turn on _UC_TLSBASE for sure in the same manner as other ports.
No functional changes since that flag is turned on via getcontext(2).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/powerpc/gen/_lwp.c

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

Modified files:

Index: src/lib/libc/arch/powerpc/gen/_lwp.c
diff -u src/lib/libc/arch/powerpc/gen/_lwp.c:1.7 src/lib/libc/arch/powerpc/gen/_lwp.c:1.8
--- src/lib/libc/arch/powerpc/gen/_lwp.c:1.7	Thu Mar 22 05:36:50 2012
+++ src/lib/libc/arch/powerpc/gen/_lwp.c	Mon Jun 22 06:49:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: _lwp.c,v 1.7 2012/03/22 05:36:50 matt Exp $	*/
+/*	$NetBSD: _lwp.c,v 1.8 2020/06/22 06:49:04 rin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _lwp.c,v 1.7 2012/03/22 05:36:50 matt Exp $");
+__RCSID("$NetBSD: _lwp.c,v 1.8 2020/06/22 06:49:04 rin Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -67,6 +67,8 @@ _lwp_makecontext(ucontext_t *u, void (*s
 	u->uc_mcontext.__gregs[1] = sp;/* stack */
 	u->uc_mcontext.__gregs[33] = (uintptr_t) _lwp_exit;	/* LR */
 	u->uc_mcontext.__gregs[34] = (uintptr_t) start;		/* PC */
+
 	u->uc_mcontext.__gregs[_REG_R2] =
 	(uintptr_t)tcb + TLS_TP_OFFSET + sizeof(struct tls_tcb);
+	u->uc_flags |= _UC_TLSBASE;
 }



CVS commit: src/lib/libc/arch/powerpc/gen

2020-06-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jun 22 06:49:04 UTC 2020

Modified Files:
src/lib/libc/arch/powerpc/gen: _lwp.c

Log Message:
Turn on _UC_TLSBASE for sure in the same manner as other ports.
No functional changes since that flag is turned on via getcontext(2).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/powerpc/gen/_lwp.c

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