Re: audio2

2019-05-29 Thread Andreas Gustafsson
Valery Ushakov wrote:
> Now, you omit the most critical bit: what would you name the thing? :)
> From "the proper way to do audio scaling" I infer that AUDIO_SCALEDOWN
> (or however that was spelled) should be ok, shouldn't it?

I'm not fussy about the naming, just about the math :)  AUDIO_SCALEDOWN
works for me, but I'm open to alternatives.
-- 
Andreas Gustafsson, g...@gson.org


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

2019-05-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 07:46:09 UTC 2019

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

Log Message:
- Simplify MII structure initialization and reference.
- Use the common path of SIOCGIFMEDIA in sys/net/if_ethersubr.c


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

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

Modified files:

Index: src/sys/arch/mips/cavium/dev/if_cnmac.c
diff -u src/sys/arch/mips/cavium/dev/if_cnmac.c:1.12 src/sys/arch/mips/cavium/dev/if_cnmac.c:1.13
--- src/sys/arch/mips/cavium/dev/if_cnmac.c:1.12	Fri Apr 26 06:33:33 2019
+++ src/sys/arch/mips/cavium/dev/if_cnmac.c	Wed May 29 07:46:08 2019
@@ -1,8 +1,8 @@
-/*	$NetBSD: if_cnmac.c,v 1.12 2019/04/26 06:33:33 msaitoh Exp $	*/
+/*	$NetBSD: if_cnmac.c,v 1.13 2019/05/29 07:46:08 msaitoh Exp $	*/
 
 #include 
 #if 0
-__KERNEL_RCSID(0, "$NetBSD: if_cnmac.c,v 1.12 2019/04/26 06:33:33 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cnmac.c,v 1.13 2019/05/29 07:46:08 msaitoh Exp $");
 #endif
 
 #include "opt_octeon.h"
@@ -536,33 +536,36 @@ static int
 octeon_eth_mediainit(struct octeon_eth_softc *sc)
 {
 	struct ifnet *ifp = &sc->sc_ethercom.ec_if;
+	struct mii_data *mii = &sc->sc_mii;
 	prop_object_t phy;
 
-	sc->sc_mii.mii_ifp = ifp;
-	sc->sc_mii.mii_readreg = octeon_eth_mii_readreg;
-	sc->sc_mii.mii_writereg = octeon_eth_mii_writereg;
-	sc->sc_mii.mii_statchg = octeon_eth_mii_statchg;
-	ifmedia_init(&sc->sc_mii.mii_media, 0, octeon_eth_mediachange,
+	mii->mii_ifp = ifp;
+	mii->mii_readreg = octeon_eth_mii_readreg;
+	mii->mii_writereg = octeon_eth_mii_writereg;
+	mii->mii_statchg = octeon_eth_mii_statchg;
+	sc->sc_ethercom.ec_mii = mii;
+
+	/* Initialize ifmedia structures. */
+	ifmedia_init(&mii->mii_media, 0, octeon_eth_mediachange,
 	octeon_eth_mediastatus);
 
 	phy = prop_dictionary_get(device_properties(sc->sc_dev), "phy-addr");
 	KASSERT(phy != NULL);
 
-	mii_attach(sc->sc_dev, &sc->sc_mii,
-	0x, prop_number_integer_value(phy),
+	mii_attach(sc->sc_dev, mii, 0x, prop_number_integer_value(phy),
 	MII_OFFSET_ANY, MIIF_DOPAUSE);
 
 	/* XXX XXX XXX */
-	if (LIST_FIRST(&sc->sc_mii.mii_phys) != NULL) {
+	if (LIST_FIRST(&mii->mii_phys) != NULL) {
 		/* XXX XXX XXX */
-		ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER | IFM_AUTO);
+		ifmedia_set(&mii->mii_media, IFM_ETHER | IFM_AUTO);
 		/* XXX XXX XXX */
 	} else {
 		/* XXX XXX XXX */
-		ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER | IFM_NONE,
+		ifmedia_add(&mii->mii_media, IFM_ETHER | IFM_NONE,
 		MII_MEDIA_NONE, NULL);
 		/* XXX XXX XXX */
-		ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER | IFM_NONE);
+		ifmedia_set(&mii->mii_media, IFM_ETHER | IFM_NONE);
 		/* XXX XXX XXX */
 	}
 	/* XXX XXX XXX */
@@ -827,9 +830,6 @@ octeon_eth_ioctl(struct ifnet *ifp, u_lo
 			sc->sc_gmx_port->sc_port_flowflags =
 ifr->ifr_media & IFM_ETH_FMASK;
 		}
-		/* FALLTHROUGH */
-	case SIOCGIFMEDIA:
-		/* XXX: Flow contorol */
 		error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd);
 		break;
 	default:



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

2019-05-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 07:46:09 UTC 2019

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

Log Message:
- Simplify MII structure initialization and reference.
- Use the common path of SIOCGIFMEDIA in sys/net/if_ethersubr.c


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mips/cavium/dev/if_cnmac.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/usb

2019-05-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed May 29 08:23:54 UTC 2019

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

Log Message:
mutexes are destroyed unconditionally in detach, so also init them
unconditionally.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/usb/if_mue.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_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.48 src/sys/dev/usb/if_mue.c:1.49
--- src/sys/dev/usb/if_mue.c:1.48	Tue May 28 07:41:50 2019
+++ src/sys/dev/usb/if_mue.c	Wed May 29 08:23:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.48 2019/05/28 07:41:50 msaitoh Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.49 2019/05/29 08:23:54 mlelstv Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.48 2019/05/28 07:41:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.49 2019/05/29 08:23:54 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -923,6 +923,9 @@ mue_attach(device_t parent, device_t sel
 	aprint_normal_dev(self, "%s\n", devinfop);
 	usbd_devinfo_free(devinfop);
 
+	mutex_init(&sc->mue_mii_lock, MUTEX_DEFAULT, IPL_NONE);
+	mutex_init(&sc->mue_usb_lock, MUTEX_DEFAULT, IPL_NET);
+
 #define MUE_CONFIG_NO	1
 	err = usbd_set_config_no(dev, MUE_CONFIG_NO, 1);
 	if (err) {
@@ -958,7 +961,6 @@ mue_attach(device_t parent, device_t sel
 		sc->mue_tx_list_cnt = MUE_TX_LIST_CNT;
 	}
 	sc->mue_txbufsz = MUE_TX_BUFSIZE;
-	mutex_init(&sc->mue_usb_lock, MUTEX_DEFAULT, IPL_NET);
 
 	/* Find endpoints. */
 	id = usbd_get_interface_descriptor(sc->mue_iface);
@@ -1062,8 +1064,6 @@ mue_attach(device_t parent, device_t sel
 
 	splx(s);
 
-	mutex_init(&sc->mue_mii_lock, MUTEX_DEFAULT, IPL_NONE);
-
 	usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->mue_udev, sc->mue_dev);
 }
 



CVS commit: src/sys/dev/usb

2019-05-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed May 29 08:23:54 UTC 2019

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

Log Message:
mutexes are destroyed unconditionally in detach, so also init them
unconditionally.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/usb/if_mue.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/usb

2019-05-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed May 29 09:04:01 UTC 2019

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

Log Message:
don't use a spin lock, the USB host driver may need to take other locks.
stop watchdog timer early to prevent calling txeof twice.
allow more output after USB error by clearing OACTIVE in error path.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/usb/if_mue.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/usb

2019-05-29 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed May 29 09:04:01 UTC 2019

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

Log Message:
don't use a spin lock, the USB host driver may need to take other locks.
stop watchdog timer early to prevent calling txeof twice.
allow more output after USB error by clearing OACTIVE in error path.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/usb/if_mue.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_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.49 src/sys/dev/usb/if_mue.c:1.50
--- src/sys/dev/usb/if_mue.c:1.49	Wed May 29 08:23:54 2019
+++ src/sys/dev/usb/if_mue.c	Wed May 29 09:04:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.49 2019/05/29 08:23:54 mlelstv Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.50 2019/05/29 09:04:01 mlelstv Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.49 2019/05/29 08:23:54 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.50 2019/05/29 09:04:01 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -924,7 +924,7 @@ mue_attach(device_t parent, device_t sel
 	usbd_devinfo_free(devinfop);
 
 	mutex_init(&sc->mue_mii_lock, MUTEX_DEFAULT, IPL_NONE);
-	mutex_init(&sc->mue_usb_lock, MUTEX_DEFAULT, IPL_NET);
+	mutex_init(&sc->mue_usb_lock, MUTEX_DEFAULT, IPL_SOFTUSB);
 
 #define MUE_CONFIG_NO	1
 	err = usbd_set_config_no(dev, MUE_CONFIG_NO, 1);
@@ -1632,6 +1632,7 @@ mue_txeof(struct usbd_xfer *xfer, void *
 	s = splnet();
 	KASSERT(cd->mue_tx_cnt > 0);
 	cd->mue_tx_cnt--;
+	ifp->if_timer = 0;
 	if (__predict_false(status != USBD_NORMAL_COMPLETION)) {
 		if (status == USBD_NOT_STARTED || status == USBD_CANCELLED) {
 			splx(s);
@@ -1644,10 +1645,10 @@ mue_txeof(struct usbd_xfer *xfer, void *
 			usbd_clear_endpoint_stall_async(
 			sc->mue_ep[MUE_ENDPT_TX]);
 		splx(s);
+		ifp->if_flags &= ~IFF_OACTIVE;
 		return;
 	}
 
-	ifp->if_timer = 0;
 	ifp->if_flags &= ~IFF_OACTIVE;
 
 	if (!IFQ_IS_EMPTY(&ifp->if_snd))



CVS commit: src/sys

2019-05-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 10:07:30 UTC 2019

Modified Files:
src/sys/arch/amiga/dev: if_es.c
src/sys/arch/arm/broadcom: bcm53xx_eth.c
src/sys/arch/arm/gemini: if_gpn.c
src/sys/arch/emips/ebus: if_le_ebus.c
src/sys/arch/macppc/dev: am79c950.c
src/sys/arch/next68k/dev: mb8795.c
src/sys/arch/sun2/dev: if_ec.c
src/sys/arch/usermode/dev: if_veth.c
src/sys/arch/x86/pci: if_vmx.c
src/sys/dev/hyperv: if_hvn.c
src/sys/dev/ic: cs89x0.c dm9000.c dp8390.c i82586.c i82596.c lance.c
lemac.c mb86950.c mb86960.c pdq_ifsubr.c tropic.c
src/sys/dev/isa: if_iy.c
src/sys/dev/pci: if_bge.c if_de.c if_dge.c if_ena.c if_kse.c if_ti.c
if_txp.c if_xge.c
src/sys/dev/pci/ixgbe: ixgbe.c ixv.c
src/sys/dev/sbus: be.c qe.c
src/sys/net: if_ether.h if_ethersubr.c if_tap.c

Log Message:
Even if we don't use MII(4), use the common path of SIOC[GS]IFMEDIA in
sys/net/if_ethersubr.c if we can.
 - Add ec_ifmedia into struct ethercom.
 - ec_mii in struct ethercom is kept and used as it is. It might be used in
   future. Note that some Ethernet drivers which _DOESN'T_ use mii(4) use
   ec_mii for keeping the if_media. Those should be changed in future.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/amiga/dev/if_es.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/broadcom/bcm53xx_eth.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/gemini/if_gpn.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/emips/ebus/if_le_ebus.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/macppc/dev/am79c950.c
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/next68k/dev/mb8795.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/sun2/dev/if_ec.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/usermode/dev/if_veth.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/pci/if_vmx.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hyperv/if_hvn.c
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/ic/cs89x0.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ic/dm9000.c
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/ic/dp8390.c
cvs rdiff -u -r1.84 -r1.85 src/sys/dev/ic/i82586.c
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/ic/i82596.c
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/ic/lance.c
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/ic/lemac.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/ic/mb86950.c
cvs rdiff -u -r1.92 -r1.93 src/sys/dev/ic/mb86960.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/ic/pdq_ifsubr.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/tropic.c
cvs rdiff -u -r1.108 -r1.109 src/sys/dev/isa/if_iy.c
cvs rdiff -u -r1.333 -r1.334 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.162 -r1.163 src/sys/dev/pci/if_de.c
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/pci/if_dge.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/if_ena.c
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/pci/if_kse.c
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/pci/if_ti.c
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/pci/if_txp.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/if_xge.c
cvs rdiff -u -r1.186 -r1.187 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.114 -r1.115 src/sys/dev/pci/ixgbe/ixv.c
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/sbus/be.c
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/sbus/qe.c
cvs rdiff -u -r1.78 -r1.79 src/sys/net/if_ether.h
cvs rdiff -u -r1.274 -r1.275 src/sys/net/if_ethersubr.c
cvs rdiff -u -r1.112 -r1.113 src/sys/net/if_tap.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-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 10:07:30 UTC 2019

Modified Files:
src/sys/arch/amiga/dev: if_es.c
src/sys/arch/arm/broadcom: bcm53xx_eth.c
src/sys/arch/arm/gemini: if_gpn.c
src/sys/arch/emips/ebus: if_le_ebus.c
src/sys/arch/macppc/dev: am79c950.c
src/sys/arch/next68k/dev: mb8795.c
src/sys/arch/sun2/dev: if_ec.c
src/sys/arch/usermode/dev: if_veth.c
src/sys/arch/x86/pci: if_vmx.c
src/sys/dev/hyperv: if_hvn.c
src/sys/dev/ic: cs89x0.c dm9000.c dp8390.c i82586.c i82596.c lance.c
lemac.c mb86950.c mb86960.c pdq_ifsubr.c tropic.c
src/sys/dev/isa: if_iy.c
src/sys/dev/pci: if_bge.c if_de.c if_dge.c if_ena.c if_kse.c if_ti.c
if_txp.c if_xge.c
src/sys/dev/pci/ixgbe: ixgbe.c ixv.c
src/sys/dev/sbus: be.c qe.c
src/sys/net: if_ether.h if_ethersubr.c if_tap.c

Log Message:
Even if we don't use MII(4), use the common path of SIOC[GS]IFMEDIA in
sys/net/if_ethersubr.c if we can.
 - Add ec_ifmedia into struct ethercom.
 - ec_mii in struct ethercom is kept and used as it is. It might be used in
   future. Note that some Ethernet drivers which _DOESN'T_ use mii(4) use
   ec_mii for keeping the if_media. Those should be changed in future.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/amiga/dev/if_es.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/broadcom/bcm53xx_eth.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/gemini/if_gpn.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/emips/ebus/if_le_ebus.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/macppc/dev/am79c950.c
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/next68k/dev/mb8795.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/sun2/dev/if_ec.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/usermode/dev/if_veth.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/pci/if_vmx.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hyperv/if_hvn.c
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/ic/cs89x0.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ic/dm9000.c
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/ic/dp8390.c
cvs rdiff -u -r1.84 -r1.85 src/sys/dev/ic/i82586.c
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/ic/i82596.c
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/ic/lance.c
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/ic/lemac.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/ic/mb86950.c
cvs rdiff -u -r1.92 -r1.93 src/sys/dev/ic/mb86960.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/ic/pdq_ifsubr.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/tropic.c
cvs rdiff -u -r1.108 -r1.109 src/sys/dev/isa/if_iy.c
cvs rdiff -u -r1.333 -r1.334 src/sys/dev/pci/if_bge.c
cvs rdiff -u -r1.162 -r1.163 src/sys/dev/pci/if_de.c
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/pci/if_dge.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/if_ena.c
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/pci/if_kse.c
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/pci/if_ti.c
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/pci/if_txp.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/if_xge.c
cvs rdiff -u -r1.186 -r1.187 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.114 -r1.115 src/sys/dev/pci/ixgbe/ixv.c
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/sbus/be.c
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/sbus/qe.c
cvs rdiff -u -r1.78 -r1.79 src/sys/net/if_ether.h
cvs rdiff -u -r1.274 -r1.275 src/sys/net/if_ethersubr.c
cvs rdiff -u -r1.112 -r1.113 src/sys/net/if_tap.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/amiga/dev/if_es.c
diff -u src/sys/arch/amiga/dev/if_es.c:1.63 src/sys/arch/amiga/dev/if_es.c:1.64
--- src/sys/arch/amiga/dev/if_es.c:1.63	Wed May 29 06:21:56 2019
+++ src/sys/arch/amiga/dev/if_es.c	Wed May 29 10:07:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_es.c,v 1.63 2019/05/29 06:21:56 msaitoh Exp $ */
+/*	$NetBSD: if_es.c,v 1.64 2019/05/29 10:07:28 msaitoh Exp $ */
 
 /*
  * Copyright (c) 1995 Michael L. Hitch
@@ -33,7 +33,7 @@
 #include "opt_ns.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.63 2019/05/29 06:21:56 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.64 2019/05/29 10:07:28 msaitoh Exp $");
 
 
 #include 
@@ -176,6 +176,8 @@ esattach(device_t parent, device_t self,
 	ifp->if_watchdog = eswatchdog;
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 
+	/* Setup ifmedia interface */
+	sc->sc_ethercom.ec_ifmedia = &sc->sc_media;
 	ifmedia_init(&sc->sc_media, 0, esmediachange, esmediastatus);
 	ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_MANUAL, 0, NULL);
 	ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_MANUAL);
@@ -943,7 +945,6 @@ esioctl(struct ifnet *ifp, u_long cmd, v
 {
 	struct es_softc *sc = ifp->if_softc;
 	register struct ifaddr *ifa = (struct ifaddr *)data;
-	struct ifreq *ifr = (struct ifreq *)data;
 	int s, error = 0;
 
 	s = splnet();
@@ -1018,11 +1019,6 @@ esioctl(struct ifnet *ifp, u_long cmd, v
 		}
 		break;
 
-	case SIOCGIFMEDIA:
-	case SIOCSIFMEDIA:
-		error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, c

CVS commit: src/sys/sys

2019-05-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 10:09:01 UTC 2019

Modified Files:
src/sys/sys: param.h

Log Message:
Addition of ec_ifmedia.

Welcome to 8.99.42.


To generate a diff of this commit:
cvs rdiff -u -r1.589 -r1.590 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: src/sys/sys

2019-05-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 10:09:01 UTC 2019

Modified Files:
src/sys/sys: param.h

Log Message:
Addition of ec_ifmedia.

Welcome to 8.99.42.


To generate a diff of this commit:
cvs rdiff -u -r1.589 -r1.590 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/sys/sys/param.h
diff -u src/sys/sys/param.h:1.589 src/sys/sys/param.h:1.590
--- src/sys/sys/param.h:1.589	Fri May 17 07:38:48 2019
+++ src/sys/sys/param.h	Wed May 29 10:09:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.589 2019/05/17 07:38:48 msaitoh Exp $	*/
+/*	$NetBSD: param.h,v 1.590 2019/05/29 10:09:01 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	899004100	/* NetBSD 8.99.41 */
+#define	__NetBSD_Version__	899004200	/* NetBSD 8.99.42 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/usr.bin/tr

2019-05-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Wed May 29 11:27:34 UTC 2019

Modified Files:
src/usr.bin/tr: tr.1

Log Message:
tr.1: add a "see also" xref to ctype(3) (to align with an inline
reference), improve punctuation, etc.

XXX lines 177-191 have been commented out since they were imported in
r. 1.2 back in 1993, they should probably be re-examined, and revised
or removed.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/tr/tr.1

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



CVS commit: src/usr.bin/tr

2019-05-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Wed May 29 11:27:34 UTC 2019

Modified Files:
src/usr.bin/tr: tr.1

Log Message:
tr.1: add a "see also" xref to ctype(3) (to align with an inline
reference), improve punctuation, etc.

XXX lines 177-191 have been commented out since they were imported in
r. 1.2 back in 1993, they should probably be re-examined, and revised
or removed.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/tr/tr.1

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

Modified files:

Index: src/usr.bin/tr/tr.1
diff -u src/usr.bin/tr/tr.1:1.22 src/usr.bin/tr/tr.1:1.23
--- src/usr.bin/tr/tr.1:1.22	Mon Jul  3 21:34:22 2017
+++ src/usr.bin/tr/tr.1	Wed May 29 11:27:34 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tr.1,v 1.22 2017/07/03 21:34:22 wiz Exp $
+.\"	$NetBSD: tr.1,v 1.23 2019/05/29 11:27:34 gutteridge Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" @(#)tr.1	8.1 (Berkeley) 6/6/93
 .\"
-.Dd May 29, 2013
+.Dd May 29, 2019
 .Dt TR 1
 .Os
 .Sh NAME
@@ -90,11 +90,11 @@ This occurs after all deletion and trans
 In the first synopsis form, the characters in
 .Ar string1
 are translated into the characters in
-.Ar string2
+.Ar string2 ,
 where the first character in
 .Ar string1
 is translated into the first character in
-.Ar string2
+.Ar string2 ,
 and so on.
 If
 .Ar string1
@@ -134,7 +134,7 @@ to specify sets of characters:
 Any character not described by one of the following conventions
 represents itself.
 .It \eoctal
-A backslash followed by 1, 2 or 3 octal digits represents a character
+A backslash followed by 1, 2, or 3 octal digits represents a character
 with that encoded value.
 To follow an octal sequence with a digit as a character, left zero-pad
 the octal sequence to the full 3 octal digits.
@@ -306,7 +306,7 @@ will have to be rewritten as
 The
 .Nm
 utility has historically not permitted the manipulation of NUL bytes in
-its input and, additionally, stripped NUL's from its input stream.
+its input and, additionally, stripped NULs from its input stream.
 This implementation has removed this behavior as a bug.
 .Pp
 The
@@ -320,7 +320,8 @@ options were ignored unless two strings 
 This implementation will not permit illegal syntax.
 .Sh SEE ALSO
 .Xr dd 1 ,
-.Xr sed 1
+.Xr sed 1 ,
+.Xr ctype 3
 .Sh STANDARDS
 The
 .Nm



CVS commit: src/sys/dev/pci

2019-05-29 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed May 29 13:12:59 UTC 2019

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

Log Message:
Fix build error on i386.  These were only needed during development.
Reported by msaitoh@.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/pci/emuxki.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-29 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Wed May 29 13:12:59 UTC 2019

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

Log Message:
Fix build error on i386.  These were only needed during development.
Reported by msaitoh@.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/pci/emuxki.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/emuxki.c
diff -u src/sys/dev/pci/emuxki.c:1.68 src/sys/dev/pci/emuxki.c:1.69
--- src/sys/dev/pci/emuxki.c:1.68	Wed May  8 13:40:18 2019
+++ src/sys/dev/pci/emuxki.c	Wed May 29 13:12:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: emuxki.c,v 1.68 2019/05/08 13:40:18 isaki Exp $	*/
+/*	$NetBSD: emuxki.c,v 1.69 2019/05/29 13:12:59 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.68 2019/05/08 13:40:18 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.69 2019/05/29 13:12:59 isaki Exp $");
 
 #include 
 #include 
@@ -337,9 +337,6 @@ dmamem_alloc(struct emuxki_softc *sc, si
 		goto destroy;
 	}
 
-	DPRINTF("map ds=%p\n", (char*)mem->map->dm_segs[0].ds_addr);
-	DPRINTF("segs ds=%p\n", (char*)mem->segs[0].ds_addr);
-
 	return mem;
 
 destroy:



CVS commit: src/external/mit/xorg/lib/libxcb

2019-05-29 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed May 29 13:15:53 UTC 2019

Modified Files:
src/external/mit/xorg/lib/libxcb: xcb.mk

Log Message:
Pick up xcb pkgconfig version automagically from the configure script
PACKAGE_VERSION.

We have failed to update it for netbsd-8 and netbsd-current, resulting
in fallout in pkgsrc, reported by Yasushi Oshima in PR xsrc/54249.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/lib/libxcb/xcb.mk

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

Modified files:

Index: src/external/mit/xorg/lib/libxcb/xcb.mk
diff -u src/external/mit/xorg/lib/libxcb/xcb.mk:1.4 src/external/mit/xorg/lib/libxcb/xcb.mk:1.5
--- src/external/mit/xorg/lib/libxcb/xcb.mk:1.4	Tue Feb  3 21:31:31 2015
+++ src/external/mit/xorg/lib/libxcb/xcb.mk	Wed May 29 13:15:53 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: xcb.mk,v 1.4 2015/02/03 21:31:31 jmcneill Exp $
+#	$NetBSD: xcb.mk,v 1.5 2019/05/29 13:15:53 maya Exp $
 
 # define XCBEXT to something before including this
 
@@ -17,8 +17,8 @@ LIBDPLIBS=\
 SHLIB_MAJOR?=	0
 SHLIB_MINOR?=	1
 
-PKGCONFIG=	xcb-${XCBEXT}
-PKGCONFIG_VERSION.${PKGCONFIG}= 1.10
+PKGCONFIG=		xcb-${XCBEXT}
+PKGDIST.xcb-${XCBEXT}=	${X11SRCDIR.xcb}
 
 .include 
 .include 



CVS commit: src/external/mit/xorg/lib/libxcb

2019-05-29 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Wed May 29 13:15:53 UTC 2019

Modified Files:
src/external/mit/xorg/lib/libxcb: xcb.mk

Log Message:
Pick up xcb pkgconfig version automagically from the configure script
PACKAGE_VERSION.

We have failed to update it for netbsd-8 and netbsd-current, resulting
in fallout in pkgsrc, reported by Yasushi Oshima in PR xsrc/54249.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/lib/libxcb/xcb.mk

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/broadcom

2019-05-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 13:25:54 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: bcm53xx_eth.c

Log Message:
 Remove unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arm/broadcom/bcm53xx_eth.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/broadcom

2019-05-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 13:25:54 UTC 2019

Modified Files:
src/sys/arch/arm/broadcom: bcm53xx_eth.c

Log Message:
 Remove unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/arm/broadcom/bcm53xx_eth.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/broadcom/bcm53xx_eth.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.37 src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.38
--- src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.37	Wed May 29 10:07:28 2019
+++ src/sys/arch/arm/broadcom/bcm53xx_eth.c	Wed May 29 13:25:54 2019
@@ -35,7 +35,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.37 2019/05/29 10:07:28 msaitoh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.38 2019/05/29 13:25:54 msaitoh Exp $");
 
 #include 
 #include 
@@ -686,7 +686,6 @@ bcmeth_ifwatchdog(struct ifnet *ifp)
 static int
 bcmeth_ifioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
-	struct bcmeth_softc *sc	 = ifp->if_softc;
 	const int s = splnet();
 	int error;
 



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

2019-05-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 14:03:37 UTC 2019

Modified Files:
src/sys/arch/mips/ralink: ralink_eth.c

Log Message:
 Fix compile error.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/ralink/ralink_eth.c

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



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

2019-05-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 14:03:37 UTC 2019

Modified Files:
src/sys/arch/mips/ralink: ralink_eth.c

Log Message:
 Fix compile error.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/ralink/ralink_eth.c

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

Modified files:

Index: src/sys/arch/mips/ralink/ralink_eth.c
diff -u src/sys/arch/mips/ralink/ralink_eth.c:1.17 src/sys/arch/mips/ralink/ralink_eth.c:1.18
--- src/sys/arch/mips/ralink/ralink_eth.c:1.17	Wed May 29 06:17:28 2019
+++ src/sys/arch/mips/ralink/ralink_eth.c	Wed May 29 14:03:36 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ralink_eth.c,v 1.17 2019/05/29 06:17:28 msaitoh Exp $	*/
+/*	$NetBSD: ralink_eth.c,v 1.18 2019/05/29 14:03:36 msaitoh Exp $	*/
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
 /* ralink_eth.c -- Ralink Ethernet Driver */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.17 2019/05/29 06:17:28 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.18 2019/05/29 14:03:36 msaitoh Exp $");
 
 #include 
 #include 
@@ -484,7 +484,7 @@ ralink_eth_attach(device_t parent, devic
 	mii->mii_writereg = ralink_eth_mii_write;
 	mii->mii_statchg = ralink_eth_mii_statchg;
 	sc->sc_ethercom.ec_mii = mii;
-	ifmedia_init(mii->mii_media, 0, ether_mediachange, ether_mediastatus);
+	ifmedia_init(&mii->mii_media, 0, ether_mediachange, ether_mediastatus);
 	mii_attach(sc->sc_dev, mii, ~0, MII_PHY_ANY, MII_OFFSET_ANY,
 	MIIF_FORCEANEG | MIIF_DOPAUSE | MIIF_NOISOLATE);
 



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

2019-05-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 14:28:37 UTC 2019

Modified Files:
src/sys/arch/i386/i386: trap.c

Log Message:
 Use PRIxREGISTER suggested by Kamil.


To generate a diff of this commit:
cvs rdiff -u -r1.300 -r1.301 src/sys/arch/i386/i386/trap.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/i386/i386

2019-05-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May 29 14:28:37 UTC 2019

Modified Files:
src/sys/arch/i386/i386: trap.c

Log Message:
 Use PRIxREGISTER suggested by Kamil.


To generate a diff of this commit:
cvs rdiff -u -r1.300 -r1.301 src/sys/arch/i386/i386/trap.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/i386/i386/trap.c
diff -u src/sys/arch/i386/i386/trap.c:1.300 src/sys/arch/i386/i386/trap.c:1.301
--- src/sys/arch/i386/i386/trap.c:1.300	Sat Apr  6 03:06:25 2019
+++ src/sys/arch/i386/i386/trap.c	Wed May 29 14:28:37 2019
@@ -1,5 +1,5 @@
 
-/*	$NetBSD: trap.c,v 1.300 2019/04/06 03:06:25 thorpej Exp $	*/
+/*	$NetBSD: trap.c,v 1.301 2019/05/29 14:28:37 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.300 2019/04/06 03:06:25 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.301 2019/05/29 14:28:37 msaitoh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -467,8 +467,9 @@ kernelfault:
 	case T_STKFLT|T_USER:
 	case T_ALIGNFLT|T_USER:
 #ifdef TRAP_SIGDEBUG
-		printf("pid %d.%d (%s): BUS/SEGV (%#x) at eip %#x addr %#lx\n",
-		p->p_pid, l->l_lid, p->p_comm, type, frame->tf_eip, rcr2());
+		printf("pid %d.%d (%s): BUS/SEGV (%#x) at eip %#x addr %#"
+		PRIxREGISTER "\n", p->p_pid, l->l_lid, p->p_comm,
+		type, frame->tf_eip, rcr2());
 		frame_dump(frame, pcb);
 #endif
 		KSI_INIT_TRAP(&ksi);
@@ -508,8 +509,9 @@ kernelfault:
 	case T_PRIVINFLT|T_USER:	/* privileged instruction fault */
 	case T_FPOPFLT|T_USER:		/* coprocessor operand fault */
 #ifdef TRAP_SIGDEBUG
-		printf("pid %d.%d (%s): ILL at eip %#x addr %#lx\n",
-		p->p_pid, l->l_lid, p->p_comm, frame->tf_eip, rcr2());
+		printf("pid %d.%d (%s): ILL at eip %#x addr %#"
+		PRIxREGISTER "\n", p->p_pid, l->l_lid, p->p_comm,
+		frame->tf_eip, rcr2());
 		frame_dump(frame, pcb);
 #endif
 		KSI_INIT_TRAP(&ksi);



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

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:43:27 UTC 2019

Modified Files:
src/sys/arch/x86/include [netbsd-8]: specialreg.h
src/sys/arch/x86/x86 [netbsd-8]: procfs_machdep.c

Log Message:
Pullup the following, requested by msaitoh in ticket #1270:

sys/arch/x86/include/specialreg.h   1.143, 1.145 via patch
sys/arch/x86/x86/procfs_machdep.c   1.30

Add TSX_FORCE_ABORT related definitions.
Add cpuid7 edx bit 10 "MD_CLEAR".


To generate a diff of this commit:
cvs rdiff -u -r1.98.2.12 -r1.98.2.13 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.15.2.8 -r1.15.2.9 src/sys/arch/x86/x86/procfs_machdep.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/x86

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:43:27 UTC 2019

Modified Files:
src/sys/arch/x86/include [netbsd-8]: specialreg.h
src/sys/arch/x86/x86 [netbsd-8]: procfs_machdep.c

Log Message:
Pullup the following, requested by msaitoh in ticket #1270:

sys/arch/x86/include/specialreg.h   1.143, 1.145 via patch
sys/arch/x86/x86/procfs_machdep.c   1.30

Add TSX_FORCE_ABORT related definitions.
Add cpuid7 edx bit 10 "MD_CLEAR".


To generate a diff of this commit:
cvs rdiff -u -r1.98.2.12 -r1.98.2.13 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.15.2.8 -r1.15.2.9 src/sys/arch/x86/x86/procfs_machdep.c

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

Modified files:

Index: src/sys/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.98.2.12 src/sys/arch/x86/include/specialreg.h:1.98.2.13
--- src/sys/arch/x86/include/specialreg.h:1.98.2.12	Tue May 14 17:12:19 2019
+++ src/sys/arch/x86/include/specialreg.h	Wed May 29 15:43:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.98.2.12 2019/05/14 17:12:19 martin Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.98.2.13 2019/05/29 15:43:26 martin Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -427,6 +427,7 @@
 #define CPUID_SEF_AVX512_4VNNIW	__BIT(2)
 #define CPUID_SEF_AVX512_4FMAPS	__BIT(3)
 #define CPUID_SEF_MD_CLEAR	__BIT(10)
+#define CPUID_SEF_TSX_FORCE_ABORT __BIT(13) /* MSR_TSX_FORCE_ABORT bit 0 */
 #define CPUID_SEF_IBRS		__BIT(26) /* IBRS / IBPB Speculation Control */
 #define CPUID_SEF_STIBP		__BIT(27) /* STIBP Speculation Control */
 #define CPUID_SEF_L1D_FLUSH	__BIT(28) /* IA32_FLUSH_CMD MSR */
@@ -436,7 +437,9 @@
 
 #define CPUID_SEF_FLAGS2	"\20" \
 "\3" "AVX512_4VNNIW" "\4" "AVX512_4FMAPS" \
-	"\33" "IBRS"	"\34" "STIBP"	\
+"\13" "MD_CLEAR"			\
+			"\16" "TSX_FORCE_ABORT"\
+	"\33" "IBRS"	"\34" "STIBP"	\
 	"\35" "L1D_FLUSH" "\36" "ARCH_CAP" "\37CORE_CAP"	"\40" "SSBD"
 
 /*
@@ -747,8 +750,9 @@
 #define 	IA32_ARCH_SKIP_L1DFL_VMENTRY 0x08
 #define 	IA32_ARCH_SSB_NO	0x10
 #define 	IA32_ARCH_MDS_NO	0x20
-#define MSR_IA32_FLUSH_CMD 0x10b
+#define MSR_IA32_FLUSH_CMD	0x10b
 #define 	IA32_FLUSH_CMD_L1D_FLUSH 0x01
+#define MSR_TSX_FORCE_ABORT	0x10f
 #define MSR_BBL_CR_ADDR		0x116	/* PII+ only */
 #define MSR_BBL_CR_DECC		0x118	/* PII+ only */
 #define MSR_BBL_CR_CTL		0x119	/* PII+ only */

Index: src/sys/arch/x86/x86/procfs_machdep.c
diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.15.2.8 src/sys/arch/x86/x86/procfs_machdep.c:1.15.2.9
--- src/sys/arch/x86/x86/procfs_machdep.c:1.15.2.8	Thu Mar  7 17:01:18 2019
+++ src/sys/arch/x86/x86/procfs_machdep.c	Wed May 29 15:43:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.15.2.8 2019/03/07 17:01:18 martin Exp $ */
+/*	$NetBSD: procfs_machdep.c,v 1.15.2.9 2019/05/29 15:43:26 martin Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.15.2.8 2019/03/07 17:01:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.15.2.9 2019/05/29 15:43:26 martin Exp $");
 
 #include 
 #include 
@@ -188,7 +188,7 @@ static const char * const x86_features[]
 
 	{ /* (18) Intel 0x0007 edx */
 	NULL, NULL, "avx512_4vnniw", "avx512_4fmaps", NULL, NULL, NULL, NULL,
-	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+	NULL, NULL, "md_clear", NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, "pconfig", NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL,
 	"flush_l1d", "arch_capabilities", NULL, "ssbd"},



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

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:47:06 UTC 2019

Modified Files:
src/sys/netinet [netbsd-8]: ip_encap.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1271):

sys/netinet/ip_encap.c: revision 1.71

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.65.2.3 -r1.65.2.4 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.65.2.3 src/sys/netinet/ip_encap.c:1.65.2.4
--- src/sys/netinet/ip_encap.c:1.65.2.3	Fri Jul 13 14:26:47 2018
+++ src/sys/netinet/ip_encap.c	Wed May 29 15:47:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_encap.c,v 1.65.2.3 2018/07/13 14:26:47 martin Exp $	*/
+/*	$NetBSD: ip_encap.c,v 1.65.2.4 2019/05/29 15:47:05 martin 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.65.2.3 2018/07/13 14:26:47 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.65.2.4 2019/05/29 15:47:05 martin 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: [netbsd-8] src/sys/netinet

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:47:06 UTC 2019

Modified Files:
src/sys/netinet [netbsd-8]: ip_encap.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1271):

sys/netinet/ip_encap.c: revision 1.71

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.65.2.3 -r1.65.2.4 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: [netbsd-8] src/sys/ufs/ffs

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:51:40 UTC 2019

Modified Files:
src/sys/ufs/ffs [netbsd-8]: ffs_alloc.c

Log Message:
Pull up following revision(s) (requested by kardel in ticket #1272):

sys/ufs/ffs/ffs_alloc.c: revision 1.164

PR/53990, PR/52380, PR/52102: UFS2 cylinder group inode allocation botch

Fix rare allocation botch in ffs_nodealloccg().

Conditions:
a) less than
 #_of_initialized_inodes(cg->cg_initediblk)
 - inodes_per_filesystem_block
   are allocated in the cylinder group
b) cg->cg_irotor points to a uninterupted run of
   allocated inodes in the inode bitmap up to the
   end of dynamically initialized inodes
   (cg->cg_initediblk)

In this case the next inode after this run was returned
without initializing the respective inode block. As the
block is not initialized these inodes could trigger panics
on inode consistency due to old (uninitialized) disk data.

In very rare cases data loss could occur when
the uninitialized inode block is initialized via the
normal mechanism.

Further conditions to occur after the above:
c) no panic
d) no (forced) fsck
e) and more than cg->cg_initediblk - inodes_per_filesystem_block
   allocated inodes.

Fix:

Always insure allocation always in initialized inode range
extending the initialized inode range as needed.

Add KASSERTMSG() safeguards.

ok hannken@


To generate a diff of this commit:
cvs rdiff -u -r1.156.6.1 -r1.156.6.2 src/sys/ufs/ffs/ffs_alloc.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/ufs/ffs

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:51:40 UTC 2019

Modified Files:
src/sys/ufs/ffs [netbsd-8]: ffs_alloc.c

Log Message:
Pull up following revision(s) (requested by kardel in ticket #1272):

sys/ufs/ffs/ffs_alloc.c: revision 1.164

PR/53990, PR/52380, PR/52102: UFS2 cylinder group inode allocation botch

Fix rare allocation botch in ffs_nodealloccg().

Conditions:
a) less than
 #_of_initialized_inodes(cg->cg_initediblk)
 - inodes_per_filesystem_block
   are allocated in the cylinder group
b) cg->cg_irotor points to a uninterupted run of
   allocated inodes in the inode bitmap up to the
   end of dynamically initialized inodes
   (cg->cg_initediblk)

In this case the next inode after this run was returned
without initializing the respective inode block. As the
block is not initialized these inodes could trigger panics
on inode consistency due to old (uninitialized) disk data.

In very rare cases data loss could occur when
the uninitialized inode block is initialized via the
normal mechanism.

Further conditions to occur after the above:
c) no panic
d) no (forced) fsck
e) and more than cg->cg_initediblk - inodes_per_filesystem_block
   allocated inodes.

Fix:

Always insure allocation always in initialized inode range
extending the initialized inode range as needed.

Add KASSERTMSG() safeguards.

ok hannken@


To generate a diff of this commit:
cvs rdiff -u -r1.156.6.1 -r1.156.6.2 src/sys/ufs/ffs/ffs_alloc.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/ufs/ffs/ffs_alloc.c
diff -u src/sys/ufs/ffs/ffs_alloc.c:1.156.6.1 src/sys/ufs/ffs/ffs_alloc.c:1.156.6.2
--- src/sys/ufs/ffs/ffs_alloc.c:1.156.6.1	Mon Jul 24 06:21:57 2017
+++ src/sys/ufs/ffs/ffs_alloc.c	Wed May 29 15:51:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_alloc.c,v 1.156.6.1 2017/07/24 06:21:57 snj Exp $	*/
+/*	$NetBSD: ffs_alloc.c,v 1.156.6.2 2019/05/29 15:51:40 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.156.6.1 2017/07/24 06:21:57 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.156.6.2 2019/05/29 15:51:40 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1259,7 +1259,7 @@ ffs_nodealloccg(struct inode *ip, int cg
 	struct buf *bp, *ibp;
 	u_int8_t *inosused;
 	int error, start, len, loc, map, i;
-	int32_t initediblk;
+	int32_t initediblk, maxiblk, irotor;
 	daddr_t nalloc;
 	struct ufs2_dinode *dp2;
 	const int needswap = UFS_FSNEEDSWAP(fs);
@@ -1271,7 +1271,13 @@ ffs_nodealloccg(struct inode *ip, int cg
 		return (0);
 	mutex_exit(&ump->um_lock);
 	ibp = NULL;
-	initediblk = -1;
+	if (fs->fs_magic == FS_UFS2_MAGIC) {
+		initediblk = -1;
+	} else {
+		initediblk = fs->fs_ipg;
+	}
+	maxiblk = initediblk;
+
 retry:
 	error = bread(ip->i_devvp, FFS_FSBTODB(fs, cgtod(fs, cg)),
 		(int)fs->fs_cgsize, B_MODIFY, &bp);
@@ -1291,7 +1297,8 @@ retry:
 	 * Check to see if we need to initialize more inodes.
 	 */
 	if (fs->fs_magic == FS_UFS2_MAGIC && ibp == NULL) {
-		initediblk = ufs_rw32(cgp->cg_initediblk, needswap);
+	initediblk = ufs_rw32(cgp->cg_initediblk, needswap);
+		maxiblk = initediblk;
 		nalloc = fs->fs_ipg - ufs_rw32(cgp->cg_cs.cs_nifree, needswap);
 		if (nalloc + FFS_INOPB(fs) > initediblk &&
 		initediblk < ufs_rw32(cgp->cg_niblk, needswap)) {
@@ -1307,6 +1314,9 @@ retry:
 			FFS_NOBLK, fs->fs_bsize, false, &ibp);
 			if (error)
 goto fail;
+
+			maxiblk += FFS_INOPB(fs);
+			
 			goto retry;
 		}
 	}
@@ -1316,14 +1326,22 @@ retry:
 	(fs->fs_old_flags & FS_FLAGS_UPDATED))
 		cgp->cg_time = ufs_rw64(time_second, needswap);
 	inosused = cg_inosused(cgp, needswap);
+	
 	if (ipref) {
 		ipref %= fs->fs_ipg;
-		if (isclr(inosused, ipref))
+		/* safeguard to stay in (to be) allocated range */
+		if (ipref < maxiblk && isclr(inosused, ipref))
 			goto gotit;
 	}
-	start = ufs_rw32(cgp->cg_irotor, needswap) / NBBY;
-	len = howmany(fs->fs_ipg - ufs_rw32(cgp->cg_irotor, needswap),
-		NBBY);
+
+	irotor = ufs_rw32(cgp->cg_irotor, needswap); 
+
+	KASSERTMSG(irotor < initediblk, "%s: allocation botch: cg=%d, irotor %d"
+		   " out of bounds, initediblk=%d",
+		   __func__, cg, irotor, initediblk);
+
+	start = irotor / NBBY;
+	len = howmany(maxiblk - irotor, NBBY);
 	loc = skpc(0xff, len, &inosused[start]);
 	if (loc == 0) {
 		len = start + 1;
@@ -1341,9 +1359,17 @@ retry:
 	if (map == 0) {
 		panic("%s: block not in map: fs=%s", __func__, fs->fs_fsmnt);
 	}
+	
 	ipref = i * NBBY + ffs(map) - 1;
+
 	cgp->cg_irotor = ufs_rw32(ipref, needswap);
+
 gotit:
+	KASSERTMSG(ipref < maxiblk, "%s: allocation botch: cg=%d attempt to "
+		   "allocate inode index %d beyond max allocated index %d"
+		   " of %d inodes/cg",
+		   __func__, cg, (int)ipref, maxiblk, cgp->cg_niblk);
+
 	UFS_WAPBL_REGISTER

CVS commit: [netbsd-7] src/sys/ufs/ffs

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:53:31 UTC 2019

Modified Files:
src/sys/ufs/ffs [netbsd-7]: ffs_alloc.c

Log Message:
Pull up following revision(s) (requested by kardel in ticket #1697):

sys/ufs/ffs/ffs_alloc.c: revision 1.164

PR/53990, PR/52380, PR/52102: UFS2 cylinder group inode allocation botch

Fix rare allocation botch in ffs_nodealloccg().

Conditions:
a) less than
 #_of_initialized_inodes(cg->cg_initediblk)
 - inodes_per_filesystem_block
   are allocated in the cylinder group
b) cg->cg_irotor points to a uninterupted run of
   allocated inodes in the inode bitmap up to the
   end of dynamically initialized inodes
   (cg->cg_initediblk)

In this case the next inode after this run was returned
without initializing the respective inode block. As the
block is not initialized these inodes could trigger panics
on inode consistency due to old (uninitialized) disk data.

In very rare cases data loss could occur when
the uninitialized inode block is initialized via the
normal mechanism.

Further conditions to occur after the above:
c) no panic
d) no (forced) fsck
e) and more than cg->cg_initediblk - inodes_per_filesystem_block
   allocated inodes.

Fix:

Always insure allocation always in initialized inode range
extending the initialized inode range as needed.

Add KASSERTMSG() safeguards.

ok hannken@


To generate a diff of this commit:
cvs rdiff -u -r1.146.2.1 -r1.146.2.2 src/sys/ufs/ffs/ffs_alloc.c

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



CVS commit: [netbsd-7] src/sys/ufs/ffs

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:53:31 UTC 2019

Modified Files:
src/sys/ufs/ffs [netbsd-7]: ffs_alloc.c

Log Message:
Pull up following revision(s) (requested by kardel in ticket #1697):

sys/ufs/ffs/ffs_alloc.c: revision 1.164

PR/53990, PR/52380, PR/52102: UFS2 cylinder group inode allocation botch

Fix rare allocation botch in ffs_nodealloccg().

Conditions:
a) less than
 #_of_initialized_inodes(cg->cg_initediblk)
 - inodes_per_filesystem_block
   are allocated in the cylinder group
b) cg->cg_irotor points to a uninterupted run of
   allocated inodes in the inode bitmap up to the
   end of dynamically initialized inodes
   (cg->cg_initediblk)

In this case the next inode after this run was returned
without initializing the respective inode block. As the
block is not initialized these inodes could trigger panics
on inode consistency due to old (uninitialized) disk data.

In very rare cases data loss could occur when
the uninitialized inode block is initialized via the
normal mechanism.

Further conditions to occur after the above:
c) no panic
d) no (forced) fsck
e) and more than cg->cg_initediblk - inodes_per_filesystem_block
   allocated inodes.

Fix:

Always insure allocation always in initialized inode range
extending the initialized inode range as needed.

Add KASSERTMSG() safeguards.

ok hannken@


To generate a diff of this commit:
cvs rdiff -u -r1.146.2.1 -r1.146.2.2 src/sys/ufs/ffs/ffs_alloc.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/ufs/ffs/ffs_alloc.c
diff -u src/sys/ufs/ffs/ffs_alloc.c:1.146.2.1 src/sys/ufs/ffs/ffs_alloc.c:1.146.2.2
--- src/sys/ufs/ffs/ffs_alloc.c:1.146.2.1	Fri Aug 14 05:29:14 2015
+++ src/sys/ufs/ffs/ffs_alloc.c	Wed May 29 15:53:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_alloc.c,v 1.146.2.1 2015/08/14 05:29:14 msaitoh Exp $	*/
+/*	$NetBSD: ffs_alloc.c,v 1.146.2.2 2019/05/29 15:53:31 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.146.2.1 2015/08/14 05:29:14 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.146.2.2 2019/05/29 15:53:31 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1283,7 +1283,7 @@ ffs_nodealloccg(struct inode *ip, int cg
 	struct buf *bp, *ibp;
 	u_int8_t *inosused;
 	int error, start, len, loc, map, i;
-	int32_t initediblk;
+	int32_t initediblk, maxiblk, irotor;
 	daddr_t nalloc;
 	struct ufs2_dinode *dp2;
 	const int needswap = UFS_FSNEEDSWAP(fs);
@@ -1295,7 +1295,13 @@ ffs_nodealloccg(struct inode *ip, int cg
 		return (0);
 	mutex_exit(&ump->um_lock);
 	ibp = NULL;
-	initediblk = -1;
+	if (fs->fs_magic == FS_UFS2_MAGIC) {
+		initediblk = -1;
+	} else {
+		initediblk = fs->fs_ipg;
+	}
+	maxiblk = initediblk;
+
 retry:
 	error = bread(ip->i_devvp, FFS_FSBTODB(fs, cgtod(fs, cg)),
 		(int)fs->fs_cgsize, NOCRED, B_MODIFY, &bp);
@@ -1315,7 +1321,8 @@ retry:
 	 * Check to see if we need to initialize more inodes.
 	 */
 	if (fs->fs_magic == FS_UFS2_MAGIC && ibp == NULL) {
-		initediblk = ufs_rw32(cgp->cg_initediblk, needswap);
+	initediblk = ufs_rw32(cgp->cg_initediblk, needswap);
+		maxiblk = initediblk;
 		nalloc = fs->fs_ipg - ufs_rw32(cgp->cg_cs.cs_nifree, needswap);
 		if (nalloc + FFS_INOPB(fs) > initediblk &&
 		initediblk < ufs_rw32(cgp->cg_niblk, needswap)) {
@@ -1331,6 +1338,9 @@ retry:
 			FFS_NOBLK, fs->fs_bsize, false, &ibp);
 			if (error)
 goto fail;
+
+			maxiblk += FFS_INOPB(fs);
+			
 			goto retry;
 		}
 	}
@@ -1340,14 +1350,22 @@ retry:
 	(fs->fs_old_flags & FS_FLAGS_UPDATED))
 		cgp->cg_time = ufs_rw64(time_second, needswap);
 	inosused = cg_inosused(cgp, needswap);
+	
 	if (ipref) {
 		ipref %= fs->fs_ipg;
-		if (isclr(inosused, ipref))
+		/* safeguard to stay in (to be) allocated range */
+		if (ipref < maxiblk && isclr(inosused, ipref))
 			goto gotit;
 	}
-	start = ufs_rw32(cgp->cg_irotor, needswap) / NBBY;
-	len = howmany(fs->fs_ipg - ufs_rw32(cgp->cg_irotor, needswap),
-		NBBY);
+
+	irotor = ufs_rw32(cgp->cg_irotor, needswap); 
+
+	KASSERTMSG(irotor < initediblk, "%s: allocation botch: cg=%d, irotor %d"
+		   " out of bounds, initediblk=%d",
+		   __func__, cg, irotor, initediblk);
+
+	start = irotor / NBBY;
+	len = howmany(maxiblk - irotor, NBBY);
 	loc = skpc(0xff, len, &inosused[start]);
 	if (loc == 0) {
 		len = start + 1;
@@ -1367,9 +1385,17 @@ retry:
 		printf("fs = %s\n", fs->fs_fsmnt);
 		panic("ffs_nodealloccg: block not in map");
 	}
+	
 	ipref = i * NBBY + ffs(map) - 1;
+
 	cgp->cg_irotor = ufs_rw32(ipref, needswap);
+
 gotit:
+	KASSERTMSG(ipref < maxiblk, "%s: allocation botch: cg=%d attempt to "
+		   "allocate inode index %d beyond max allocated index %d"
+		   " of %d inodes/cg",
+		   __func__, cg, (int)ipref, maxiblk, cgp->cg_niblk);
+
 	

CVS commit: [netbsd-7] src/doc

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:54:07 UTC 2019

Modified Files:
src/doc [netbsd-7]: CHANGES-7.3

Log Message:
Ticket #1697


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.52 -r1.1.2.53 src/doc/CHANGES-7.3

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



CVS commit: [netbsd-7] src/doc

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:54:07 UTC 2019

Modified Files:
src/doc [netbsd-7]: CHANGES-7.3

Log Message:
Ticket #1697


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.52 -r1.1.2.53 src/doc/CHANGES-7.3

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-7.3
diff -u src/doc/CHANGES-7.3:1.1.2.52 src/doc/CHANGES-7.3:1.1.2.53
--- src/doc/CHANGES-7.3:1.1.2.52	Tue May  7 18:54:28 2019
+++ src/doc/CHANGES-7.3	Wed May 29 15:54:07 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.3,v 1.1.2.52 2019/05/07 18:54:28 martin Exp $
+# $NetBSD: CHANGES-7.3,v 1.1.2.53 2019/05/29 15:54:07 martin Exp $
 
 A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3
 release:
@@ -573,3 +573,9 @@ sys/netsmb/smb_conn.c1.30
 	defined.
 	[christos, ticket #1696]
 
+sys/ufs/ffs/ffs_alloc.c1.164
+
+	PR 53990, PR 52380, PR 52102:
+	Fix rare allocation botch in ffs_nodealloccg().
+	[kardel, ticket #1697]
+



CVS commit: [netbsd-7-1] src/sys/ufs/ffs

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:54:31 UTC 2019

Modified Files:
src/sys/ufs/ffs [netbsd-7-1]: ffs_alloc.c

Log Message:
Pull up following revision(s) (requested by kardel in ticket #1697):

sys/ufs/ffs/ffs_alloc.c: revision 1.164

PR/53990, PR/52380, PR/52102: UFS2 cylinder group inode allocation botch

Fix rare allocation botch in ffs_nodealloccg().

Conditions:
a) less than
 #_of_initialized_inodes(cg->cg_initediblk)
 - inodes_per_filesystem_block
   are allocated in the cylinder group
b) cg->cg_irotor points to a uninterupted run of
   allocated inodes in the inode bitmap up to the
   end of dynamically initialized inodes
   (cg->cg_initediblk)

In this case the next inode after this run was returned
without initializing the respective inode block. As the
block is not initialized these inodes could trigger panics
on inode consistency due to old (uninitialized) disk data.

In very rare cases data loss could occur when
the uninitialized inode block is initialized via the
normal mechanism.

Further conditions to occur after the above:
c) no panic
d) no (forced) fsck
e) and more than cg->cg_initediblk - inodes_per_filesystem_block
   allocated inodes.

Fix:

Always insure allocation always in initialized inode range
extending the initialized inode range as needed.

Add KASSERTMSG() safeguards.

ok hannken@


To generate a diff of this commit:
cvs rdiff -u -r1.146.2.1 -r1.146.2.1.6.1 src/sys/ufs/ffs/ffs_alloc.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/ufs/ffs/ffs_alloc.c
diff -u src/sys/ufs/ffs/ffs_alloc.c:1.146.2.1 src/sys/ufs/ffs/ffs_alloc.c:1.146.2.1.6.1
--- src/sys/ufs/ffs/ffs_alloc.c:1.146.2.1	Fri Aug 14 05:29:14 2015
+++ src/sys/ufs/ffs/ffs_alloc.c	Wed May 29 15:54:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_alloc.c,v 1.146.2.1 2015/08/14 05:29:14 msaitoh Exp $	*/
+/*	$NetBSD: ffs_alloc.c,v 1.146.2.1.6.1 2019/05/29 15:54:30 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.146.2.1 2015/08/14 05:29:14 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.146.2.1.6.1 2019/05/29 15:54:30 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1283,7 +1283,7 @@ ffs_nodealloccg(struct inode *ip, int cg
 	struct buf *bp, *ibp;
 	u_int8_t *inosused;
 	int error, start, len, loc, map, i;
-	int32_t initediblk;
+	int32_t initediblk, maxiblk, irotor;
 	daddr_t nalloc;
 	struct ufs2_dinode *dp2;
 	const int needswap = UFS_FSNEEDSWAP(fs);
@@ -1295,7 +1295,13 @@ ffs_nodealloccg(struct inode *ip, int cg
 		return (0);
 	mutex_exit(&ump->um_lock);
 	ibp = NULL;
-	initediblk = -1;
+	if (fs->fs_magic == FS_UFS2_MAGIC) {
+		initediblk = -1;
+	} else {
+		initediblk = fs->fs_ipg;
+	}
+	maxiblk = initediblk;
+
 retry:
 	error = bread(ip->i_devvp, FFS_FSBTODB(fs, cgtod(fs, cg)),
 		(int)fs->fs_cgsize, NOCRED, B_MODIFY, &bp);
@@ -1315,7 +1321,8 @@ retry:
 	 * Check to see if we need to initialize more inodes.
 	 */
 	if (fs->fs_magic == FS_UFS2_MAGIC && ibp == NULL) {
-		initediblk = ufs_rw32(cgp->cg_initediblk, needswap);
+	initediblk = ufs_rw32(cgp->cg_initediblk, needswap);
+		maxiblk = initediblk;
 		nalloc = fs->fs_ipg - ufs_rw32(cgp->cg_cs.cs_nifree, needswap);
 		if (nalloc + FFS_INOPB(fs) > initediblk &&
 		initediblk < ufs_rw32(cgp->cg_niblk, needswap)) {
@@ -1331,6 +1338,9 @@ retry:
 			FFS_NOBLK, fs->fs_bsize, false, &ibp);
 			if (error)
 goto fail;
+
+			maxiblk += FFS_INOPB(fs);
+			
 			goto retry;
 		}
 	}
@@ -1340,14 +1350,22 @@ retry:
 	(fs->fs_old_flags & FS_FLAGS_UPDATED))
 		cgp->cg_time = ufs_rw64(time_second, needswap);
 	inosused = cg_inosused(cgp, needswap);
+	
 	if (ipref) {
 		ipref %= fs->fs_ipg;
-		if (isclr(inosused, ipref))
+		/* safeguard to stay in (to be) allocated range */
+		if (ipref < maxiblk && isclr(inosused, ipref))
 			goto gotit;
 	}
-	start = ufs_rw32(cgp->cg_irotor, needswap) / NBBY;
-	len = howmany(fs->fs_ipg - ufs_rw32(cgp->cg_irotor, needswap),
-		NBBY);
+
+	irotor = ufs_rw32(cgp->cg_irotor, needswap); 
+
+	KASSERTMSG(irotor < initediblk, "%s: allocation botch: cg=%d, irotor %d"
+		   " out of bounds, initediblk=%d",
+		   __func__, cg, irotor, initediblk);
+
+	start = irotor / NBBY;
+	len = howmany(maxiblk - irotor, NBBY);
 	loc = skpc(0xff, len, &inosused[start]);
 	if (loc == 0) {
 		len = start + 1;
@@ -1367,9 +1385,17 @@ retry:
 		printf("fs = %s\n", fs->fs_fsmnt);
 		panic("ffs_nodealloccg: block not in map");
 	}
+	
 	ipref = i * NBBY + ffs(map) - 1;
+
 	cgp->cg_irotor = ufs_rw32(ipref, needswap);
+
 gotit:
+	KASSERTMSG(ipref < maxiblk, "%s: allocation botch: cg=%d attempt to "
+		   "allocate inode index %d beyond max allocated index %d"
+		   " of %d inodes/cg",
+		   __func__, cg, (int)ipref, maxiblk, cg

CVS commit: [netbsd-7-1] src/sys/ufs/ffs

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:54:31 UTC 2019

Modified Files:
src/sys/ufs/ffs [netbsd-7-1]: ffs_alloc.c

Log Message:
Pull up following revision(s) (requested by kardel in ticket #1697):

sys/ufs/ffs/ffs_alloc.c: revision 1.164

PR/53990, PR/52380, PR/52102: UFS2 cylinder group inode allocation botch

Fix rare allocation botch in ffs_nodealloccg().

Conditions:
a) less than
 #_of_initialized_inodes(cg->cg_initediblk)
 - inodes_per_filesystem_block
   are allocated in the cylinder group
b) cg->cg_irotor points to a uninterupted run of
   allocated inodes in the inode bitmap up to the
   end of dynamically initialized inodes
   (cg->cg_initediblk)

In this case the next inode after this run was returned
without initializing the respective inode block. As the
block is not initialized these inodes could trigger panics
on inode consistency due to old (uninitialized) disk data.

In very rare cases data loss could occur when
the uninitialized inode block is initialized via the
normal mechanism.

Further conditions to occur after the above:
c) no panic
d) no (forced) fsck
e) and more than cg->cg_initediblk - inodes_per_filesystem_block
   allocated inodes.

Fix:

Always insure allocation always in initialized inode range
extending the initialized inode range as needed.

Add KASSERTMSG() safeguards.

ok hannken@


To generate a diff of this commit:
cvs rdiff -u -r1.146.2.1 -r1.146.2.1.6.1 src/sys/ufs/ffs/ffs_alloc.c

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



CVS commit: [netbsd-7-1] src/doc

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:54:58 UTC 2019

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.3

Log Message:
Ticket #1697


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.50 -r1.1.2.51 src/doc/CHANGES-7.1.3

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



CVS commit: [netbsd-7-1] src/doc

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:54:58 UTC 2019

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.3

Log Message:
Ticket #1697


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.50 -r1.1.2.51 src/doc/CHANGES-7.1.3

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-7.1.3
diff -u src/doc/CHANGES-7.1.3:1.1.2.50 src/doc/CHANGES-7.1.3:1.1.2.51
--- src/doc/CHANGES-7.1.3:1.1.2.50	Tue May  7 18:55:20 2019
+++ src/doc/CHANGES-7.1.3	Wed May 29 15:54:58 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.3,v 1.1.2.50 2019/05/07 18:55:20 martin Exp $
+# $NetBSD: CHANGES-7.1.3,v 1.1.2.51 2019/05/29 15:54:58 martin Exp $
 
 A complete list of changes from the NetBSD 7.1.2 release to the NetBSD 7.1.3
 release:
@@ -506,3 +506,9 @@ sys/netsmb/smb_conn.c1.30
 	defined.
 	[christos, ticket #1696]
 
+sys/ufs/ffs/ffs_alloc.c1.164
+
+	PR 53990, PR 52380, PR 52102:
+	Fix rare allocation botch in ffs_nodealloccg().
+	[kardel, ticket #1697]
+



CVS commit: [netbsd-7-0] src/sys/ufs/ffs

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:55:18 UTC 2019

Modified Files:
src/sys/ufs/ffs [netbsd-7-0]: ffs_alloc.c

Log Message:
Pull up following revision(s) (requested by kardel in ticket #1697):

sys/ufs/ffs/ffs_alloc.c: revision 1.164

PR/53990, PR/52380, PR/52102: UFS2 cylinder group inode allocation botch

Fix rare allocation botch in ffs_nodealloccg().

Conditions:
a) less than
 #_of_initialized_inodes(cg->cg_initediblk)
 - inodes_per_filesystem_block
   are allocated in the cylinder group
b) cg->cg_irotor points to a uninterupted run of
   allocated inodes in the inode bitmap up to the
   end of dynamically initialized inodes
   (cg->cg_initediblk)

In this case the next inode after this run was returned
without initializing the respective inode block. As the
block is not initialized these inodes could trigger panics
on inode consistency due to old (uninitialized) disk data.

In very rare cases data loss could occur when
the uninitialized inode block is initialized via the
normal mechanism.

Further conditions to occur after the above:
c) no panic
d) no (forced) fsck
e) and more than cg->cg_initediblk - inodes_per_filesystem_block
   allocated inodes.

Fix:

Always insure allocation always in initialized inode range
extending the initialized inode range as needed.

Add KASSERTMSG() safeguards.

ok hannken@


To generate a diff of this commit:
cvs rdiff -u -r1.146.2.1 -r1.146.2.1.2.1 src/sys/ufs/ffs/ffs_alloc.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/ufs/ffs/ffs_alloc.c
diff -u src/sys/ufs/ffs/ffs_alloc.c:1.146.2.1 src/sys/ufs/ffs/ffs_alloc.c:1.146.2.1.2.1
--- src/sys/ufs/ffs/ffs_alloc.c:1.146.2.1	Fri Aug 14 05:29:14 2015
+++ src/sys/ufs/ffs/ffs_alloc.c	Wed May 29 15:55:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_alloc.c,v 1.146.2.1 2015/08/14 05:29:14 msaitoh Exp $	*/
+/*	$NetBSD: ffs_alloc.c,v 1.146.2.1.2.1 2019/05/29 15:55:18 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.146.2.1 2015/08/14 05:29:14 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.146.2.1.2.1 2019/05/29 15:55:18 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1283,7 +1283,7 @@ ffs_nodealloccg(struct inode *ip, int cg
 	struct buf *bp, *ibp;
 	u_int8_t *inosused;
 	int error, start, len, loc, map, i;
-	int32_t initediblk;
+	int32_t initediblk, maxiblk, irotor;
 	daddr_t nalloc;
 	struct ufs2_dinode *dp2;
 	const int needswap = UFS_FSNEEDSWAP(fs);
@@ -1295,7 +1295,13 @@ ffs_nodealloccg(struct inode *ip, int cg
 		return (0);
 	mutex_exit(&ump->um_lock);
 	ibp = NULL;
-	initediblk = -1;
+	if (fs->fs_magic == FS_UFS2_MAGIC) {
+		initediblk = -1;
+	} else {
+		initediblk = fs->fs_ipg;
+	}
+	maxiblk = initediblk;
+
 retry:
 	error = bread(ip->i_devvp, FFS_FSBTODB(fs, cgtod(fs, cg)),
 		(int)fs->fs_cgsize, NOCRED, B_MODIFY, &bp);
@@ -1315,7 +1321,8 @@ retry:
 	 * Check to see if we need to initialize more inodes.
 	 */
 	if (fs->fs_magic == FS_UFS2_MAGIC && ibp == NULL) {
-		initediblk = ufs_rw32(cgp->cg_initediblk, needswap);
+	initediblk = ufs_rw32(cgp->cg_initediblk, needswap);
+		maxiblk = initediblk;
 		nalloc = fs->fs_ipg - ufs_rw32(cgp->cg_cs.cs_nifree, needswap);
 		if (nalloc + FFS_INOPB(fs) > initediblk &&
 		initediblk < ufs_rw32(cgp->cg_niblk, needswap)) {
@@ -1331,6 +1338,9 @@ retry:
 			FFS_NOBLK, fs->fs_bsize, false, &ibp);
 			if (error)
 goto fail;
+
+			maxiblk += FFS_INOPB(fs);
+			
 			goto retry;
 		}
 	}
@@ -1340,14 +1350,22 @@ retry:
 	(fs->fs_old_flags & FS_FLAGS_UPDATED))
 		cgp->cg_time = ufs_rw64(time_second, needswap);
 	inosused = cg_inosused(cgp, needswap);
+	
 	if (ipref) {
 		ipref %= fs->fs_ipg;
-		if (isclr(inosused, ipref))
+		/* safeguard to stay in (to be) allocated range */
+		if (ipref < maxiblk && isclr(inosused, ipref))
 			goto gotit;
 	}
-	start = ufs_rw32(cgp->cg_irotor, needswap) / NBBY;
-	len = howmany(fs->fs_ipg - ufs_rw32(cgp->cg_irotor, needswap),
-		NBBY);
+
+	irotor = ufs_rw32(cgp->cg_irotor, needswap); 
+
+	KASSERTMSG(irotor < initediblk, "%s: allocation botch: cg=%d, irotor %d"
+		   " out of bounds, initediblk=%d",
+		   __func__, cg, irotor, initediblk);
+
+	start = irotor / NBBY;
+	len = howmany(maxiblk - irotor, NBBY);
 	loc = skpc(0xff, len, &inosused[start]);
 	if (loc == 0) {
 		len = start + 1;
@@ -1367,9 +1385,17 @@ retry:
 		printf("fs = %s\n", fs->fs_fsmnt);
 		panic("ffs_nodealloccg: block not in map");
 	}
+	
 	ipref = i * NBBY + ffs(map) - 1;
+
 	cgp->cg_irotor = ufs_rw32(ipref, needswap);
+
 gotit:
+	KASSERTMSG(ipref < maxiblk, "%s: allocation botch: cg=%d attempt to "
+		   "allocate inode index %d beyond max allocated index %d"
+		   " of %d inodes/cg",
+		   __func__, cg, (int)ipref, maxiblk, cg

CVS commit: [netbsd-7-0] src/sys/ufs/ffs

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:55:18 UTC 2019

Modified Files:
src/sys/ufs/ffs [netbsd-7-0]: ffs_alloc.c

Log Message:
Pull up following revision(s) (requested by kardel in ticket #1697):

sys/ufs/ffs/ffs_alloc.c: revision 1.164

PR/53990, PR/52380, PR/52102: UFS2 cylinder group inode allocation botch

Fix rare allocation botch in ffs_nodealloccg().

Conditions:
a) less than
 #_of_initialized_inodes(cg->cg_initediblk)
 - inodes_per_filesystem_block
   are allocated in the cylinder group
b) cg->cg_irotor points to a uninterupted run of
   allocated inodes in the inode bitmap up to the
   end of dynamically initialized inodes
   (cg->cg_initediblk)

In this case the next inode after this run was returned
without initializing the respective inode block. As the
block is not initialized these inodes could trigger panics
on inode consistency due to old (uninitialized) disk data.

In very rare cases data loss could occur when
the uninitialized inode block is initialized via the
normal mechanism.

Further conditions to occur after the above:
c) no panic
d) no (forced) fsck
e) and more than cg->cg_initediblk - inodes_per_filesystem_block
   allocated inodes.

Fix:

Always insure allocation always in initialized inode range
extending the initialized inode range as needed.

Add KASSERTMSG() safeguards.

ok hannken@


To generate a diff of this commit:
cvs rdiff -u -r1.146.2.1 -r1.146.2.1.2.1 src/sys/ufs/ffs/ffs_alloc.c

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



CVS commit: [netbsd-7-0] src/doc

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:55:42 UTC 2019

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
Ticket #1697


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

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-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.143 src/doc/CHANGES-7.0.3:1.1.2.144
--- src/doc/CHANGES-7.0.3:1.1.2.143	Tue May  7 18:56:53 2019
+++ src/doc/CHANGES-7.0.3	Wed May 29 15:55:41 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.143 2019/05/07 18:56:53 martin Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.144 2019/05/29 15:55:41 martin Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5814,3 +5814,9 @@ sys/netsmb/smb_conn.c1.30
 	defined.
 	[christos, ticket #1696]
 
+sys/ufs/ffs/ffs_alloc.c1.164
+
+	PR 53990, PR 52380, PR 52102:
+	Fix rare allocation botch in ffs_nodealloccg().
+	[kardel, ticket #1697]
+



CVS commit: [netbsd-7-0] src/doc

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:55:42 UTC 2019

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
Ticket #1697


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

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/netipsec

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:57:38 UTC 2019

Modified Files:
src/sys/netipsec [netbsd-8]: ipsecif.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1273):

sys/netipsec/ipsecif.c: revision 1.16

Don't clear calculated Tx tos value for IPv[46] over IPv6.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/sys/netipsec/ipsecif.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/netipsec/ipsecif.c
diff -u src/sys/netipsec/ipsecif.c:1.1.2.7 src/sys/netipsec/ipsecif.c:1.1.2.8
--- src/sys/netipsec/ipsecif.c:1.1.2.7	Thu May 17 14:07:03 2018
+++ src/sys/netipsec/ipsecif.c	Wed May 29 15:57:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsecif.c,v 1.1.2.7 2018/05/17 14:07:03 martin Exp $  */
+/*	$NetBSD: ipsecif.c,v 1.1.2.8 2019/05/29 15:57:38 martin Exp $  */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsecif.c,v 1.1.2.7 2018/05/17 14:07:03 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsecif.c,v 1.1.2.8 2019/05/29 15:57:38 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -557,13 +557,13 @@ ipsecif6_output(struct ipsec_variant *va
 		return ENETUNREACH;
 	}
 #ifndef IPSEC_TX_TOS_CLEAR
+	if (!ip6_ipsec_copy_tos)
+		otos = 0;
+
 	if (ifp->if_flags & IFF_ECN)
 		ip_ecn_ingress(ECN_ALLOWED, &otos, &itos);
 	else
 		ip_ecn_ingress(ECN_NOCARE, &otos, &itos);
-
-	if (!ip6_ipsec_copy_tos)
-		otos = 0;
 #else
 	if (ip6_ipsec_copy_tos)
 		otos = itos;



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

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 15:57:38 UTC 2019

Modified Files:
src/sys/netipsec [netbsd-8]: ipsecif.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #1273):

sys/netipsec/ipsecif.c: revision 1.16

Don't clear calculated Tx tos value for IPv[46] over IPv6.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/sys/netipsec/ipsecif.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/include

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 16:00:02 UTC 2019

Modified Files:
src/include [netbsd-8]: assert.h

Log Message:
Pull up following revision(s) (requested by maya in ticket #1275):

include/assert.h: revision 1.23

Limit static_assert visibility to C11.

The existing definition caused issues as GCC only provides _Static_assert
when building C11 code.

This follows the C standard: static_assert available since C11.

Fixes https://rt.perl.org/Public/Bug/Display.html?id=134023


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.6.1 src/include/assert.h

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

Modified files:

Index: src/include/assert.h
diff -u src/include/assert.h:1.22 src/include/assert.h:1.22.6.1
--- src/include/assert.h:1.22	Mon Oct  3 12:08:39 2016
+++ src/include/assert.h	Wed May 29 16:00:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: assert.h,v 1.22 2016/10/03 12:08:39 kamil Exp $	*/
+/*	$NetBSD: assert.h,v 1.22.6.1 2019/05/29 16:00:02 martin Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -105,7 +105,7 @@ void __diagassert13(const char *, int, c
 __END_DECLS
 #endif /* __ASSERT_DECLARED */
 
-#if ((__cplusplus - 0) < 201103L)
+#if defined(_ISOC11_SOURCE) || (__STDC_VERSION__ - 0) >= 201101L
 #ifndef static_assert
 #define static_assert _Static_assert
 #endif /* static_assert */



CVS commit: [netbsd-8] src/include

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 16:00:02 UTC 2019

Modified Files:
src/include [netbsd-8]: assert.h

Log Message:
Pull up following revision(s) (requested by maya in ticket #1275):

include/assert.h: revision 1.23

Limit static_assert visibility to C11.

The existing definition caused issues as GCC only provides _Static_assert
when building C11 code.

This follows the C standard: static_assert available since C11.

Fixes https://rt.perl.org/Public/Bug/Display.html?id=134023


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.6.1 src/include/assert.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/sys/net

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 16:01:51 UTC 2019

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

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1276):

sys/net/rtsock.c: revision 1.250

Don't take softnet_lock in sysctl_rtable

Taking softnet_lock there can cause a deadlock with nfs sosend, so we don't.
Having only KERNEL_LOCK is enough because now the routing table is protected by
KERNEL_LOCK that was introduced by the fix for PR 53043.

PR kern/54227 from Paul Ripke


To generate a diff of this commit:
cvs rdiff -u -r1.213.2.12 -r1.213.2.13 src/sys/net/rtsock.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/rtsock.c
diff -u src/sys/net/rtsock.c:1.213.2.12 src/sys/net/rtsock.c:1.213.2.13
--- src/sys/net/rtsock.c:1.213.2.12	Thu Mar  7 16:59:10 2019
+++ src/sys/net/rtsock.c	Wed May 29 16:01:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.213.2.12 2019/03/07 16:59:10 martin Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.213.2.13 2019/05/29 16:01:51 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.213.2.12 2019/03/07 16:59:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.213.2.13 2019/05/29 16:01:51 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1873,7 +1873,7 @@ again:
 	w.w_needed = 0 - w.w_given;
 	w.w_where = where;
 
-	SOFTNET_KERNEL_LOCK_UNLESS_NET_MPSAFE();
+	KERNEL_LOCK_UNLESS_NET_MPSAFE();
 	s = splsoftnet();
 	switch (w.w_op) {
 
@@ -1932,7 +1932,7 @@ again:
 		break;
 	}
 	splx(s);
-	SOFTNET_KERNEL_UNLOCK_UNLESS_NET_MPSAFE();
+	KERNEL_UNLOCK_UNLESS_NET_MPSAFE();
 
 	/* check to see if we couldn't allocate memory with NOWAIT */
 	if (error == ENOBUFS && w.w_tmem == 0 && w.w_tmemneeded)



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

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 16:01:51 UTC 2019

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

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1276):

sys/net/rtsock.c: revision 1.250

Don't take softnet_lock in sysctl_rtable

Taking softnet_lock there can cause a deadlock with nfs sosend, so we don't.
Having only KERNEL_LOCK is enough because now the routing table is protected by
KERNEL_LOCK that was introduced by the fix for PR 53043.

PR kern/54227 from Paul Ripke


To generate a diff of this commit:
cvs rdiff -u -r1.213.2.12 -r1.213.2.13 src/sys/net/rtsock.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/doc

2019-05-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 16:03:30 UTC 2019

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

Log Message:
Tickets #1270 - #1273, #1275, #1276


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.147 -r1.1.2.148 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-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 29 16:03:30 UTC 2019

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

Log Message:
Tickets #1270 - #1273, #1275, #1276


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.147 -r1.1.2.148 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.147 src/doc/CHANGES-8.1:1.1.2.148
--- src/doc/CHANGES-8.1:1.1.2.147	Wed May 15 04:42:01 2019
+++ src/doc/CHANGES-8.1	Wed May 29 16:03:30 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.147 2019/05/15 04:42:01 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.148 2019/05/29 16:03:30 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -3189,3 +3189,36 @@ doc/LAST_MINUTE
 	Welcome to 8.1_RC.
 	[martin]
 
+sys/arch/x86/include/specialreg.h		1.143, 1.145 via patch
+sys/arch/x86/x86/procfs_machdep.c		1.30
+
+	- Add TSX_FORCE_ABORT related definitions.
+	- Add cpuid7 edx bit 10 "MD_CLEAR".
+	[msaitoh, ticket #1270]
+
+sys/netinet/ip_encap.c1.71
+
+	Fix build failure when INET6 is disabled.
+	[knakahara, ticket #1271]
+
+sys/ufs/ffs/ffs_alloc.c1.164
+
+	PR 53990, PR 52380, PR 52102:
+	Fix rare allocation botch in ffs_nodealloccg().
+	[kardel, ticket #1272]
+
+sys/netipsec/ipsecif.c1.16
+
+	Don't clear calculated Tx tos value for IPv[46] over IPv6.
+	[knakahara, ticket #1273]
+
+include/assert.h1.23
+
+	Limit static_assert visibility to C11.
+	[maya, ticket #1275]
+
+sys/net/rtsock.c1.250
+
+	Don't take softnet_lock in sysctl_rtable.
+	[ozaki-r, ticket #1276]
+



CVS commit: src/sys/arch

2019-05-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 29 16:54:42 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: cpufunc.S genassym.cf
src/sys/arch/amd64/include: pmap.h
src/sys/arch/x86/include: cpufunc.h pmap.h specialreg.h
src/sys/arch/x86/x86: cpu.c svs.c x86_machdep.c

Log Message:
Add PCID support in SVS. This avoids TLB flushes during kernel<->user
transitions, which greatly reduces the performance penalty introduced by
SVS.

We use two ASIDs, 0 (kern) and 1 (user), and use invpcid to flush pages
in both ASIDs.

The read-only machdep.svs.pcid={0,1} sysctl is added, and indicates whether
SVS+PCID is in use.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/amd64/amd64/cpufunc.S
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/amd64/include/pmap.h
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x86/include/cpufunc.h
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.170 -r1.171 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/x86/svs.c
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/x86/x86/x86_machdep.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/cpufunc.S
diff -u src/sys/arch/amd64/amd64/cpufunc.S:1.40 src/sys/arch/amd64/amd64/cpufunc.S:1.41
--- src/sys/arch/amd64/amd64/cpufunc.S:1.40	Sun May 19 08:17:02 2019
+++ src/sys/arch/amd64/amd64/cpufunc.S	Wed May 29 16:54:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.S,v 1.40 2019/05/19 08:17:02 maxv Exp $	*/
+/*	$NetBSD: cpufunc.S,v 1.41 2019/05/29 16:54:41 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -41,6 +41,7 @@
 #include 
 
 #include "opt_xen.h"
+#include "opt_svs.h"
 
 #include "assym.h"
 
@@ -65,6 +66,17 @@ END(x86_mfence)
 
 #ifndef XENPV
 ENTRY(invlpg)
+#ifdef SVS
+	movb	_C_LABEL(svs_pcid),%al
+	testb	%al,%al
+	jz	1f
+	pushq	%rdi
+	pushq	$PMAP_PCID_USER
+	movq	$INVPCID_ADDRESS,%rax
+	invpcid	(%rsp),%rax
+	addq	$16,%rsp
+1:	/* FALLTHROUGH */
+#endif
 	invlpg	(%rdi)
 	ret
 END(invlpg)
@@ -112,7 +124,7 @@ END(ltr)
 ENTRY(tlbflushg)
 	movq	%cr4, %rax
 	testq	$CR4_PGE, %rax
-	jz	1f
+	jz	tlbflush
 	movq	%rax, %rdx
 	andq	$~CR4_PGE, %rdx
 	movq	%rdx, %cr4
@@ -121,8 +133,19 @@ ENTRY(tlbflushg)
 END(tlbflushg)
 
 ENTRY(tlbflush)
-1:
-	movq	%cr3, %rax
+#ifdef SVS
+	movb	_C_LABEL(svs_pcid),%al
+	testb	%al,%al
+	jz	1f
+	xorq	%rax,%rax
+	pushq	%rax
+	pushq	%rax
+	movq	$INVPCID_ALL_NONGLOBAL,%rax
+	invpcid	(%rsp),%rax
+	addq	$16,%rsp
+	ret
+#endif
+1:	movq	%cr3, %rax
 	movq	%rax, %cr3
 	ret
 END(tlbflush)

Index: src/sys/arch/amd64/amd64/genassym.cf
diff -u src/sys/arch/amd64/amd64/genassym.cf:1.75 src/sys/arch/amd64/amd64/genassym.cf:1.76
--- src/sys/arch/amd64/amd64/genassym.cf:1.75	Mon May 27 17:32:36 2019
+++ src/sys/arch/amd64/amd64/genassym.cf	Wed May 29 16:54:41 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.75 2019/05/27 17:32:36 maxv Exp $
+#	$NetBSD: genassym.cf,v 1.76 2019/05/29 16:54:41 maxv Exp $
 
 #
 # Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -276,6 +276,14 @@ define	ACPI_SUSPEND_CR3	offsetof(struct 
 define	ACPI_SUSPEND_CR4	offsetof(struct cpu_info, ci_suspend_cr4)
 define	ACPI_SUSPEND_CR8	offsetof(struct cpu_info, ci_suspend_cr8)
 
+define	INVPCID_ADDRESS		INVPCID_ADDRESS
+define	INVPCID_CONTEXT		INVPCID_CONTEXT
+define	INVPCID_ALL		INVPCID_ALL
+define	INVPCID_ALL_NONGLOBAL	INVPCID_ALL_NONGLOBAL
+
+define	PMAP_PCID_USER		PMAP_PCID_USER
+define	PMAP_PCID_KERN		PMAP_PCID_KERN
+
 if NIOAPIC > 0
 define		PIC_IOAPIC		offsetof(struct pic, pic_ioapic)
 define		IOAPIC_SC_REG		offsetof(struct ioapic_softc, sc_reg)

Index: src/sys/arch/amd64/include/pmap.h
diff -u src/sys/arch/amd64/include/pmap.h:1.60 src/sys/arch/amd64/include/pmap.h:1.61
--- src/sys/arch/amd64/include/pmap.h:1.60	Sat Mar  9 09:09:56 2019
+++ src/sys/arch/amd64/include/pmap.h	Wed May 29 16:54:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.60 2019/03/09 09:09:56 maxv Exp $	*/
+/*	$NetBSD: pmap.h,v 1.61 2019/05/29 16:54:41 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -179,6 +179,7 @@ void svs_lwp_switch(struct lwp *, struct
 void svs_pdir_switch(struct pmap *);
 void svs_init(void);
 extern bool svs_enabled;
+extern bool svs_pcid;
 
 #include 
 

Index: src/sys/arch/x86/include/cpufunc.h
diff -u src/sys/arch/x86/include/cpufunc.h:1.30 src/sys/arch/x86/include/cpufunc.h:1.31
--- src/sys/arch/x86/include/cpufunc.h:1.30	Sat May 11 13:40:26 2019
+++ src/sys/arch/x86/include/cpufunc.h	Wed May 29 16:54:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.h,v 1.30 2019/05/11 13:40:26 christos Exp $	*/
+/*	$NetBSD: cpufunc.h,v 1.31 2019/05/29 16:54:41 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2019 The NetBSD Foundation, Inc.
@@ -65,6 +65,

CVS commit: src/sys/arch

2019-05-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 29 16:54:42 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: cpufunc.S genassym.cf
src/sys/arch/amd64/include: pmap.h
src/sys/arch/x86/include: cpufunc.h pmap.h specialreg.h
src/sys/arch/x86/x86: cpu.c svs.c x86_machdep.c

Log Message:
Add PCID support in SVS. This avoids TLB flushes during kernel<->user
transitions, which greatly reduces the performance penalty introduced by
SVS.

We use two ASIDs, 0 (kern) and 1 (user), and use invpcid to flush pages
in both ASIDs.

The read-only machdep.svs.pcid={0,1} sysctl is added, and indicates whether
SVS+PCID is in use.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/amd64/amd64/cpufunc.S
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/amd64/include/pmap.h
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x86/include/cpufunc.h
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.170 -r1.171 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/x86/svs.c
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/x86/x86/x86_machdep.c

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



CVS commit: src

2019-05-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 29 17:09:18 UTC 2019

Modified Files:
src/sys/dev/tprof: tprof_x86_amd.c
src/usr.sbin/tprof: tprof.8
src/usr.sbin/tprof/arch: tprof_x86.c

Log Message:
Add support for AMD Family 17h.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/tprof/tprof_x86_amd.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/tprof/tprof.8
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/tprof/arch/tprof_x86.c

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



CVS commit: src

2019-05-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed May 29 17:09:18 UTC 2019

Modified Files:
src/sys/dev/tprof: tprof_x86_amd.c
src/usr.sbin/tprof: tprof.8
src/usr.sbin/tprof/arch: tprof_x86.c

Log Message:
Add support for AMD Family 17h.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/tprof/tprof_x86_amd.c
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/tprof/tprof.8
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/tprof/arch/tprof_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/tprof/tprof_x86_amd.c
diff -u src/sys/dev/tprof/tprof_x86_amd.c:1.2 src/sys/dev/tprof/tprof_x86_amd.c:1.3
--- src/sys/dev/tprof/tprof_x86_amd.c:1.2	Tue Jul 24 09:47:35 2018
+++ src/sys/dev/tprof/tprof_x86_amd.c	Wed May 29 17:09:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_x86_amd.c,v 1.2 2018/07/24 09:47:35 maxv Exp $	*/
+/*	$NetBSD: tprof_x86_amd.c,v 1.3 2019/05/29 17:09:17 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tprof_x86_amd.c,v 1.2 2018/07/24 09:47:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tprof_x86_amd.c,v 1.3 2019/05/29 17:09:17 maxv Exp $");
 
 #include 
 #include 
@@ -205,6 +205,7 @@ tprof_amd_ident(void)
 
 	switch (CPUID_TO_FAMILY(ci->ci_signature)) {
 	case 0x10:
+	case 0x17:
 		return TPROF_IDENT_AMD_GENERIC;
 	}
 

Index: src/usr.sbin/tprof/tprof.8
diff -u src/usr.sbin/tprof/tprof.8:1.13 src/usr.sbin/tprof/tprof.8:1.14
--- src/usr.sbin/tprof/tprof.8:1.13	Mon Nov 26 23:20:56 2018
+++ src/usr.sbin/tprof/tprof.8	Wed May 29 17:09:17 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tprof.8,v 1.13 2018/11/26 23:20:56 knakahara Exp $
+.\"	$NetBSD: tprof.8,v 1.14 2019/05/29 17:09:17 maxv Exp $
 .\"
 .\" Copyright (c)2011 YAMAMOTO Takashi,
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd November 27, 2018
+.Dd May 29, 2019
 .Dt TPROF 8
 .Os
 .Sh NAME
@@ -130,6 +130,8 @@ ARMv8
 .It
 x86 AMD Family 10h
 .It
+x86 AMD Family 17h
+.It
 x86 Intel Generic (all Intel CPUs)
 .It
 x86 Intel Skylake/Kabylake
@@ -168,7 +170,7 @@ were dropped.
 .An -nosplit
 The
 .Nm
-utility is written by
+utility was written by
 .An YAMAMOTO Takashi .
 It was revamped by
 .An Maxime Villard

Index: src/usr.sbin/tprof/arch/tprof_x86.c
diff -u src/usr.sbin/tprof/arch/tprof_x86.c:1.7 src/usr.sbin/tprof/arch/tprof_x86.c:1.8
--- src/usr.sbin/tprof/arch/tprof_x86.c:1.7	Mon Nov 26 23:20:57 2018
+++ src/usr.sbin/tprof/arch/tprof_x86.c	Wed May 29 17:09:18 2019
@@ -1,7 +1,7 @@
-/*	$NetBSD: tprof_x86.c,v 1.7 2018/11/26 23:20:57 knakahara Exp $	*/
+/*	$NetBSD: tprof_x86.c,v 1.8 2019/05/29 17:09:18 maxv Exp $	*/
 
 /*
- * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -654,11 +654,57 @@ static struct event_table amd_f10h = {
 	.next = NULL
 };
 
-static struct event_table *
-init_amd_f10h(void)
-{
-	return &amd_f10h;
-}
+/*
+ * AMD Family 17h
+ */
+static struct name_to_event amd_f17h_names[] = {
+	{ "FpRetx87FpOps",		0x02, __BITS(2,0), true },
+	{ "FpRetSseAvxOps",		0x03, __BITS(7,0), true },
+	{ "FpRetiredSerOps",		0x05, __BITS(3,0), true },
+	{ "LsL1DTlbMiss",		0x45, __BITS(7,0), true },
+	{ "LsTableWalker",		0x46, __BITS(3,0), true },
+	{ "LsMisalAccesses",		0x47, 0x00, true },
+	{ "LsInefSwPref",		0x52, __BITS(1,0), true },
+	{ "LsNotHaltedCyc",		0x76, 0x00, true },
+	{ "IcFw32",			0x80, 0x00, true },
+	{ "IcFw32Miss",			0x81, 0x00, true },
+	{ "IcCacheFillL2",		0x82, 0x00, true },
+	{ "IcCacheFillSys",		0x83, 0x00, true },
+	{ "IcFetchStall",		0x87, __BITS(2,0), true },
+	{ "IcCacheInval",		0x8C, __BITS(1,0), true },
+	{ "BpL1TlbMissL2Hit",		0x84, 0x00, true },
+	{ "BpL1TlbMissL2Miss",		0x85, 0x00, true },
+	{ "BpSnpReSync",		0x86, 0x00, true },
+	{ "BpL1BTBCorrect",		0x8A, 0x00, true },
+	{ "BpL2BTBCorrect",		0x8B, 0x00, true },
+	{ "BpTlbRel",			0x99, 0x00, true },
+	{ "ExRetInstr",			0xC0, 0x00, true },
+	{ "ExRetCops",			0xC1, 0x00, true },
+	{ "ExRetBrn",			0xC2, 0x00, true },
+	{ "ExRetBrnMisp",		0xC3, 0x00, true },
+	{ "ExRetBrnTkn",		0xC4, 0x00, true },
+	{ "ExRetBrnTknMisp",		0xC5, 0x00, true },
+	{ "ExRetBrnFar",		0xC6, 0x00, true },
+	{ "ExRetBrnResync",		0xC7, 0x00, true },
+	{ "ExRetBrnIndMisp",		0xCA, 0x00, true },
+	{ "ExRetNearRet",		0xC8, 0x00, true },
+	{ "ExRetNearRetMispred",	0xC9, 0x00, true },
+	{ "ExRetMmxFpInstr@X87",	0xCB, __BIT(0), true },
+	{ "ExRetMmxFpInstr@Mmx",	0xCB, __BIT(1), true },
+	{ "ExRetMmxFpInstr@Sse",	0xCB, __BIT(2), true },
+	{ "ExRetCond",			0xD1, 0x00, true },
+	{ "ExRetCondMisp",		0xD2, 0x00, true },
+	{ "ExDivBusy",			0xD3, 0x00, true },
+	{ "ExDivCount",			0xD4, 0x00, true },
+};
+
+static struct event_table amd_f17h = {
+	.table

CVS commit: src/external/gpl3/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 17:52:10 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: bsd-kvm.c i386-bsd-nat.h
src/external/gpl3/gdb/lib/libbfd/arch/i386: bfd-in3.h bfd.h
bfd_stdint.h bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libdecnumber/arch/i386: config.h gstdint.h
src/external/gpl3/gdb/lib/libgdb/arch/i386: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdb/arch/i386/build-gnulib: config.h
src/external/gpl3/gdb/lib/libiberty/arch/i386: config.h
src/external/gpl3/gdb/lib/libopcodes/arch/i386: config.h
src/external/gpl3/gdb/lib/libreadline/arch/i386: config.h

Log Message:
fix build and regen for i386


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.h
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/lib/libbfd/arch/i386/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/i386/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/i386/bfd_stdint.h \
src/external/gpl3/gdb/lib/libbfd/arch/i386/bfdver.h
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/lib/libbfd/arch/i386/config.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/lib/libbfd/arch/i386/defs.mk
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/i386/targmatch.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libdecnumber/arch/i386/config.h
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gdb/lib/libdecnumber/arch/i386/gstdint.h
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gdb/lib/libgdb/arch/i386/config.h
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/lib/libgdb/arch/i386/defs.mk
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/lib/libgdb/arch/i386/init.c
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gdb/lib/libgdb/arch/i386/jit-reader.h
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/lib/libgdb/arch/i386/version.c \
src/external/gpl3/gdb/lib/libgdb/arch/i386/xml-builtin.c
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gdb/lib/libgdb/arch/i386/build-gnulib/config.h
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gdb/lib/libiberty/arch/i386/config.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gdb/lib/libopcodes/arch/i386/config.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libreadline/arch/i386/config.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-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 18:19:03 UTC 2019

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

Log Message:
Add i386


To generate a diff of this commit:
cvs rdiff -u -r1.1139 -r1.1140 src/share/mk/bsd.own.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-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 18:19:03 UTC 2019

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

Log Message:
Add i386


To generate a diff of this commit:
cvs rdiff -u -r1.1139 -r1.1140 src/share/mk/bsd.own.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.own.mk
diff -u src/share/mk/bsd.own.mk:1.1139 src/share/mk/bsd.own.mk:1.1140
--- src/share/mk/bsd.own.mk:1.1139	Tue May 28 21:57:59 2019
+++ src/share/mk/bsd.own.mk	Wed May 29 14:19:03 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1139 2019/05/29 01:57:59 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.1140 2019/05/29 18:19:03 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -138,7 +138,8 @@ USE_SSP?=	yes
 #
 # What GDB is used?
 #
-.if ${MACHINE} == "amd64"
+.if ${MACHINE} == "amd64" || \
+${MACHINE} == "i386"
 HAVE_GDB?=	830
 .else
 HAVE_GDB?=	801



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:07:47 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: configure.nat
Removed Files:
src/external/gpl3/gdb/dist/gdb/config/i386: nbsd64.mh nbsdelf.mh

Log Message:
Move definitions into configure.nat; harmonize and refactor the NetBSD
nat definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/configure.nat
cvs rdiff -u -r1.10 -r0 src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh
cvs rdiff -u -r1.7 -r0 src/external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh

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

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/configure.nat
diff -u src/external/gpl3/gdb/dist/gdb/configure.nat:1.1.1.1 src/external/gpl3/gdb/dist/gdb/configure.nat:1.2
--- src/external/gpl3/gdb/dist/gdb/configure.nat:1.1.1.1	Sun May 26 16:59:23 2019
+++ src/external/gpl3/gdb/dist/gdb/configure.nat	Wed May 29 18:07:47 2019
@@ -329,11 +329,12 @@ case ${gdb_host} in
 	esac
 	;;
 nbsd)
+	NATDEPFILES="${NATDEPFILES} nbsd-nat.o bsd-kvm.o"
+	LOADLIBES='-lkvm'
 	case ${gdb_host_cpu} in
 	alpha)
 		# Host: NetBSD/alpha
-		NATDEPFILES="${NATDEPFILES} alpha-bsd-nat.o bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} alpha-bsd-nat.o"
 		;;
 	mips)
 		# Host: NetBSD/mips
@@ -341,12 +342,11 @@ case ${gdb_host} in
 		;;
 	pa)
 		# Host: NetBSD/hppa
-		NATDEPFILES="${NATDEPFILES} nbsd-nat.o hppa-nbsd-nat.o"
+		NATDEPFILES="${NATDEPFILES} hppa-nbsd-nat.o"
 		;;
 	powerpc)
 		# Host: NetBSD/powerpc
-		NATDEPFILES="${NATDEPFILES} ppc-nbsd-nat.o bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} ppc-nbsd-nat.o"
 		;;
 	sh)
 		# Host: NetBSD/sh
@@ -356,22 +356,24 @@ case ${gdb_host} in
 	esac
 	;;
 nbsd64)
+	NATDEPFILES="${NATDEPFILES} nbsd-nat.o bsd-kvm.o"
+	LOADLIBES='-lkvm'
 	case ${gdb_host_cpu} in
 	i386)
 		# Host: NetBSD/amd64
-		NATDEPFILES="${NATDEPFILES} nbsd-nat.o amd64-nat.o x86-nat.o \
-		nat/x86-dregs.o x86-bsd-nat.o amd64-bsd-nat.o amd64-nbsd-nat.o"
+		NATDEPFILES="${NATDEPFILES} amd64-nbsd-nat.o amd64-bsd-nat.o \
+		amd64-nat.o x86-bsd-nat.o x86-nat.o nat/x86-dregs.o"
 		;;
 	sparc)
 		# Host: NetBSD/sparc64
-		NATDEPFILES="${NATDEPFILES} sparc64-nbsd-nat.o sparc-nat.o \
-		bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} sparc64-nbsd-nat.o sparc-nat.o"
 		;;
 
 	esac
 	;;
 nbsdelf)
+	NATDEPFILES="${NATDEPFILES} nbsd-nat.o bsd-kvm.o"
+	LOADLIBES='-lkvm'
 	case ${gdb_host_cpu} in
 	arm)
 		# Host: NetBSD/arm
@@ -379,26 +381,20 @@ case ${gdb_host} in
 		;;
 	i386)
 		# Host: NetBSD/i386 ELF
-		NATDEPFILES="${NATDEPFILES} nbsd-nat.o x86-nat.o \
-		nat/x86-dregs.o \
-		x86-bsd-nat.o i386-bsd-nat.o i386-nbsd-nat.o bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} i386-nbsd-nat.o i386-bsd-nat.o \
+		x86-bsd-nat.o x86-nat.o nat/x86-dregs.o"
 		;;
 	m68k)
 		# Host: NetBSD/m68k ELF
-		NATDEPFILES="${NATDEPFILES} m68k-bsd-nat.o bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} m68k-bsd-nat.o"
 		;;
 	sparc)
 		# Host: NetBSD/sparc ELF
-		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-nbsd-nat.o \
-		bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} sparc-nat.o sparc-nbsd-nat.o"
 		;;
 	vax)
 		# Host: NetBSD/vax ELF
-		NATDEPFILES="${NATDEPFILES} vax-bsd-nat.o bsd-kvm.o"
-		LOADLIBES='-lkvm'
+		NATDEPFILES="${NATDEPFILES} vax-bsd-nat.o"
 		;;
 
 	esac



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:08:28 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: sparc-nat.c sparc-nat.h
sparc-nbsd-nat.c sparc-nbsd-tdep.c sparc64-nbsd-nat.c

Log Message:
make those compile again...


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/gdb/sparc-nat.c
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/sparc-nat.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/sparc-nbsd-tdep.c

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



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:08:28 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: sparc-nat.c sparc-nat.h
sparc-nbsd-nat.c sparc-nbsd-tdep.c sparc64-nbsd-nat.c

Log Message:
make those compile again...


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/gdb/sparc-nat.c
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/sparc-nat.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/sparc-nbsd-tdep.c

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

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/sparc-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/sparc-nat.c:1.12 src/external/gpl3/gdb/dist/gdb/sparc-nat.c:1.13
--- src/external/gpl3/gdb/dist/gdb/sparc-nat.c:1.12	Tue May 28 11:30:39 2019
+++ src/external/gpl3/gdb/dist/gdb/sparc-nat.c	Wed May 29 18:08:28 2019
@@ -252,7 +252,7 @@ sparc_store_inferior_registers (struct r
TARGET_OBJECT_WCOOKIE.  Fetch StackGhost Per-Process XOR cookie.  */
 
 enum target_xfer_status
-sparc_xfer_wcookie (struct target_ops *ops, enum target_object object,
+sparc_xfer_wcookie (enum target_object object,
 		const char *annex, gdb_byte *readbuf,
 		const gdb_byte *writebuf, ULONGEST offset, ULONGEST len,
 		ULONGEST *xfered_len)

Index: src/external/gpl3/gdb/dist/gdb/sparc-nat.h
diff -u src/external/gpl3/gdb/dist/gdb/sparc-nat.h:1.1.1.7 src/external/gpl3/gdb/dist/gdb/sparc-nat.h:1.2
--- src/external/gpl3/gdb/dist/gdb/sparc-nat.h:1.1.1.7	Sun May 26 16:59:31 2019
+++ src/external/gpl3/gdb/dist/gdb/sparc-nat.h	Wed May 29 18:08:28 2019
@@ -75,7 +75,7 @@ struct sparc_target : public BaseTarget
   return sparc_xfer_wcookie (object, annex, readbuf, writebuf,
  offset, len, xfered_len);
 
-return BaseTarget (object, annex, readbuf, writebuf,
+return BaseTarget::xfer_partial (object, annex, readbuf, writebuf,
 		   offset, len, xfered_len);
   }
 };

Index: src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c:1.5 src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c:1.6
--- src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c:1.5	Sun May 26 17:40:01 2019
+++ src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c	Wed May 29 18:08:28 2019
@@ -91,7 +91,7 @@ sparc32nbsd_supply_pcb (struct regcache 
   return 1;
 }
 
-static sparc_target the_sparc_nbsd_nat_target;
+static sparc_target the_sparc_nbsd_nat_target;
 
 void
 _initialize_sparcnbsd_nat (void)
@@ -100,7 +100,7 @@ _initialize_sparcnbsd_nat (void)
   sparc_gregmap = &sparc32nbsd_gregmap;
   sparc_fpregmap = &sparc32_bsd_fpregmap;
 
-  add_inf_child_target (&sparc_nbsd_nat_target);
+  add_inf_child_target (&the_sparc_nbsd_nat_target);
 
   /* Support debugging kernel virtual memory images.  */
   bsd_kvm_add_target (sparc32nbsd_supply_pcb);
Index: src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c:1.5 src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c:1.6
--- src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c:1.5	Sun May 26 17:40:01 2019
+++ src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c	Wed May 29 18:08:28 2019
@@ -20,6 +20,8 @@
 #include "defs.h"
 #include "gdbcore.h"
 #include "regcache.h"
+#include "inferior.h"
+#include "inf-ptrace.h"
 #include "target.h"
 
 #include "nbsd-nat.h"
@@ -27,17 +29,6 @@
 #include "sparc-nbsd-tdep.h"
 #include "sparc-nat.h"
 
-#include 
-
-#ifndef HAVE_GREGSET_T
-typedef struct reg gregset_t;
-#endif
-
-#ifndef HAVE_FPREGSET_T
-typedef struct fpreg fpregset_t;
-#endif
-#include "gregset.h"
- 
 /* NetBSD is different from the other OSes that support both SPARC and
UltraSPARC in that the result of ptrace(2) depends on whether the
traced process is 32-bit or 64-bit.  */
@@ -139,29 +130,7 @@ sparc64nbsd_fpregset_supplies_p (struct 
   return 0;
 }
 
-void
-supply_gregset (struct regcache *regcache, const gregset_t *gregs)
-{
-  sparc64nbsd_supply_gregset (sparc_gregmap, regcache, -1, gregs);
-}
-
-void
-supply_fpregset (struct regcache *regcache, const fpregset_t *fpregs)
-{
-  sparc64nbsd_supply_fpregset (sparc_fpregmap, regcache, -1, fpregs);
-}
 
-void
-fill_gregset (const struct regcache *regcache, gregset_t *gregs, int regnum)
-{
-  sparc64nbsd_collect_gregset (sparc_gregmap, regcache, regnum, gregs);
-}
-
-void
-fill_fpregset (const struct regcache *regcache, fpregset_t *fpregs, int regnum)
-{
-  sparc64nbsd_collect_fpregset (sparc_fpregmap, regcache, regnum, fpregs);
-}
 /* Support for debugging kernel virtual memory images.  */
 
 #include 
@@ -203,13 +172,11 @@ sparc64nbsd_supply_pcb (struct regcache 
 }
 
 /* We've got nothing to add to the generic SPARC target.  */
-static sparc_target the_sparc64_nbsd_nat_target;
+static sparc_target the_sparc64_n

CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:07:47 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: configure.nat
Removed Files:
src/external/gpl3/gdb/dist/gdb/config/i386: nbsd64.mh nbsdelf.mh

Log Message:
Move definitions into configure.nat; harmonize and refactor the NetBSD
nat definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/configure.nat
cvs rdiff -u -r1.10 -r0 src/external/gpl3/gdb/dist/gdb/config/i386/nbsd64.mh
cvs rdiff -u -r1.7 -r0 src/external/gpl3/gdb/dist/gdb/config/i386/nbsdelf.mh

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



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:10:38 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-nat.c arm-nbsd-nat.c

Log Message:
Some more mechanical c++ificiation.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c

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



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:10:38 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-nat.c arm-nbsd-nat.c

Log Message:
Some more mechanical c++ificiation.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c

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

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.2	Thu Dec 27 04:55:27 2018
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c	Wed May 29 18:10:38 2019
@@ -61,7 +61,7 @@ aarch64_nbsd_fetch_inferior_registers (s
   pid_t pid = ptid_get_pid (ptid);
   int tid = ptid_get_lwp (ptid);
 
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
 {
   struct reg regs;
@@ -96,7 +96,7 @@ aarch64_nbsd_store_inferior_registers (s
   pid_t pid = ptid_get_pid (ptid);
   int tid = ptid_get_lwp (ptid);
 
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
 {
   struct reg regs;
@@ -159,13 +159,13 @@ aarch64_nbsd_supply_pcb (struct regcache
 
   for (i = 0; i <= 30; i++)
 {
-  regcache_raw_supply (regcache, AARCH64_X0_REGNUM + i, &tf.tf_reg[i]);
+  regcache->raw_supply (AARCH64_X0_REGNUM + i, &tf.tf_reg[i]);
 }
-  regcache_raw_supply (regcache, AARCH64_SP_REGNUM, &tf.tf_sp);
-  regcache_raw_supply (regcache, AARCH64_PC_REGNUM, &tf.tf_pc);
+  regcache->raw_supply (AARCH64_SP_REGNUM, &tf.tf_sp);
+  regcache->raw_supply (AARCH64_PC_REGNUM, &tf.tf_pc);
 
-  regcache_raw_supply (regcache, AARCH64_FPCR_REGNUM, &pcb->pcb_fpregs.fpcr);
-  regcache_raw_supply (regcache, AARCH64_FPSR_REGNUM, &pcb->pcb_fpregs.fpsr);
+  regcache->raw_supply (AARCH64_FPCR_REGNUM, &pcb->pcb_fpregs.fpcr);
+  regcache->raw_supply (AARCH64_FPSR_REGNUM, &pcb->pcb_fpregs.fpsr);
 
   return 1;
 }

Index: src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.8 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.9
--- src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c:1.8	Tue May 28 11:30:39 2019
+++ src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c	Wed May 29 18:10:38 2019
@@ -93,17 +93,17 @@ armnbsd_supply_pcb (struct regcache *reg
 
   read_memory (pcb->pcb_sp, (gdb_byte *) &sf, sizeof sf);
 
-  regcache_raw_supply (regcache, ARM_PC_REGNUM, &sf.sf_pc);
-  regcache_raw_supply (regcache, ARM_SP_REGNUM, &pcb->pcb_sp);
-  regcache_raw_supply (regcache, 12, &pcb->pcb_r12);
-  regcache_raw_supply (regcache, 11, &pcb->pcb_r11);
-  regcache_raw_supply (regcache, 10, &pcb->pcb_r10);
-  regcache_raw_supply (regcache, 9, &pcb->pcb_r9);
-  regcache_raw_supply (regcache, 8, &pcb->pcb_r8);
-  regcache_raw_supply (regcache, 7, &sf.sf_r7);
-  regcache_raw_supply (regcache, 6, &sf.sf_r6);
-  regcache_raw_supply (regcache, 5, &sf.sf_r5);
-  regcache_raw_supply (regcache, 4, &sf.sf_r4);
+  regcache->raw_supply (ARM_PC_REGNUM, &sf.sf_pc);
+  regcache->raw_supply (ARM_SP_REGNUM, &pcb->pcb_sp);
+  regcache->raw_supply (12, &pcb->pcb_r12);
+  regcache->raw_supply (11, &pcb->pcb_r11);
+  regcache->raw_supply (10, &pcb->pcb_r10);
+  regcache->raw_supply (9, &pcb->pcb_r9);
+  regcache->raw_supply (8, &pcb->pcb_r8);
+  regcache->raw_supply (7, &sf.sf_r7);
+  regcache->raw_supply (6, &sf.sf_r6);
+  regcache->raw_supply (5, &sf.sf_r5);
+  regcache->raw_supply (4, &sf.sf_r4);
 
   return 1;
 }



CVS commit: src/external/gpl3/gdb/lib

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:11:00 UTC 2019

Modified Files:
src/external/gpl3/gdb/lib/libbfd/arch/sparc: bfd-in3.h bfd.h
bfd_stdint.h bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libbfd/arch/sparc64: bfd-in3.h bfd.h
bfd_stdint.h bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libdecnumber/arch/sparc: config.h gstdint.h
src/external/gpl3/gdb/lib/libdecnumber/arch/sparc64: config.h gstdint.h
src/external/gpl3/gdb/lib/libgdb/arch/i386: init.c
src/external/gpl3/gdb/lib/libgdb/arch/sparc: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdb/arch/sparc/build-gnulib: config.h
src/external/gpl3/gdb/lib/libgdb/arch/sparc64: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdb/arch/sparc64/build-gnulib: config.h
src/external/gpl3/gdb/lib/libgdb/arch/x86_64: defs.mk init.c
src/external/gpl3/gdb/lib/libiberty/arch/sparc: config.h
src/external/gpl3/gdb/lib/libiberty/arch/sparc64: config.h
src/external/gpl3/gdb/lib/libopcodes/arch/sparc: config.h
src/external/gpl3/gdb/lib/libopcodes/arch/sparc64: config.h
src/external/gpl3/gdb/lib/libreadline/arch/sparc: config.h
src/external/gpl3/gdb/lib/libreadline/arch/sparc64: config.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gdb/lib/libbfd/arch/sparc/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/sparc/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/sparc/bfdver.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gdb/lib/libbfd/arch/sparc/bfd_stdint.h
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/lib/libbfd/arch/sparc/config.h
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/lib/libbfd/arch/sparc/defs.mk
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/sparc/targmatch.h
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gdb/lib/libbfd/arch/sparc64/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/sparc64/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/sparc64/bfdver.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gdb/lib/libbfd/arch/sparc64/bfd_stdint.h
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gdb/lib/libbfd/arch/sparc64/config.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libbfd/arch/sparc64/defs.mk
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/sparc64/targmatch.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libdecnumber/arch/sparc/config.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gdb/lib/libdecnumber/arch/sparc/gstdint.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libdecnumber/arch/sparc64/config.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gdb/lib/libdecnumber/arch/sparc64/gstdint.h
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/lib/libgdb/arch/i386/init.c
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libgdb/arch/sparc/config.h
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gdb/lib/libgdb/arch/sparc/defs.mk \
src/external/gpl3/gdb/lib/libgdb/arch/sparc/init.c
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gdb/lib/libgdb/arch/sparc/jit-reader.h
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gdb/lib/libgdb/arch/sparc/version.c \
src/external/gpl3/gdb/lib/libgdb/arch/sparc/xml-builtin.c
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libgdb/arch/sparc/build-gnulib/config.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libgdb/arch/sparc64/config.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libgdb/arch/sparc64/defs.mk
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gdb/lib/libgdb/arch/sparc64/init.c
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gdb/lib/libgdb/arch/sparc64/jit-reader.h
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gdb/lib/libgdb/arch/sparc64/version.c \
src/external/gpl3/gdb/lib/libgdb/arch/sparc64/xml-builtin.c
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gdb/lib/libgdb/arch/sparc64/build-gnulib/config.h
cvs rdiff -u -r1.15 -r1.16 \
src/external/gpl3/gdb/lib/libgdb/arch/x86_64/defs.mk \
src/external/gpl3/gdb/lib/libgdb/arch/x86_64/init.c
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gdb/lib/libiberty/arch/sparc/config.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gdb/lib/libiberty/arch/sparc64/config.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gdb/lib/libopcodes/arch/sparc/config.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gdb/lib/libopcodes/arch/sparc64/config.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libreadline/arch/sparc/config.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libreadline/arch/sparc64/config.h

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

CVS commit: src/share/mk

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:12:16 UTC 2019

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

Log Message:
move sparc* to new gdb.


To generate a diff of this commit:
cvs rdiff -u -r1.1140 -r1.1141 src/share/mk/bsd.own.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.own.mk
diff -u src/share/mk/bsd.own.mk:1.1140 src/share/mk/bsd.own.mk:1.1141
--- src/share/mk/bsd.own.mk:1.1140	Wed May 29 14:19:03 2019
+++ src/share/mk/bsd.own.mk	Wed May 29 18:12:16 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1140 2019/05/29 18:19:03 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.1141 2019/05/29 22:12:16 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -139,7 +139,9 @@ USE_SSP?=	yes
 # What GDB is used?
 #
 .if ${MACHINE} == "amd64" || \
-${MACHINE} == "i386"
+${MACHINE} == "i386" || \
+${MACHINE} == "sparc" || \
+${MACHINE} == "sparc64"
 HAVE_GDB?=	830
 .else
 HAVE_GDB?=	801



CVS commit: src/share/mk

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 22:12:16 UTC 2019

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

Log Message:
move sparc* to new gdb.


To generate a diff of this commit:
cvs rdiff -u -r1.1140 -r1.1141 src/share/mk/bsd.own.mk

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



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 01:19:36 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-nat.c alpha-bsd-nat.c
arm-nbsd-nat.c hppa-nbsd-nat.c i386-bsd-nat.c m68k-bsd-nat.c
mips-nbsd-nat.c ppc-nbsd-nat.c sh-nbsd-nat.c sparc-nat.c
sparc-nbsd-nat.c sparc64-nbsd-nat.c vax-bsd-nat.c x86-bsd-nat.c

Log Message:
more cleanups and homogenization


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/hppa-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sh-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gdb/dist/gdb/sparc-nat.c

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



CVS commit: src/external/gpl3/gdb/dist/gdb

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 01:19:36 UTC 2019

Modified Files:
src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-nat.c alpha-bsd-nat.c
arm-nbsd-nat.c hppa-nbsd-nat.c i386-bsd-nat.c m68k-bsd-nat.c
mips-nbsd-nat.c ppc-nbsd-nat.c sh-nbsd-nat.c sparc-nat.c
sparc-nbsd-nat.c sparc64-nbsd-nat.c vax-bsd-nat.c x86-bsd-nat.c

Log Message:
more cleanups and homogenization


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/alpha-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gdb/dist/gdb/arm-nbsd-nat.c
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/gdb/hppa-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/ppc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sh-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/sparc64-nbsd-nat.c \
src/external/gpl3/gdb/dist/gdb/vax-bsd-nat.c \
src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/i386-bsd-nat.c
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/m68k-bsd-nat.c
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gdb/dist/gdb/sparc-nat.c

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

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.3 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.4
--- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c:1.3	Wed May 29 18:10:38 2019
+++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-nat.c	Wed May 29 21:19:36 2019
@@ -36,6 +36,14 @@
 
 /* Determine if PT_GETREGS fetches REGNUM.  */
 
+struct aarch64_nbsd_nat_target final : public nbsd_nat_target
+{
+  void fetch_registers (struct regcache *, int) override;
+  void store_registers (struct regcache *, int) override;
+};
+
+static aarch64_nbsd_nat_target the_aarch64_nbsd_nat_target;
+
 static bool
 getregs_supplies (struct gdbarch *gdbarch, int regnum)
 {
@@ -50,23 +58,19 @@ getfpregs_supplies (struct gdbarch *gdba
   return (regnum >= AARCH64_V0_REGNUM && regnum <= AARCH64_FPCR_REGNUM);
 }
 
-/* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
-   for all registers.  */
-
-static void
-aarch64_nbsd_fetch_inferior_registers (struct target_ops *ops,
-struct regcache *regcache, int regnum)
-{
-  ptid_t ptid = regcache_get_ptid (regcache);
-  pid_t pid = ptid_get_pid (ptid);
-  int tid = ptid_get_lwp (ptid);
+void
+aarch64_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
+{
+  ptid_t ptid = regcache->ptid ();
+  pid_t pid = ptid.pid ();
+  int lwp = ptid.lwp ();
 
   struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
 {
   struct reg regs;
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, tid) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, lwp) == -1)
 	perror_with_name (_("Couldn't get registers"));
 
   regcache_supply_regset (&aarch64_nbsd_gregset, regcache, regnum, ®s,
@@ -77,7 +81,7 @@ aarch64_nbsd_fetch_inferior_registers (s
 {
   struct fpreg fpregs;
 
-  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, tid) == -1)
+  if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, lwp) == -1)
 	perror_with_name (_("Couldn't get floating point status"));
 
   regcache_supply_regset (&aarch64_nbsd_fpregset, regcache, regnum, &fpregs,
@@ -88,20 +92,19 @@ aarch64_nbsd_fetch_inferior_registers (s
 /* Store register REGNUM back into the inferior.  If REGNUM is -1, do
this for all registers.  */
 
-static void
-aarch64_nbsd_store_inferior_registers (struct target_ops *ops,
-struct regcache *regcache, int regnum)
-{
-  ptid_t ptid = regcache_get_ptid (regcache);
-  pid_t pid = ptid_get_pid (ptid);
-  int tid = ptid_get_lwp (ptid);
+void
+aarch64_nbsd_nat_target::store_registers (struct regcache *regcache, int regno)
+{
+  ptid_t ptid = regcache->ptid ();
+  pid_t pid = ptid.pid ();
+  int lwp = ptid.lwp ();
 
   struct gdbarch *gdbarch = regcache->arch ();
   if (regnum == -1 || getregs_supplies (gdbarch, regnum))
 {
   struct reg regs;
 
-  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, tid) == -1)
+  if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, lwp) == -1)
 	perror_with_name (_("Couldn't get registers"));
 
   regcache_collect_regset (&aarch64_nbsd_gregset, regcache,regnum, ®s,
@@ -173,12 +176,7 @@ aarch64_nbsd_supply_pcb (struct regcache
 void
 _initialize_aarch64_nbsd_nat (void)
 {
-  struct target_ops *t;
-
-  t = inf_ptrace_target ();
-  t->to_fetch_registers = aarch64_nbsd_fetch_inferior_registers;
-  t->to_store_registers = aarch64_nbsd_store_inferior_registers;
-  nbsd_n

CVS commit: src/external/gpl3/gdb/lib

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 01:20:00 UTC 2019

Modified Files:
src/external/gpl3/gdb/lib/libbfd/arch/vax: bfd-in3.h bfd.h bfd_stdint.h
bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libdecnumber/arch/vax: config.h gstdint.h
src/external/gpl3/gdb/lib/libgdb/arch/vax: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdb/arch/vax/build-gnulib: config.h
src/external/gpl3/gdb/lib/libiberty/arch/vax: config.h
src/external/gpl3/gdb/lib/libopcodes/arch/vax: config.h
src/external/gpl3/gdb/lib/libreadline/arch/vax: config.h

Log Message:
vaxinate.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/lib/libbfd/arch/vax/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/vax/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/vax/bfdver.h
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gdb/lib/libbfd/arch/vax/bfd_stdint.h
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gdb/lib/libbfd/arch/vax/config.h
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/lib/libbfd/arch/vax/defs.mk
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/vax/targmatch.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libdecnumber/arch/vax/config.h
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gdb/lib/libdecnumber/arch/vax/gstdint.h
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/lib/libgdb/arch/vax/config.h
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gdb/lib/libgdb/arch/vax/defs.mk
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gdb/lib/libgdb/arch/vax/init.c
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gdb/lib/libgdb/arch/vax/jit-reader.h
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/lib/libgdb/arch/vax/version.c \
src/external/gpl3/gdb/lib/libgdb/arch/vax/xml-builtin.c
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gdb/lib/libgdb/arch/vax/build-gnulib/config.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gdb/lib/libiberty/arch/vax/config.h
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gdb/lib/libopcodes/arch/vax/config.h
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gdb/lib/libreadline/arch/vax/config.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-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 01:20:41 UTC 2019

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

Log Message:
add vax to new gdb


To generate a diff of this commit:
cvs rdiff -u -r1.1141 -r1.1142 src/share/mk/bsd.own.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.own.mk
diff -u src/share/mk/bsd.own.mk:1.1141 src/share/mk/bsd.own.mk:1.1142
--- src/share/mk/bsd.own.mk:1.1141	Wed May 29 18:12:16 2019
+++ src/share/mk/bsd.own.mk	Wed May 29 21:20:41 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1141 2019/05/29 22:12:16 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.1142 2019/05/30 01:20:41 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -141,7 +141,8 @@ USE_SSP?=	yes
 .if ${MACHINE} == "amd64" || \
 ${MACHINE} == "i386" || \
 ${MACHINE} == "sparc" || \
-${MACHINE} == "sparc64"
+${MACHINE} == "sparc64" || \
+${MACHINE} == "vax"
 HAVE_GDB?=	830
 .else
 HAVE_GDB?=	801



CVS commit: src/share/mk

2019-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 30 01:20:41 UTC 2019

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

Log Message:
add vax to new gdb


To generate a diff of this commit:
cvs rdiff -u -r1.1141 -r1.1142 src/share/mk/bsd.own.mk

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-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 30 02:32:18 UTC 2019

Modified Files:
src/sys/arch/arm/ep93xx: epe.c
src/sys/arch/arm/omap: omapl1x_emac.c
src/sys/arch/sgimips/mace: if_mec.c
src/sys/dev/ic: lan9118.c mtd803.c rtl8169.c smc91cxx.c
src/sys/dev/pci: if_bce.c if_lii.c if_sk.c

Log Message:
 Simplify MII structure initialization and reference. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/arm/ep93xx/epe.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/omap/omapl1x_emac.c
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/sgimips/mace/if_mec.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/ic/lan9118.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/ic/mtd803.c
cvs rdiff -u -r1.158 -r1.159 src/sys/dev/ic/rtl8169.c
cvs rdiff -u -r1.101 -r1.102 src/sys/dev/ic/smc91cxx.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/if_bce.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/if_lii.c
cvs rdiff -u -r1.97 -r1.98 src/sys/dev/pci/if_sk.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/ep93xx/epe.c
diff -u src/sys/arch/arm/ep93xx/epe.c:1.43 src/sys/arch/arm/ep93xx/epe.c:1.44
--- src/sys/arch/arm/ep93xx/epe.c:1.43	Tue May 28 07:41:46 2019
+++ src/sys/arch/arm/ep93xx/epe.c	Thu May 30 02:32:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: epe.c,v 1.43 2019/05/28 07:41:46 msaitoh Exp $	*/
+/*	$NetBSD: epe.c,v 1.44 2019/05/30 02:32:17 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2004 Jesse Off
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.43 2019/05/28 07:41:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.44 2019/05/30 02:32:17 msaitoh Exp $");
 
 #include 
 #include 
@@ -284,6 +284,7 @@ epe_init(struct epe_softc *sc)
 	char *addr;
 	int rsegs, err, i;
 	struct ifnet * ifp = &sc->sc_ec.ec_if;
+	struct mii_data *mii = &sc->sc_mii;
 	int mdcdiv = DEFAULT_MDCDIV;
 
 	callout_init(&sc->epe_tick_ch, 0);
@@ -396,16 +397,16 @@ epe_init(struct epe_softc *sc)
 		mdcdiv = device_cfdata(sc->sc_dev)->cf_flags;
 	EPE_WRITE(SelfCtl, (SelfCtl_MDCDIV(mdcdiv) | SelfCtl_PSPRS));
 
-	sc->sc_mii.mii_ifp = ifp;
-	sc->sc_mii.mii_readreg = epe_mii_readreg;
-	sc->sc_mii.mii_writereg = epe_mii_writereg;
-	sc->sc_mii.mii_statchg = epe_statchg;
-	sc->sc_ec.ec_mii = &sc->sc_mii;
-	ifmedia_init(&sc->sc_mii.mii_media, IFM_IMASK, epe_mediachange,
+	mii->mii_ifp = ifp;
+	mii->mii_readreg = epe_mii_readreg;
+	mii->mii_writereg = epe_mii_writereg;
+	mii->mii_statchg = epe_statchg;
+	sc->sc_ec.ec_mii = mii;
+	ifmedia_init(&mii->mii_media, IFM_IMASK, epe_mediachange,
 		ether_mediastatus);
-	mii_attach(sc->sc_dev, &sc->sc_mii, 0x, MII_PHY_ANY,
-		MII_OFFSET_ANY, 0);
-	ifmedia_set(&sc->sc_mii.mii_media, IFM_ETHER | IFM_AUTO);
+	mii_attach(sc->sc_dev, mii, 0x, MII_PHY_ANY,
+	MII_OFFSET_ANY, 0);
+	ifmedia_set(&mii->mii_media, IFM_ETHER | IFM_AUTO);
 
 	EPE_WRITE(BMCtl, BMCtl_RxEn | BMCtl_TxEn);
 	EPE_WRITE(IntEn, IntEn_REOFIE);

Index: src/sys/arch/arm/omap/omapl1x_emac.c
diff -u src/sys/arch/arm/omap/omapl1x_emac.c:1.10 src/sys/arch/arm/omap/omapl1x_emac.c:1.11
--- src/sys/arch/arm/omap/omapl1x_emac.c:1.10	Wed May 29 06:21:56 2019
+++ src/sys/arch/arm/omap/omapl1x_emac.c	Thu May 30 02:32:17 2019
@@ -30,7 +30,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: omapl1x_emac.c,v 1.10 2019/05/29 06:21:56 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omapl1x_emac.c,v 1.11 2019/05/30 02:32:17 msaitoh Exp $");
 
 #include "opt_omapl1x.h"
 
@@ -1197,6 +1197,7 @@ emac_attach (device_t parent, device_t s
 {
 	struct emac_softc * const sc = device_private(self);
 	struct ifnet * const ifp = &sc->sc_if;
+	struct mii_data *mii = &sc->sc_mii;
 	struct tipb_attach_args *tipb = aux;
 	const char * const xname = device_xname(self);
 	prop_dictionary_t dict = device_properties(self);
@@ -1320,26 +1321,23 @@ emac_attach (device_t parent, device_t s
 	}
 
 	/* mii related stuff */
-	sc->sc_mii.mii_ifp = ifp;
-	sc->sc_mii.mii_readreg = emac_mii_readreg;
-	sc->sc_mii.mii_writereg = emac_mii_writereg;
-	sc->sc_mii.mii_statchg = emac_mii_statchg;
-	sc->sc_ec.ec_mii = &sc->sc_mii;
+	mii->mii_ifp = ifp;
+	mii->mii_readreg = emac_mii_readreg;
+	mii->mii_writereg = emac_mii_writereg;
+	mii->mii_statchg = emac_mii_statchg;
+	sc->sc_ec.ec_mii = mii;
 
 	EMAC_WRITE(sc, MACMDIOCONTROL, __BIT(30) | __BIT(18) |
 		   EMAC_MDIO_CLKDIV);
 
-	ifmedia_init(&sc->sc_mii.mii_media, 0, ether_mediachange,
-	ether_mediastatus);
-	mii_attach(self, &sc->sc_mii, 0x, MII_PHY_ANY, 0, 0);
-	if (LIST_FIRST(&sc->sc_mii.mii_phys) == NULL) {
+	ifmedia_init(&mii->mii_media, 0, ether_mediachange, ether_mediastatus);
+	mii_attach(self, mii, 0x, MII_PHY_ANY, 0, 0);
+	if (LIST_FIRST(&mii->mii_phys) == NULL) {
 		aprint_error_dev(self, "no PHY found!\n");
-		ifmedia_add(&sc->sc_mii.mii_media,
-		IFM_ETHER | IFM_MANUAL, 0, NULL);
-		ifmedia_set(&sc->sc_mii.mii_media, 

CVS commit: src/sys

2019-05-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 30 02:32:18 UTC 2019

Modified Files:
src/sys/arch/arm/ep93xx: epe.c
src/sys/arch/arm/omap: omapl1x_emac.c
src/sys/arch/sgimips/mace: if_mec.c
src/sys/dev/ic: lan9118.c mtd803.c rtl8169.c smc91cxx.c
src/sys/dev/pci: if_bce.c if_lii.c if_sk.c

Log Message:
 Simplify MII structure initialization and reference. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/arm/ep93xx/epe.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/omap/omapl1x_emac.c
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/sgimips/mace/if_mec.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/ic/lan9118.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/ic/mtd803.c
cvs rdiff -u -r1.158 -r1.159 src/sys/dev/ic/rtl8169.c
cvs rdiff -u -r1.101 -r1.102 src/sys/dev/ic/smc91cxx.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/if_bce.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/if_lii.c
cvs rdiff -u -r1.97 -r1.98 src/sys/dev/pci/if_sk.c

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