CVS commit: src/sys/arch/aarch64

2019-12-19 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Dec 20 07:16:43 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: cpuswitch.S
src/sys/arch/aarch64/include: asm.h

Log Message:
Add a speculation barrier after the 'eret'.

Some aarch64 cpus speculatively execute instructions after 'eret',
and this potentiates side-channel attack.

from
 
https://github.com/torvalds/linux/commit/679db70801da9fda91d26caf13bf5b5ccc74e8e8


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/aarch64/aarch64/cpuswitch.S
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/aarch64/include/asm.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/aarch64/aarch64/cpuswitch.S
diff -u src/sys/arch/aarch64/aarch64/cpuswitch.S:1.12 src/sys/arch/aarch64/aarch64/cpuswitch.S:1.13
--- src/sys/arch/aarch64/aarch64/cpuswitch.S:1.12	Sun Sep 15 07:13:37 2019
+++ src/sys/arch/aarch64/aarch64/cpuswitch.S	Fri Dec 20 07:16:43 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuswitch.S,v 1.12 2019/09/15 07:13:37 skrll Exp $ */
+/* $NetBSD: cpuswitch.S,v 1.13 2019/12/20 07:16:43 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #include "opt_ddb.h"
 #include "opt_kasan.h"
 
-RCSID("$NetBSD: cpuswitch.S,v 1.12 2019/09/15 07:13:37 skrll Exp $")
+RCSID("$NetBSD: cpuswitch.S,v 1.13 2019/12/20 07:16:43 ryo Exp $")
 
 /*
  * At IPL_SCHED:
@@ -268,7 +268,7 @@ ENTRY_NP(el1_trap_exit)
 	ldp	x1, x2, [x0, #TF_X1]
 	ldr	x0, [x0, #TF_X0]
 
-	eret
+	ERET
 END(el1_trap_exit)
 #ifdef DDB
 END(el1_trap)
@@ -339,7 +339,7 @@ ENTRY_NP(el0_trap_exit)
 	unwind_x0_x2
 
 	/* leave sp at l_md.md_utf, return back to EL0 user process */
-	eret
+	ERET
 END(el0_trap_exit)
 #ifdef DDB
 END(el0_trap)

Index: src/sys/arch/aarch64/include/asm.h
diff -u src/sys/arch/aarch64/include/asm.h:1.4 src/sys/arch/aarch64/include/asm.h:1.5
--- src/sys/arch/aarch64/include/asm.h:1.4	Mon Aug  5 16:24:48 2019
+++ src/sys/arch/aarch64/include/asm.h	Fri Dec 20 07:16:43 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: asm.h,v 1.4 2019/08/05 16:24:48 joerg Exp $ */
+/* $NetBSD: asm.h,v 1.5 2019/12/20 07:16:43 ryo Exp $ */
 
 #ifndef _AARCH64_ASM_H_
 #define _AARCH64_ASM_H_
@@ -8,6 +8,15 @@
 #ifdef __aarch64__
 #define	fp	x29
 #define	lr	x30
+
+/*
+ * Add a speculation barrier after the 'eret'.
+ * Some aarch64 cpus speculatively execute instructions after 'eret',
+ * and this potentiates side-channel attacks.
+ */
+#define	ERET	\
+	eret; dsb sy; isb
+
 #endif
 
 #endif /* !_AARCH64_ASM_H_ */



CVS commit: src/sys/arch/aarch64

2019-12-19 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Dec 20 07:16:43 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: cpuswitch.S
src/sys/arch/aarch64/include: asm.h

Log Message:
Add a speculation barrier after the 'eret'.

Some aarch64 cpus speculatively execute instructions after 'eret',
and this potentiates side-channel attack.

from
 
https://github.com/torvalds/linux/commit/679db70801da9fda91d26caf13bf5b5ccc74e8e8


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/aarch64/aarch64/cpuswitch.S
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/aarch64/include/asm.h

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



CVS commit: src/share/mk

2019-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 20 04:04:25 UTC 2019

Modified Files:
src/share/mk: bsd.sys.mk sys.mk

Log Message:
move MV to sys.mk because it is used there. Pointed out by joerg@


To generate a diff of this commit:
cvs rdiff -u -r1.297 -r1.298 src/share/mk/bsd.sys.mk
cvs rdiff -u -r1.139 -r1.140 src/share/mk/sys.mk

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



CVS commit: src/share/mk

2019-12-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec 20 04:04:25 UTC 2019

Modified Files:
src/share/mk: bsd.sys.mk sys.mk

Log Message:
move MV to sys.mk because it is used there. Pointed out by joerg@


To generate a diff of this commit:
cvs rdiff -u -r1.297 -r1.298 src/share/mk/bsd.sys.mk
cvs rdiff -u -r1.139 -r1.140 src/share/mk/sys.mk

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

Modified files:

Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.297 src/share/mk/bsd.sys.mk:1.298
--- src/share/mk/bsd.sys.mk:1.297	Sun Dec  1 12:25:47 2019
+++ src/share/mk/bsd.sys.mk	Thu Dec 19 23:04:25 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.297 2019/12/01 17:25:47 kamil Exp $
+#	$NetBSD: bsd.sys.mk,v 1.298 2019/12/20 04:04:25 christos Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -270,7 +270,6 @@ OBJCOPY?=	objcopy
 OBJDUMP?=	objdump
 PAXCTL?=	paxctl
 STRIP?=		strip
-MV?=		mv -f
 
 .SUFFIXES:	.o .ln .lo .c .cc .cpp .cxx .C .m ${YHEADER:D.h}
 

Index: src/share/mk/sys.mk
diff -u src/share/mk/sys.mk:1.139 src/share/mk/sys.mk:1.140
--- src/share/mk/sys.mk:1.139	Sun Apr  7 15:32:24 2019
+++ src/share/mk/sys.mk	Thu Dec 19 23:04:25 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: sys.mk,v 1.139 2019/04/07 19:32:24 christos Exp $
+#	$NetBSD: sys.mk,v 1.140 2019/12/20 04:04:25 christos Exp $
 #	@(#)sys.mk	8.2 (Berkeley) 3/21/94
 #
 # This file contains the basic rules for make(1) and is read first
@@ -14,6 +14,7 @@ unix?=		We run NetBSD.
 AR?=		ar
 ARFLAGS?=	rl
 RANLIB?=	ranlib
+MV?=		mv -f
 
 AS?=		as
 AFLAGS?=



CVS commit: src/share/man/man4

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 02:24:02 UTC 2019

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

Log Message:
Add information for ixl(4)'s VLAN hardware filter


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/ixl.4

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

Modified files:

Index: src/share/man/man4/ixl.4
diff -u src/share/man/man4/ixl.4:1.1 src/share/man/man4/ixl.4:1.2
--- src/share/man/man4/ixl.4:1.1	Tue Dec 10 13:07:28 2019
+++ src/share/man/man4/ixl.4	Fri Dec 20 02:24:02 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ixl.4,v 1.1 2019/12/10 13:07:28 yamaguchi Exp $
+.\"	$NetBSD: ixl.4,v 1.2 2019/12/20 02:24:02 yamaguchi Exp $
 .\"
 .\" Copyright (c) 2019 Internet Initiative Japan, Inc.
 .\" All rights reserved.
@@ -63,3 +63,7 @@ into
 .Nx
 by
 .An Shoichi Yamaguchi Aq Mt yamagu...@netbsd.org .
+.Sh BUGS
+VLAN hardware filter doesn't work while the interface is promiscuous mode.
+If a register of VLAN tag is failed due to lack of resources, the interface
+don't send and receive packets containing the tag.



CVS commit: src/share/man/man4

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 02:24:02 UTC 2019

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

Log Message:
Add information for ixl(4)'s VLAN hardware filter


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/ixl.4

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

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 02:19:27 UTC 2019

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

Log Message:
ixl(4) supports ETHERCAP_VLAN_HWFILTER
the feature is disable by default.

reviewed by msaitoh and knakahara


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/if_ixl.c

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

Modified files:

Index: src/sys/dev/pci/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.11 src/sys/dev/pci/if_ixl.c:1.12
--- src/sys/dev/pci/if_ixl.c:1.11	Fri Dec 20 02:12:31 2019
+++ src/sys/dev/pci/if_ixl.c	Fri Dec 20 02:19:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.11 2019/12/20 02:12:31 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.12 2019/12/20 02:19:27 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -646,8 +646,8 @@ static int	ixl_set_link_status(struct ix
 static void	ixl_config_rss(struct ixl_softc *);
 static int	ixl_add_macvlan(struct ixl_softc *, const uint8_t *,
 		uint16_t, uint16_t);
-static int	ixl_remove_macvlan(struct ixl_softc *, uint8_t *, uint16_t,
-		uint16_t);
+static int	ixl_remove_macvlan(struct ixl_softc *, const uint8_t *,
+		uint16_t, uint16_t);
 static void	ixl_arq(void *);
 static void	ixl_hmc_pack(void *, const void *,
 		const struct ixl_hmc_pack *, unsigned int);
@@ -725,7 +725,10 @@ static const struct ixl_product *
 		ixl_lookup(const struct pci_attach_args *pa);
 static void	ixl_link_state_update(struct ixl_softc *,
 		const struct ixl_aq_desc *);
-static int	ixl_set_macvlan(struct ixl_softc *);
+static int	ixl_vlan_cb(struct ethercom *, uint16_t, bool);
+static int	ixl_setup_vlan_hwfilter(struct ixl_softc *);
+static void	ixl_teardown_vlan_hwfilter(struct ixl_softc *);
+static int	ixl_update_macvlan(struct ixl_softc *);
 static int	ixl_setup_interrupts(struct ixl_softc *);;
 static void	ixl_teardown_interrupts(struct ixl_softc *);
 static int	ixl_setup_stats(struct ixl_softc *);
@@ -1194,10 +1197,15 @@ ixl_attach(device_t parent, device_t sel
 	IFCAP_CSUM_TCPv4_Tx | IFCAP_CSUM_TCPv4_Rx |
 	IFCAP_CSUM_UDPv4_Tx | IFCAP_CSUM_UDPv4_Rx;
 #endif
+	ether_set_vlan_cb(>sc_ec, ixl_vlan_cb);
 	sc->sc_ec.ec_capabilities |= ETHERCAP_VLAN_MTU;
 	sc->sc_ec.ec_capabilities |= ETHERCAP_VLAN_HWTAGGING;
+	sc->sc_ec.ec_capabilities |= ETHERCAP_VLAN_HWFILTER;
 
 	sc->sc_ec.ec_capenable = sc->sc_ec.ec_capabilities;
+	/* Disable VLAN_HWFILTER by default */
+	CLR(sc->sc_ec.ec_capenable, ETHERCAP_VLAN_HWFILTER);
+
 	sc->sc_cur_ec_capenable = sc->sc_ec.ec_capenable;
 
 	sc->sc_ec.ec_ifmedia = >sc_media;
@@ -1219,7 +1227,25 @@ ixl_attach(device_t parent, device_t sel
 	ixl_config_other_intr(sc);
 	ixl_enable_other_intr(sc);
 
-	ixl_set_macvlan(sc);
+	/* remove default mac filter and replace it so we can see vlans */
+	rv = ixl_remove_macvlan(sc, sc->sc_enaddr, 0, 0);
+	if (rv != ENOENT) {
+		aprint_debug_dev(self,
+		"unable to remove macvlan %u\n", rv);
+	}
+	rv = ixl_remove_macvlan(sc, sc->sc_enaddr, 0,
+	IXL_AQ_OP_REMOVE_MACVLAN_IGNORE_VLAN);
+	if (rv != ENOENT) {
+		aprint_debug_dev(self,
+		"unable to remove macvlan, ignore vlan %u\n", rv);
+	}
+
+	if (ixl_update_macvlan(sc) != 0) {
+		aprint_debug_dev(self,
+		"couldn't enable vlan hardware filter\n");
+		CLR(sc->sc_ec.ec_capenable, ETHERCAP_VLAN_HWFILTER);
+		CLR(sc->sc_cur_ec_capenable, ETHERCAP_VLAN_HWFILTER);
+	}
 
 	sc->sc_txrx_workqueue = true;
 	sc->sc_tx_process_limit = IXL_TX_PROCESS_LIMIT;
@@ -1380,6 +1406,34 @@ ixl_workqs_teardown(device_t self)
 	return 0;
 }
 
+static int
+ixl_vlan_cb(struct ethercom *ec, uint16_t vid, bool set)
+{
+	struct ifnet *ifp = >ec_if;
+	struct ixl_softc *sc = ifp->if_softc;
+	int rv;
+
+	if (!ISSET(sc->sc_cur_ec_capenable, ETHERCAP_VLAN_HWFILTER)) {
+		return 0;
+	}
+
+	if (set) {
+		rv = ixl_add_macvlan(sc, sc->sc_enaddr, vid,
+		IXL_AQ_OP_ADD_MACVLAN_PERFECT_MATCH);
+		if (rv == 0) {
+			rv = ixl_add_macvlan(sc, etherbroadcastaddr,
+			vid, IXL_AQ_OP_ADD_MACVLAN_PERFECT_MATCH);
+		}
+	} else {
+		rv = ixl_remove_macvlan(sc, sc->sc_enaddr, vid,
+		IXL_AQ_OP_REMOVE_MACVLAN_PERFECT_MATCH);
+		(void)ixl_remove_macvlan(sc, etherbroadcastaddr, vid,
+		IXL_AQ_OP_REMOVE_MACVLAN_PERFECT_MATCH);
+	}
+
+	return rv;
+}
+
 static void
 ixl_media_add(struct ixl_softc *sc, uint64_t phy_types)
 {
@@ -1460,6 +1514,7 @@ ixl_add_multi(struct ixl_softc *sc, uint
 		return ENETRESET;
 	}
 
+	/* multicast address can not use VLAN HWFILTER */
 	rv = ixl_add_macvlan(sc, addrlo, 0,
 	IXL_AQ_OP_ADD_MACVLAN_IGNORE_VLAN);
 
@@ -1726,7 +1781,6 @@ ixl_reinit(struct ixl_softc *sc)
 	if (ixl_set_vsi(sc) != 0)
 		return EIO;
 
-
 	for (i = 0; i < sc->sc_nqueue_pairs; i++) {
 		txr = sc->sc_qps[i].qp_txr;
 		rxr = sc->sc_qps[i].qp_rxr;
@@ -1752,7 +1806,6 @@ ixl_reinit(struct ixl_softc *sc)
 		ixl_wr(sc, txr->txr_tail, txr->txr_prod);
 		ixl_wr(sc, rxr->rxr_tail, rxr->rxr_prod);
 
-
 	

CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 02:19:27 UTC 2019

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

Log Message:
ixl(4) supports ETHERCAP_VLAN_HWFILTER
the feature is disable by default.

reviewed by msaitoh and knakahara


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/if_ixl.c

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



CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 02:12:31 UTC 2019

Modified Files:
src/sys/dev/pci: if_ixl.c if_ixlvar.h

Log Message:
ixl(4) supports ETHERCAP_VLAN_HWTAGGING
It is enabled by defualt

The features is realized by the following operations:
- internal switch
   - use "0b00: Show VLAN, DEI and UP in descriptor" mode
- TX
   - set VLAN tag and IL2TAG1 flag to each descriptor
- RX
   - use 32byte descriptor to use SHOWIV and L2SEL flag
 included in RX queue configuration
  - VLAN tags are not stored in descriptor without these config.
   - get VLAN tags from L2TAG1 field included in RX descriptor
 and set them to mbuf

reviewed by msaitoh and knakahara


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

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 02:12:31 UTC 2019

Modified Files:
src/sys/dev/pci: if_ixl.c if_ixlvar.h

Log Message:
ixl(4) supports ETHERCAP_VLAN_HWTAGGING
It is enabled by defualt

The features is realized by the following operations:
- internal switch
   - use "0b00: Show VLAN, DEI and UP in descriptor" mode
- TX
   - set VLAN tag and IL2TAG1 flag to each descriptor
- RX
   - use 32byte descriptor to use SHOWIV and L2SEL flag
 included in RX queue configuration
  - VLAN tags are not stored in descriptor without these config.
   - get VLAN tags from L2TAG1 field included in RX descriptor
 and set them to mbuf

reviewed by msaitoh and knakahara


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/if_ixl.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/if_ixlvar.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/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.10 src/sys/dev/pci/if_ixl.c:1.11
--- src/sys/dev/pci/if_ixl.c:1.10	Fri Dec 20 02:04:26 2019
+++ src/sys/dev/pci/if_ixl.c	Fri Dec 20 02:12:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.10 2019/12/20 02:04:26 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.11 2019/12/20 02:12:31 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -525,6 +525,8 @@ struct ixl_softc {
 	u_int			 sc_tx_intr_process_limit;
 	u_int			 sc_rx_intr_process_limit;
 
+	int			 sc_cur_ec_capenable;
+
 	struct pci_attach_args	 sc_pa;
 	pci_intr_handle_t	*sc_ihp;
 	void			**sc_ihs;
@@ -1125,13 +1127,17 @@ ixl_attach(device_t parent, device_t sel
 		goto free_hmc;
 	}
 
-	if (ixl_get_vsi(sc) != 0) {
-		/* error printed by ixl_get_vsi */
+	rv = ixl_get_vsi(sc);
+	if (rv != 0) {
+		aprint_error_dev(self, "GET VSI %s %d\n",
+		rv == ETIMEDOUT ? "timeout" : "error", rv);
 		goto free_scratch;
 	}
 
-	if (ixl_set_vsi(sc) != 0) {
-		/* error printed by ixl_set_vsi */
+	rv = ixl_set_vsi(sc);
+	if (rv != 0) {
+		aprint_error_dev(self, "UPDATE VSI error %s %d\n",
+		rv == ETIMEDOUT ? "timeout" : "error", rv);
 		goto free_scratch;
 	}
 
@@ -1189,9 +1195,10 @@ ixl_attach(device_t parent, device_t sel
 	IFCAP_CSUM_UDPv4_Tx | IFCAP_CSUM_UDPv4_Rx;
 #endif
 	sc->sc_ec.ec_capabilities |= ETHERCAP_VLAN_MTU;
-#if 0
 	sc->sc_ec.ec_capabilities |= ETHERCAP_VLAN_HWTAGGING;
-#endif
+
+	sc->sc_ec.ec_capenable = sc->sc_ec.ec_capabilities;
+	sc->sc_cur_ec_capenable = sc->sc_ec.ec_capenable;
 
 	sc->sc_ec.ec_ifmedia = >sc_media;
 	ifmedia_init(>sc_media, IFM_IMASK, ixl_media_change,
@@ -1713,6 +1720,13 @@ ixl_reinit(struct ixl_softc *sc)
 
 	KASSERT(mutex_owned(>sc_cfg_lock));
 
+	if (ixl_get_vsi(sc) != 0)
+		return EIO;
+
+	if (ixl_set_vsi(sc) != 0)
+		return EIO;
+
+
 	for (i = 0; i < sc->sc_nqueue_pairs; i++) {
 		txr = sc->sc_qps[i].qp_txr;
 		rxr = sc->sc_qps[i].qp_rxr;
@@ -1781,10 +1795,15 @@ ixl_init_locked(struct ixl_softc *sc)
 
 	KASSERT(mutex_owned(>sc_cfg_lock));
 
+	if (ISSET(ifp->if_flags, IFF_RUNNING))
+		ixl_stop_locked(sc);
+
 	if (sc->sc_dead) {
 		return ENXIO;
 	}
 
+	sc->sc_cur_ec_capenable = sc->sc_ec.ec_capenable;
+
 	if (sc->sc_intrtype != PCI_INTR_TYPE_MSIX)
 		sc->sc_nqueue_pairs = 1;
 	else
@@ -2304,7 +2323,7 @@ ixl_tx_common_locked(struct ifnet *ifp, 
 	struct ixl_tx_map *txm;
 	bus_dmamap_t map;
 	struct mbuf *m;
-	uint64_t cmd;
+	uint64_t cmd, cmd_vlan;
 	unsigned int prod, free, last, i;
 	unsigned int mask;
 	int post = 0;
@@ -2358,6 +2377,14 @@ ixl_tx_common_locked(struct ifnet *ifp, 
 			continue;
 		}
 
+		if (vlan_has_tag(m)) {
+			cmd_vlan = (uint64_t)vlan_get_tag(m) <<
+			IXL_TX_DESC_L2TAG1_SHIFT;
+			cmd_vlan |= IXL_TX_DESC_CMD_IL2TAG1;
+		} else {
+			cmd_vlan = 0;
+		}
+
 		bus_dmamap_sync(sc->sc_dmat, map, 0,
 		map->dm_mapsize, BUS_DMASYNC_PREWRITE);
 
@@ -2367,6 +2394,7 @@ ixl_tx_common_locked(struct ifnet *ifp, 
 			cmd = (uint64_t)map->dm_segs[i].ds_len <<
 			IXL_TX_DESC_BSIZE_SHIFT;
 			cmd |= IXL_TX_DESC_DTYPE_DATA | IXL_TX_DESC_CMD_ICRC;
+			cmd |= cmd_vlan;
 
 			txd->addr = htole64(map->dm_segs[i].ds_addr);
 			txd->cmd = htole64(cmd);
@@ -2558,7 +2586,7 @@ ixl_rxr_alloc(struct ixl_softc *sc, unsi
 	KM_SLEEP);
 
 	if (ixl_dmamem_alloc(sc, >rxr_mem,
-	sizeof(struct ixl_rx_rd_desc_16) * sc->sc_rx_ring_ndescs,
+	sizeof(struct ixl_rx_rd_desc_32) * sc->sc_rx_ring_ndescs,
 	IXL_RX_QUEUE_ALIGN) != 0)
 		goto free;
 
@@ -2684,10 +2712,10 @@ ixl_rxr_config(struct ixl_softc *sc, str
 	rxq.dbuff = htole16(MCLBYTES / IXL_HMC_RXQ_DBUFF_UNIT);
 	rxq.hbuff = 0;
 	rxq.dtype = IXL_HMC_RXQ_DTYPE_NOSPLIT;
-	rxq.dsize = IXL_HMC_RXQ_DSIZE_16;
+	rxq.dsize = IXL_HMC_RXQ_DSIZE_32;
 	rxq.crcstrip = 1;
-	rxq.l2sel = 0;
-	rxq.showiv = 0;
+	rxq.l2sel = 1;
+	rxq.showiv = 1;
 	rxq.rxmax = htole16(IXL_HARDMTU);
 	rxq.tphrdesc_ena = 0;
 	rxq.tphwdesc_ena = 0;
@@ -2734,12 +2762,12 @@ static int
 ixl_rxeof(struct ixl_softc *sc, struct ixl_rx_ring 

CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 02:04:26 UTC 2019

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

Log Message:
enable other interrupt even if ixl(4) is down


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/if_ixl.c

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

Modified files:

Index: src/sys/dev/pci/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.9 src/sys/dev/pci/if_ixl.c:1.10
--- src/sys/dev/pci/if_ixl.c:1.9	Fri Dec 20 01:54:39 2019
+++ src/sys/dev/pci/if_ixl.c	Fri Dec 20 02:04:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.9 2019/12/20 01:54:39 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.10 2019/12/20 02:04:26 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -1205,16 +1205,15 @@ ixl_attach(device_t parent, device_t sel
 	if_deferred_start_init(ifp, NULL);
 	ether_ifattach(ifp, sc->sc_enaddr);
 	ether_set_ifflags_cb(>sc_ec, ixl_ifflags_cb);
-	(void)ixl_get_link_status(sc);
 
+	(void)ixl_get_link_status_poll(sc);
 	ixl_work_set(>sc_link_state_task, ixl_get_link_status, sc);
 
 	ixl_config_other_intr(sc);
+	ixl_enable_other_intr(sc);
 
 	ixl_set_macvlan(sc);
 
-	ixl_enable_other_intr(sc);
-
 	sc->sc_txrx_workqueue = true;
 	sc->sc_tx_process_limit = IXL_TX_PROCESS_LIMIT;
 	sc->sc_rx_process_limit = IXL_RX_PROCESS_LIMIT;
@@ -1286,6 +1285,15 @@ ixl_detach(device_t self, int flags)
 
 	ixl_stop(ifp, 1);
 
+	ixl_disable_other_intr(sc);
+
+	/* wait for ATQ handler */
+	mutex_enter(>sc_atq_lock);
+	mutex_exit(>sc_atq_lock);
+
+	ixl_work_wait(sc->sc_workq, >sc_arq_task);
+	ixl_work_wait(sc->sc_workq, >sc_link_state_task);
+
 	if (sc->sc_workq != NULL) {
 		ixl_workq_destroy(sc->sc_workq);
 		sc->sc_workq = NULL;
@@ -1791,12 +1799,11 @@ ixl_init_locked(struct ixl_softc *sc)
 	SET(ifp->if_flags, IFF_RUNNING);
 	CLR(ifp->if_flags, IFF_OACTIVE);
 
-	(void)ixl_get_link_status_poll(sc);
+	(void)ixl_get_link_status(sc);
 
 	ixl_config_rss(sc);
 	ixl_config_queue_intr(sc);
 
-	ixl_enable_other_intr(sc);
 	for (i = 0; i < sc->sc_nqueue_pairs; i++) {
 		ixl_enable_queue_intr(sc, >sc_qps[i]);
 	}
@@ -1892,13 +1899,6 @@ ixl_stop_rendezvous(struct ixl_softc *sc
 		ixl_work_wait(sc->sc_workq_txrx,
 		>sc_qps[i].qp_task);
 	}
-
-	mutex_enter(>sc_atq_lock);
-	mutex_exit(>sc_atq_lock);
-
-	ixl_work_wait(sc->sc_workq, >sc_arq_task);
-	ixl_work_wait(sc->sc_workq, >sc_link_state_task);
-
 }
 
 static void
@@ -1914,7 +1914,6 @@ ixl_stop_locked(struct ixl_softc *sc)
 
 	CLR(ifp->if_flags, IFF_RUNNING | IFF_OACTIVE);
 
-	ixl_disable_other_intr(sc);
 	for (i = 0; i < sc->sc_nqueue_pairs; i++) {
 		txr = sc->sc_qps[i].qp_txr;
 		rxr = sc->sc_qps[i].qp_rxr;



CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 02:04:26 UTC 2019

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

Log Message:
enable other interrupt even if ixl(4) is down


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/if_ixl.c

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



Re: CVS commit: src/share/mk

2019-12-19 Thread Joerg Sonnenberger
On Mon, Jan 21, 2019 at 04:11:55PM -0500, Christos Zoulas wrote:
> Module Name:  src
> Committed By: christos
> Date: Mon Jan 21 21:11:55 UTC 2019
> 
> Modified Files:
>   src/share/mk: bsd.dep.mk bsd.hostprog.mk bsd.info.mk bsd.kmodule.mk
>   bsd.lib.mk bsd.man.mk bsd.prog.mk bsd.sys.mk bsd.test.mk bsd.x11.mk
>   sys.mk
> 
> Log Message:
> Most of the mv operations are to move temporary files to their final place.
> Some use -f, others don't. This can lead to spurious build failures when
> the user performing the build changes. Centralize, and always use -f.

At least the sys.mk part of this breaks standalone Makefiles, because MV
is not defined.

Joerg


CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 01:54:39 UTC 2019

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

Log Message:
Do IXL_AQ_OP_SET_VSI_PROMISC in ixl_ifflags_cb() for
applying IFF_PROMISC


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/if_ixl.c

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



CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 01:54:39 UTC 2019

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

Log Message:
Do IXL_AQ_OP_SET_VSI_PROMISC in ixl_ifflags_cb() for
applying IFF_PROMISC


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/if_ixl.c

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

Modified files:

Index: src/sys/dev/pci/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.8 src/sys/dev/pci/if_ixl.c:1.9
--- src/sys/dev/pci/if_ixl.c:1.8	Fri Dec 20 01:49:30 2019
+++ src/sys/dev/pci/if_ixl.c	Fri Dec 20 01:54:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.8 2019/12/20 01:49:30 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.9 2019/12/20 01:54:39 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -3414,6 +3414,8 @@ ixl_atq_poll(struct ixl_softc *sc, struc
 	unsigned int prod;
 	unsigned int t = 0;
 
+	mutex_enter(>sc_atq_lock);
+
 	atq = IXL_DMA_KVA(>sc_atq);
 	prod = sc->sc_atq_prod;
 	slot = atq + prod;
@@ -3435,8 +3437,10 @@ ixl_atq_poll(struct ixl_softc *sc, struc
 	while (ixl_rd(sc, sc->sc_aq_regs->atq_head) != prod) {
 		delaymsec(1);
 
-		if (t++ > tm)
+		if (t++ > tm) {
+			mutex_exit(>sc_atq_lock);
 			return ETIMEDOUT;
+		}
 	}
 
 	bus_dmamap_sync(sc->sc_dmat, IXL_DMA_MAP(>sc_atq),
@@ -3448,6 +3452,8 @@ ixl_atq_poll(struct ixl_softc *sc, struc
 
 	sc->sc_atq_cons = prod;
 
+	mutex_exit(>sc_atq_lock);
+
 	return 0;
 }
 
@@ -4820,8 +4826,15 @@ ixl_set_macvlan(struct ixl_softc *sc)
 static int
 ixl_ifflags_cb(struct ethercom *ec)
 {
+	struct ifnet *ifp = >ec_if;
+	struct ixl_softc *sc = ifp->if_softc;
+	int rv;
 
-	return 0;
+	mutex_enter(>sc_cfg_lock);
+	rv = ixl_iff(sc);
+	mutex_exit(>sc_cfg_lock);
+
+	return rv;
 }
 
 static int



CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 01:49:30 UTC 2019

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

Log Message:
Fix ixl(4) to set ENETRESET when IFF_ALLMULTI is changed


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/if_ixl.c

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

Modified files:

Index: src/sys/dev/pci/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.7 src/sys/dev/pci/if_ixl.c:1.8
--- src/sys/dev/pci/if_ixl.c:1.7	Fri Dec 20 01:45:20 2019
+++ src/sys/dev/pci/if_ixl.c	Fri Dec 20 01:49:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.7 2019/12/20 01:45:20 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.8 2019/12/20 01:49:30 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -1442,7 +1442,7 @@ ixl_add_multi(struct ixl_softc *sc, uint
 	if (memcmp(addrlo, addrhi, ETHER_ADDR_LEN) != 0) {
 		ixl_del_all_multiaddr(sc);
 		SET(ifp->if_flags, IFF_ALLMULTI);
-		return 0;
+		return ENETRESET;
 	}
 
 	rv = ixl_add_macvlan(sc, addrlo, 0,
@@ -1451,25 +1451,25 @@ ixl_add_multi(struct ixl_softc *sc, uint
 	if (rv == ENOSPC) {
 		ixl_del_all_multiaddr(sc);
 		SET(ifp->if_flags, IFF_ALLMULTI);
-		return 0;
+		return ENETRESET;
 	}
 
 	return rv;
 }
 
-static void
+static int
 ixl_del_multi(struct ixl_softc *sc, uint8_t *addrlo, uint8_t *addrhi)
 {
 	struct ifnet *ifp = >sc_ec.ec_if;
 	struct ethercom *ec = >sc_ec;
 	struct ether_multi *enm, *enm_last;
 	struct ether_multistep step;
-	int rv;
+	int error, rv = 0;
 
 	if (!ISSET(ifp->if_flags, IFF_ALLMULTI)) {
 		ixl_remove_macvlan(sc, addrlo, 0,
 		IXL_AQ_OP_REMOVE_MACVLAN_IGNORE_VLAN);
-		return;
+		return 0;
 	}
 
 	ETHER_LOCK(ec);
@@ -1477,16 +1477,15 @@ ixl_del_multi(struct ixl_softc *sc, uint
 	ETHER_NEXT_MULTI(step, enm)) {
 		if (memcmp(enm->enm_addrlo, enm->enm_addrhi,
 		ETHER_ADDR_LEN) != 0) {
-			ETHER_UNLOCK(ec);
-			return;
+			goto out;
 		}
 	}
 
 	for (ETHER_FIRST_MULTI(step, ec, enm); enm != NULL;
 	ETHER_NEXT_MULTI(step, enm)) {
-		rv = ixl_add_macvlan(sc, enm->enm_addrlo, 0,
+		error = ixl_add_macvlan(sc, enm->enm_addrlo, 0,
 		IXL_AQ_OP_ADD_MACVLAN_IGNORE_VLAN);
-		if (rv != 0)
+		if (error != 0)
 			break;
 	}
 
@@ -1502,9 +1501,12 @@ ixl_del_multi(struct ixl_softc *sc, uint
 		}
 	} else {
 		CLR(ifp->if_flags, IFF_ALLMULTI);
+		rv = ENETRESET;
 	}
 
+out:
 	ETHER_UNLOCK(ec);
+	return rv;
 }
 
 static int
@@ -1527,7 +1529,8 @@ ixl_ioctl(struct ifnet *ifp, u_long cmd,
 			if (error != 0)
 return error;
 
-			if (ixl_add_multi(sc, addrlo, addrhi) != 0) {
+			error = ixl_add_multi(sc, addrlo, addrhi);
+			if (error != 0 && error != ENETRESET) {
 ether_delmulti(sa, >sc_ec);
 error = EIO;
 			}
@@ -1541,7 +1544,7 @@ ixl_ioctl(struct ifnet *ifp, u_long cmd,
 			if (error != 0)
 return error;
 
-			ixl_del_multi(sc, addrlo, addrhi);
+			error = ixl_del_multi(sc, addrlo, addrhi);
 		}
 		break;
 



CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 01:49:30 UTC 2019

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

Log Message:
Fix ixl(4) to set ENETRESET when IFF_ALLMULTI is changed


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/if_ixl.c

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



CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 01:45:20 UTC 2019

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

Log Message:
Fix ixl_{add|remove}_macvlan() to return errno
instead of command status


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/if_ixl.c

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

Modified files:

Index: src/sys/dev/pci/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.6 src/sys/dev/pci/if_ixl.c:1.7
--- src/sys/dev/pci/if_ixl.c:1.6	Fri Dec 20 01:18:53 2019
+++ src/sys/dev/pci/if_ixl.c	Fri Dec 20 01:45:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.6 2019/12/20 01:18:53 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.7 2019/12/20 01:45:20 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -1448,16 +1448,13 @@ ixl_add_multi(struct ixl_softc *sc, uint
 	rv = ixl_add_macvlan(sc, addrlo, 0,
 	IXL_AQ_OP_ADD_MACVLAN_IGNORE_VLAN);
 
-	if (rv == IXL_AQ_RC_ENOSPC) {
+	if (rv == ENOSPC) {
 		ixl_del_all_multiaddr(sc);
 		SET(ifp->if_flags, IFF_ALLMULTI);
 		return 0;
 	}
 
-	if (rv != IXL_AQ_RC_OK)
-		return EIO;
-
-	return 0;
+	return rv;
 }
 
 static void
@@ -1489,7 +1486,7 @@ ixl_del_multi(struct ixl_softc *sc, uint
 	ETHER_NEXT_MULTI(step, enm)) {
 		rv = ixl_add_macvlan(sc, enm->enm_addrlo, 0,
 		IXL_AQ_OP_ADD_MACVLAN_IGNORE_VLAN);
-		if (rv != IXL_AQ_RC_OK)
+		if (rv != 0)
 			break;
 	}
 
@@ -4180,7 +4177,24 @@ ixl_add_macvlan(struct ixl_softc *sc, co
 		return IXL_AQ_RC_EINVAL;
 	}
 
-	return le16toh(iaq.iaq_retval);
+	switch (le16toh(iaq.iaq_retval)) {
+	case IXL_AQ_RC_OK:
+		break;
+	case IXL_AQ_RC_ENOSPC:
+		return ENOSPC;
+	case IXL_AQ_RC_ENOENT:
+		return ENOENT;
+	case IXL_AQ_RC_EACCES:
+		return EACCES;
+	case IXL_AQ_RC_EEXIST:
+		return EEXIST;
+	case IXL_AQ_RC_EINVAL:
+		return EINVAL;
+	default:
+		return EIO;
+	}
+
+	return 0;
 }
 
 static int
@@ -4210,10 +4224,23 @@ ixl_remove_macvlan(struct ixl_softc *sc,
 	elem->vlan = htole16(vlan);
 
 	if (ixl_atq_poll(sc, , 250) != 0) {
-		return IXL_AQ_RC_EINVAL;
+		return EINVAL;
 	}
 
-	return le16toh(iaq.iaq_retval);
+	switch (le16toh(iaq.iaq_retval)) {
+	case IXL_AQ_RC_OK:
+		break;
+	case IXL_AQ_RC_ENOENT:
+		return ENOENT;
+	case IXL_AQ_RC_EACCES:
+		return EACCES;
+	case IXL_AQ_RC_EINVAL:
+		return EINVAL;
+	default:
+		return EIO;
+	}
+
+	return 0;
 }
 
 static int
@@ -4756,14 +4783,14 @@ ixl_set_macvlan(struct ixl_softc *sc)
 	/* remove default mac filter and replace it so we can see vlans */
 
 	error = ixl_remove_macvlan(sc, sc->sc_enaddr, 0, 0);
-	if (error != IXL_AQ_RC_OK) {
+	if (error != 0 && error != ENOENT) {
 		aprint_debug_dev(sc->sc_dev, "unable to remove macvlan\n");
 		rv = -1;
 	}
 
 	error = ixl_remove_macvlan(sc, sc->sc_enaddr, 0,
 	IXL_AQ_OP_REMOVE_MACVLAN_IGNORE_VLAN);
-	if (error != IXL_AQ_RC_OK && error != IXL_AQ_RC_ENOENT) {
+	if (error != 0 && error != ENOENT) {
 		aprint_debug_dev(sc->sc_dev,
 		"unable to remove macvlan(IGNORE_VLAN)\n");
 		rv = -1;
@@ -4771,14 +4798,14 @@ ixl_set_macvlan(struct ixl_softc *sc)
 
 	error = ixl_add_macvlan(sc, sc->sc_enaddr, 0,
 	IXL_AQ_OP_ADD_MACVLAN_IGNORE_VLAN);
-	if (error != IXL_AQ_RC_OK) {
+	if (error != 0) {
 		aprint_debug_dev(sc->sc_dev, "unable to add mac address\n");
 		rv = -1;
 	}
 
 	error = ixl_add_macvlan(sc, etherbroadcastaddr, 0,
 	IXL_AQ_OP_ADD_MACVLAN_IGNORE_VLAN);
-	if (error != IXL_AQ_RC_OK) {
+	if (error != 0) {
 		aprint_debug_dev(sc->sc_dev,
 		"unable to add broadcast mac address\n");
 		rv = -1;



CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 01:45:20 UTC 2019

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

Log Message:
Fix ixl_{add|remove}_macvlan() to return errno
instead of command status


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/if_ixl.c

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



CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 01:18:53 UTC 2019

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

Log Message:
Fix softint leak in ixl(4) when detaching


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/if_ixl.c

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

Modified files:

Index: src/sys/dev/pci/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.5 src/sys/dev/pci/if_ixl.c:1.6
--- src/sys/dev/pci/if_ixl.c:1.5	Fri Dec 20 01:12:51 2019
+++ src/sys/dev/pci/if_ixl.c	Fri Dec 20 01:18:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.5 2019/12/20 01:12:51 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.6 2019/12/20 01:18:53 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -2001,6 +2001,8 @@ ixl_queue_pairs_alloc(struct ixl_softc *
 
 		qp->qp_si = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
 		ixl_handle_queue, qp);
+		if (qp->qp_si == NULL)
+			goto free;
 
 		qp->qp_txr = ixl_txr_alloc(sc, i);
 		if (qp->qp_txr == NULL)
@@ -2026,6 +2028,8 @@ free:
 ixl_txr_free(sc, qp->qp_txr);
 			if (qp->qp_rxr != NULL)
 ixl_rxr_free(sc, qp->qp_rxr);
+			if (qp->qp_si != NULL)
+softint_disestablish(qp->qp_si);
 		}
 
 		sz = sizeof(sc->sc_qps[0]) * sc->sc_nqueue_pairs_max;
@@ -2047,6 +2051,7 @@ ixl_queue_pairs_free(struct ixl_softc *s
 		qp = >sc_qps[i];
 		ixl_txr_free(sc, qp->qp_txr);
 		ixl_rxr_free(sc, qp->qp_rxr);
+		softint_disestablish(qp->qp_si);
 	}
 
 	sz = sizeof(sc->sc_qps[0]) * sc->sc_nqueue_pairs_max;



CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 01:18:53 UTC 2019

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

Log Message:
Fix softint leak in ixl(4) when detaching


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/if_ixl.c

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



CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 01:12:51 UTC 2019

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

Log Message:
Use name of variable instead of that of data structure


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/if_ixl.c

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

Modified files:

Index: src/sys/dev/pci/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.4 src/sys/dev/pci/if_ixl.c:1.5
--- src/sys/dev/pci/if_ixl.c:1.4	Wed Dec 11 10:03:08 2019
+++ src/sys/dev/pci/if_ixl.c	Fri Dec 20 01:12:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.4 2019/12/11 10:03:08 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.5 2019/12/20 01:12:51 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -813,7 +813,7 @@ ixl_dmamem_hi(struct ixl_dmamem *ixm)
 	uint32_t retval;
 	uint64_t val;
 
-	if (sizeof(bus_addr_t) > 4) {
+	if (sizeof(IXL_DMA_DVA(ixm)) > 4) {
 		val = (intptr_t)IXL_DMA_DVA(ixm);
 		retval = (uint32_t)(val >> 32);
 	} else {
@@ -835,7 +835,7 @@ ixl_aq_dva(struct ixl_aq_desc *iaq, bus_
 {
 	uint64_t val;
 
-	if (sizeof(bus_addr_t) > 4) {
+	if (sizeof(addr) > 4) {
 		val = (intptr_t)addr;
 		iaq->iaq_param[2] = htole32(val >> 32);
 	} else {



CVS commit: src/sys/dev/pci

2019-12-19 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Dec 20 01:12:51 UTC 2019

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

Log Message:
Use name of variable instead of that of data structure


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/if_ixl.c

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



Re: CVS commit: src/usr.bin/crunch/crunchgen

2019-12-19 Thread Joerg Sonnenberger
On Thu, Dec 19, 2019 at 12:27:23PM -0500, Christos Zoulas wrote:
> On Dec 19,  4:19pm, jo...@bec.de (Joerg Sonnenberger) wrote:
> -- Subject: Re: CVS commit: src/usr.bin/crunch/crunchgen
> 
> | > I think that there are two uses: install media and rescue. I can reinstate
> | > it for rescue. Is that ok? Note that by default both ssp and fortify are
> | > off for most things, so my change was mostly a no-op for the default 
> settings.
> | 
> | We seem to default to off for more things, PIE too for example.
> 
> Indeed, I also dislike the alphabet soup of flags for disabling
> things.  I propose that instead we provide a way to add a preamble
> to the generated Makefile via -f  file, default to a
> either a built-in configuration file, or one installed in the tree.
> It is inappropriate for crunchgen to have knowledge of variables
> specific to our build system that change over time.
> 
> So I propose:
> 
> 1. to make that change [configuration file]
> 2. leave the defaults as they are for the installation binaries
> 3. change the defaults to turn nothing off for the rescue binaries

With the exception of the default, I agree. IMO crunchgen is a general
purpose tool. It is used in different circumstances and shouldn't
dictate whether "normal" use is space constrained or not.

Joerg


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

2019-12-19 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Dec 19 19:19:28 UTC 2019

Modified Files:
src/tests/lib/libc/string: Makefile

Log Message:
disable string op warnings for t_strcat
now this builds on macppc with gcc 8.3
from riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libc/string/Makefile

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



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

2019-12-19 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Dec 19 19:19:28 UTC 2019

Modified Files:
src/tests/lib/libc/string: Makefile

Log Message:
disable string op warnings for t_strcat
now this builds on macppc with gcc 8.3
from riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libc/string/Makefile

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/string/Makefile
diff -u src/tests/lib/libc/string/Makefile:1.11 src/tests/lib/libc/string/Makefile:1.12
--- src/tests/lib/libc/string/Makefile:1.11	Mon Oct 15 17:55:28 2018
+++ src/tests/lib/libc/string/Makefile	Thu Dec 19 19:19:28 2019
@@ -1,10 +1,12 @@
-# $NetBSD: Makefile,v 1.11 2018/10/15 17:55:28 christos Exp $
+# $NetBSD: Makefile,v 1.12 2019/12/19 19:19:28 macallan Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/lib/libc/string
 DBG=-g
 
+COPTS.t_strcat.c+= ${GCC_NO_STRINGOP_TRUNCATION}
+
 TESTS_C+=	t_bm
 TESTS_C+=	t_memchr
 TESTS_C+=	t_memcpy



Re: CVS commit: src/usr.bin/crunch/crunchgen

2019-12-19 Thread Christos Zoulas
On Dec 19,  4:19pm, jo...@bec.de (Joerg Sonnenberger) wrote:
-- Subject: Re: CVS commit: src/usr.bin/crunch/crunchgen

| > I think that there are two uses: install media and rescue. I can reinstate
| > it for rescue. Is that ok? Note that by default both ssp and fortify are
| > off for most things, so my change was mostly a no-op for the default 
settings.
| 
| We seem to default to off for more things, PIE too for example.

Indeed, I also dislike the alphabet soup of flags for disabling
things.  I propose that instead we provide a way to add a preamble
to the generated Makefile via -f  file, default to a
either a built-in configuration file, or one installed in the tree.
It is inappropriate for crunchgen to have knowledge of variables
specific to our build system that change over time.

So I propose:

1. to make that change [configuration file]
2. leave the defaults as they are for the installation binaries
3. change the defaults to turn nothing off for the rescue binaries

christos


CVS commit: src/sys/dev/sdmmc

2019-12-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Dec 19 17:24:45 UTC 2019

Modified Files:
src/sys/dev/sdmmc: sdmmc_ioreg.h

Log Message:
Avoid changing signedness bit with << in sdmmc_ioreg.h

Reported by 


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/sdmmc/sdmmc_ioreg.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/sdmmc/sdmmc_ioreg.h
diff -u src/sys/dev/sdmmc/sdmmc_ioreg.h:1.5 src/sys/dev/sdmmc/sdmmc_ioreg.h:1.6
--- src/sys/dev/sdmmc/sdmmc_ioreg.h:1.5	Mon Oct 28 06:26:19 2019
+++ src/sys/dev/sdmmc/sdmmc_ioreg.h	Thu Dec 19 17:24:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdmmc_ioreg.h,v 1.5 2019/10/28 06:26:19 mlelstv Exp $	*/
+/*	$NetBSD: sdmmc_ioreg.h,v 1.6 2019/12/19 17:24:45 kamil Exp $	*/
 /*	$OpenBSD: sdmmc_ioreg.h,v 1.4 2007/06/02 01:48:37 uwe Exp $	*/
 
 /*
@@ -39,7 +39,7 @@
 
 /* CMD53 arguments */
 #define SD_ARG_CMD53_READ		(0<<31)
-#define SD_ARG_CMD53_WRITE		(1<<31)
+#define SD_ARG_CMD53_WRITE		(1U<<31)
 #define SD_ARG_CMD53_FUNC_SHIFT		28
 #define SD_ARG_CMD53_FUNC_MASK		0x7
 #define SD_ARG_CMD53_BLOCK_MODE		(1<<27)
@@ -55,7 +55,7 @@
 #define MMC_R5(resp)			((resp)[0])
 
 /* SD R4 response (IO OCR) */
-#define SD_IO_OCR_MEM_READY		(1<<31)
+#define SD_IO_OCR_MEM_READY		(1U<<31)
 #define SD_IO_OCR_NUM_FUNCTIONS(ocr)	(((ocr) >> 28) & 0x7)
 #define SD_IO_OCR_MEM_PRESENT		(1<<27)
 #define SD_IO_OCR_MASK			0x00f0



CVS commit: src/sys/dev/sdmmc

2019-12-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Dec 19 17:24:45 UTC 2019

Modified Files:
src/sys/dev/sdmmc: sdmmc_ioreg.h

Log Message:
Avoid changing signedness bit with << in sdmmc_ioreg.h

Reported by 


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/sdmmc/sdmmc_ioreg.h

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



Re: CVS commit: src

2019-12-19 Thread Taylor R Campbell
> Date: Thu, 19 Dec 2019 08:19:07 +0100
> From: Maxime Villard 
> 
> I think you meant to say "REMOVING things you don't like".

Correct, I made an editing error.  Sorry for the confusion.

> In the meantime, I have absolutely no intent to reinstate filemon. You can
> reinstate it if you want, but it should come as no surprise to you in the
> near future that filemon, after whatever "necessary" discussion or different
> forms of bureaucratic idiocy you want to throw at it, will be deleted almost
> as fast as it came back from the attic. Especially considering the emails
> sent from the other people since I proceeded.

This is not negotiable.  It is core's position that the filemon
removal should be undone for the time being, so please go ahead and
undo it.

Thanks,
-Riastradh, on behalf of core


CVS commit: src/sys/net80211

2019-12-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Dec 19 16:29:51 UTC 2019

Modified Files:
src/sys/net80211: ieee80211_crypto_tkip.c

Log Message:
Avoid changing signedness bit with << 24 in ieee80211_crypto_tkip.c

Reported by 


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/net80211/ieee80211_crypto_tkip.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/net80211/ieee80211_crypto_tkip.c
diff -u src/sys/net80211/ieee80211_crypto_tkip.c:1.15 src/sys/net80211/ieee80211_crypto_tkip.c:1.16
--- src/sys/net80211/ieee80211_crypto_tkip.c:1.15	Mon Sep  3 16:29:36 2018
+++ src/sys/net80211/ieee80211_crypto_tkip.c	Thu Dec 19 16:29:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_crypto_tkip.c,v 1.15 2018/09/03 16:29:36 riastradh Exp $	*/
+/*	$NetBSD: ieee80211_crypto_tkip.c,v 1.16 2019/12/19 16:29:50 kamil Exp $	*/
 
 /*
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_crypto_tkip.c,v 1.10 2005/08/08 18:46:35 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_tkip.c,v 1.15 2018/09/03 16:29:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_crypto_tkip.c,v 1.16 2019/12/19 16:29:50 kamil Exp $");
 #endif
 
 /*
@@ -231,7 +231,7 @@ tkip_enmic(struct ieee80211_key *k, stru
 static __inline uint64_t
 READ_6(uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5)
 {
-	uint32_t iv32 = (b0 << 0) | (b1 << 8) | (b2 << 16) | (b3 << 24);
+	uint32_t iv32 = (b0 << 0) | (b1 << 8) | (b2 << 16) | ((u32)b3 << 24);
 	uint16_t iv16 = (b4 << 0) | (b5 << 8);
 	return (((uint64_t)iv16) << 32) | iv32;
 }
@@ -733,7 +733,7 @@ do {\
 
 static __inline u32 get_le32_split(u8 b0, u8 b1, u8 b2, u8 b3)
 {
-	return b0 | (b1 << 8) | (b2 << 16) | (b3 << 24);
+	return b0 | (b1 << 8) | (b2 << 16) | ((u32)b3 << 24);
 }
 
 static __inline u32 get_le32(const u8 *p)



CVS commit: src/sys/net80211

2019-12-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Dec 19 16:29:51 UTC 2019

Modified Files:
src/sys/net80211: ieee80211_crypto_tkip.c

Log Message:
Avoid changing signedness bit with << 24 in ieee80211_crypto_tkip.c

Reported by 


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/net80211/ieee80211_crypto_tkip.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/dm

2019-12-19 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Dec 19 16:27:39 UTC 2019

Modified Files:
src/sys/dev/dm: dm_ioctl.c

Log Message:
dm: Minor dm_ioctl.c fixes (indentation/typo/type/etc)


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/dm/dm_ioctl.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/dm/dm_ioctl.c
diff -u src/sys/dev/dm/dm_ioctl.c:1.46 src/sys/dev/dm/dm_ioctl.c:1.47
--- src/sys/dev/dm/dm_ioctl.c:1.46	Sun Dec 15 14:39:42 2019
+++ src/sys/dev/dm/dm_ioctl.c	Thu Dec 19 16:27:39 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_ioctl.c,v 1.46 2019/12/15 14:39:42 tkusumi Exp $  */
+/* $NetBSD: dm_ioctl.c,v 1.47 2019/12/19 16:27:39 tkusumi Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.46 2019/12/15 14:39:42 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.47 2019/12/19 16:27:39 tkusumi Exp $");
 
 /*
  * Locking is used to synchronise between ioctl calls and between dm_table's
@@ -103,23 +103,23 @@ static struct cfdata dm_cfdata = {
 	.cf_fstate = FSTATE_STAR,
 	.cf_unit = 0
 };
+
 #define DM_REMOVE_FLAG(flag, name) do {	\
-		prop_dictionary_get_uint32(dm_dict,DM_IOCTL_FLAGS,); \
-		flag &= ~name;		\
-		prop_dictionary_set_uint32(dm_dict,DM_IOCTL_FLAGS,flag); \
+	prop_dictionary_get_uint32(dm_dict,DM_IOCTL_FLAGS,);	\
+	flag &= ~name;			\
+	prop_dictionary_set_uint32(dm_dict,DM_IOCTL_FLAGS,flag);	\
 } while (/*CONSTCOND*/0)
 
 #define DM_ADD_FLAG(flag, name) do {	\
-		prop_dictionary_get_uint32(dm_dict,DM_IOCTL_FLAGS,); \
-		flag |= name;		\
-		prop_dictionary_set_uint32(dm_dict,DM_IOCTL_FLAGS,flag); \
+	prop_dictionary_get_uint32(dm_dict,DM_IOCTL_FLAGS,);	\
+	flag |= name;			\
+	prop_dictionary_set_uint32(dm_dict,DM_IOCTL_FLAGS,flag);	\
 } while (/*CONSTCOND*/0)
 
-static int dm_dbg_print_flags(uint32_t);
 static int dm_table_init(dm_target_t *, dm_table_entry_t *, char *);
 
 /*
- * Print flags sent to the kernel from libevmapper.
+ * Print flags sent to the kernel from libdevmapper.
  */
 static int
 dm_dbg_print_flags(uint32_t flags)
@@ -663,7 +663,6 @@ dm_table_deps_ioctl(prop_dictionary_t dm
  *
  * Load table to inactive slot table are switched in dm_device_resume_ioctl.
  * This simulates Linux behaviour better there should not be any difference.
- *
  */
 int
 dm_table_load_ioctl(prop_dictionary_t dm_dict)
@@ -967,7 +966,7 @@ dm_table_status_ioctl(prop_dictionary_t 
 int
 dm_check_version(prop_dictionary_t dm_dict)
 {
-	size_t i;
+	int i;
 	uint32_t dm_version[3];
 	prop_array_t ver;
 



CVS commit: src/sys/dev/dm

2019-12-19 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Dec 19 16:27:39 UTC 2019

Modified Files:
src/sys/dev/dm: dm_ioctl.c

Log Message:
dm: Minor dm_ioctl.c fixes (indentation/typo/type/etc)


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/dm/dm_ioctl.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/ic

2019-12-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Dec 19 16:25:13 UTC 2019

Modified Files:
src/sys/dev/ic: rtsx.c

Log Message:
Avoid changing signedness bit with << in rtsx_read_cfg()

Reported by 


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/rtsx.c

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

Modified files:

Index: src/sys/dev/ic/rtsx.c
diff -u src/sys/dev/ic/rtsx.c:1.3 src/sys/dev/ic/rtsx.c:1.4
--- src/sys/dev/ic/rtsx.c:1.3	Tue Apr 24 18:34:30 2018
+++ src/sys/dev/ic/rtsx.c	Thu Dec 19 16:25:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsx.c,v 1.3 2018/04/24 18:34:30 maya Exp $	*/
+/*	$NetBSD: rtsx.c,v 1.4 2019/12/19 16:25:13 kamil Exp $	*/
 /*	$OpenBSD: rtsx.c,v 1.10 2014/08/19 17:55:03 phessler Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsx.c,v 1.3 2018/04/24 18:34:30 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsx.c,v 1.4 2019/12/19 16:25:13 kamil Exp $");
 
 #include 
 #include 
@@ -1044,7 +1044,7 @@ rtsx_read_cfg(struct rtsx_softc *sc, uin
 	RTSX_READ(sc, RTSX_CFGDATA1, );
 	RTSX_READ(sc, RTSX_CFGDATA2, );
 	RTSX_READ(sc, RTSX_CFGDATA3, );
-	*val = (data3 << 24) | (data2 << 16) | (data1 << 8) | data0;
+	*val = ((uint32_t)data3 << 24) | (data2 << 16) | (data1 << 8) | data0;
 
 	return 0;
 }



CVS commit: src/sys/dev/ic

2019-12-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Dec 19 16:25:13 UTC 2019

Modified Files:
src/sys/dev/ic: rtsx.c

Log Message:
Avoid changing signedness bit with << in rtsx_read_cfg()

Reported by 


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/rtsx.c

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



CVS commit: src/lib/libc/termios

2019-12-19 Thread Leonardo Taccari
Module Name:src
Committed By:   leot
Date:   Thu Dec 19 16:12:21 UTC 2019

Modified Files:
src/lib/libc/termios: tcgetsid.3

Log Message:
tcgetsid() is defined in , not  or .


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/termios/tcgetsid.3

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/termios/tcgetsid.3
diff -u src/lib/libc/termios/tcgetsid.3:1.5 src/lib/libc/termios/tcgetsid.3:1.6
--- src/lib/libc/termios/tcgetsid.3:1.5	Thu Aug  7 16:44:13 2003
+++ src/lib/libc/termios/tcgetsid.3	Thu Dec 19 16:12:21 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tcgetsid.3,v 1.5 2003/08/07 16:44:13 agc Exp $
+.\"	$NetBSD: tcgetsid.3,v 1.6 2019/12/19 16:12:21 leot Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)tcgetpgrp.3	8.1 (Berkeley) 6/4/93
 .\"
-.Dd February 13, 1998
+.Dd December 19, 2019
 .Dt TCGETSID 3
 .Os
 .Sh NAME
@@ -38,8 +38,7 @@
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
-.In sys/types.h
-.In unistd.h
+.In termios.h
 .Ft pid_t
 .Fn tcgetsid "int fd"
 .Sh DESCRIPTION



CVS commit: src/lib/libc/termios

2019-12-19 Thread Leonardo Taccari
Module Name:src
Committed By:   leot
Date:   Thu Dec 19 16:12:21 UTC 2019

Modified Files:
src/lib/libc/termios: tcgetsid.3

Log Message:
tcgetsid() is defined in , not  or .


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/termios/tcgetsid.3

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



CVS commit: src/sys/dev/fdt

2019-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Dec 19 16:00:52 UTC 2019

Modified Files:
src/sys/dev/fdt: fdt_panel.c

Log Message:
Abort panel driver attach if required regulator is missing.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/fdt_panel.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/fdt/fdt_panel.c
diff -u src/sys/dev/fdt/fdt_panel.c:1.1 src/sys/dev/fdt/fdt_panel.c:1.2
--- src/sys/dev/fdt/fdt_panel.c:1.1	Thu Dec 19 00:35:01 2019
+++ src/sys/dev/fdt/fdt_panel.c	Thu Dec 19 16:00:52 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_panel.c,v 1.1 2019/12/19 00:35:01 jakllsch Exp $ */
+/* $NetBSD: fdt_panel.c,v 1.2 2019/12/19 16:00:52 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2019 Jonathan A. Kollasch 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_panel.c,v 1.1 2019/12/19 00:35:01 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_panel.c,v 1.2 2019/12/19 16:00:52 jakllsch Exp $");
 
 #include 
 #include 
@@ -144,6 +144,10 @@ panel_fdt_attach(device_t parent, device
 
 	/* required for "simple-panel" */
 sc->sc_regulator = fdtbus_regulator_acquire(phandle, "power-supply");
+if (sc->sc_regulator == NULL) {
+		aprint_error_dev(self, "regulator not found\n");
+		return;
+	}
 
 	/* optional for "simple-panel" */
 	sc->sc_enable = fdtbus_gpio_acquire_index(phandle,



CVS commit: src/sys/dev/fdt

2019-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Dec 19 16:00:52 UTC 2019

Modified Files:
src/sys/dev/fdt: fdt_panel.c

Log Message:
Abort panel driver attach if required regulator is missing.


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

2019-12-19 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Dec 19 15:57:46 UTC 2019

Modified Files:
src/sys/dev/dm: device-mapper.c

Log Message:
dm: Refactor dmioctl()

More readable without dm_ioctl_switch() as a separate function.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/dm/device-mapper.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/dm/device-mapper.c
diff -u src/sys/dev/dm/device-mapper.c:1.56 src/sys/dev/dm/device-mapper.c:1.57
--- src/sys/dev/dm/device-mapper.c:1.56	Thu Dec 19 15:34:54 2019
+++ src/sys/dev/dm/device-mapper.c	Thu Dec 19 15:57:46 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: device-mapper.c,v 1.56 2019/12/19 15:34:54 tkusumi Exp $ */
+/*$NetBSD: device-mapper.c,v 1.57 2019/12/19 15:57:46 tkusumi Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -67,7 +67,6 @@ static void dm_doinit(void);
 
 static int dm_cmd_to_fun(prop_dictionary_t);
 static int disk_ioctl_switch(dev_t, unsigned long, void *);
-static int dm_ioctl_switch(unsigned long);
 static void dmminphys(struct buf *);
 
 /* CF attach/detach functions used for power management */
@@ -356,10 +355,15 @@ dmioctl(dev_t dev, const u_long cmd, voi
 	if ((r = disk_ioctl_switch(dev, cmd, data)) == ENOTTY) {
 		struct plistref *pref = (struct plistref *)data;
 
-		/* Check if we were called with NETBSD_DM_IOCTL ioctl
-		   otherwise quit. */
-		if ((r = dm_ioctl_switch(cmd)) != 0)
-			return r;
+		switch(cmd) {
+		case NETBSD_DM_IOCTL:
+			aprint_debug("dm NETBSD_DM_IOCTL called\n");
+			break;
+		default:
+			aprint_debug("dm unknown ioctl called\n");
+			return ENOTTY;
+			break; /* NOT REACHED */
+		}
 
 		if ((r = prop_dictionary_copyin_ioctl(pref, cmd, _dict_in))
 		!= 0)
@@ -411,24 +415,6 @@ dm_cmd_to_fun(prop_dictionary_t dm_dict)
 	return cmd_fn[i].fn(dm_dict);
 }
 
-/* Call apropriate ioctl handler function. */
-static int
-dm_ioctl_switch(unsigned long cmd)
-{
-
-	switch(cmd) {
-	case NETBSD_DM_IOCTL:
-		aprint_debug("dm NETBSD_DM_IOCTL called\n");
-		break;
-	default:
-		aprint_debug("dm unknown ioctl called\n");
-		return ENOTTY;
-		break; /* NOT REACHED */
-	}
-
-	return 0;
-}
-
 /*
  * Check for disk specific ioctls.
  */



CVS commit: src/sys/dev/dm

2019-12-19 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Dec 19 15:57:46 UTC 2019

Modified Files:
src/sys/dev/dm: device-mapper.c

Log Message:
dm: Refactor dmioctl()

More readable without dm_ioctl_switch() as a separate function.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/dm/device-mapper.c

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



CVS commit: src/sys/net80211

2019-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Dec 19 15:54:21 UTC 2019

Modified Files:
src/sys/net80211: ieee80211_node.c

Log Message:
Add comment for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/net80211/ieee80211_node.c

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



CVS commit: src/sys/net80211

2019-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Dec 19 15:54:21 UTC 2019

Modified Files:
src/sys/net80211: ieee80211_node.c

Log Message:
Add comment for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/net80211/ieee80211_node.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/net80211/ieee80211_node.c
diff -u src/sys/net80211/ieee80211_node.c:1.77 src/sys/net80211/ieee80211_node.c:1.78
--- src/sys/net80211/ieee80211_node.c:1.77	Thu Dec 19 15:27:07 2019
+++ src/sys/net80211/ieee80211_node.c	Thu Dec 19 15:54:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_node.c,v 1.77 2019/12/19 15:27:07 jakllsch Exp $	*/
+/*	$NetBSD: ieee80211_node.c,v 1.78 2019/12/19 15:54:21 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2001 Atsushi Onoe
@@ -37,7 +37,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_node.c,v 1.65 2005/08/13 17:50:21 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_node.c,v 1.77 2019/12/19 15:27:07 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_node.c,v 1.78 2019/12/19 15:54:21 jakllsch Exp $");
 #endif
 
 #ifdef _KERNEL_OPT
@@ -543,6 +543,7 @@ ieee80211_match_bss(struct ieee80211com 
 	if (ni->ni_fails >= STA_FAILS_MAX)
 		fail |= 0x40;
 
+	/* If no ESS/IBSS is desired, do not match any. */
 	if (ic->ic_des_esslen == 0)
 		fail |= 0x80;
 



CVS commit: src/doc

2019-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Dec 19 15:44:30 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Note addition of anxdp(4).


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2625 src/doc/CHANGES:1.2626
--- src/doc/CHANGES:1.2625	Thu Dec 19 15:39:01 2019
+++ src/doc/CHANGES	Thu Dec 19 15:44:30 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2625 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2626 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -83,5 +83,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	openpam(3): update to 20190224 (tabebuia) [christos 20191215]
  	kerberos(8): Update to Heimdal-7.7.0 [christos 20191215]
 	file(1): Upgraded to 5.38. [christos 20191216]
+	anxdp(4): Add driver for Analogix DisplayPort core found in
+		Rockchip RK3399. [jakllsch 20191219]
 	net80211: Require SSID configuration to associate with an open AP.
 		[jakllsch 20191219]



CVS commit: src/doc

2019-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Dec 19 15:44:30 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Note addition of anxdp(4).


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

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



CVS commit: src/doc

2019-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Dec 19 15:39:01 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Note change of net80211 behavior regarding association to any AP when
no SSID is configured.


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2624 src/doc/CHANGES:1.2625
--- src/doc/CHANGES:1.2624	Tue Dec 17 02:32:26 2019
+++ src/doc/CHANGES	Thu Dec 19 15:39:01 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2624 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2625 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -83,3 +83,5 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	openpam(3): update to 20190224 (tabebuia) [christos 20191215]
  	kerberos(8): Update to Heimdal-7.7.0 [christos 20191215]
 	file(1): Upgraded to 5.38. [christos 20191216]
+	net80211: Require SSID configuration to associate with an open AP.
+		[jakllsch 20191219]



CVS commit: src/doc

2019-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Dec 19 15:39:01 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Note change of net80211 behavior regarding association to any AP when
no SSID is configured.


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

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



CVS commit: src/sys/dev/dm

2019-12-19 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Dec 19 15:34:54 UTC 2019

Modified Files:
src/sys/dev/dm: device-mapper.c dm_target.c

Log Message:
dm: u_{int,long} -> unsigned {int,long}


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/dm/device-mapper.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/dm/dm_target.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/dm

2019-12-19 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Dec 19 15:34:54 UTC 2019

Modified Files:
src/sys/dev/dm: device-mapper.c dm_target.c

Log Message:
dm: u_{int,long} -> unsigned {int,long}


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/dm/device-mapper.c
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/dm/dm_target.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/dm/device-mapper.c
diff -u src/sys/dev/dm/device-mapper.c:1.55 src/sys/dev/dm/device-mapper.c:1.56
--- src/sys/dev/dm/device-mapper.c:1.55	Sun Dec 15 16:14:27 2019
+++ src/sys/dev/dm/device-mapper.c	Thu Dec 19 15:34:54 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: device-mapper.c,v 1.55 2019/12/15 16:14:27 tkusumi Exp $ */
+/*$NetBSD: device-mapper.c,v 1.56 2019/12/19 15:34:54 tkusumi Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -66,8 +66,8 @@ static int dmdestroy(void);
 static void dm_doinit(void);
 
 static int dm_cmd_to_fun(prop_dictionary_t);
-static int disk_ioctl_switch(dev_t, u_long, void *);
-static int dm_ioctl_switch(u_long);
+static int disk_ioctl_switch(dev_t, unsigned long, void *);
+static int dm_ioctl_switch(unsigned long);
 static void dmminphys(struct buf *);
 
 /* CF attach/detach functions used for power management */
@@ -413,7 +413,7 @@ dm_cmd_to_fun(prop_dictionary_t dm_dict)
 
 /* Call apropriate ioctl handler function. */
 static int
-dm_ioctl_switch(u_long cmd)
+dm_ioctl_switch(unsigned long cmd)
 {
 
 	switch(cmd) {
@@ -433,7 +433,7 @@ dm_ioctl_switch(u_long cmd)
  * Check for disk specific ioctls.
  */
 static int
-disk_ioctl_switch(dev_t dev, u_long cmd, void *data)
+disk_ioctl_switch(dev_t dev, unsigned long cmd, void *data)
 {
 	dm_dev_t *dmv;
 
@@ -504,9 +504,8 @@ disk_ioctl_switch(dev_t dev, u_long cmd,
 	}
 	case DIOCGSECTORSIZE:
 	{
-		u_int *valp = data;
 		uint64_t numsec;
-		unsigned int secsize;
+		unsigned int secsize, *valp = data;
 
 		if ((dmv = dm_dev_lookup(NULL, NULL, minor(dev))) == NULL)
 			return ENODEV;

Index: src/sys/dev/dm/dm_target.c
diff -u src/sys/dev/dm/dm_target.c:1.33 src/sys/dev/dm/dm_target.c:1.34
--- src/sys/dev/dm/dm_target.c:1.33	Mon Dec 16 14:26:23 2019
+++ src/sys/dev/dm/dm_target.c	Thu Dec 19 15:34:54 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: dm_target.c,v 1.33 2019/12/16 14:26:23 tkusumi Exp $  */
+/*$NetBSD: dm_target.c,v 1.34 2019/12/19 15:34:54 tkusumi Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dm_target.c,v 1.33 2019/12/16 14:26:23 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_target.c,v 1.34 2019/12/19 15:34:54 tkusumi Exp $");
 
 #include 
 #include 
@@ -77,7 +77,7 @@ dm_target_t *
 dm_target_autoload(const char *dm_target_name)
 {
 	char name[30];
-	u_int gen;
+	unsigned int gen;
 	dm_target_t *dmt;
 
 	snprintf(name, sizeof(name), "dm_target_%s", dm_target_name);



CVS commit: src/sys/net80211

2019-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Dec 19 15:27:07 UTC 2019

Modified Files:
src/sys/net80211: ieee80211_node.c

Log Message:
Do not associate with with any access point if no SSID has been configured.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/net80211/ieee80211_node.c

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



CVS commit: src/sys/net80211

2019-12-19 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Dec 19 15:27:07 UTC 2019

Modified Files:
src/sys/net80211: ieee80211_node.c

Log Message:
Do not associate with with any access point if no SSID has been configured.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/net80211/ieee80211_node.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/net80211/ieee80211_node.c
diff -u src/sys/net80211/ieee80211_node.c:1.76 src/sys/net80211/ieee80211_node.c:1.77
--- src/sys/net80211/ieee80211_node.c:1.76	Sun Nov 10 21:16:38 2019
+++ src/sys/net80211/ieee80211_node.c	Thu Dec 19 15:27:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_node.c,v 1.76 2019/11/10 21:16:38 chs Exp $	*/
+/*	$NetBSD: ieee80211_node.c,v 1.77 2019/12/19 15:27:07 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2001 Atsushi Onoe
@@ -37,7 +37,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_node.c,v 1.65 2005/08/13 17:50:21 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_node.c,v 1.76 2019/11/10 21:16:38 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_node.c,v 1.77 2019/12/19 15:27:07 jakllsch Exp $");
 #endif
 
 #ifdef _KERNEL_OPT
@@ -543,6 +543,9 @@ ieee80211_match_bss(struct ieee80211com 
 	if (ni->ni_fails >= STA_FAILS_MAX)
 		fail |= 0x40;
 
+	if (ic->ic_des_esslen == 0)
+		fail |= 0x80;
+
 #ifdef IEEE80211_DEBUG
 	if (ieee80211_msg_scan(ic)) {
 		printf(" %c %s",



Re: CVS commit: src/usr.bin/crunch/crunchgen

2019-12-19 Thread Joerg Sonnenberger
On Thu, Dec 19, 2019 at 01:46:43PM -, Christos Zoulas wrote:
> In article <20191218222723.ga17...@bec.de>,
> Joerg Sonnenberger   wrote:
> >On Wed, Dec 18, 2019 at 03:51:21PM -, Christos Zoulas wrote:
> >> In article <20191218152113.ga7...@bec.de>,
> >> Joerg Sonnenberger   wrote:
> >> >On Tue, Dec 17, 2019 at 09:16:04PM -0500, Christos Zoulas wrote:
> >> >> Module Name:src
> >> >> Committed By:   christos
> >> >> Date:   Wed Dec 18 02:16:04 UTC 2019
> >> >> 
> >> >> Modified Files:
> >> >> src/usr.bin/crunch/crunchgen: crunchgen.1 crunchgen.c
> >> >> 
> >> >> Log Message:
> >> >> Also disable ssp and fortify by default.
> >> >
> >> >Why?
> >> 
> >> Size reduction on install media. There are flags to turn it on.
> >
> >Not all users of crunchgen are space constrained, so this seems like a
> >bad default to me.
> 
> I think that there are two uses: install media and rescue. I can reinstate
> it for rescue. Is that ok? Note that by default both ssp and fortify are
> off for most things, so my change was mostly a no-op for the default settings.

We seem to default to off for more things, PIE too for example.

Joerg


CVS commit: src/sys/dev/usb

2019-12-19 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Dec 19 15:17:30 UTC 2019

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

Log Message:
Code that's #if'ed out still ought to compile.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/usb/if_run.c

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

Modified files:

Index: src/sys/dev/usb/if_run.c
diff -u src/sys/dev/usb/if_run.c:1.33 src/sys/dev/usb/if_run.c:1.34
--- src/sys/dev/usb/if_run.c:1.33	Tue Oct  8 07:30:58 2019
+++ src/sys/dev/usb/if_run.c	Thu Dec 19 15:17:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_run.c,v 1.33 2019/10/08 07:30:58 mlelstv Exp $	*/
+/*	$NetBSD: if_run.c,v 1.34 2019/12/19 15:17:30 gson Exp $	*/
 /*	$OpenBSD: if_run.c,v 1.90 2012/03/24 15:11:04 jsg Exp $	*/
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.33 2019/10/08 07:30:58 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.34 2019/12/19 15:17:30 gson Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1070,7 +1070,7 @@ run_write_region_1(struct run_softc *sc,
 	USETW(req.wValue, 0);
 	USETW(req.wIndex, reg);
 	USETW(req.wLength, len);
-	return usbd_do_request(sc->sc_udev, , buf);
+	return usbd_do_request(sc->sc_udev, , __UNCONST(buf));
 #endif
 }
 



CVS commit: src/sys/dev/usb

2019-12-19 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Dec 19 15:17:30 UTC 2019

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

Log Message:
Code that's #if'ed out still ought to compile.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/usb/if_run.c

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



Re: CVS commit: src/usr.bin/crunch/crunchgen

2019-12-19 Thread Christos Zoulas
In article <20191218222723.ga17...@bec.de>,
Joerg Sonnenberger   wrote:
>On Wed, Dec 18, 2019 at 03:51:21PM -, Christos Zoulas wrote:
>> In article <20191218152113.ga7...@bec.de>,
>> Joerg Sonnenberger   wrote:
>> >On Tue, Dec 17, 2019 at 09:16:04PM -0500, Christos Zoulas wrote:
>> >> Module Name:  src
>> >> Committed By: christos
>> >> Date: Wed Dec 18 02:16:04 UTC 2019
>> >> 
>> >> Modified Files:
>> >>   src/usr.bin/crunch/crunchgen: crunchgen.1 crunchgen.c
>> >> 
>> >> Log Message:
>> >> Also disable ssp and fortify by default.
>> >
>> >Why?
>> 
>> Size reduction on install media. There are flags to turn it on.
>
>Not all users of crunchgen are space constrained, so this seems like a
>bad default to me.

I think that there are two uses: install media and rescue. I can reinstate
it for rescue. Is that ok? Note that by default both ssp and fortify are
off for most things, so my change was mostly a no-op for the default settings.

christos



Re: CVS commit: src

2019-12-19 Thread Warner Losh
On Wed, Dec 18, 2019, 10:45 AM  wrote:

> On Wed, Dec 18, 2019 at 06:47:44AM -0500, Christos Zoulas wrote:
> > While there was no discussion, it is more efficient to have the
> discussion
> > whether we should put it back or not (instead of putting it back first
> and
> > having the discussion). Of course we should fix the build first since it
> seems
> > to be broken.
> >
> > The reality of the situation is that the syscall race has been there for
> months
> > and nobody has taken responsibility to fix it. The code is in version
> control,
> > so someone should fix it first and then we can discuss if we should
> bring it
> > back.
>
>
> I'd like to also publicly object to the removal of the code from bmake
> (I responded privately at first).
> FreeBSD has filemon, and I suspect it has more acceptance there, but
> maxv stated he will propose it.
> Sharing the code with FreeBSD is more than worth the 200 unused-by-us
> lines of code, and it's already optional.
> No rush though. Let's wait to see what they say.
>

FreeBSD definitely uses filemon in our build system... I've not looked at
the details of this removal to know if that messes things up for us or not.

Warner

I have no objections to removing the kernel module.
>


CVS commit: src/sys/kern

2019-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Dec 19 10:51:55 UTC 2019

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

Log Message:
Whitespace police (minor infraction).


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/kern/subr_xcall.c

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

Modified files:

Index: src/sys/kern/subr_xcall.c
diff -u src/sys/kern/subr_xcall.c:1.32 src/sys/kern/subr_xcall.c:1.33
--- src/sys/kern/subr_xcall.c:1.32	Sun Dec  1 20:56:39 2019
+++ src/sys/kern/subr_xcall.c	Thu Dec 19 10:51:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_xcall.c,v 1.32 2019/12/01 20:56:39 riastradh Exp $	*/
+/*	$NetBSD: subr_xcall.c,v 1.33 2019/12/19 10:51:54 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2007-2010, 2019 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.32 2019/12/01 20:56:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_xcall.c,v 1.33 2019/12/19 10:51:54 thorpej Exp $");
 
 #include 
 #include 
@@ -273,15 +273,13 @@ xc_broadcast(unsigned int flags, xcfunc_
 	}
 }
 
-
 static void
 xc_nop(void *arg1, void *arg2)
 {
 
-return;
+	return;
 }
 
-
 /*
  * xc_barrier:
  *
@@ -296,7 +294,6 @@ xc_barrier(unsigned int flags)
 	xc_wait(where);
 }
 
-
 /*
  * xc_unicast:
  *



CVS commit: src/sys/kern

2019-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Dec 19 10:51:55 UTC 2019

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

Log Message:
Whitespace police (minor infraction).


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/kern/subr_xcall.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/aarch64/include

2019-12-19 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Dec 19 09:47:42 UTC 2019

Modified Files:
src/sys/arch/aarch64/include: cpufunc.h

Log Message:
aarch64_cache_info[] is not global


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/aarch64/include/cpufunc.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/aarch64/include

2019-12-19 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Dec 19 09:47:42 UTC 2019

Modified Files:
src/sys/arch/aarch64/include: cpufunc.h

Log Message:
aarch64_cache_info[] is not global


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/aarch64/include/cpufunc.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/aarch64/include/cpufunc.h
diff -u src/sys/arch/aarch64/include/cpufunc.h:1.8 src/sys/arch/aarch64/include/cpufunc.h:1.9
--- src/sys/arch/aarch64/include/cpufunc.h:1.8	Fri Nov 22 05:21:19 2019
+++ src/sys/arch/aarch64/include/cpufunc.h	Thu Dec 19 09:47:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.h,v 1.8 2019/11/22 05:21:19 mlelstv Exp $	*/
+/*	$NetBSD: cpufunc.h,v 1.9 2019/12/19 09:47:42 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -64,7 +64,6 @@ struct aarch64_cache_info {
 };
 
 #define MAX_CACHE_LEVEL	8		/* ARMv8 has maximum 8 level cache */
-extern struct aarch64_cache_info aarch64_cache_info[MAX_CACHE_LEVEL];
 extern u_int aarch64_cache_vindexsize;	/* cachesize/way (VIVT/VIPT) */
 extern u_int aarch64_cache_prefer_mask;
 extern u_int cputype;			/* compat arm */