CVS commit: [netbsd-8] src/doc

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 15 04:42:01 UTC 2019

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

Log Message:
Fix description for ticktes #1267 and #1268


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.146 -r1.1.2.147 src/doc/CHANGES-8.1

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.146 src/doc/CHANGES-8.1:1.1.2.147
--- src/doc/CHANGES-8.1:1.1.2.146	Tue May 14 17:21:59 2019
+++ src/doc/CHANGES-8.1	Wed May 15 04:42:01 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.146 2019/05/14 17:21:59 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.147 2019/05/15 04:42:01 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -3161,18 +3161,15 @@ sys/net/if_media.c1.42 (patch)
 sys/arch/arm/imx/if_enet.c			1.19
 sys/dev/pci/if_wm.c1.634
 
-	SIOCS is 'S'et function and the ioctl argument is ifreq.
-	SIOCG is 'G'et function and the ioctl argument is ifmediareq.
-	Before this change, SIOCG modify sc->sc_flowflags unexpectedly.
-	Don't hook SIOCGIFMEDIA because this driver uses MII(4) and
-	ether_ioctl has	the hook(if_ethersubr.c rev. 1.160).
+	Fix a bug that getting interface's media breaks
+	flow setting in enet(4) and wm(4)   
 	[msaitoh, ticket #1267]
 
 sys/dev/pci/if_alc.c1.33,1.34
 
-	Fix a wrong and extra ether_ioctl() call in alc_ioctl().
-	Add ether_ioctl() call for SIOCSIFADDR and SIOCSIFFLAGS to make
-	behavior the same as before.
+	Fix a bug that other than SIOCSIFADDR and SIOCSIFFLAGS
+	may not work correctly. One of bug example is that SIOCGIFMEDIA
+	always failed.
 	[msaitoh, ticket #1268]
 
 sys/arch/amd64/amd64/amd64_trap.S		1.47 (adapted)



CVS commit: [netbsd-8] src/doc

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 15 04:42:01 UTC 2019

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

Log Message:
Fix description for ticktes #1267 and #1268


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.146 -r1.1.2.147 src/doc/CHANGES-8.1

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



CVS commit: src/sys/dev/nvmm/x86

2019-05-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 15 04:39:52 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86.c

Log Message:
NVMM: Expose MD_CLEAR to the guests.


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

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

Modified files:

Index: src/sys/dev/nvmm/x86/nvmm_x86.c
diff -u src/sys/dev/nvmm/x86/nvmm_x86.c:1.6 src/sys/dev/nvmm/x86/nvmm_x86.c:1.7
--- src/sys/dev/nvmm/x86/nvmm_x86.c:1.6	Sat Apr  6 11:49:53 2019
+++ src/sys/dev/nvmm/x86/nvmm_x86.c	Wed May 15 04:39:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvmm_x86.c,v 1.6 2019/04/06 11:49:53 maxv Exp $	*/
+/*	$NetBSD: nvmm_x86.c,v 1.7 2019/05/15 04:39:52 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86.c,v 1.6 2019/04/06 11:49:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86.c,v 1.7 2019/05/15 04:39:52 maxv Exp $");
 
 #include 
 #include 
@@ -284,8 +284,8 @@ const struct nvmm_x86_cpuid_mask nvmm_cp
 	CPUID_SEF_CLDEMOTE | CPUID_SEF_MOVDIRI |
 	CPUID_SEF_MOVDIR64B | CPUID_SEF_SGXLC,
 	.edx =
-	/* Excluded: all except CAP. */
-	CPUID_SEF_ARCH_CAP
+	/* Excluded: all except MD_CLEAR and ARCH_CAP. */
+	CPUID_SEF_MD_CLEAR | CPUID_SEF_ARCH_CAP
 };
 
 const struct nvmm_x86_cpuid_mask nvmm_cpuid_8001 = {



CVS commit: src/sys/dev/nvmm/x86

2019-05-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 15 04:39:52 UTC 2019

Modified Files:
src/sys/dev/nvmm/x86: nvmm_x86.c

Log Message:
NVMM: Expose MD_CLEAR to the guests.


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

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



CVS commit: src/sys/netinet

2019-05-14 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed May 15 03:33:41 UTC 2019

Modified Files:
src/sys/netinet: ip_encap.c

Log Message:
Fix build failure when INET6 is disabled. Pointed out by ozaki-r@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/netinet/ip_encap.c

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



CVS commit: src/sys/netinet

2019-05-14 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed May 15 03:33:41 UTC 2019

Modified Files:
src/sys/netinet: ip_encap.c

Log Message:
Fix build failure when INET6 is disabled. Pointed out by ozaki-r@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/netinet/ip_encap.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/netinet/ip_encap.c
diff -u src/sys/netinet/ip_encap.c:1.70 src/sys/netinet/ip_encap.c:1.71
--- src/sys/netinet/ip_encap.c:1.70	Fri Sep 14 05:09:51 2018
+++ src/sys/netinet/ip_encap.c	Wed May 15 03:33:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_encap.c,v 1.70 2018/09/14 05:09:51 maxv Exp $	*/
+/*	$NetBSD: ip_encap.c,v 1.71 2019/05/15 03:33:41 knakahara Exp $	*/
 /*	$KAME: ip_encap.c,v 1.73 2001/10/02 08:30:58 itojun Exp $	*/
 
 /*
@@ -68,7 +68,7 @@
 #define USE_RADIX
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.70 2018/09/14 05:09:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.71 2019/05/15 03:33:41 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mrouting.h"
@@ -79,6 +79,7 @@ __KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v
 #include 
 #include 
 #include 
+#include  /* for softnet_lock */
 #include 
 #include 
 #include 



CVS commit: src/sys

2019-05-14 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed May 15 02:56:48 UTC 2019

Modified Files:
src/sys/dev/ic: dwc_gmac.c
src/sys/dev/pci: if_wm.c
src/sys/dev/pci/ixgbe: ixgbe.c
src/sys/net: if.c if_ether.h if_ethersubr.c

Log Message:
Store IFF_ALLMULTI in ec_flags instead of if_flags to avoid data races

IFF_ALLMULTI is set/unset to if_flags via if_mcast_op.  To avoid data races on
if_flags, IFNET_LOCK was added for if_mcast_op.  Unfortunately it produces
a deadlock so we want to remove added IFNET_LOCK by avoiding the data races by
another approach.

This fix introduces ec_flags to struct ethercom and stores IFF_ALLMULTI to it.
ec_flags is protected by ETHER_LOCK and thus IFNET_LOCK is no longer necessary
for if_mcast_op.  Note that the fix is applied only to MP-safe drivers that
the data races matter.

In the kernel, IFF_ALLMULTI is set by a driver and used by the driver itself.
So changing the storing place doesn't break anything.  One exception is
ioctl(SIOCGIFFLAGS); we have to include IFF_ALLMULTI in a result if needed to
export the flag as well as before.

A upcoming commit will remove IFNET_LOCK.

PR kern/54189


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/ic/dwc_gmac.c
cvs rdiff -u -r1.635 -r1.636 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.182 -r1.183 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.451 -r1.452 src/sys/net/if.c
cvs rdiff -u -r1.77 -r1.78 src/sys/net/if_ether.h
cvs rdiff -u -r1.273 -r1.274 src/sys/net/if_ethersubr.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/dwc_gmac.c
diff -u src/sys/dev/ic/dwc_gmac.c:1.59 src/sys/dev/ic/dwc_gmac.c:1.60
--- src/sys/dev/ic/dwc_gmac.c:1.59	Mon Apr 15 06:00:04 2019
+++ src/sys/dev/ic/dwc_gmac.c	Wed May 15 02:56:47 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_gmac.c,v 1.59 2019/04/15 06:00:04 ozaki-r Exp $ */
+/* $NetBSD: dwc_gmac.c,v 1.60 2019/05/15 02:56:47 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.59 2019/04/15 06:00:04 ozaki-r Exp $");
+__KERNEL_RCSID(1, "$NetBSD: dwc_gmac.c,v 1.60 2019/05/15 02:56:47 ozaki-r Exp $");
 
 /* #define	DWC_GMAC_DEBUG	1 */
 
@@ -1357,21 +1357,21 @@ dwc_gmac_setmulti(struct dwc_gmac_softc 
 		goto special_filter;
 	}
 
-	ifp->if_flags &= ~IFF_ALLMULTI;
 	ffilt &= ~(AWIN_GMAC_MAC_FFILT_PM|AWIN_GMAC_MAC_FFILT_PR);
 
 	bus_space_write_4(sc->sc_bst, sc->sc_bsh, AWIN_GMAC_MAC_HTLOW, 0);
 	bus_space_write_4(sc->sc_bst, sc->sc_bsh, AWIN_GMAC_MAC_HTHIGH, 0);
 
 	ETHER_LOCK(ec);
+	ec->ec_flags &= ~ETHER_F_ALLMULTI;
 	ETHER_FIRST_MULTI(step, ec, enm);
 	mcnt = 0;
 	while (enm != NULL) {
 		if (memcmp(enm->enm_addrlo, enm->enm_addrhi,
 		ETHER_ADDR_LEN) != 0) {
-			ETHER_UNLOCK(ec);
 			ffilt |= AWIN_GMAC_MAC_FFILT_PM;
-			ifp->if_flags |= IFF_ALLMULTI;
+			ec->ec_flags |= ETHER_F_ALLMULTI;
+			ETHER_UNLOCK(ec);
 			goto special_filter;
 		}
 
@@ -1395,7 +1395,7 @@ dwc_gmac_setmulti(struct dwc_gmac_softc 
 	hashes[0]);
 	bus_space_write_4(sc->sc_bst, sc->sc_bsh, AWIN_GMAC_MAC_HTHIGH,
 	hashes[1]);
-	sc->sc_if_flags = sc->sc_ec.ec_if.if_flags;
+	sc->sc_if_flags = ifp->if_flags;
 
 #ifdef DWC_GMAC_DEBUG
 	dwc_gmac_dump_ffilt(sc, ffilt);

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.635 src/sys/dev/pci/if_wm.c:1.636
--- src/sys/dev/pci/if_wm.c:1.635	Tue May 14 09:43:55 2019
+++ src/sys/dev/pci/if_wm.c	Wed May 15 02:56:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.635 2019/05/14 09:43:55 ozaki-r Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.636 2019/05/15 02:56:47 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.635 2019/05/14 09:43:55 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.636 2019/05/15 02:56:47 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -3707,6 +3707,9 @@ wm_set_filter(struct wm_softc *sc)
 		sc->sc_rctl |= RCTL_BAM;
 	if (ifp->if_flags & IFF_PROMISC) {
 		sc->sc_rctl |= RCTL_UPE;
+		ETHER_LOCK(ec);
+		ec->ec_flags |= ETHER_F_ALLMULTI;
+		ETHER_UNLOCK(ec);
 		goto allmulti;
 	}
 
@@ -3757,6 +3760,7 @@ wm_set_filter(struct wm_softc *sc)
 	ETHER_FIRST_MULTI(step, ec, enm);
 	while (enm != NULL) {
 		if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
+			ec->ec_flags |= ETHER_F_ALLMULTI;
 			ETHER_UNLOCK(ec);
 			/*
 			 * We must listen to a range of multicast addresses.
@@ -3804,13 +3808,12 @@ wm_set_filter(struct wm_softc *sc)
 
 		ETHER_NEXT_MULTI(step, enm);
 	}
+	ec->ec_flags &= ~ETHER_F_ALLMULTI;
 	ETHER_UNLOCK(ec);
 
-	ifp->if_flags &= ~IFF_ALLMULTI;
 	goto setit;
 
  allmulti:
-	ifp->if_flags |= IFF_ALLMULTI;
 	sc->sc_rctl |= RCTL_MPE;
 
  setit:

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

CVS commit: src/sys

2019-05-14 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed May 15 02:59:19 UTC 2019

Modified Files:
src/sys/net: if_vlan.c
src/sys/netinet: in_pcb.c ip_output.c
src/sys/netinet6: in6_pcb.c ip6_output.c

Log Message:
Get rid of IFNET_LOCK for if_mcast_op to avoid a deadlock

The IFNET_LOCK was added to avoid data races on if_flags for IFF_ALLMULTI.
Unfortunatetly it caused a deadlock instead.  A known scenario causing a
deadlock is to occur the following two operations concurrently: (a) a removal of
an IP adddres assigned to an interface and (b) a manipulation of multicast
groups to the interface.  The resource dependency graph is like this:
  softnet_lock => IFNET_LOCK => psref_target_destroy => softint => softnet_lock

Thanks to the previous commit that avoids data races on if_flags for
IFF_ALLMULTI by another approach, we can remove IFNET_LOCK and defuse the
deadlock.

PR kern/54189


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/net/if_vlan.c
cvs rdiff -u -r1.182 -r1.183 src/sys/netinet/in_pcb.c
cvs rdiff -u -r1.311 -r1.312 src/sys/netinet/ip_output.c
cvs rdiff -u -r1.165 -r1.166 src/sys/netinet6/in6_pcb.c
cvs rdiff -u -r1.219 -r1.220 src/sys/netinet6/ip6_output.c

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



CVS commit: src/sys

2019-05-14 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed May 15 02:59:19 UTC 2019

Modified Files:
src/sys/net: if_vlan.c
src/sys/netinet: in_pcb.c ip_output.c
src/sys/netinet6: in6_pcb.c ip6_output.c

Log Message:
Get rid of IFNET_LOCK for if_mcast_op to avoid a deadlock

The IFNET_LOCK was added to avoid data races on if_flags for IFF_ALLMULTI.
Unfortunatetly it caused a deadlock instead.  A known scenario causing a
deadlock is to occur the following two operations concurrently: (a) a removal of
an IP adddres assigned to an interface and (b) a manipulation of multicast
groups to the interface.  The resource dependency graph is like this:
  softnet_lock => IFNET_LOCK => psref_target_destroy => softint => softnet_lock

Thanks to the previous commit that avoids data races on if_flags for
IFF_ALLMULTI by another approach, we can remove IFNET_LOCK and defuse the
deadlock.

PR kern/54189


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/net/if_vlan.c
cvs rdiff -u -r1.182 -r1.183 src/sys/netinet/in_pcb.c
cvs rdiff -u -r1.311 -r1.312 src/sys/netinet/ip_output.c
cvs rdiff -u -r1.165 -r1.166 src/sys/netinet6/in6_pcb.c
cvs rdiff -u -r1.219 -r1.220 src/sys/netinet6/ip6_output.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/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.135 src/sys/net/if_vlan.c:1.136
--- src/sys/net/if_vlan.c:1.135	Fri Apr 26 11:51:56 2019
+++ src/sys/net/if_vlan.c	Wed May 15 02:59:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.135 2019/04/26 11:51:56 pgoyette Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.136 2019/05/15 02:59:18 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.135 2019/04/26 11:51:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.136 2019/05/15 02:59:18 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1197,9 +1197,7 @@ vlan_ether_addmulti(struct ifvlan *ifv, 
 	mib = ifv->ifv_mib;
 
 	KERNEL_LOCK_UNLESS_IFP_MPSAFE(mib->ifvm_p);
-	IFNET_LOCK(mib->ifvm_p);
 	error = if_mcast_op(mib->ifvm_p, SIOCADDMULTI, sa);
-	IFNET_UNLOCK(mib->ifvm_p);
 	KERNEL_UNLOCK_UNLESS_IFP_MPSAFE(mib->ifvm_p);
 
 	if (error != 0)
@@ -1255,9 +1253,7 @@ vlan_ether_delmulti(struct ifvlan *ifv, 
 
 	/* We no longer use this multicast address.  Tell parent so. */
 	mib = ifv->ifv_mib;
-	IFNET_LOCK(mib->ifvm_p);
 	error = if_mcast_op(mib->ifvm_p, SIOCDELMULTI, sa);
-	IFNET_UNLOCK(mib->ifvm_p);
 
 	if (error == 0) {
 		/* And forget about this address. */
@@ -1287,10 +1283,8 @@ vlan_ether_purgemulti(struct ifvlan *ifv
 	}
 
 	while ((mc = LIST_FIRST(>ifv_mc_listhead)) != NULL) {
-		IFNET_LOCK(mib->ifvm_p);
 		(void)if_mcast_op(mib->ifvm_p, SIOCDELMULTI,
 		sstocsa(>mc_addr));
-		IFNET_UNLOCK(mib->ifvm_p);
 		LIST_REMOVE(mc, mc_entries);
 		free(mc, M_DEVBUF);
 	}

Index: src/sys/netinet/in_pcb.c
diff -u src/sys/netinet/in_pcb.c:1.182 src/sys/netinet/in_pcb.c:1.183
--- src/sys/netinet/in_pcb.c:1.182	Tue Feb 27 14:44:10 2018
+++ src/sys/netinet/in_pcb.c	Wed May 15 02:59:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: in_pcb.c,v 1.182 2018/02/27 14:44:10 maxv Exp $	*/
+/*	$NetBSD: in_pcb.c,v 1.183 2019/05/15 02:59:18 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -93,7 +93,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.182 2018/02/27 14:44:10 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.183 2019/05/15 02:59:18 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -779,9 +779,7 @@ in_pcbpurgeif0(struct inpcbtable *table,
 		}
 
 		/* IFNET_LOCK must be taken after solock */
-		IFNET_LOCK(ifp);
 		in_purgeifmcast(inp->inp_moptions, ifp);
-		IFNET_UNLOCK(ifp);
 
 		if (need_unlock)
 			inp_unlock(inp);

Index: src/sys/netinet/ip_output.c
diff -u src/sys/netinet/ip_output.c:1.311 src/sys/netinet/ip_output.c:1.312
--- src/sys/netinet/ip_output.c:1.311	Mon May 13 07:47:59 2019
+++ src/sys/netinet/ip_output.c	Wed May 15 02:59:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_output.c,v 1.311 2019/05/13 07:47:59 ozaki-r Exp $	*/
+/*	$NetBSD: ip_output.c,v 1.312 2019/05/15 02:59:18 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.311 2019/05/13 07:47:59 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.312 2019/05/15 02:59:18 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1837,9 +1837,7 @@ ip_add_membership(struct ip_moptions *im
 	 * Everything looks good; add a new record to the multicast
 	 * address list for the given interface.
 	 */
-	IFNET_LOCK(ifp);
 	imo->imo_membership[i] = in_addmulti(, ifp);
-	IFNET_UNLOCK(ifp);
 	if (imo->imo_membership[i] == NULL) {
 		error = ENOBUFS;
 		goto out;
@@ -1899,10 +1897,7 @@ ip_drop_membership(struct 

CVS commit: src/sys

2019-05-14 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed May 15 02:56:48 UTC 2019

Modified Files:
src/sys/dev/ic: dwc_gmac.c
src/sys/dev/pci: if_wm.c
src/sys/dev/pci/ixgbe: ixgbe.c
src/sys/net: if.c if_ether.h if_ethersubr.c

Log Message:
Store IFF_ALLMULTI in ec_flags instead of if_flags to avoid data races

IFF_ALLMULTI is set/unset to if_flags via if_mcast_op.  To avoid data races on
if_flags, IFNET_LOCK was added for if_mcast_op.  Unfortunately it produces
a deadlock so we want to remove added IFNET_LOCK by avoiding the data races by
another approach.

This fix introduces ec_flags to struct ethercom and stores IFF_ALLMULTI to it.
ec_flags is protected by ETHER_LOCK and thus IFNET_LOCK is no longer necessary
for if_mcast_op.  Note that the fix is applied only to MP-safe drivers that
the data races matter.

In the kernel, IFF_ALLMULTI is set by a driver and used by the driver itself.
So changing the storing place doesn't break anything.  One exception is
ioctl(SIOCGIFFLAGS); we have to include IFF_ALLMULTI in a result if needed to
export the flag as well as before.

A upcoming commit will remove IFNET_LOCK.

PR kern/54189


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/ic/dwc_gmac.c
cvs rdiff -u -r1.635 -r1.636 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.182 -r1.183 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.451 -r1.452 src/sys/net/if.c
cvs rdiff -u -r1.77 -r1.78 src/sys/net/if_ether.h
cvs rdiff -u -r1.273 -r1.274 src/sys/net/if_ethersubr.c

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



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

2019-05-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May 15 01:24:43 UTC 2019

Modified Files:
src/sys/arch/arm/rockchip: rk3328_cru.c rk_tsadc.c

Log Message:
support RK3328 tsadc:

- add clk_24m, clk_tsadc and pclk_tsadc rk3328 clocks
- rk3328 data<->temp conversion table is is wrong.  the actual values
  seen are 4096 - , and the linux driver has these values
  in the inverted value directly
- the above means the rk3328 is increasing data for increasing temp,
  and the min/max values are also inverted and swapped
- move auto-period into the rk_data
- rk3328 only has one sensor, deal with this
- rename rk_data_table as rk_data, and also s/rdt/rd/

thanks to jmcneill who helped clean up clocks confusion, and pointed
out the linux driver values matched my own inverted data experience.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/rockchip/rk3328_cru.c \
src/sys/arch/arm/rockchip/rk_tsadc.c

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

Modified files:

Index: src/sys/arch/arm/rockchip/rk3328_cru.c
diff -u src/sys/arch/arm/rockchip/rk3328_cru.c:1.4 src/sys/arch/arm/rockchip/rk3328_cru.c:1.5
--- src/sys/arch/arm/rockchip/rk3328_cru.c:1.4	Sun Aug 12 16:48:04 2018
+++ src/sys/arch/arm/rockchip/rk3328_cru.c	Wed May 15 01:24:43 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: rk3328_cru.c,v 1.4 2018/08/12 16:48:04 jmcneill Exp $ */
+/* $NetBSD: rk3328_cru.c,v 1.5 2019/05/15 01:24:43 mrg Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: rk3328_cru.c,v 1.4 2018/08/12 16:48:04 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: rk3328_cru.c,v 1.5 2019/05/15 01:24:43 mrg Exp $");
 
 #include 
 #include 
@@ -147,6 +147,7 @@ static const char * mux_uart1_parents[] 
 static const char * mux_uart2_parents[] = { "clk_uart2_div", "clk_uart2_frac", "xin24m" };
 static const char * mux_mac2io_src_parents[] = { "clk_mac2io_src", "gmac_clkin" };
 static const char * mux_mac2io_ext_parents[] = { "clk_mac2io", "gmac_clkin" };
+static const char * mux_clk_tsadc_parents[] = { "clk_24m" };
 static const char * mux_2plls_parents[] = { "cpll", "gpll" };
 static const char * mux_2plls_hdmiphy_parents[] = { "cpll", "gpll", "dummy_hdmiphy" };
 static const char * comp_uart_parents[] = { "cpll", "gpll", "usb480m" };
@@ -329,6 +330,15 @@ static struct rk_cru_clk rk3328_cru_clks
 		 CLKGATE_CON(2),	/* gate_reg */
 		 __BIT(12),		/* gate_mask */
 		 0),
+	RK_COMPOSITE(RK3328_SCLK_TSADC, "clk_tsadc", mux_clk_tsadc_parents,
+		 CLKSEL_CON(22),	/* muxdiv_reg */
+		 0,			/* mux_mask */
+		 __BITS(9,0),	/* div_mask */
+		 CLKGATE_CON(2),	/* gate_reg */
+		 __BIT(6),		/* gate_mask */
+		 0),
+
+	RK_DIV(0, "clk_24m", "xin24m", CLKSEL_CON(2), __BITS(12,8), 0),
 
 	RK_GATE(0, "apll_core", "apll", CLKGATE_CON(0), 0),
 	RK_GATE(0, "dpll_core", "dpll", CLKGATE_CON(0), 1),
@@ -351,6 +361,7 @@ static struct rk_cru_clk rk3328_cru_clks
 	RK_GATE(RK3328_PCLK_UART0, "pclk_uart0", "pclk_bus", CLKGATE_CON(16), 11),
 	RK_GATE(RK3328_PCLK_UART1, "pclk_uart1", "pclk_bus", CLKGATE_CON(16), 12),
 	RK_GATE(RK3328_PCLK_UART2, "pclk_uart2", "pclk_bus", CLKGATE_CON(16), 13),
+	RK_GATE(RK3328_PCLK_TSADC, "pclk_tsadc", "pclk_bus", CLKGATE_CON(16), 14),
 	RK_GATE(RK3328_SCLK_MAC2IO_REF, "clk_mac2io_ref", "clk_mac2io", CLKGATE_CON(9), 7),
 	RK_GATE(RK3328_SCLK_MAC2IO_RX, "clk_mac2io_rx", "clk_mac2io", CLKGATE_CON(9), 4),
 	RK_GATE(RK3328_SCLK_MAC2IO_TX, "clk_mac2io_tx", "clk_mac2io", CLKGATE_CON(9), 5),
Index: src/sys/arch/arm/rockchip/rk_tsadc.c
diff -u src/sys/arch/arm/rockchip/rk_tsadc.c:1.4 src/sys/arch/arm/rockchip/rk_tsadc.c:1.5
--- src/sys/arch/arm/rockchip/rk_tsadc.c:1.4	Tue May 14 07:45:03 2019
+++ src/sys/arch/arm/rockchip/rk_tsadc.c	Wed May 15 01:24:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rk_tsadc.c,v 1.4 2019/05/14 07:45:03 mrg Exp $	*/
+/*	$NetBSD: rk_tsadc.c,v 1.5 2019/05/15 01:24:43 mrg Exp $	*/
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -30,7 +30,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v 1.4 2019/05/14 07:45:03 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v 1.5 2019/05/15 01:24:43 mrg Exp $");
 
 /*
  * Driver for the TSADC temperature sensor monitor in RK3328 and RK3399.
@@ -40,8 +40,6 @@ __KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v
  * - handle DT trips/temp value defaults
  * - interrupts aren't triggered (test by lowering warn/crit values), and
  *   once they work, make the interrupt do something
- * - fix for RK3328, and port to other rockchips (will require moving some
- *   part into per-chipset sections, such as code<->temp tables)
  */
 
 #include 
@@ -57,7 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v
 
 #include 
 
-//#define RKTSADC_DEBUG
 #ifdef RKTSADC_DEBUG
 #define DPRINTF(fmt, ...) \
 	printf("%s:%d: " fmt "\n", __func__, __LINE__, ## __VA_ARGS__)
@@ -159,7 +156,7 @@ __KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v
 
 

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

2019-05-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May 15 01:24:43 UTC 2019

Modified Files:
src/sys/arch/arm/rockchip: rk3328_cru.c rk_tsadc.c

Log Message:
support RK3328 tsadc:

- add clk_24m, clk_tsadc and pclk_tsadc rk3328 clocks
- rk3328 data<->temp conversion table is is wrong.  the actual values
  seen are 4096 - , and the linux driver has these values
  in the inverted value directly
- the above means the rk3328 is increasing data for increasing temp,
  and the min/max values are also inverted and swapped
- move auto-period into the rk_data
- rk3328 only has one sensor, deal with this
- rename rk_data_table as rk_data, and also s/rdt/rd/

thanks to jmcneill who helped clean up clocks confusion, and pointed
out the linux driver values matched my own inverted data experience.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/rockchip/rk3328_cru.c \
src/sys/arch/arm/rockchip/rk_tsadc.c

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



Re: CVS commit: src/sys

2019-05-14 Thread Ryota Ozaki
On Tue, May 14, 2019 at 10:54 PM Greg Troxel  wrote:
>
> Ryota Ozaki  writes:
>
> > On Tue, May 14, 2019 at 2:31 AM Jason Thorpe  wrote:
> >>
> >>
> >>
> >> > On May 13, 2019, at 7:17 AM, Greg Troxel  wrote:
> >> >
> >> > 2) Your option 2 seems to involve two things at once:
> >> >
> >> >  - migration to lwp_specificadata
> >> >  - using DEBUG instead of DIAGNOSTIC to control the leak check feature
> >> >
> >> > I do not understand why changing the nature of the implementation is
> >> > linked to how it is enabled.
> >>
> >> I think Ozaki-san saying that the 3% performance hit only happens
> >> when lwp_specificdata is used, and hence that it would need to be
> >> wrapped in DEBUG rather than DIAGNOSTIC.
>
> Now this is all making sense.
>
> >> The original negligible-impact implementation did NOT use
> >> lwp_specificdata, and thus was fine for DIAGNOSTIC.  I believe
> >> Ozaki-san's preference is to use *this* implementation so that it
> >> can be exposed to a wider audience.  The lwp_specificdata approach
> >> was only explored after someone else suggested a preference for it.
> >>
> >> At least, that's my understanding of the situation.
> >
> > Yes, your understanding is correct.  Thank you for the clarification.
>
> So having a check under DIAGNOSTIC that you more or less can't measure
> sounds just fine to me.  I only meant to object to a 3% slowdown under
> DIAGNOSTIC.
>
> And, if someone is inclined, having better checks with meaurable
> slowdown under DEBUG sounds ok too, but my revised understanding is
> unclear on whether that's helpful.  (But I am only trying to keep
> performance under DIAGNOSTIC high; I am unconcerned about DEBUG and
> don't need to understand.)

I've proposed another implementation a few days ago (*).  That provides
useful information for debugging in exchange for expensive overhead.
It is enabled by PSREF_DEBUG.

(*) https://mail-index.netbsd.org/tech-kern/2019/05/10/msg025049.html

  ozaki-r


Re: CVS commit: src/sys

2019-05-14 Thread Greg Troxel
Ryota Ozaki  writes:

>> And, if someone is inclined, having better checks with meaurable
>> slowdown under DEBUG sounds ok too, but my revised understanding is
>> unclear on whether that's helpful.  (But I am only trying to keep
>> performance under DIAGNOSTIC high; I am unconcerned about DEBUG and
>> don't need to understand.)
>
> I've proposed another implementation a few days ago (*).  That provides
> useful information for debugging in exchange for expensive overhead.
> It is enabled by PSREF_DEBUG.
>
> (*) https://mail-index.netbsd.org/tech-kern/2019/05/10/msg025049.html

That sounds useful when needed.  I don't mind if DEBUG turns on
PSREF_DEBUG, but it might be that turning it on only when there is a
known reproduction recipe for a leak is sensible.

Thanks all for the useful and rational discussion.


CVS commit: src/doc

2019-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 14 19:24:09 UTC 2019

Modified Files:
src/doc: TODO.clang

Log Message:
more powerpc issues


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/doc/TODO.clang

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

Modified files:

Index: src/doc/TODO.clang
diff -u src/doc/TODO.clang:1.21 src/doc/TODO.clang:1.22
--- src/doc/TODO.clang:1.21	Tue May  7 21:08:18 2019
+++ src/doc/TODO.clang	Tue May 14 15:24:09 2019
@@ -1,4 +1,4 @@
-$NetBSD: TODO.clang,v 1.21 2019/05/08 01:08:18 christos Exp $
+$NetBSD: TODO.clang,v 1.22 2019/05/14 19:24:09 christos Exp $
 
 Hacks for the clang integration
 ---
@@ -26,3 +26,9 @@ src/external/mit/xorg/lib/gallium
 src/external/mpl/bind/
 has atomic alignment issues 
 
+src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
+hack around tls_model("initial_exec") on powerpc
+
+src/tests/libexec/ld.elf_so/Makefile.inc
+use -msecure-plt on powerpc for ifuncs
+



CVS commit: src/doc

2019-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 14 19:24:09 UTC 2019

Modified Files:
src/doc: TODO.clang

Log Message:
more powerpc issues


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/doc/TODO.clang

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



CVS commit: src/tests/libexec/ld.elf_so

2019-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 14 19:07:07 UTC 2019

Modified Files:
src/tests/libexec/ld.elf_so: Makefile Makefile.inc

Log Message:
clang ifunc's on powerpc require secure-plt.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/libexec/ld.elf_so/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/libexec/ld.elf_so/Makefile.inc

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

Modified files:

Index: src/tests/libexec/ld.elf_so/Makefile
diff -u src/tests/libexec/ld.elf_so/Makefile:1.9 src/tests/libexec/ld.elf_so/Makefile:1.10
--- src/tests/libexec/ld.elf_so/Makefile:1.9	Tue Jul 11 11:21:36 2017
+++ src/tests/libexec/ld.elf_so/Makefile	Tue May 14 15:07:07 2019
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.9 2017/07/11 15:21:36 joerg Exp $
+# $NetBSD: Makefile,v 1.10 2019/05/14 19:07:07 christos Exp $
 #
 
 NOMAN=		# defined
 
+.include "Makefile.inc"
 .include 
 
 .if ${MKPIC} != "no"

Index: src/tests/libexec/ld.elf_so/Makefile.inc
diff -u src/tests/libexec/ld.elf_so/Makefile.inc:1.1 src/tests/libexec/ld.elf_so/Makefile.inc:1.2
--- src/tests/libexec/ld.elf_so/Makefile.inc:1.1	Sat Jun 11 14:03:19 2011
+++ src/tests/libexec/ld.elf_so/Makefile.inc	Tue May 14 15:07:07 2019
@@ -1 +1,5 @@
 .include "../Makefile.inc"
+
+.if ${MACHINE_ARCH} == "powerpc"
+CFLAGS	+= -msecure-plt
+.endif



CVS commit: src/tests/libexec/ld.elf_so

2019-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 14 19:07:07 UTC 2019

Modified Files:
src/tests/libexec/ld.elf_so: Makefile Makefile.inc

Log Message:
clang ifunc's on powerpc require secure-plt.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/libexec/ld.elf_so/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/libexec/ld.elf_so/Makefile.inc

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



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

2019-05-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue May 14 18:11:34 UTC 2019

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
 Add snprintb's string for cpuid7 edx bit 10 "MD_CLEAR".


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/arch/x86/include/specialreg.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/x86/include

2019-05-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue May 14 18:11:34 UTC 2019

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
 Add snprintb's string for cpuid7 edx bit 10 "MD_CLEAR".


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/arch/x86/include/specialreg.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/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.144 src/sys/arch/x86/include/specialreg.h:1.145
--- src/sys/arch/x86/include/specialreg.h:1.144	Tue May 14 16:59:26 2019
+++ src/sys/arch/x86/include/specialreg.h	Tue May 14 18:11:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.144 2019/05/14 16:59:26 maxv Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.145 2019/05/14 18:11:34 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -437,6 +437,7 @@
 
 #define CPUID_SEF_FLAGS2	"\20" \
 "\3" "AVX512_4VNNIW" "\4" "AVX512_4FMAPS" \
+"\13" "MD_CLEAR"			\
 			"\16" "TSX_FORCE_ABORT"\
 	"\33" "IBRS"	"\34" "STIBP"	\
 	"\35" "L1D_FLUSH" "\36" "ARCH_CAP" "\37CORE_CAP"	"\40" "SSBD"



CVS commit: [netbsd-8] src

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 17:21:59 UTC 2019

Modified Files:
src/doc [netbsd-8]: CHANGES-8.1 LAST_MINUTE
src/external/gpl2/groff/tmac [netbsd-8]: mdoc.local
src/sys/sys [netbsd-8]: param.h

Log Message:
Welcome to 8.1_RC1!


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.145 -r1.1.2.146 src/doc/CHANGES-8.1
cvs rdiff -u -r1.2.60.1 -r1.2.60.2 src/doc/LAST_MINUTE
cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/external/gpl2/groff/tmac/mdoc.local
cvs rdiff -u -r1.542.2.5 -r1.542.2.6 src/sys/sys/param.h

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



CVS commit: [netbsd-8] src

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 17:21:59 UTC 2019

Modified Files:
src/doc [netbsd-8]: CHANGES-8.1 LAST_MINUTE
src/external/gpl2/groff/tmac [netbsd-8]: mdoc.local
src/sys/sys [netbsd-8]: param.h

Log Message:
Welcome to 8.1_RC1!


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.145 -r1.1.2.146 src/doc/CHANGES-8.1
cvs rdiff -u -r1.2.60.1 -r1.2.60.2 src/doc/LAST_MINUTE
cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/external/gpl2/groff/tmac/mdoc.local
cvs rdiff -u -r1.542.2.5 -r1.542.2.6 src/sys/sys/param.h

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.145 src/doc/CHANGES-8.1:1.1.2.146
--- src/doc/CHANGES-8.1:1.1.2.145	Tue May 14 17:13:49 2019
+++ src/doc/CHANGES-8.1	Tue May 14 17:21:59 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.145 2019/05/14 17:13:49 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.146 2019/05/14 17:21:59 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -3184,3 +3184,11 @@ sys/arch/x86/x86/spectre.c			1.27 (adapt
 	Mitigation for INTEL-SA-00233: Microarchitectural Data Sampling (MDS).
 	[maxv, ticket #1269]
 
+
+external/gpl2/groff/tmac/mdoc.local		patched by hand
+sys/sys/param.h	patched by hand
+doc/LAST_MINUTE
+
+	Welcome to 8.1_RC.
+	[martin]
+

Index: src/doc/LAST_MINUTE
diff -u src/doc/LAST_MINUTE:1.2.60.1 src/doc/LAST_MINUTE:1.2.60.2
--- src/doc/LAST_MINUTE:1.2.60.1	Sun Jun  4 07:12:09 2017
+++ src/doc/LAST_MINUTE	Tue May 14 17:21:59 2019
@@ -1,6 +1,6 @@
-#	$NetBSD: LAST_MINUTE,v 1.2.60.1 2017/06/04 07:12:09 snj Exp $
+#	$NetBSD: LAST_MINUTE,v 1.2.60.2 2019/05/14 17:21:59 martin Exp $
 
-This file contains important information on the NetBSD 8.0 release that
+This file contains important information on the NetBSD 8.1 release that
 did not make it into the main documentation.
 
 [all]

Index: src/external/gpl2/groff/tmac/mdoc.local
diff -u src/external/gpl2/groff/tmac/mdoc.local:1.2.4.2 src/external/gpl2/groff/tmac/mdoc.local:1.2.4.3
--- src/external/gpl2/groff/tmac/mdoc.local:1.2.4.2	Thu Jul 26 18:47:47 2018
+++ src/external/gpl2/groff/tmac/mdoc.local	Tue May 14 17:21:58 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: mdoc.local,v 1.2.4.2 2018/07/26 18:47:47 snj Exp $
+.\" $NetBSD: mdoc.local,v 1.2.4.3 2019/05/14 17:21:58 martin Exp $
 .\"
 .\" Copyright (c) 2003, 2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -44,9 +44,9 @@
 .as doc-str-St--ieee1275-94 " (\*[Lq]\*[doc-Tn-font-size]Open Firmware\*[doc-str-St]\*[Rq])
 .
 .\" Default .Os value
-.ds doc-operating-system NetBSD\~8.0_STABLE
+.ds doc-operating-system NetBSD\~8.1_RC1
 .\" Default footer operating system value
-.ds doc-default-operating-system NetBSD\~8.0_STABLE
+.ds doc-default-operating-system NetBSD\~8.1_RC1
 .\" Other known versions, not yet in groff distribution
 .ds doc-operating-system-NetBSD-1.3.3  1.3.3
 .ds doc-operating-system-NetBSD-1.6.3  1.6.3
@@ -63,6 +63,7 @@
 .ds doc-operating-system-NetBSD-7.07.0
 .ds doc-operating-system-NetBSD-7.17.1
 .ds doc-operating-system-NetBSD-8.08.0
+.ds doc-operating-system-NetBSD-8.18.1
 .ds doc-operating-system-FreeBSD-4.11  4.11
 .ds doc-operating-system-FreeBSD-5.4   5.4
 .ds doc-operating-system-FreeBSD-5.5   5.5

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.542.2.5 src/sys/sys/param.h:1.542.2.6
--- src/sys/sys/param.h:1.542.2.5	Thu Jul 26 18:47:47 2018
+++ src/sys/sys/param.h	Tue May 14 17:21:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.542.2.5 2018/07/26 18:47:47 snj Exp $	*/
+/*	$NetBSD: param.h,v 1.542.2.6 2019/05/14 17:21:58 martin Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	8	/* NetBSD 8.0_STABLE */
+#define	__NetBSD_Version__	80100	/* NetBSD 8.1_RC1 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: [netbsd-8] src/distrib/notes/common

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 17:18:20 UTC 2019

Modified Files:
src/distrib/notes/common [netbsd-8]: main

Log Message:
Prepare for 8.1 RC1


To generate a diff of this commit:
cvs rdiff -u -r1.535.2.3 -r1.535.2.4 src/distrib/notes/common/main

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



CVS commit: [netbsd-8] src/distrib/notes/common

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 17:18:20 UTC 2019

Modified Files:
src/distrib/notes/common [netbsd-8]: main

Log Message:
Prepare for 8.1 RC1


To generate a diff of this commit:
cvs rdiff -u -r1.535.2.3 -r1.535.2.4 src/distrib/notes/common/main

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/common/main
diff -u src/distrib/notes/common/main:1.535.2.3 src/distrib/notes/common/main:1.535.2.4
--- src/distrib/notes/common/main:1.535.2.3	Tue Jul 17 14:54:09 2018
+++ src/distrib/notes/common/main	Tue May 14 17:18:20 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: main,v 1.535.2.3 2018/07/17 14:54:09 martin Exp $
+.\"	$NetBSD: main,v 1.535.2.4 2019/05/14 17:18:20 martin Exp $
 .\"
 .\" Copyright (c) 1999-2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -50,7 +50,7 @@
 .as MACHINE_LIST " sgimips shark sparc sparc64 sun2 sun3 vax x68k xen zaurus .
 .so \*[.CURDIR]/../common/macros
 .
-.Dd July 17, 2018
+.Dd May 13, 2019
 .Dt INSTALL 8
 .Os NetBSD
 .Sh NAME
@@ -480,44 +480,21 @@ possible,
 would not exist.
 .
 .if \n[FOR_RELEASE] \{\
-.Ss "Dedication"
 .Pp
-.
-.Nx
-8.0 is dedicated to the memory of Nicolas Joly, who
-passed away in June 2017.
-.Pp
-Nicolas' technical contributions are too many to list here in full.
-He commited more than 1000 changes all over the
-.Nx
-source tree and pkgsrc.
-.Pp
-Beyond that he was always helpful and friendly. His
-example encouraged users to contribute to the project and share their
-work with the community.
-.Pp
-.Ss Changes Between The NetBSD 7.0 and 8.0 Releases
+.Ss Changes Between The NetBSD 8.0 and 8.1 Releases
 .Pp
 The
 .Nx
 \*V release
-provides many significant changes, including support for many new
-devices, hundreds of bug fixes, new and updated kernel subsystems, and
-numerous userland enhancements.
-The result of these improvements is a stable operating system fit for
-production use that rivals most commercially available systems.
-.Pp
-It is impossible to completely summarize the massive development that
-went into the
-.Nx
-\*V release.
+is the first security/critical update of the NetBSD 8 release branch.
+It represents a selected subset of fixes deemed important for
+security or stability reasons.
 The complete list of changes can be found in the
-CHANGES:
-.Lk https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.0/CHANGES
-and
-CHANGES-8.0:
-.Lk https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.0/CHANGES-8.0
-files in the top level directory of the NetBSD 8.0 release tree.
+CHANGES-8.1:
+.Lk https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.1_RC1/CHANGES-8.1
+file in the top level directory of the NetBSD
+\*V release
+tree.
 .Pp
 The release anouncements, status, updates and links to other resources
 can be found at
@@ -588,6 +565,8 @@ The root directory of the
 Changes between the 7.0 and 8.0 releases.
 .It Li CHANGES-8.0
 Changes between the initial 8.0 branch and final release of 8.0.
+.It Li CHANGES-8.1
+Changes between the 8.0 release and the 8.1 release.
 .It Li CHANGES.prev
 Changes in previous
 .Nx



CVS commit: [netbsd-8] src/doc

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 17:13:49 UTC 2019

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

Log Message:
Ticket #1269


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.144 -r1.1.2.145 src/doc/CHANGES-8.1

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.144 src/doc/CHANGES-8.1:1.1.2.145
--- src/doc/CHANGES-8.1:1.1.2.144	Tue May 14 11:44:32 2019
+++ src/doc/CHANGES-8.1	Tue May 14 17:13:49 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.144 2019/05/14 11:44:32 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.145 2019/05/14 17:13:49 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -3175,3 +3175,12 @@ sys/dev/pci/if_alc.c1.33,1.34
 	behavior the same as before.
 	[msaitoh, ticket #1268]
 
+sys/arch/amd64/amd64/amd64_trap.S		1.47 (adapted)
+sys/arch/amd64/amd64/locore.S			1.181 (adapted)
+sys/arch/amd64/include/frameasm.h		1.43 (adapted)
+sys/arch/x86/include/specialreg.h		1.144 (adapted)
+sys/arch/x86/x86/spectre.c			1.27 (adapted)
+
+	Mitigation for INTEL-SA-00233: Microarchitectural Data Sampling (MDS).
+	[maxv, ticket #1269]
+



CVS commit: [netbsd-8] src/doc

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 17:13:49 UTC 2019

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

Log Message:
Ticket #1269


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.144 -r1.1.2.145 src/doc/CHANGES-8.1

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



CVS commit: [netbsd-8] src/sys/arch

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 17:12:20 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-8]: amd64_trap.S locore.S
src/sys/arch/amd64/include [netbsd-8]: frameasm.h
src/sys/arch/x86/include [netbsd-8]: specialreg.h
src/sys/arch/x86/x86 [netbsd-8]: spectre.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1269):

sys/arch/amd64/amd64/locore.S: revision 1.181 (adapted)
sys/arch/amd64/amd64/amd64_trap.S: revision 1.47 (adapted)
sys/arch/x86/include/specialreg.h: revision 1.144 (adapted)
sys/arch/amd64/include/frameasm.h: revision 1.43 (adapted)
sys/arch/x86/x86/spectre.c: revision 1.27 (adapted)

Mitigation for INTEL-SA-00233: Microarchitectural Data Sampling (MDS).
It requires a microcode update, now available on the Intel website. The
microcode modifies the behavior of the VERW instruction, and makes it flush
internal CPU buffers. We hotpatch the return-to-userland path to add VERW.

Two sysctls are added:

machdep.mds.mitigated = {0/1} user-settable
machdep.mds.method = {string} constructed by the kernel

The kernel will automatically enable the mitigation if the updated
microcode is present. If the new microcode is not present, the user can
load it via cpuctl, and set machdep.mds.mitigated=1.


To generate a diff of this commit:
cvs rdiff -u -r1.5.6.3 -r1.5.6.4 src/sys/arch/amd64/amd64/amd64_trap.S
cvs rdiff -u -r1.123.6.8 -r1.123.6.9 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.20.32.3 -r1.20.32.4 src/sys/arch/amd64/include/frameasm.h
cvs rdiff -u -r1.98.2.11 -r1.98.2.12 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.19.2.2 -r1.19.2.3 src/sys/arch/x86/x86/spectre.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/amd64/amd64/amd64_trap.S
diff -u src/sys/arch/amd64/amd64/amd64_trap.S:1.5.6.3 src/sys/arch/amd64/amd64/amd64_trap.S:1.5.6.4
--- src/sys/arch/amd64/amd64/amd64_trap.S:1.5.6.3	Sat Apr 14 10:11:49 2018
+++ src/sys/arch/amd64/amd64/amd64_trap.S	Tue May 14 17:12:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: amd64_trap.S,v 1.5.6.3 2018/04/14 10:11:49 martin Exp $	*/
+/*	$NetBSD: amd64_trap.S,v 1.5.6.4 2019/05/14 17:12:19 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008, 2017 The NetBSD Foundation, Inc.
@@ -151,6 +151,7 @@ IDTVEC(trap02)
 	movq	%rsp,%rdi
 	incq	CPUVAR(NTRAP)
 	call	_C_LABEL(nmitrap)
+	MDS_LEAVE
 	SVS_LEAVE_ALTSTACK
 	swapgs
 	jmp	.Lnmileave
@@ -159,6 +160,7 @@ IDTVEC(trap02)
 	movq	%rsp,%rdi
 	incq	CPUVAR(NTRAP)
 	call	_C_LABEL(nmitrap)
+	MDS_LEAVE
 	SVS_LEAVE_ALTSTACK
 
 .Lnmileave:
@@ -247,6 +249,7 @@ IDTVEC(trap08)
 	incq	CPUVAR(NTRAP)
 	call	_C_LABEL(doubletrap)
 
+	MDS_LEAVE
 	SVS_LEAVE_ALTSTACK
 	INTR_RESTORE_GPRS
 

Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.123.6.8 src/sys/arch/amd64/amd64/locore.S:1.123.6.9
--- src/sys/arch/amd64/amd64/locore.S:1.123.6.8	Tue Jul 10 15:35:26 2018
+++ src/sys/arch/amd64/amd64/locore.S	Tue May 14 17:12:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.123.6.8 2018/07/10 15:35:26 martin Exp $	*/
+/*	$NetBSD: locore.S,v 1.123.6.9 2019/05/14 17:12:19 martin Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -1465,6 +1465,7 @@ IDTVEC_END(osyscall)
 	TEXT_USER_BEGIN
 	_ALIGN_TEXT
 LABEL(syscall_sysret)
+	MDS_LEAVE
 	SVS_LEAVE
 
 	/* Set default the 64bit values in %ds and %es. */
@@ -1561,6 +1562,7 @@ END(pagezero)
 	_ALIGN_TEXT
 LABEL(intrfastexit)
 	NOT_XEN(cli;)
+	MDS_LEAVE
 	SVS_LEAVE
 	INTR_RESTORE_GPRS
 	addq	$(TF_REGSIZE+16),%rsp	/* iret frame */
@@ -1637,3 +1639,18 @@ LABEL(nosvs_leave_altstack)
 	NOSVS_LEAVE_ALTSTACK
 LABEL(nosvs_leave_altstack_end)
 #endif
+
+	.globl	mds_leave, mds_leave_end
+
+LABEL(mds_leave)
+	testb	$SEL_UPL,TF_CS(%rsp)
+	jz	1234f
+	pushq	$GSEL(GDATA_SEL, SEL_KPL)
+	verw	(%rsp)
+	addq	$8,%rsp
+1234:
+LABEL(mds_leave_end)
+
+LABEL(nomds_leave)
+	NOMDS_LEAVE
+LABEL(nomds_leave_end)

Index: src/sys/arch/amd64/include/frameasm.h
diff -u src/sys/arch/amd64/include/frameasm.h:1.20.32.3 src/sys/arch/amd64/include/frameasm.h:1.20.32.4
--- src/sys/arch/amd64/include/frameasm.h:1.20.32.3	Sat Apr 14 10:11:49 2018
+++ src/sys/arch/amd64/include/frameasm.h	Tue May 14 17:12:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: frameasm.h,v 1.20.32.3 2018/04/14 10:11:49 martin Exp $	*/
+/*	$NetBSD: frameasm.h,v 1.20.32.4 2019/05/14 17:12:19 martin Exp $	*/
 
 #ifndef _AMD64_MACHINE_FRAMEASM_H
 #define _AMD64_MACHINE_FRAMEASM_H
@@ -42,6 +42,7 @@
 #define HP_NAME_SVS_LEAVE	6
 #define HP_NAME_SVS_ENTER_ALT	7
 #define HP_NAME_SVS_LEAVE_ALT	8
+#define HP_NAME_MDS_LEAVE	13
 
 #define HOTPATCH(name, size) \
 123:		; \
@@ -59,6 +60,18 @@
 	HOTPATCH(HP_NAME_STAC, 3)		; \
 	.byte 0x0F, 0x1F, 0x00			; \
 
+/*
+ * MDS
+ */
+
+#define MDS_LEAVE_BYTES	20
+#define MDS_LEAVE \
+	HOTPATCH(HP_NAME_MDS_LEAVE, MDS_LEAVE_BYTES)		; \
+	NOMDS_LEAVE
+#define 

CVS commit: [netbsd-8] src/sys/arch

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 17:12:20 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-8]: amd64_trap.S locore.S
src/sys/arch/amd64/include [netbsd-8]: frameasm.h
src/sys/arch/x86/include [netbsd-8]: specialreg.h
src/sys/arch/x86/x86 [netbsd-8]: spectre.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1269):

sys/arch/amd64/amd64/locore.S: revision 1.181 (adapted)
sys/arch/amd64/amd64/amd64_trap.S: revision 1.47 (adapted)
sys/arch/x86/include/specialreg.h: revision 1.144 (adapted)
sys/arch/amd64/include/frameasm.h: revision 1.43 (adapted)
sys/arch/x86/x86/spectre.c: revision 1.27 (adapted)

Mitigation for INTEL-SA-00233: Microarchitectural Data Sampling (MDS).
It requires a microcode update, now available on the Intel website. The
microcode modifies the behavior of the VERW instruction, and makes it flush
internal CPU buffers. We hotpatch the return-to-userland path to add VERW.

Two sysctls are added:

machdep.mds.mitigated = {0/1} user-settable
machdep.mds.method = {string} constructed by the kernel

The kernel will automatically enable the mitigation if the updated
microcode is present. If the new microcode is not present, the user can
load it via cpuctl, and set machdep.mds.mitigated=1.


To generate a diff of this commit:
cvs rdiff -u -r1.5.6.3 -r1.5.6.4 src/sys/arch/amd64/amd64/amd64_trap.S
cvs rdiff -u -r1.123.6.8 -r1.123.6.9 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.20.32.3 -r1.20.32.4 src/sys/arch/amd64/include/frameasm.h
cvs rdiff -u -r1.98.2.11 -r1.98.2.12 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.19.2.2 -r1.19.2.3 src/sys/arch/x86/x86/spectre.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

2019-05-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue May 14 16:59:26 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: amd64_trap.S locore.S
src/sys/arch/amd64/include: frameasm.h
src/sys/arch/x86/include: specialreg.h
src/sys/arch/x86/x86: spectre.c

Log Message:
Mitigation for INTEL-SA-00233: Microarchitectural Data Sampling (MDS).

It requires a microcode update, now available on the Intel website. The
microcode modifies the behavior of the VERW instruction, and makes it flush
internal CPU buffers. We hotpatch the return-to-userland path to add VERW.

Two sysctls are added:

machdep.mds.mitigated = {0/1} user-settable
machdep.mds.method = {string} constructed by the kernel

The kernel will automatically enable the mitigation if the updated
microcode is present. If the new microcode is not present, the user can
load it via cpuctl, and set machdep.mds.mitigated=1.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/amd64/amd64/amd64_trap.S
cvs rdiff -u -r1.180 -r1.181 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/amd64/include/frameasm.h
cvs rdiff -u -r1.143 -r1.144 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/x86/x86/spectre.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

2019-05-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue May 14 16:59:26 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: amd64_trap.S locore.S
src/sys/arch/amd64/include: frameasm.h
src/sys/arch/x86/include: specialreg.h
src/sys/arch/x86/x86: spectre.c

Log Message:
Mitigation for INTEL-SA-00233: Microarchitectural Data Sampling (MDS).

It requires a microcode update, now available on the Intel website. The
microcode modifies the behavior of the VERW instruction, and makes it flush
internal CPU buffers. We hotpatch the return-to-userland path to add VERW.

Two sysctls are added:

machdep.mds.mitigated = {0/1} user-settable
machdep.mds.method = {string} constructed by the kernel

The kernel will automatically enable the mitigation if the updated
microcode is present. If the new microcode is not present, the user can
load it via cpuctl, and set machdep.mds.mitigated=1.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/amd64/amd64/amd64_trap.S
cvs rdiff -u -r1.180 -r1.181 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/amd64/include/frameasm.h
cvs rdiff -u -r1.143 -r1.144 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/x86/x86/spectre.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/amd64/amd64/amd64_trap.S
diff -u src/sys/arch/amd64/amd64/amd64_trap.S:1.46 src/sys/arch/amd64/amd64/amd64_trap.S:1.47
--- src/sys/arch/amd64/amd64/amd64_trap.S:1.46	Mon Feb 11 14:59:32 2019
+++ src/sys/arch/amd64/amd64/amd64_trap.S	Tue May 14 16:59:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: amd64_trap.S,v 1.46 2019/02/11 14:59:32 cherry Exp $	*/
+/*	$NetBSD: amd64_trap.S,v 1.47 2019/05/14 16:59:25 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008, 2017 The NetBSD Foundation, Inc.
@@ -281,6 +281,7 @@ IDTVEC(trap02)
 	call	_C_LABEL(nmitrap)
 
 .Lnmileave:
+	MDS_LEAVE
 	SVS_LEAVE_NMI
 	IBRS_LEAVE
 	INTR_RESTORE_GPRS
@@ -369,6 +370,7 @@ IDTVEC(trap08)
 	incq	CPUVAR(NTRAP)
 	call	_C_LABEL(doubletrap)
 
+	MDS_LEAVE
 	SVS_LEAVE_ALTSTACK
 	IBRS_LEAVE
 	INTR_RESTORE_GPRS

Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.180 src/sys/arch/amd64/amd64/locore.S:1.181
--- src/sys/arch/amd64/amd64/locore.S:1.180	Sat Mar  9 08:42:25 2019
+++ src/sys/arch/amd64/amd64/locore.S	Tue May 14 16:59:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.180 2019/03/09 08:42:25 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.181 2019/05/14 16:59:25 maxv Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -1483,6 +1483,7 @@ IDTVEC_END(osyscall)
 	TEXT_USER_BEGIN
 	_ALIGN_TEXT
 LABEL(syscall_sysret)
+	MDS_LEAVE
 	SVS_LEAVE
 	IBRS_LEAVE
 	INTR_RESTORE_GPRS
@@ -1574,6 +1575,7 @@ END(pagezero)
 	_ALIGN_TEXT
 LABEL(intrfastexit)
 	NOT_XEN(cli;)
+	MDS_LEAVE
 	SVS_LEAVE
 	IBRS_LEAVE
 	INTR_RESTORE_GPRS
@@ -1721,3 +1723,18 @@ LABEL(noibrs_enter_end)
 LABEL(noibrs_leave)
 	NOIBRS_LEAVE
 LABEL(noibrs_leave_end)
+
+	.globl	mds_leave, mds_leave_end
+
+LABEL(mds_leave)
+	testb	$SEL_UPL,TF_CS(%rsp)
+	jz	1234f
+	pushq	$GSEL(GDATA_SEL, SEL_KPL)
+	verw	(%rsp)
+	addq	$8,%rsp
+1234:
+LABEL(mds_leave_end)
+
+LABEL(nomds_leave)
+	NOMDS_LEAVE
+LABEL(nomds_leave_end)

Index: src/sys/arch/amd64/include/frameasm.h
diff -u src/sys/arch/amd64/include/frameasm.h:1.42 src/sys/arch/amd64/include/frameasm.h:1.43
--- src/sys/arch/amd64/include/frameasm.h:1.42	Mon Feb 11 14:59:32 2019
+++ src/sys/arch/amd64/include/frameasm.h	Tue May 14 16:59:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: frameasm.h,v 1.42 2019/02/11 14:59:32 cherry Exp $	*/
+/*	$NetBSD: frameasm.h,v 1.43 2019/05/14 16:59:25 maxv Exp $	*/
 
 #ifndef _AMD64_MACHINE_FRAMEASM_H
 #define _AMD64_MACHINE_FRAMEASM_H
@@ -48,6 +48,7 @@
 #define HP_NAME_IBRS_LEAVE	10
 #define HP_NAME_SVS_ENTER_NMI	11
 #define HP_NAME_SVS_LEAVE_NMI	12
+#define HP_NAME_MDS_LEAVE	13
 
 #define HOTPATCH(name, size) \
 123:		; \
@@ -85,6 +86,18 @@
 	.byte 0xEB, (IBRS_LEAVE_BYTES-2)	/* jmp */	; \
 	.fill	(IBRS_LEAVE_BYTES-2),1,0xCC
 
+/*
+ * MDS
+ */
+
+#define MDS_LEAVE_BYTES	20
+#define MDS_LEAVE \
+	HOTPATCH(HP_NAME_MDS_LEAVE, MDS_LEAVE_BYTES)		; \
+	NOMDS_LEAVE
+#define NOMDS_LEAVE \
+	.byte 0xEB, (MDS_LEAVE_BYTES-2)	/* jmp */		; \
+	.fill	(MDS_LEAVE_BYTES-2),1,0xCC
+
 #define	SWAPGS	NOT_XEN(swapgs)
 
 /*

Index: src/sys/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.143 src/sys/arch/x86/include/specialreg.h:1.144
--- src/sys/arch/x86/include/specialreg.h:1.143	Wed Mar 13 05:22:07 2019
+++ src/sys/arch/x86/include/specialreg.h	Tue May 14 16:59:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.143 2019/03/13 05:22:07 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.144 2019/05/14 16:59:26 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -426,6 +426,7 @@
 /* %edx */
 #define CPUID_SEF_AVX512_4VNNIW	__BIT(2)
 #define 

CVS commit: src/external/bsd/jemalloc/include/jemalloc/internal

2019-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 14 16:22:09 UTC 2019

Modified Files:
src/external/bsd/jemalloc/include/jemalloc/internal:
jemalloc_internal_defs.h

Log Message:
Hack around clang powerpc tls_model("initial-exec") pic issue; this is gross.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h

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



CVS commit: src/distrib/i386/installimage

2019-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 14 15:41:23 UTC 2019

Modified Files:
src/distrib/i386/installimage: Makefile

Log Message:
clang binaries are so much bigger.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/distrib/i386/installimage/Makefile

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

Modified files:

Index: src/distrib/i386/installimage/Makefile
diff -u src/distrib/i386/installimage/Makefile:1.14 src/distrib/i386/installimage/Makefile:1.15
--- src/distrib/i386/installimage/Makefile:1.14	Sun Apr  7 01:29:00 2019
+++ src/distrib/i386/installimage/Makefile	Tue May 14 11:41:23 2019
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.14 2019/04/07 05:29:00 rin Exp $
+#	$NetBSD: Makefile,v 1.15 2019/05/14 15:41:23 christos Exp $
 
 .include 
 
 INSTIMGBASE=	NetBSD-${DISTRIBVER}-i386-install	# gives ${IMGBASE}.img
 
-INSTIMAGEMB?=	1600			# for all installation binaries
+INSTIMAGEMB?=	1750			# for all installation binaries
 
 PRIMARY_BOOT=		bootxx_ffsv1
 SECONDARY_BOOT=		boot



CVS commit: src/distrib/i386/installimage

2019-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 14 15:41:23 UTC 2019

Modified Files:
src/distrib/i386/installimage: Makefile

Log Message:
clang binaries are so much bigger.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/distrib/i386/installimage/Makefile

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



Re: CVS commit: src/sys

2019-05-14 Thread Greg Troxel
Ryota Ozaki  writes:

> On Tue, May 14, 2019 at 2:31 AM Jason Thorpe  wrote:
>>
>>
>>
>> > On May 13, 2019, at 7:17 AM, Greg Troxel  wrote:
>> >
>> > 2) Your option 2 seems to involve two things at once:
>> >
>> >  - migration to lwp_specificadata
>> >  - using DEBUG instead of DIAGNOSTIC to control the leak check feature
>> >
>> > I do not understand why changing the nature of the implementation is
>> > linked to how it is enabled.
>>
>> I think Ozaki-san saying that the 3% performance hit only happens
>> when lwp_specificdata is used, and hence that it would need to be
>> wrapped in DEBUG rather than DIAGNOSTIC.

Now this is all making sense.

>> The original negligible-impact implementation did NOT use
>> lwp_specificdata, and thus was fine for DIAGNOSTIC.  I believe
>> Ozaki-san's preference is to use *this* implementation so that it
>> can be exposed to a wider audience.  The lwp_specificdata approach
>> was only explored after someone else suggested a preference for it.
>>
>> At least, that's my understanding of the situation.
>
> Yes, your understanding is correct.  Thank you for the clarification.

So having a check under DIAGNOSTIC that you more or less can't measure
sounds just fine to me.  I only meant to object to a 3% slowdown under
DIAGNOSTIC.

And, if someone is inclined, having better checks with meaurable
slowdown under DEBUG sounds ok too, but my revised understanding is
unclear on whether that's helpful.  (But I am only trying to keep
performance under DIAGNOSTIC high; I am unconcerned about DEBUG and
don't need to understand.)




CVS commit: [netbsd-8] src/doc

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:44:33 UTC 2019

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

Log Message:
Tickets #1264 - #1268


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.143 -r1.1.2.144 src/doc/CHANGES-8.1

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



CVS commit: [netbsd-8] src/doc

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:44:33 UTC 2019

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

Log Message:
Tickets #1264 - #1268


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.143 -r1.1.2.144 src/doc/CHANGES-8.1

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.143 src/doc/CHANGES-8.1:1.1.2.144
--- src/doc/CHANGES-8.1:1.1.2.143	Mon May 13 12:42:24 2019
+++ src/doc/CHANGES-8.1	Tue May 14 11:44:32 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.143 2019/05/13 12:42:24 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.144 2019/05/14 11:44:32 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -3136,3 +3136,42 @@ sys/dev/usb/if_aue.c1.149
 	when the IFM_GMASK bit other than IFM_[FH]DX is set.
 	[msaitoh, #1263]
 
+sys/arch/arm/sunxi/sunxi_sata.c			1.2 (via patch)
+	(applied to sys/arm/allwinner/awin_ahcisata.c)
+
+	Use new magic values from linux for DMACR.
+	[bouyer, ticket #1264]
+
+distrib/sets/lists/etc/mi			1.258
+etc/defaults/rc.conf1.148
+etc/mtree/special1.167
+etc/rc.d/Makefile1.103,1.104
+etc/rc.d/smtoff	1.1-1.4
+share/man/man5/rc.conf.5			1.180
+usr.sbin/postinstall/postinstall		1.226
+
+	Add smtoff, an rc.d script that disables Simultaneous Multi-Threading.
+	[maxv, ticket #1265]
+
+sys/net/if_media.c1.42 (patch)
+
+	Add missing error check.
+	[msaitoh, ticket #1266]
+
+sys/arch/arm/imx/if_enet.c			1.19
+sys/dev/pci/if_wm.c1.634
+
+	SIOCS is 'S'et function and the ioctl argument is ifreq.
+	SIOCG is 'G'et function and the ioctl argument is ifmediareq.
+	Before this change, SIOCG modify sc->sc_flowflags unexpectedly.
+	Don't hook SIOCGIFMEDIA because this driver uses MII(4) and
+	ether_ioctl has	the hook(if_ethersubr.c rev. 1.160).
+	[msaitoh, ticket #1267]
+
+sys/dev/pci/if_alc.c1.33,1.34
+
+	Fix a wrong and extra ether_ioctl() call in alc_ioctl().
+	Add ether_ioctl() call for SIOCSIFADDR and SIOCSIFFLAGS to make
+	behavior the same as before.
+	[msaitoh, ticket #1268]
+



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

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:43:23 UTC 2019

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

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

sys/dev/pci/if_alc.c: revision 1.33
sys/dev/pci/if_alc.c: revision 1.34

 Fix a wrong and extra ether_ioctl() call in alc_ioctl(). _IOWR types call
broke ifreq by the first ether_ioct() and the second ether_ioctl() caused
unexpected behavior. One of bug example is that SIOCGIFMEDIA always failed.

This bug was added in if_alc.c rev. 1.16.
XXX pullup-8

 -

 Add ether_ioctl() call for SIOCSIFADDR and SIOCSIFFLAGS to make behavior
the same as before.

XXX need cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.24.8.2 -r1.24.8.3 src/sys/dev/pci/if_alc.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_alc.c
diff -u src/sys/dev/pci/if_alc.c:1.24.8.2 src/sys/dev/pci/if_alc.c:1.24.8.3
--- src/sys/dev/pci/if_alc.c:1.24.8.2	Thu Jul 26 23:55:30 2018
+++ src/sys/dev/pci/if_alc.c	Tue May 14 11:43:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_alc.c,v 1.24.8.2 2018/07/26 23:55:30 snj Exp $	*/
+/*	$NetBSD: if_alc.c,v 1.24.8.3 2019/05/14 11:43:23 martin Exp $	*/
 /*	$OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $	*/
 /*-
  * Copyright (c) 2009, Pyun YongHyeon 
@@ -2036,15 +2036,16 @@ alc_ioctl(struct ifnet *ifp, u_long cmd,
 
 	s = splnet();
 
-	error = ether_ioctl(ifp, cmd, data);
 	switch (cmd) {
 	case SIOCSIFADDR:
+		error = ether_ioctl(ifp, cmd, data);
 		ifp->if_flags |= IFF_UP;
 		if (!(ifp->if_flags & IFF_RUNNING))
 			alc_init(ifp);
 		break;
- 
+
 	case SIOCSIFFLAGS:
+		error = ether_ioctl(ifp, cmd, data);
 		if (ifp->if_flags & IFF_UP) {
 			if (ifp->if_flags & IFF_RUNNING)
 error = ENETRESET;
@@ -2060,7 +2061,7 @@ alc_ioctl(struct ifnet *ifp, u_long cmd,
 	case SIOCGIFMEDIA:
 		error = ifmedia_ioctl(ifp, ifr, >mii_media, cmd);
 		break;
- 
+
 	default:
 		error = ether_ioctl(ifp, cmd, data);
 		break;



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

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:43:23 UTC 2019

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

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

sys/dev/pci/if_alc.c: revision 1.33
sys/dev/pci/if_alc.c: revision 1.34

 Fix a wrong and extra ether_ioctl() call in alc_ioctl(). _IOWR types call
broke ifreq by the first ether_ioct() and the second ether_ioctl() caused
unexpected behavior. One of bug example is that SIOCGIFMEDIA always failed.

This bug was added in if_alc.c rev. 1.16.
XXX pullup-8

 -

 Add ether_ioctl() call for SIOCSIFADDR and SIOCSIFFLAGS to make behavior
the same as before.

XXX need cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.24.8.2 -r1.24.8.3 src/sys/dev/pci/if_alc.c

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



CVS commit: [netbsd-8] src/sys

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:40:42 UTC 2019

Modified Files:
src/sys/arch/arm/imx [netbsd-8]: if_enet.c
src/sys/dev/pci [netbsd-8]: if_wm.c

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

sys/arch/arm/imx/if_enet.c: revision 1.19
sys/dev/pci/if_wm.c: revision 1.634

SIOCS is 'S'et function and the ioctl argument is ifreq.
SIOCG is 'G'et function and the ioctl armument is ifmediareq.

Before this change, SIOCG modify sc->sc_flowflags unexpectedly.

Don't hook SIOCGIFMEDIA becauise this driver uses MII(4) and ether_ioctl has
the hook(if_ethersubr.c rev. 1.160).
real bug because the modification is overriden in ifmedia_ioctl().

 This driver might require some additional fixes for SIOCSIFMTU and other
ioctl()s.
XXX pullup-[78].


To generate a diff of this commit:
cvs rdiff -u -r1.10.8.1 -r1.10.8.2 src/sys/arch/arm/imx/if_enet.c
cvs rdiff -u -r1.508.4.31 -r1.508.4.32 src/sys/dev/pci/if_wm.c

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



CVS commit: [netbsd-8] src/sys

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:40:42 UTC 2019

Modified Files:
src/sys/arch/arm/imx [netbsd-8]: if_enet.c
src/sys/dev/pci [netbsd-8]: if_wm.c

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

sys/arch/arm/imx/if_enet.c: revision 1.19
sys/dev/pci/if_wm.c: revision 1.634

SIOCS is 'S'et function and the ioctl argument is ifreq.
SIOCG is 'G'et function and the ioctl armument is ifmediareq.

Before this change, SIOCG modify sc->sc_flowflags unexpectedly.

Don't hook SIOCGIFMEDIA becauise this driver uses MII(4) and ether_ioctl has
the hook(if_ethersubr.c rev. 1.160).
real bug because the modification is overriden in ifmedia_ioctl().

 This driver might require some additional fixes for SIOCSIFMTU and other
ioctl()s.
XXX pullup-[78].


To generate a diff of this commit:
cvs rdiff -u -r1.10.8.1 -r1.10.8.2 src/sys/arch/arm/imx/if_enet.c
cvs rdiff -u -r1.508.4.31 -r1.508.4.32 src/sys/dev/pci/if_wm.c

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

Modified files:

Index: src/sys/arch/arm/imx/if_enet.c
diff -u src/sys/arch/arm/imx/if_enet.c:1.10.8.1 src/sys/arch/arm/imx/if_enet.c:1.10.8.2
--- src/sys/arch/arm/imx/if_enet.c:1.10.8.1	Mon May 13 12:40:13 2019
+++ src/sys/arch/arm/imx/if_enet.c	Tue May 14 11:40:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_enet.c,v 1.10.8.1 2019/05/13 12:40:13 martin Exp $	*/
+/*	$NetBSD: if_enet.c,v 1.10.8.2 2019/05/14 11:40:41 martin Exp $	*/
 
 /*
  * Copyright (c) 2014 Ryo Shimizu 
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.10.8.1 2019/05/13 12:40:13 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_enet.c,v 1.10.8.2 2019/05/14 11:40:41 martin Exp $");
 
 #include "vlan.h"
 
@@ -1036,7 +1036,6 @@ enet_ioctl(struct ifnet *ifp, u_long com
 		}
 		break;
 	case SIOCSIFMEDIA:
-	case SIOCGIFMEDIA:
 		/* Flow control requires full-duplex mode. */
 		if (IFM_SUBTYPE(ifr->ifr_media) == IFM_AUTO ||
 		(ifr->ifr_media & IFM_FDX) == 0)

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.31 src/sys/dev/pci/if_wm.c:1.508.4.32
--- src/sys/dev/pci/if_wm.c:1.508.4.31	Thu Mar  7 17:11:53 2019
+++ src/sys/dev/pci/if_wm.c	Tue May 14 11:40:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.31 2019/03/07 17:11:53 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.32 2019/05/14 11:40:41 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.31 2019/03/07 17:11:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.32 2019/05/14 11:40:41 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -3321,7 +3321,6 @@ wm_ioctl(struct ifnet *ifp, u_long cmd, 
 #endif
 	switch (cmd) {
 	case SIOCSIFMEDIA:
-	case SIOCGIFMEDIA:
 		WM_CORE_LOCK(sc);
 		/* Flow control requires full-duplex mode. */
 		if (IFM_SUBTYPE(ifr->ifr_media) == IFM_AUTO ||



CVS commit: [netbsd-8] src/sys/net

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:37:13 UTC 2019

Modified Files:
src/sys/net [netbsd-8]: if_media.c

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

sys/net/if_media.c: revision 1.42 (via patch)

Add missing error check.


To generate a diff of this commit:
cvs rdiff -u -r1.32.6.2 -r1.32.6.3 src/sys/net/if_media.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/if_media.c
diff -u src/sys/net/if_media.c:1.32.6.2 src/sys/net/if_media.c:1.32.6.3
--- src/sys/net/if_media.c:1.32.6.2	Tue Jan  2 10:20:33 2018
+++ src/sys/net/if_media.c	Tue May 14 11:37:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_media.c,v 1.32.6.2 2018/01/02 10:20:33 snj Exp $	*/
+/*	$NetBSD: if_media.c,v 1.32.6.3 2019/05/14 11:37:12 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_media.c,v 1.32.6.2 2018/01/02 10:20:33 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_media.c,v 1.32.6.3 2019/05/14 11:37:12 martin Exp $");
 
 #include 
 #include 
@@ -335,6 +335,9 @@ _ifmedia_ioctl(struct ifnet *ifp, struct
 			: nwords;
 			int *kptr = (int *)malloc(minwords * sizeof(int),
 			M_TEMP, M_WAITOK);
+
+			if (kptr == NULL)
+return ENOMEM;
 			/*
 			 * Get the media words from the interface's list.
 			 */



CVS commit: [netbsd-8] src/sys/net

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:37:13 UTC 2019

Modified Files:
src/sys/net [netbsd-8]: if_media.c

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

sys/net/if_media.c: revision 1.42 (via patch)

Add missing error check.


To generate a diff of this commit:
cvs rdiff -u -r1.32.6.2 -r1.32.6.3 src/sys/net/if_media.c

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



CVS commit: [netbsd-8] src

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:33:43 UTC 2019

Modified Files:
src/distrib/sets/lists/etc [netbsd-8]: mi
src/etc/defaults [netbsd-8]: rc.conf
src/etc/mtree [netbsd-8]: special
src/etc/rc.d [netbsd-8]: Makefile
src/share/man/man5 [netbsd-8]: rc.conf.5
src/usr.sbin/postinstall [netbsd-8]: postinstall
Added Files:
src/etc/rc.d [netbsd-8]: smtoff

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1265):
etc/rc.d/smtoff: revision 1.1
etc/rc.d/smtoff: revision 1.2
distrib/sets/lists/etc/mi: revision 1.258
etc/rc.d/smtoff: revision 1.3
etc/rc.d/smtoff: revision 1.4
etc/defaults/rc.conf: revision 1.148
etc/rc.d/Makefile: revision 1.103
usr.sbin/postinstall/postinstall: revision 1.226
etc/rc.d/Makefile: revision 1.104
etc/mtree/special: revision 1.167
share/man/man5/rc.conf.5: revision 1.180

Add smtoff, an rc.d script that disables Simultaneous Multi-Threading. It
parses the output of cpuctl, and executes "cpuctl offline" for each CPU
that has SmtID!=0.

The default is "smtoff=NO", which means that SMT remains enabled.
Restructure code a little.

Use quoting everywhere possibly useful (always the right way, except
in the few cases where it is wrong...)

Avoid using cut & grep (from /usr/bin) so script could run before /usr
is mounted (pity cpuctl is in /usr/sbin ...).

Use sysctl -n rather than attempting to parse its output.
install rc.d

No change...   Previous log message should have said:
  Install rc.d/smtoff

I should know better!   Don't rely upon the way the shell implements
pipes.   Skip the "error" printf from GetSmtId() as there is no easy
portable way to avoid it occurring (there are complicated ways) - but
we don't need it, there is no logical difference between "error" and ""
so just use the latter (if we get an ID, good, if there is nothing, then
there is none - saying 'error' does not mean anything.)

Remove comment, since there is no parsing anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.247 -r1.247.2.1 src/distrib/sets/lists/etc/mi
cvs rdiff -u -r1.139 -r1.139.6.1 src/etc/defaults/rc.conf
cvs rdiff -u -r1.160 -r1.160.4.1 src/etc/mtree/special
cvs rdiff -u -r1.95 -r1.95.6.1 src/etc/rc.d/Makefile
cvs rdiff -u -r0 -r1.4.2.2 src/etc/rc.d/smtoff
cvs rdiff -u -r1.166 -r1.166.6.1 src/share/man/man5/rc.conf.5
cvs rdiff -u -r1.214.4.1 -r1.214.4.2 src/usr.sbin/postinstall/postinstall

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

Modified files:

Index: src/distrib/sets/lists/etc/mi
diff -u src/distrib/sets/lists/etc/mi:1.247 src/distrib/sets/lists/etc/mi:1.247.2.1
--- src/distrib/sets/lists/etc/mi:1.247	Sun May 21 15:28:38 2017
+++ src/distrib/sets/lists/etc/mi	Tue May 14 11:33:42 2019
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.247 2017/05/21 15:28:38 riastradh Exp $
+# $NetBSD: mi,v 1.247.2.1 2019/05/14 11:33:42 martin Exp $
 #
 # Note: end-user configuration files that are moved to another location
 #	should not be marked "obsolete"; they should just be removed from
@@ -283,6 +283,7 @@
 ./etc/rc.d/screenblanketc-sys-rc
 ./etc/rc.d/sdpd	etc-obsolete		obsolete
 ./etc/rc.d/secureleveletc-sys-rc
+./etc/rc.d/smtoffetc-sys-rc
 ./etc/rc.d/sshd	etc-secsh-rc
 ./etc/rc.d/staticrouteetc-sys-rc
 ./etc/rc.d/swap1etc-sys-rc

Index: src/etc/defaults/rc.conf
diff -u src/etc/defaults/rc.conf:1.139 src/etc/defaults/rc.conf:1.139.6.1
--- src/etc/defaults/rc.conf:1.139	Sat Jan  7 20:00:33 2017
+++ src/etc/defaults/rc.conf	Tue May 14 11:33:42 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: rc.conf,v 1.139 2017/01/07 20:00:33 christos Exp $
+#	$NetBSD: rc.conf,v 1.139.6.1 2019/05/14 11:33:42 martin Exp $
 #
 # /etc/defaults/rc.conf --
 #	default configuration of /etc/rc.conf
@@ -380,6 +380,9 @@ random_seed=YES
 # Creating / updating of man page index on boot
 makemandb=YES
 
+# Disable Simultaneous Multi-Threading
+smtoff=NO
+
 # blacklist daemon, needs npf
 blacklistd=NO
 

Index: src/etc/mtree/special
diff -u src/etc/mtree/special:1.160 src/etc/mtree/special:1.160.4.1
--- src/etc/mtree/special:1.160	Mon Feb 20 13:45:43 2017
+++ src/etc/mtree/special	Tue May 14 11:33:43 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: special,v 1.160 2017/02/20 13:45:43 christos Exp $
+#	$NetBSD: special,v 1.160.4.1 2019/05/14 11:33:43 martin Exp $
 #	@(#)special	8.2 (Berkeley) 1/23/94
 #
 # This file may be overwritten on upgrades.
@@ -281,6 +281,7 @@
 ./etc/rc.d/savecore		type=file mode=0555
 ./etc/rc.d/screenblank		type=file mode=0555
 ./etc/rc.d/securelevel		type=file mode=0555
+./etc/rc.d/smtoff		type=file mode=0555
 ./etc/rc.d/sshd			type=file mode=0555
 ./etc/rc.d/staticroute		type=file mode=0555
 ./etc/rc.d/swap1		type=file mode=0555

Index: src/etc/rc.d/Makefile
diff -u src/etc/rc.d/Makefile:1.95 src/etc/rc.d/Makefile:1.95.6.1
--- 

CVS commit: [netbsd-8] src

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:33:43 UTC 2019

Modified Files:
src/distrib/sets/lists/etc [netbsd-8]: mi
src/etc/defaults [netbsd-8]: rc.conf
src/etc/mtree [netbsd-8]: special
src/etc/rc.d [netbsd-8]: Makefile
src/share/man/man5 [netbsd-8]: rc.conf.5
src/usr.sbin/postinstall [netbsd-8]: postinstall
Added Files:
src/etc/rc.d [netbsd-8]: smtoff

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1265):
etc/rc.d/smtoff: revision 1.1
etc/rc.d/smtoff: revision 1.2
distrib/sets/lists/etc/mi: revision 1.258
etc/rc.d/smtoff: revision 1.3
etc/rc.d/smtoff: revision 1.4
etc/defaults/rc.conf: revision 1.148
etc/rc.d/Makefile: revision 1.103
usr.sbin/postinstall/postinstall: revision 1.226
etc/rc.d/Makefile: revision 1.104
etc/mtree/special: revision 1.167
share/man/man5/rc.conf.5: revision 1.180

Add smtoff, an rc.d script that disables Simultaneous Multi-Threading. It
parses the output of cpuctl, and executes "cpuctl offline" for each CPU
that has SmtID!=0.

The default is "smtoff=NO", which means that SMT remains enabled.
Restructure code a little.

Use quoting everywhere possibly useful (always the right way, except
in the few cases where it is wrong...)

Avoid using cut & grep (from /usr/bin) so script could run before /usr
is mounted (pity cpuctl is in /usr/sbin ...).

Use sysctl -n rather than attempting to parse its output.
install rc.d

No change...   Previous log message should have said:
  Install rc.d/smtoff

I should know better!   Don't rely upon the way the shell implements
pipes.   Skip the "error" printf from GetSmtId() as there is no easy
portable way to avoid it occurring (there are complicated ways) - but
we don't need it, there is no logical difference between "error" and ""
so just use the latter (if we get an ID, good, if there is nothing, then
there is none - saying 'error' does not mean anything.)

Remove comment, since there is no parsing anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.247 -r1.247.2.1 src/distrib/sets/lists/etc/mi
cvs rdiff -u -r1.139 -r1.139.6.1 src/etc/defaults/rc.conf
cvs rdiff -u -r1.160 -r1.160.4.1 src/etc/mtree/special
cvs rdiff -u -r1.95 -r1.95.6.1 src/etc/rc.d/Makefile
cvs rdiff -u -r0 -r1.4.2.2 src/etc/rc.d/smtoff
cvs rdiff -u -r1.166 -r1.166.6.1 src/share/man/man5/rc.conf.5
cvs rdiff -u -r1.214.4.1 -r1.214.4.2 src/usr.sbin/postinstall/postinstall

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



CVS commit: [netbsd-8] src/sys/arch/arm/allwinner

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:24:33 UTC 2019

Modified Files:
src/sys/arch/arm/allwinner [netbsd-8]: awin_ahcisata.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1264):

sys/arch/arm/sunxi/sunxi_sata.c: revision 1.2
(applied to sys/arm/allwinner/awin_ahcisata.c)

Use new magic values from linux for DMACR. While I couldn't measure any
significant difference with my old, slow laptop drive, linux commiter claims
a 3x write performance boost (from 40 to 120MB/s) and 200MB/s read with
a ssd.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.30.1 src/sys/arch/arm/allwinner/awin_ahcisata.c

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



CVS commit: [netbsd-8] src/sys/arch/arm/allwinner

2019-05-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue May 14 11:24:33 UTC 2019

Modified Files:
src/sys/arch/arm/allwinner [netbsd-8]: awin_ahcisata.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1264):

sys/arch/arm/sunxi/sunxi_sata.c: revision 1.2
(applied to sys/arm/allwinner/awin_ahcisata.c)

Use new magic values from linux for DMACR. While I couldn't measure any
significant difference with my old, slow laptop drive, linux commiter claims
a 3x write performance boost (from 40 to 120MB/s) and 200MB/s read with
a ssd.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.30.1 src/sys/arch/arm/allwinner/awin_ahcisata.c

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

Modified files:

Index: src/sys/arch/arm/allwinner/awin_ahcisata.c
diff -u src/sys/arch/arm/allwinner/awin_ahcisata.c:1.11 src/sys/arch/arm/allwinner/awin_ahcisata.c:1.11.30.1
--- src/sys/arch/arm/allwinner/awin_ahcisata.c:1.11	Mon Feb 24 16:40:29 2014
+++ src/sys/arch/arm/allwinner/awin_ahcisata.c	Tue May 14 11:24:33 2019
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: awin_ahcisata.c,v 1.11 2014/02/24 16:40:29 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_ahcisata.c,v 1.11.30.1 2019/05/14 11:24:33 martin Exp $");
 
 #include 
 #include 
@@ -168,8 +168,8 @@ awin_ahci_channel_start(struct ahci_soft
 	bus_size_t dma_reg = AHCI_P_AWIN_DMA(chp->ch_channel);
 
 	uint32_t dma = AHCI_READ(sc, dma_reg);
-	dma &= ~0xff00;
-	dma |= 0x4400;
+	dma &= ~0x;
+	dma |= 0x4433;
 	AHCI_WRITE(sc, dma_reg, dma);
 }
 



CVS commit: src/sys/dev/pci

2019-05-14 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue May 14 09:43:55 UTC 2019

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

Log Message:
Remove unnecessary checks of IFF_ALLMULTI

IFF_ALLMULTI is changed by only driver itself, so we don't need to check its
change on ec_ifflags_cb.

This is part of PR kern/54189. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.634 -r1.635 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.181 -r1.182 src/sys/dev/pci/ixgbe/ixgbe.c

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



CVS commit: src/sys/dev/pci

2019-05-14 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Tue May 14 09:43:55 UTC 2019

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

Log Message:
Remove unnecessary checks of IFF_ALLMULTI

IFF_ALLMULTI is changed by only driver itself, so we don't need to check its
change on ec_ifflags_cb.

This is part of PR kern/54189. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.634 -r1.635 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.181 -r1.182 src/sys/dev/pci/ixgbe/ixgbe.c

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.634 src/sys/dev/pci/if_wm.c:1.635
--- src/sys/dev/pci/if_wm.c:1.634	Wed Apr 24 11:18:20 2019
+++ src/sys/dev/pci/if_wm.c	Tue May 14 09:43:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.634 2019/04/24 11:18:20 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.635 2019/05/14 09:43:55 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.634 2019/04/24 11:18:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.635 2019/05/14 09:43:55 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -3319,7 +3319,7 @@ wm_ifflags_cb(struct ethercom *ec)
 	}
 
 	/* iff related updates */
-	if ((iffchange & (IFF_PROMISC | IFF_ALLMULTI)) != 0)
+	if ((iffchange & IFF_PROMISC) != 0)
 		wm_set_filter(sc);
 
 	wm_set_vlan(sc);

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.181 src/sys/dev/pci/ixgbe/ixgbe.c:1.182
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.181	Mon May 13 05:04:17 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue May 14 09:43:55 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.181 2019/05/13 05:04:17 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.182 2019/05/14 09:43:55 ozaki-r Exp $ */
 
 /**
 
@@ -6163,7 +6163,7 @@ ixgbe_ifflags_cb(struct ethercom *ec)
 
 	if ((change & ~(IFF_CANTCHANGE | IFF_DEBUG)) != 0)
 		rc = ENETRESET;
-	else if ((change & (IFF_PROMISC | IFF_ALLMULTI)) != 0)
+	else if ((change & IFF_PROMISC) != 0)
 		ixgbe_set_promisc(adapter);
 
 	/* Set up VLAN support and filter */



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

2019-05-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue May 14 07:45:03 UTC 2019

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

Log Message:
mostly port to rk3328.

- add rk3328 data<->temp table, and adjust code to use this vs rk3399
  table for rk3328.  add support for decrementing data.
- adjust auto period times for rk3328 vs rk3399
- add min/max data values, if data is outside these values mark the
  sensor invalid.
- move init code into cpu specific sections, add rk3328 support

with a rk3328_cru.c update to add clocks, this attaches and reports
garbage values, so for now it's disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/rockchip/rk_tsadc.c

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

Modified files:

Index: src/sys/arch/arm/rockchip/rk_tsadc.c
diff -u src/sys/arch/arm/rockchip/rk_tsadc.c:1.3 src/sys/arch/arm/rockchip/rk_tsadc.c:1.4
--- src/sys/arch/arm/rockchip/rk_tsadc.c:1.3	Fri Apr 26 10:27:49 2019
+++ src/sys/arch/arm/rockchip/rk_tsadc.c	Tue May 14 07:45:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rk_tsadc.c,v 1.3 2019/04/26 10:27:49 mrg Exp $	*/
+/*	$NetBSD: rk_tsadc.c,v 1.4 2019/05/14 07:45:03 mrg Exp $	*/
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -30,7 +30,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v 1.3 2019/04/26 10:27:49 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v 1.4 2019/05/14 07:45:03 mrg Exp $");
 
 /*
  * Driver for the TSADC temperature sensor monitor in RK3328 and RK3399.
@@ -40,7 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v
  * - handle DT trips/temp value defaults
  * - interrupts aren't triggered (test by lowering warn/crit values), and
  *   once they work, make the interrupt do something
- * - test on RK3328, and port to other rockchips (will require moving some
+ * - fix for RK3328, and port to other rockchips (will require moving some
  *   part into per-chipset sections, such as code<->temp tables)
  */
 
@@ -128,7 +128,8 @@ __KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v
 #define TSADC_COMP1_LOW_INT 0x84
 #define  TSADC_COMP1_LOW_INT_COMP_SRC1  __BITS(11,0)
 
-#define TSADC_AUTO_PERIOD_TIME  1875 /* 2.5ms */
+#define RK3328_TSADC_AUTO_PERIOD_TIME   250 /* 250ms */
+#define RK3399_TSADC_AUTO_PERIOD_TIME   1875 /* 2.5ms */
 #define TSADC_HT_DEBOUNCE_COUNT 4
 
 /*
@@ -160,50 +161,20 @@ __KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v
 
 #define NUM_SENSORS   2
 
-/* Table from RK3399 manual */
-static const struct {
+typedef struct rk_data_array {
 	uint32_t data;  /* register value */
 	int temp;   /* micro-degC */
-} rk3399_data_table[] = {
-#define ENTRY(d,C)	{ .data = (d), .temp = (C) * 1000 * 1000, }
-	ENTRY(0,   -40),
-	ENTRY(402, -40),
-	ENTRY(410, -35),
-	ENTRY(419, -30),
-	ENTRY(427, -25),
-	ENTRY(436, -20),
-	ENTRY(444, -15),
-	ENTRY(453, -10),
-	ENTRY(461,  -5),
-	ENTRY(470,   0),
-	ENTRY(478,   5),
-	ENTRY(487,  10),
-	ENTRY(496,  15),
-	ENTRY(504,  20),
-	ENTRY(513,  25),
-	ENTRY(521,  30),
-	ENTRY(530,  35),
-	ENTRY(538,  40),
-	ENTRY(547,  45),
-	ENTRY(555,  50),
-	ENTRY(564,  55),
-	ENTRY(573,  60),
-	ENTRY(581,  65),
-	ENTRY(590,  70),
-	ENTRY(599,  75),
-	ENTRY(607,  80),
-	ENTRY(616,  85),
-	ENTRY(624,  90),
-	ENTRY(633,  95),
-	ENTRY(642, 100),
-	ENTRY(650, 105),
-	ENTRY(659, 110),
-	ENTRY(668, 115),
-	ENTRY(677, 120),
-	ENTRY(685, 125),
-	ENTRY(TSADC_DATA_MAX, 125),
-#undef ENTRY
-};
+} rk_data_array;
+
+struct rk_tsadc_softc;
+typedef struct rk_data_table {
+	const rk_data_array	*rdt_array;
+	size_t			 rdt_size;
+	void			(*rdt_init)(struct rk_tsadc_softc *, int, int);
+	bool			 rdt_decr;  /* lower values -> higher temp */
+	unsigned		 rdt_min, rdt_max;
+	unsigned		 rdt_auto_period;
+} rk_data_table;
 
 /* Per-sensor data */
 struct rk_tsadc_sensor {
@@ -236,6 +207,8 @@ struct rk_tsadc_softc {
 	struct clk		*sc_clockapb;
 	struct fdtbus_reset	*sc_reset;
 	struct syscon		*sc_syscon;
+
+	const rk_data_table	*sc_rdt;
 };
 
 static int rk_tsadc_match(device_t, cfdata_t, void *);
@@ -245,8 +218,10 @@ static int rk_tsadc_init_clocks(struct r
 static void rk_tsadc_init_counts(struct rk_tsadc_softc *);
 static void rk_tsadc_tshut_set(struct rk_tsadc_softc *s);
 static void rk_tsadc_init_tshut(struct rk_tsadc_softc *, int, int);
-static void rk_tsadc_init_grf(struct rk_tsadc_softc *);
+static void rk_tsadc_init_rk3328(struct rk_tsadc_softc *, int, int);
+static void rk_tsadc_init_rk3399(struct rk_tsadc_softc *, int, int);
 static void rk_tsadc_init_enable(struct rk_tsadc_softc *);
+static void rk_tsadc_init(struct rk_tsadc_softc *, int, int);
 static void rk_tsadc_refresh(struct sysmon_envsys *, envsys_data_t *);
 static void rk_tsadc_get_limits(struct sysmon_envsys *, envsys_data_t *,
 sysmon_envsys_lim_t *, uint32_t *);
@@ -289,8 +264,122 @@ static const struct rk_tsadc_sensor rk_t
 	},
 };
 
-static 

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

2019-05-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue May 14 07:45:03 UTC 2019

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

Log Message:
mostly port to rk3328.

- add rk3328 data<->temp table, and adjust code to use this vs rk3399
  table for rk3328.  add support for decrementing data.
- adjust auto period times for rk3328 vs rk3399
- add min/max data values, if data is outside these values mark the
  sensor invalid.
- move init code into cpu specific sections, add rk3328 support

with a rk3328_cru.c update to add clocks, this attaches and reports
garbage values, so for now it's disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/rockchip/rk_tsadc.c

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