CVS commit: src

2022-01-07 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Fri Jan  7 10:17:39 UTC 2022

Modified Files:
src/sbin/ifconfig: ifconfig.8
src/usr.bin/netstat: netstat.1

Log Message:
mention ifmcstat(8) in SEE ALSO.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sbin/ifconfig/ifconfig.8
cvs rdiff -u -r1.74 -r1.75 src/usr.bin/netstat/netstat.1

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



CVS commit: src

2022-01-07 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Fri Jan  7 10:17:39 UTC 2022

Modified Files:
src/sbin/ifconfig: ifconfig.8
src/usr.bin/netstat: netstat.1

Log Message:
mention ifmcstat(8) in SEE ALSO.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sbin/ifconfig/ifconfig.8
cvs rdiff -u -r1.74 -r1.75 src/usr.bin/netstat/netstat.1

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

Modified files:

Index: src/sbin/ifconfig/ifconfig.8
diff -u src/sbin/ifconfig/ifconfig.8:1.122 src/sbin/ifconfig/ifconfig.8:1.123
--- src/sbin/ifconfig/ifconfig.8:1.122	Tue Mar  9 14:39:43 2021
+++ src/sbin/ifconfig/ifconfig.8	Fri Jan  7 10:17:39 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ifconfig.8,v 1.122 2021/03/09 14:39:43 christos Exp $
+.\"	$NetBSD: ifconfig.8,v 1.123 2022/01/07 10:17:39 bad Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -902,6 +902,7 @@ tried to alter an interface's configurat
 .Xr vlan 4 ,
 .Xr ifconfig.if 5 ,
 .\" .Xr eon 5 ,
+.Xr ifmcstat 8 ,
 .Xr rc 8 ,
 .Xr routed 8
 .Sh BUGS

Index: src/usr.bin/netstat/netstat.1
diff -u src/usr.bin/netstat/netstat.1:1.74 src/usr.bin/netstat/netstat.1:1.75
--- src/usr.bin/netstat/netstat.1:1.74	Tue Jul 21 04:58:43 2020
+++ src/usr.bin/netstat/netstat.1	Fri Jan  7 10:17:39 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: netstat.1,v 1.74 2020/07/21 04:58:43 gutteridge Exp $
+.\"	$NetBSD: netstat.1,v 1.75 2022/01/07 10:17:39 bad Exp $
 .\"
 .\" Copyright (c) 1983, 1990, 1992, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -441,6 +441,7 @@ And the fifth character shows the header
 .Xr networks 5 ,
 .Xr protocols 5 ,
 .Xr services 5 ,
+.Xr ifmcstat 8 ,
 .Xr iostat 8 ,
 .Xr route 8 ,
 .Xr trpt 8



Re: CVS commit: src/sys/uvm

2019-12-21 Thread Christoph Badura
On Sat, Dec 21, 2019 at 12:58:26PM +, Andrew Doran wrote:
> Modified Files:
>   src/sys/uvm: uvm_extern.h uvm_page.c
> Log Message:
> Add uvm_free(): returns number of free pages in system.

Can you rename this to a more descriptive name? Say uvm_free_pages() or
something.

Also, we traditionally use xxx_free() to actually free some object and not
return statistics.  It would be nice to spare future readers the
confusion.

--chris


Re: case-sensitive APFS volumes

2019-11-14 Thread Christoph Badura
On Wed, Nov 13, 2019 at 05:55:58AM -0800, Jason Thorpe wrote:
> > On Nov 13, 2019, at 1:57 AM, Christoph Badura  wrote:
> > Just HTF does one add the same cryptographic users that the / volume has?
> > TFM does not tell.  It just says that "indeed, they should be added before
> > encryption".
> 
> Hm, I'm not actually sure.  I'll do a bit of research.

Thanks!

> > Maybe we can document this for the benfit of other NetBSD developers.
> > 
> > And yes, I do *not* want to dink around in the Disk Utility GUI.
> > Automation or GTFO.
> 
> All of these things should be possible with the diskutil command.

Yeah. From the rest of the man page it looked like that should be doable.

Actually, what I reall would like the system to do is the following:
Unlock the file system with the same key that the root fs gets unlocked
with during boot.  And mount the file system always, e.g. not only when I
log in to the machine with the gui.

That might be a different problem.  But I didn't have the time and
caffeine to investigate that yesterday.

--chris


case-sensitive APFS volumes

2019-11-13 Thread Christoph Badura
On Tue, Sep 03, 2019 at 07:31:06AM -0700, Jason Thorpe wrote:
> If your Mac has APFS, it's not quite that bad -- you can create a new
> file system that's case-insensitive inside the same APFS container as
> the file system with your home directory and space-share with that
> file system (the default behavior).  You can do this all within Disk
> Utility without having to remember any command line magic.

Just HTF does one add the same cryptographic users that the / volume has?
TFM does not tell.  It just says that "indeed, they should be added before
encryption".

Maybe we can document this for the benfit of other NetBSD developers.

And yes, I do *not* want to dink around in the Disk Utility GUI.
Automation or GTFO.

--chris


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

2019-11-12 Thread Christoph Badura
Hi,

On Tue, Nov 12, 2019 at 06:00:13PM +, Maxime Villard wrote:
> Committed By: maxv
> Date: Tue Nov 12 18:00:13 UTC 2019
> Modified Files:
>   src/sys/arch/x86/include: specialreg.h
>   src/sys/arch/x86/x86: spectre.c
> Log Message:
> Mitigation for CVE-2019-11135: TSX Asynchronous Abort (TAA).

are you planing to document the new sysctls properly? Preferably without
TLA-soup.

--chris


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

2019-11-01 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Fri Nov  1 13:30:02 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_gmac.c

Log Message:
fetch PHY id from FDT.  same as sunxi_emac.c.

prevents PHY 0 of RTL8211E from wrongly attaching on e.g. Bananpi M1.
requested by jmcneill@, patch by martin@.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/sunxi/sunxi_gmac.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/sunxi

2019-11-01 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Fri Nov  1 13:30:02 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_gmac.c

Log Message:
fetch PHY id from FDT.  same as sunxi_emac.c.

prevents PHY 0 of RTL8211E from wrongly attaching on e.g. Bananpi M1.
requested by jmcneill@, patch by martin@.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/sunxi/sunxi_gmac.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/sunxi/sunxi_gmac.c
diff -u src/sys/arch/arm/sunxi/sunxi_gmac.c:1.6 src/sys/arch/arm/sunxi/sunxi_gmac.c:1.7
--- src/sys/arch/arm/sunxi/sunxi_gmac.c:1.6	Sun Jul 21 08:24:32 2019
+++ src/sys/arch/arm/sunxi/sunxi_gmac.c	Fri Nov  1 13:30:02 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_gmac.c,v 1.6 2019/07/21 08:24:32 mrg Exp $ */
+/* $NetBSD: sunxi_gmac.c,v 1.7 2019/11/01 13:30:02 bad Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_gmac.c,v 1.6 2019/07/21 08:24:32 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_gmac.c,v 1.7 2019/11/01 13:30:02 bad Exp $");
 
 #include 
 #include 
@@ -94,6 +94,24 @@ sunxi_gmac_intr(void *arg)
 }
 
 static int
+sunxi_gmac_get_phyid(int phandle)
+{
+	bus_addr_t addr;
+	int phy_phandle;
+
+	phy_phandle = fdtbus_get_phandle(phandle, "phy");
+	if (phy_phandle == -1)
+		phy_phandle = fdtbus_get_phandle(phandle, "phy-handle");
+	if (phy_phandle == -1)
+		return MII_PHY_ANY;
+
+	if (fdtbus_get_reg(phy_phandle, 0, , NULL) != 0)
+		return MII_PHY_ANY;
+
+	return (int)addr;
+}
+
+static int
 sunxi_gmac_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct fdt_attach_args * const faa = aux;
@@ -192,7 +210,8 @@ sunxi_gmac_attach(device_t parent, devic
 	if (sunxi_gmac_reset(phandle) != 0)
 		aprint_error_dev(self, "PHY reset failed\n");
 
-	dwc_gmac_attach(sc, MII_PHY_ANY, GMAC_MII_CLK_150_250M_DIV102);
+	dwc_gmac_attach(sc, sunxi_gmac_get_phyid(phandle),
+	GMAC_MII_CLK_150_250M_DIV102);
 }
 
 CFATTACH_DECL_NEW(sunxi_gmac, sizeof(struct dwc_gmac_softc),



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

2019-11-01 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Fri Nov  1 13:22:08 UTC 2019

Modified Files:
src/sys/arch/arm/fdt: cpu_fdt.c

Log Message:
fix typos in comment in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/fdt/cpu_fdt.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/fdt

2019-11-01 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Fri Nov  1 13:22:08 UTC 2019

Modified Files:
src/sys/arch/arm/fdt: cpu_fdt.c

Log Message:
fix typos in comment in previous.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/fdt/cpu_fdt.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/fdt/cpu_fdt.c
diff -u src/sys/arch/arm/fdt/cpu_fdt.c:1.29 src/sys/arch/arm/fdt/cpu_fdt.c:1.30
--- src/sys/arch/arm/fdt/cpu_fdt.c:1.29	Fri Nov  1 12:44:54 2019
+++ src/sys/arch/arm/fdt/cpu_fdt.c	Fri Nov  1 13:22:08 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_fdt.c,v 1.29 2019/11/01 12:44:54 bad Exp $ */
+/* $NetBSD: cpu_fdt.c,v 1.30 2019/11/01 13:22:08 bad Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -30,7 +30,7 @@
 #include "psci_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.29 2019/11/01 12:44:54 bad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.30 2019/11/01 13:22:08 bad Exp $");
 
 #include 
 #include 
@@ -349,7 +349,7 @@ cpu_enable_psci(int phandle)
 
 #if !defined(AARCH64)
 	/*
-	 * not necessary on AARCH64. besids there it hangs the sysmte
+	 * not necessary on AARCH64. beside there it hangs the system
 	 * because cache ops are only functional after cpu_attach()
 	 * was called.
 	 */



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

2019-11-01 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Fri Nov  1 12:44:54 UTC 2019

Modified Files:
src/sys/arch/arm/fdt: cpu_fdt.c

Log Message:
re-apply r1.26. but only #if !defined(AARCH64).

not necessary on armv8 and cache ops are not available that early there.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/fdt/cpu_fdt.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/fdt

2019-11-01 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Fri Nov  1 12:44:54 UTC 2019

Modified Files:
src/sys/arch/arm/fdt: cpu_fdt.c

Log Message:
re-apply r1.26. but only #if !defined(AARCH64).

not necessary on armv8 and cache ops are not available that early there.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/fdt/cpu_fdt.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/fdt/cpu_fdt.c
diff -u src/sys/arch/arm/fdt/cpu_fdt.c:1.28 src/sys/arch/arm/fdt/cpu_fdt.c:1.29
--- src/sys/arch/arm/fdt/cpu_fdt.c:1.28	Sat Oct 19 18:04:26 2019
+++ src/sys/arch/arm/fdt/cpu_fdt.c	Fri Nov  1 12:44:54 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_fdt.c,v 1.28 2019/10/19 18:04:26 jmcneill Exp $ */
+/* $NetBSD: cpu_fdt.c,v 1.29 2019/11/01 12:44:54 bad Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -30,7 +30,7 @@
 #include "psci_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.28 2019/10/19 18:04:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.29 2019/11/01 12:44:54 bad Exp $");
 
 #include 
 #include 
@@ -347,6 +347,14 @@ cpu_enable_psci(int phandle)
 
 	fdtbus_get_reg64(phandle, 0, , NULL);
 
+#if !defined(AARCH64)
+	/*
+	 * not necessary on AARCH64. besids there it hangs the sysmte
+	 * because cache ops are only functional after cpu_attach()
+	 * was called.
+	 */
+	cpu_dcache_wbinv_all();
+#endif
 	ret = psci_cpu_on(mpidr, cpu_fdt_mpstart_pa(), 0);
 	if (ret != PSCI_SUCCESS)
 		return EIO;



CVS commit: src/sys/dev/sdmmc

2019-10-27 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Sun Oct 27 21:39:50 UTC 2019

Modified Files:
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
white space police.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/sdmmc/if_bwfm_sdio.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/sdmmc/if_bwfm_sdio.c
diff -u src/sys/dev/sdmmc/if_bwfm_sdio.c:1.6 src/sys/dev/sdmmc/if_bwfm_sdio.c:1.7
--- src/sys/dev/sdmmc/if_bwfm_sdio.c:1.6	Wed Sep 25 16:21:14 2019
+++ src/sys/dev/sdmmc/if_bwfm_sdio.c	Sun Oct 27 21:39:50 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bwfm_sdio.c,v 1.6 2019/09/25 16:21:14 mlelstv Exp $ */
+/* $NetBSD: if_bwfm_sdio.c,v 1.7 2019/10/27 21:39:50 bad Exp $ */
 /* $OpenBSD: if_bwfm_sdio.c,v 1.1 2017/10/11 17:19:50 patrick Exp $ */
 /*
  * Copyright (c) 2010-2016 Broadcom Corporation
@@ -171,9 +171,9 @@ voidbwfm_sdio_rx_frames(stru
 voidbwfm_sdio_rx_glom(struct bwfm_sdio_softc *,
 		uint16_t *, int, uint16_t *);
 
-#ifdef BWFM_DEBUG 
+#ifdef BWFM_DEBUG
 void		bwfm_sdio_debug_console(struct bwfm_sdio_softc *);
-#endif 
+#endif
 
 struct bwfm_bus_ops bwfm_sdio_bus_ops = {
 	.bs_init = NULL,
@@ -203,22 +203,22 @@ static const struct bwfm_sdio_product {
 } bwfm_sdio_products[] = {
 	{
 		SDMMC_VENDOR_BROADCOM,
-		SDMMC_PRODUCT_BROADCOM_BCM4330, 
+		SDMMC_PRODUCT_BROADCOM_BCM4330,
 		SDMMC_CIS_BROADCOM_BCM4330
 	},
 	{
 		SDMMC_VENDOR_BROADCOM,
-		SDMMC_PRODUCT_BROADCOM_BCM4334, 
+		SDMMC_PRODUCT_BROADCOM_BCM4334,
 		SDMMC_CIS_BROADCOM_BCM4334
 	},
 	{
 		SDMMC_VENDOR_BROADCOM,
-		SDMMC_PRODUCT_BROADCOM_BCM43143, 
+		SDMMC_PRODUCT_BROADCOM_BCM43143,
 		SDMMC_CIS_BROADCOM_BCM43143
 	},
 	{
 		SDMMC_VENDOR_BROADCOM,
-		SDMMC_PRODUCT_BROADCOM_BCM43430, 
+		SDMMC_PRODUCT_BROADCOM_BCM43430,
 		SDMMC_CIS_BROADCOM_BCM43430
 	},
 };
@@ -296,14 +296,14 @@ bwfm_sdio_attach(device_t parent, device
 	sdmmc_io_set_blocklen(sc->sc_sf[1]->sc, sc->sc_sf[1], 64);
 	sdmmc_io_set_blocklen(sc->sc_sf[2]->sc, sc->sc_sf[2], 512);
 
-/* Enable Function 1. */
-if (sdmmc_io_function_enable(sc->sc_sf[1]) != 0) {
-printf("%s: cannot enable function 1\n", DEVNAME(sc));
-return;
-}
+	/* Enable Function 1. */
+	if (sdmmc_io_function_enable(sc->sc_sf[1]) != 0) {
+		printf("%s: cannot enable function 1\n", DEVNAME(sc));
+		return;
+	}
 
-DPRINTF(("%s: F1 signature read @0x1800=%x\n", DEVNAME(sc),
-bwfm_sdio_read_4(sc, 0x1800)));
+	DPRINTF(("%s: F1 signature read @0x1800=%x\n", DEVNAME(sc),
+	bwfm_sdio_read_4(sc, 0x1800)));
 
 	/* Force PLL off */
 	bwfm_sdio_write_1(sc, BWFM_SDIO_FUNC1_CHIPCLKCSR,
@@ -486,8 +486,8 @@ bwfm_sdio_attachhook(device_t self)
 	bwfm_sdio_dev_write(sc, SDPCMD_TOSBMAILBOXDATA,
 	SDPCM_PROT_VERSION << SDPCM_PROT_VERSION_SHIFT);
 	if (sdmmc_io_function_enable(sc->sc_sf[2])) {
-printf("%s: cannot enable function 2\n", DEVNAME(sc));
-goto err;
+		printf("%s: cannot enable function 2\n", DEVNAME(sc));
+		goto err;
 	}
 
 	bwfm_sdio_dev_write(sc, SDPCMD_HOSTINTMASK,
@@ -1264,7 +1264,7 @@ bwfm_sdio_intr(void *v)
 {
 	struct bwfm_sdio_softc *sc = (void *)v;
 
-DPRINTF(("%s: sdio_intr\n", DEVNAME(sc)));
+	DPRINTF(("%s: sdio_intr\n", DEVNAME(sc)));
 
 	mutex_enter(>sc_intr_lock);
 	if (!sdmmc_task_pending(>sc_task))
@@ -1312,7 +1312,7 @@ bwfm_sdio_task1(struct bwfm_sdio_softc *
 	}
 
 	intstat = bwfm_sdio_dev_read(sc, BWFM_SDPCMD_INTSTATUS);
-DPRINTF(("%s: intstat 0x%" PRIx32 "\n", DEVNAME(sc), intstat));
+	DPRINTF(("%s: intstat 0x%" PRIx32 "\n", DEVNAME(sc), intstat));
 	intstat &= (SDPCMD_INTSTATUS_HMB_SW_MASK|SDPCMD_INTSTATUS_CHIPACTIVE);
 	/* XXX fc state */
 	if (intstat)
@@ -1320,7 +1320,7 @@ bwfm_sdio_task1(struct bwfm_sdio_softc *
 
 	if (intstat & SDPCMD_INTSTATUS_HMB_HOST_INT) {
 		hostint = bwfm_sdio_dev_read(sc, SDPCMD_TOHOSTMAILBOXDATA);
-	DPRINTF(("%s: hostint 0x%" PRIx32 "\n", DEVNAME(sc), hostint));
+		DPRINTF(("%s: hostint 0x%" PRIx32 "\n", DEVNAME(sc), hostint));
 		bwfm_sdio_dev_write(sc, SDPCMD_TOSBMAILBOX,
 		SDPCMD_TOSBMAILBOX_INT_ACK);
 		if (hostint & SDPCMD_TOHOSTMAILBOXDATA_NAKHANDLED)
@@ -1345,7 +1345,7 @@ bwfm_sdio_tx_ok(struct bwfm_sdio_softc *
 	((uint8_t)(sc->sc_tx_max_seq - sc->sc_tx_seq) & 0x80) == 0;
 }
 
-void
+void
 bwfm_sdio_tx_frames(struct bwfm_sdio_softc *sc)
 {
 	struct mbuf *m;
@@ -1365,7 +1365,7 @@ bwfm_sdio_tx_frames(struct bwfm_sdio_sof
 		if (m->m_type == MT_CONTROL)
 			bwfm_sdio_tx_ctrlframe(sc, m);
 		else {
-			bwfm_sdio_tx_dataframe(sc, m);  
+			bwfm_sdio_tx_dataframe(sc, m);
 			ifp->if_opackets++;
 			ifstart = true;
 		}
@@ -1385,7 +1385,7 @@ bwfm_sdio_tx_ctrlframe(struct bwfm_sdio_
 	struct bwfm_sdio_hwhdr *hwhdr;
 	struct bwfm_sdio_swhdr *swhdr;
 	size_t len, roundto;
-	
+
 	len = sizeof(*hwhdr) + sizeof(*swhdr) + m->m_len;
 
 	/* Zero-pad to 

CVS commit: src/sys/dev/sdmmc

2019-10-27 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Sun Oct 27 21:39:50 UTC 2019

Modified Files:
src/sys/dev/sdmmc: if_bwfm_sdio.c

Log Message:
white space police.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/sdmmc/if_bwfm_sdio.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/fdt

2019-10-17 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 17 21:52:27 UTC 2019

Modified Files:
src/sys/arch/arm/fdt: cpu_fdt.c

Log Message:
back out r1.26. it makes the pinebook fail to boot.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/fdt/cpu_fdt.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/fdt/cpu_fdt.c
diff -u src/sys/arch/arm/fdt/cpu_fdt.c:1.26 src/sys/arch/arm/fdt/cpu_fdt.c:1.27
--- src/sys/arch/arm/fdt/cpu_fdt.c:1.26	Tue Oct 15 17:25:02 2019
+++ src/sys/arch/arm/fdt/cpu_fdt.c	Thu Oct 17 21:52:26 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_fdt.c,v 1.26 2019/10/15 17:25:02 bad Exp $ */
+/* $NetBSD: cpu_fdt.c,v 1.27 2019/10/17 21:52:26 bad Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -30,7 +30,7 @@
 #include "psci_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.26 2019/10/15 17:25:02 bad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.27 2019/10/17 21:52:26 bad Exp $");
 
 #include 
 #include 
@@ -348,7 +348,6 @@ cpu_enable_psci(int phandle)
 
 	fdtbus_get_reg64(phandle, 0, , NULL);
 
-	cpu_dcache_wbinv_all();
 	ret = psci_cpu_on(mpidr, cpu_fdt_mpstart_pa(), 0);
 	if (ret != PSCI_SUCCESS)
 		return EIO;



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

2019-10-17 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 17 21:52:27 UTC 2019

Modified Files:
src/sys/arch/arm/fdt: cpu_fdt.c

Log Message:
back out r1.26. it makes the pinebook fail to boot.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/fdt/cpu_fdt.c

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



CVS commit: src/doc

2019-10-16 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Oct 16 20:49:59 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Mention support for FriendlyElec NanoPi R1 and Duo2.


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

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



CVS commit: src/doc

2019-10-16 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Oct 16 20:49:59 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Mention support for FriendlyElec NanoPi R1 and Duo2.


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2596 src/doc/CHANGES:1.2597
--- src/doc/CHANGES:1.2596	Wed Oct 16 14:56:34 2019
+++ src/doc/CHANGES	Wed Oct 16 20:49:59 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2596 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2597 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -59,3 +59,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	acpi(4): Updated ACPICA to 20190816. [christos 20191015]
 	sup: removed, use ftp://ftp.astron.com/pub/sup [christos 20191015]
 	dhcpcd(8): Import dhcpcd-8.1.1 [roy 20191016]
+	evbarm: Add support for the NanoPi R1 and Duo2. [bad 20191016]



CVS commit: src/sys/dev/usb

2019-10-16 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Oct 16 13:11:16 UTC 2019

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

Log Message:
allocate a random mac address if on-chip mac is all zeroes.

helps ure(4) on NanoPi R1.

partly from ganbold@freebsd r346052.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/usb/if_ure.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-10-16 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Oct 16 13:11:16 UTC 2019

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

Log Message:
allocate a random mac address if on-chip mac is all zeroes.

helps ure(4) on NanoPi R1.

partly from ganbold@freebsd r346052.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/usb/if_ure.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_ure.c
diff -u src/sys/dev/usb/if_ure.c:1.32 src/sys/dev/usb/if_ure.c:1.33
--- src/sys/dev/usb/if_ure.c:1.32	Wed Oct 16 13:02:51 2019
+++ src/sys/dev/usb/if_ure.c	Wed Oct 16 13:11:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ure.c,v 1.32 2019/10/16 13:02:51 bad Exp $	*/
+/*	$NetBSD: if_ure.c,v 1.33 2019/10/16 13:11:16 bad Exp $	*/
 /*	$OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $	*/
 
 /*-
@@ -30,7 +30,7 @@
 /* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.32 2019/10/16 13:02:51 bad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.33 2019/10/16 13:11:16 bad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -38,6 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1
 #endif
 
 #include 
+#include 
 
 #include 
 
@@ -66,6 +67,9 @@ int	uredebug = 0;
 #define DPRINTFN(n, x)
 #endif
 
+#define ETHER_IS_ZERO(addr) \
+	(!(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]))
+
 static const struct usb_devno ure_devs[] = {
 	{ USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8152 },
 	{ USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_RTL8153 }
@@ -848,6 +852,7 @@ ure_attach(device_t parent, device_t sel
 	uint16_t ver;
 	uint8_t eaddr[8]; /* 2byte padded */
 	char *devinfop;
+	uint32_t maclo, machi;
 
 	aprint_naive("\n");
 	aprint_normal("\n");
@@ -949,6 +954,16 @@ ure_attach(device_t parent, device_t sel
 		ure_read_mem(un, URE_PLA_BACKUP, URE_MCU_TYPE_PLA, eaddr,
 		sizeof(eaddr));
 	usbnet_unlock(un);
+	if (ETHER_IS_ZERO(eaddr)) {
+		maclo = 0x00f2 | (cprng_strong32() & 0x);
+		machi = cprng_strong32() & 0x;
+		eaddr[0] = maclo & 0xff;
+		eaddr[1] = (maclo >> 8) & 0xff;
+		eaddr[2] = (maclo >> 16) & 0xff;
+		eaddr[3] = (maclo >> 24) & 0xff;
+		eaddr[4] = machi & 0xff;
+		eaddr[5] = (machi >> 8) & 0xff;
+	}
 	memcpy(un->un_eaddr, eaddr, sizeof un->un_eaddr);
 
 	struct ifnet *ifp = usbnet_ifp(un);



CVS commit: src/sys/dev/usb

2019-10-16 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Oct 16 13:02:51 UTC 2019

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

Log Message:
read mac address of ure version 4c10 from URE_PLA_IDR, save as 4c00.

from ganbold@freebsd r346052.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/usb/if_ure.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_ure.c
diff -u src/sys/dev/usb/if_ure.c:1.31 src/sys/dev/usb/if_ure.c:1.32
--- src/sys/dev/usb/if_ure.c:1.31	Fri Aug 23 04:32:57 2019
+++ src/sys/dev/usb/if_ure.c	Wed Oct 16 13:02:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ure.c,v 1.31 2019/08/23 04:32:57 mrg Exp $	*/
+/*	$NetBSD: if_ure.c,v 1.32 2019/10/16 13:02:51 bad Exp $	*/
 /*	$OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $	*/
 
 /*-
@@ -30,7 +30,7 @@
 /* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.31 2019/08/23 04:32:57 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.32 2019/10/16 13:02:51 bad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -941,7 +941,8 @@ ure_attach(device_t parent, device_t sel
 	else
 		ure_rtl8153_init(un);
 
-	if (un->un_flags & URE_FLAG_VER_4C00)
+	if ((un->un_flags & URE_FLAG_VER_4C00) ||
+	(un->un_flags & URE_FLAG_VER_4C10))
 		ure_read_mem(un, URE_PLA_IDR, URE_MCU_TYPE_PLA, eaddr,
 		sizeof(eaddr));
 	else



CVS commit: src/sys/dev/usb

2019-10-16 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Oct 16 13:02:51 UTC 2019

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

Log Message:
read mac address of ure version 4c10 from URE_PLA_IDR, save as 4c00.

from ganbold@freebsd r346052.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/usb/if_ure.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/fdt

2019-10-15 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Tue Oct 15 17:25:02 UTC 2019

Modified Files:
src/sys/arch/arm/fdt: cpu_fdt.c

Log Message:
flush the dcache in cpu_enable_psci() before calling psci_cpu_on().

fixes the kernel hanging with multiple "mpstart" on (at least) NanoPi R1.

OK jmcneill@, skrll@

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/fdt/cpu_fdt.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/fdt/cpu_fdt.c
diff -u src/sys/arch/arm/fdt/cpu_fdt.c:1.25 src/sys/arch/arm/fdt/cpu_fdt.c:1.26
--- src/sys/arch/arm/fdt/cpu_fdt.c:1.25	Sat Apr 13 19:15:25 2019
+++ src/sys/arch/arm/fdt/cpu_fdt.c	Tue Oct 15 17:25:02 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_fdt.c,v 1.25 2019/04/13 19:15:25 jmcneill Exp $ */
+/* $NetBSD: cpu_fdt.c,v 1.26 2019/10/15 17:25:02 bad Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -30,7 +30,7 @@
 #include "psci_fdt.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.25 2019/04/13 19:15:25 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.26 2019/10/15 17:25:02 bad Exp $");
 
 #include 
 #include 
@@ -348,6 +348,7 @@ cpu_enable_psci(int phandle)
 
 	fdtbus_get_reg64(phandle, 0, , NULL);
 
+	cpu_dcache_wbinv_all();
 	ret = psci_cpu_on(mpidr, cpu_fdt_mpstart_pa(), 0);
 	if (ret != PSCI_SUCCESS)
 		return EIO;



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

2019-10-15 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Tue Oct 15 17:25:02 UTC 2019

Modified Files:
src/sys/arch/arm/fdt: cpu_fdt.c

Log Message:
flush the dcache in cpu_enable_psci() before calling psci_cpu_on().

fixes the kernel hanging with multiple "mpstart" on (at least) NanoPi R1.

OK jmcneill@, skrll@

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/fdt/cpu_fdt.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/pcmcia

2019-10-10 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 10 23:37:13 UTC 2019

Modified Files:
src/sys/dev/pcmcia: if_malo_pcmcia.c

Log Message:
if we can memcpy to body->macaddr, we can memcpy from it.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pcmcia/if_malo_pcmcia.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/pcmcia/if_malo_pcmcia.c
diff -u src/sys/dev/pcmcia/if_malo_pcmcia.c:1.21 src/sys/dev/pcmcia/if_malo_pcmcia.c:1.22
--- src/sys/dev/pcmcia/if_malo_pcmcia.c:1.21	Tue Mar  5 08:25:02 2019
+++ src/sys/dev/pcmcia/if_malo_pcmcia.c	Thu Oct 10 23:37:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_malo_pcmcia.c,v 1.21 2019/03/05 08:25:02 msaitoh Exp $	*/
+/*	$NetBSD: if_malo_pcmcia.c,v 1.22 2019/10/10 23:37:13 bad Exp $	*/
 /*  $OpenBSD: if_malo.c,v 1.65 2009/03/29 21:53:53 sthen Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_malo_pcmcia.c,v 1.21 2019/03/05 08:25:02 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_malo_pcmcia.c,v 1.22 2019/10/10 23:37:13 bad Exp $");
 
 #ifdef _MODULE
 #include 
@@ -1313,8 +1313,7 @@ cmalo_cmd_rsp_hwspec(struct malo_softc *
 	body = (struct malo_cmd_body_spec *)(hdr + 1);
 
 	/* get our MAC address */
-	for (i = 0; i < ETHER_ADDR_LEN; i++)
-		ic->ic_myaddr[i] = body->macaddr[i];
+	memcpy(ic->ic_myaddr, body->macaddr, ETHER_ADDR_LEN);
 
 	return 0;
 }



CVS commit: src/sys/dev/pcmcia

2019-10-10 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 10 23:37:13 UTC 2019

Modified Files:
src/sys/dev/pcmcia: if_malo_pcmcia.c

Log Message:
if we can memcpy to body->macaddr, we can memcpy from it.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pcmcia/if_malo_pcmcia.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-10-10 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 10 23:30:02 UTC 2019

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

Log Message:
use ether_snprintf instead of open coding it.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/usb/if_urtwn.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_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.72 src/sys/dev/usb/if_urtwn.c:1.73
--- src/sys/dev/usb/if_urtwn.c:1.72	Mon Aug 19 07:20:07 2019
+++ src/sys/dev/usb/if_urtwn.c	Thu Oct 10 23:30:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.72 2019/08/19 07:20:07 mrg Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.73 2019/10/10 23:30:02 bad Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.72 2019/08/19 07:20:07 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.73 2019/10/10 23:30:02 bad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1340,10 +1340,8 @@ urtwn_dump_rom(struct urtwn_softc *sc, s
 	rp->usb_opt, rp->ep_setting, rp->usb_phy);
 
 	aprint_normal_dev(sc->sc_dev,
-	"macaddr %02x:%02x:%02x:%02x:%02x:%02x\n",
-	rp->macaddr[0], rp->macaddr[1],
-	rp->macaddr[2], rp->macaddr[3],
-	rp->macaddr[4], rp->macaddr[5]);
+	"macaddr %s\n",
+	ether_sprintf(rp->macaddr));
 
 	aprint_normal_dev(sc->sc_dev,
 	"string %s, subcustomer_id 0x%x\n",



CVS commit: src/sys/dev/usb

2019-10-10 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 10 23:30:02 UTC 2019

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

Log Message:
use ether_snprintf instead of open coding it.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/usb/if_urtwn.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-10-10 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 10 22:34:42 UTC 2019

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

Log Message:
magic number police. use ETHER_ADDR_LEN.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/dev/pci/if_iwn.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-10-10 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 10 22:34:42 UTC 2019

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

Log Message:
magic number police. use ETHER_ADDR_LEN.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/dev/pci/if_iwn.c

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

Modified files:

Index: src/sys/dev/pci/if_iwn.c
diff -u src/sys/dev/pci/if_iwn.c:1.91 src/sys/dev/pci/if_iwn.c:1.92
--- src/sys/dev/pci/if_iwn.c:1.91	Fri Apr 19 19:37:31 2019
+++ src/sys/dev/pci/if_iwn.c	Thu Oct 10 22:34:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwn.c,v 1.91 2019/04/19 19:37:31 gutteridge Exp $	*/
+/*	$NetBSD: if_iwn.c,v 1.92 2019/10/10 22:34:42 bad Exp $	*/
 /*	$OpenBSD: if_iwn.c,v 1.135 2014/09/10 07:22:09 dcoppa Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.91 2019/04/19 19:37:31 gutteridge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.92 2019/10/10 22:34:42 bad Exp $");
 
 #define IWN_USE_RBUF	/* Use local storage for RX */
 #undef IWN_HWCRYPTO	/* XXX does not even compile yet */
@@ -1568,7 +1568,7 @@ iwn_read_eeprom(struct iwn_softc *sc)
 		sc->rxchainmask = IWN_RFCFG_RXANTMSK(sc->rfcfg);
 
 	/* Read MAC address. */
-	iwn_read_prom_data(sc, IWN_EEPROM_MAC, ic->ic_myaddr, 6);
+	iwn_read_prom_data(sc, IWN_EEPROM_MAC, ic->ic_myaddr, ETHER_ADDR_LEN);
 
 	/* Read adapter-specific information from EEPROM. */
 	ops->read_eeprom(sc);



CVS commit: src/sys/arch/evbarm/conf

2019-10-08 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Tue Oct  8 23:03:01 UTC 2019

Modified Files:
src/sys/arch/evbarm/conf: GENERIC

Log Message:
Add sun8i-h3-nanopi-duo2.dts and sun8i-h3-nanopi-r1.dts.

The former is untested.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/evbarm/conf/GENERIC

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/evbarm/conf/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.53 src/sys/arch/evbarm/conf/GENERIC:1.54
--- src/sys/arch/evbarm/conf/GENERIC:1.53	Sun Oct  6 07:36:46 2019
+++ src/sys/arch/evbarm/conf/GENERIC	Tue Oct  8 23:03:01 2019
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.53 2019/10/06 07:36:46 skrll Exp $
+#	$NetBSD: GENERIC,v 1.54 2019/10/08 23:03:01 bad Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -124,8 +124,10 @@ makeoptions	DTS="
 	sun8i-h3-beelink-x2.dts
 	sun8i-h3-libretech-all-h3-cc.dts
 	sun8i-h3-mapleboard-mp130.dts
+	sun8i-h3-nanopi-duo2.dts
 	sun8i-h3-nanopi-m1-plus.dts
 	sun8i-h3-nanopi-m1.dts
+	sun8i-h3-nanopi-r1.dts
 	sun8i-h3-nanopi-neo.dts
 	sun8i-h3-nanopi-neo-air.dts
 	sun8i-h3-orangepi-2.dts



CVS commit: src/sys/arch/evbarm/conf

2019-10-08 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Tue Oct  8 23:03:01 UTC 2019

Modified Files:
src/sys/arch/evbarm/conf: GENERIC

Log Message:
Add sun8i-h3-nanopi-duo2.dts and sun8i-h3-nanopi-r1.dts.

The former is untested.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/evbarm/conf/GENERIC

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

2019-10-08 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Tue Oct  8 23:00:36 UTC 2019

Modified Files:
src/sys/arch/arm/dts: sun8i-h3-nanopi-r1.dts

Log Message:
Cherry pick a few changes from the armbian u-boot patch.

Makes my NanoPi R1 boot reliably.
>From 
>https://github.com/armbian/build/blob/master/patch/u-boot/u-boot-sunxi/add-nano+pi-r1-and-duo2.patch


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts

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

2019-10-08 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Tue Oct  8 23:00:36 UTC 2019

Modified Files:
src/sys/arch/arm/dts: sun8i-h3-nanopi-r1.dts

Log Message:
Cherry pick a few changes from the armbian u-boot patch.

Makes my NanoPi R1 boot reliably.
>From 
>https://github.com/armbian/build/blob/master/patch/u-boot/u-boot-sunxi/add-nano+pi-r1-and-duo2.patch


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts

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

Modified files:

Index: src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts
diff -u src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts:1.1 src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts:1.2
--- src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts:1.1	Tue Oct  8 22:55:58 2019
+++ src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts	Tue Oct  8 23:00:36 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sun8i-h3-nanopi-r1.dts,v 1.1 2019/10/08 22:55:58 bad Exp $ */
+/* $NetBSD: sun8i-h3-nanopi-r1.dts,v 1.2 2019/10/08 23:00:36 bad Exp $ */
 
 /*
  * Copyright (C) 2019 Igor Pecovnik 
@@ -63,6 +63,7 @@
 
 	reg_gmac_3v3: gmac-3v3 {
 		compatible = "regulator-fixed";
+		pinctrl-names = "default";
 		regulator-name = "gmac-3v3";
 		regulator-min-microvolt = <330>;
 		regulator-max-microvolt = <330>;
@@ -129,6 +130,15 @@
 	};
 };
 
+#if 0 /* XXX u-boot dts for NanoPi R1 has this but not needed? */
+ {
+	gmac_power_pin_nanopi: gmac_power_pin@0 {
+		pins = "PD6";
+		function = "gpio_out";
+	};
+};
+#endif
+
  {
 	pinctrl-names = "default";
 	pinctrl-0 = <_rgmii_pins>;
@@ -170,6 +180,11 @@
 	vqmmc-supply = <_vcc3v3>;
 	bus-width = <8>;
 	non-removable;
+	cap-mmc-hw-reset;
+	status = "okay";
+};
+
+ {
 	status = "okay";
 };
 



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

2019-10-08 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Tue Oct  8 22:55:59 UTC 2019

Added Files:
src/sys/arch/arm/dts: sun8i-h3-nanopi-duo2.dts sun8i-h3-nanopi-r1.dts

Log Message:
Add sun8i-h3-nanopi-r1.dts and sun8i-h3-nanopi-duo2.dts.

>From 
>https://github.com/armbian/build/blob/master/patch/kernel/sunxi-next/xxx-add-nanopi-r1-and-duo2.patch


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/dts/sun8i-h3-nanopi-duo2.dts \
src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts

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

2019-10-08 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Tue Oct  8 22:55:59 UTC 2019

Added Files:
src/sys/arch/arm/dts: sun8i-h3-nanopi-duo2.dts sun8i-h3-nanopi-r1.dts

Log Message:
Add sun8i-h3-nanopi-r1.dts and sun8i-h3-nanopi-duo2.dts.

>From 
>https://github.com/armbian/build/blob/master/patch/kernel/sunxi-next/xxx-add-nanopi-r1-and-duo2.patch


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/dts/sun8i-h3-nanopi-duo2.dts \
src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts

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

Added files:

Index: src/sys/arch/arm/dts/sun8i-h3-nanopi-duo2.dts
diff -u /dev/null src/sys/arch/arm/dts/sun8i-h3-nanopi-duo2.dts:1.1
--- /dev/null	Tue Oct  8 22:55:59 2019
+++ src/sys/arch/arm/dts/sun8i-h3-nanopi-duo2.dts	Tue Oct  8 22:55:58 2019
@@ -0,0 +1,99 @@
+/* $NetBSD: sun8i-h3-nanopi-duo2.dts,v 1.1 2019/10/08 22:55:58 bad Exp $ */
+
+/*
+ * Copyright (C) 2019 Igor 
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "sun8i-h3-nanopi.dtsi"
+
+/ {
+	model = "FriendlyElec NanoPi-Duo2";
+	compatible = "friendlyarm,nanopi-duo2", "allwinner,sun8i-h3";
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		pinctrl-names = "default";
+		reset-gpios = <_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
+		post-power-on-delay-ms = <200>;
+	};
+
+};
+
+_pio {
+	wifi_en_npi: wifi_en_pin {
+		pins = "PL7";
+		function = "gpio_out";
+	};
+};
+
+ {
+	vmmc-supply = <_vcc3v3>;
+	vqmmc-supply = <_vcc3v3>;
+	mmc-pwrseq = <_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	sdio_wifi: sdio_wifi@1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+		interrupt-parent = <>;
+		interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
+		interrupt-names = "host-wake";
+	};
+
+};
+
+ {
+	phy-handle = <_mii_phy>;
+	phy-mode = "mii";
+	allwinner,leds-active-low;
+	status = "okay";
+};
+
+_otg {
+	dr_mode = "peripheral";
+	status = "okay";
+};
+
+ {
+	status = "okay";
+};
Index: src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts
diff -u /dev/null src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts:1.1
--- /dev/null	Tue Oct  8 22:55:59 2019
+++ src/sys/arch/arm/dts/sun8i-h3-nanopi-r1.dts	Tue Oct  8 22:55:58 2019
@@ -0,0 +1,191 @@
+/* $NetBSD: sun8i-h3-nanopi-r1.dts,v 1.1 2019/10/08 22:55:58 bad Exp $ */
+
+/*
+ * Copyright (C) 2019 Igor Pecovnik 
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or 

CVS commit: src/sbin/fsck

2019-09-28 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Sat Sep 28 18:03:19 UTC 2019

Modified Files:
src/sbin/fsck: partutil.c

Log Message:
initialize disc_dict to NULL.

otherwise, if DIOCGDISKINFO returns an error != ENXIO getdiskinfo() later
tries to prop_object_release() stack garbage.

found by rumpctrl tests using clang-7.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sbin/fsck/partutil.c

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



CVS commit: src/sbin/fsck

2019-09-28 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Sat Sep 28 18:03:19 UTC 2019

Modified Files:
src/sbin/fsck: partutil.c

Log Message:
initialize disc_dict to NULL.

otherwise, if DIOCGDISKINFO returns an error != ENXIO getdiskinfo() later
tries to prop_object_release() stack garbage.

found by rumpctrl tests using clang-7.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sbin/fsck/partutil.c

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

Modified files:

Index: src/sbin/fsck/partutil.c
diff -u src/sbin/fsck/partutil.c:1.16 src/sbin/fsck/partutil.c:1.17
--- src/sbin/fsck/partutil.c:1.16	Sun Aug 18 11:08:56 2019
+++ src/sbin/fsck/partutil.c	Sat Sep 28 18:03:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partutil.c,v 1.16 2019/08/18 11:08:56 martin Exp $	*/
+/*	$NetBSD: partutil.c,v 1.17 2019/09/28 18:03:18 bad Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: partutil.c,v 1.16 2019/08/18 11:08:56 martin Exp $");
+__RCSID("$NetBSD: partutil.c,v 1.17 2019/09/28 18:03:18 bad Exp $");
 
 #include 
 #include 
@@ -108,6 +108,7 @@ getdiskinfo(const char *s, int fd, const
 	}
 
 	/* Get disk description dictionary */
+	disk_dict = NULL;
 	error = prop_dictionary_recv_ioctl(fd, DIOCGDISKINFO, _dict);
 
 	/* fail quickly if the device does not exist at all */



CVS commit: src/sys/rump

2019-09-27 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Fri Sep 27 11:57:42 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Remove libelf from "usr" list. Deleted 2015-09-30.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/rump/listsrcdirs

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

Modified files:

Index: src/sys/rump/listsrcdirs
diff -u src/sys/rump/listsrcdirs:1.48 src/sys/rump/listsrcdirs:1.49
--- src/sys/rump/listsrcdirs:1.48	Fri Sep 27 11:53:42 2019
+++ src/sys/rump/listsrcdirs	Fri Sep 27 11:57:42 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: listsrcdirs,v 1.48 2019/09/27 11:53:42 bad Exp $
+#	$NetBSD: listsrcdirs,v 1.49 2019/09/27 11:57:42 bad Exp $
 #
 
 #
@@ -133,7 +133,7 @@ lsrc usr /sbin/			rndctl route setkey sy
 lsrc usr /usr.bin/		kdump ktrace mixerctl sockstat
 lsrc usr /usr.sbin/		arp dumpfs mdconfig ndp npf pcictl
 lsrc usr /usr.sbin/		rtadvd vnconfig wlanctl
-lsrc usr /external/bsd/		libelf libnv libpcap tcpdump wpa
+lsrc usr /external/bsd/		libnv libpcap tcpdump wpa
 lsrc usr /crypto/		Makefile.openssl
 lsrc usr /crypto/dist/		ipsec-tools
 lsrc usr /crypto/external/bsd/	openssl



CVS commit: src/sys/rump

2019-09-27 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Fri Sep 27 11:57:42 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Remove libelf from "usr" list. Deleted 2015-09-30.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/rump/listsrcdirs

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



CVS commit: src/sys/rump

2019-09-27 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Fri Sep 27 11:53:42 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Exclude sys/external/{gpl2/dts,bsd/drm*}.

Saves some 100MB in the src-netbsd repo.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/rump/listsrcdirs

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

Modified files:

Index: src/sys/rump/listsrcdirs
diff -u src/sys/rump/listsrcdirs:1.47 src/sys/rump/listsrcdirs:1.48
--- src/sys/rump/listsrcdirs:1.47	Thu Sep 26 22:43:36 2019
+++ src/sys/rump/listsrcdirs	Fri Sep 27 11:53:42 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: listsrcdirs,v 1.47 2019/09/26 22:43:36 bad Exp $
+#	$NetBSD: listsrcdirs,v 1.48 2019/09/27 11:53:42 bad Exp $
 #
 
 #
@@ -142,7 +142,12 @@ lsrc usr /crypto/external/bsd/	openssl
 # If -c is given, use CVS syntax to exclude large subdirectories
 # of sys.  Otherwise just do it wholesale.
 if ${cvsmode}; then
-	iswanted sys && echo \!src/sys/arch src/sys
+	iswanted sys && \
+	echo \!src/sys/arch \
+		 \!src/sys/external/gpl2/dts \
+		 \!src/sys/external/bsd/drm \
+		 \!src/sys/external/bsd/drm2 \
+		src/sys
 
 	iswanted usr && \
 	echo \!src/external/bsd/libc++/dist/libcxx/test \



CVS commit: src/sys/rump

2019-09-27 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Fri Sep 27 11:53:42 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Exclude sys/external/{gpl2/dts,bsd/drm*}.

Saves some 100MB in the src-netbsd repo.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/rump/listsrcdirs

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



CVS commit: src/sys/rump

2019-09-26 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 26 22:43:37 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
rtadvd needs expandm.[hc] from libwrap.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/rump/listsrcdirs

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

Modified files:

Index: src/sys/rump/listsrcdirs
diff -u src/sys/rump/listsrcdirs:1.46 src/sys/rump/listsrcdirs:1.47
--- src/sys/rump/listsrcdirs:1.46	Thu Sep 26 22:39:55 2019
+++ src/sys/rump/listsrcdirs	Thu Sep 26 22:43:36 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: listsrcdirs,v 1.46 2019/09/26 22:39:55 bad Exp $
+#	$NetBSD: listsrcdirs,v 1.47 2019/09/26 22:43:36 bad Exp $
 #
 
 #
@@ -117,7 +117,7 @@ lsrc posix /usr.bin/		rump_server rump_a
 # dist directory consisting ~90% (50+MB) of tests unnecessary to us
 lsrc usr /lib/			i18n_module
 lsrc usr /lib/lib		crypt ipsec kvm m npf pci prop
-lsrc usr /lib/lib		pthread rmt y z
+lsrc usr /lib/lib		pthread rmt wrap y z
 lsrc usr /libexec/		ld.elf_so
 lsrc usr /bin/			chmod cp dd df ed ln ls mkdir mv pax
 lsrc usr /bin/			rm rmdir



CVS commit: src/sys/rump

2019-09-26 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 26 22:43:37 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
rtadvd needs expandm.[hc] from libwrap.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/rump/listsrcdirs

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



CVS commit: src/sys/rump

2019-09-26 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 26 22:39:55 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
revert r1.35-r1.40 of sys/rump/listsrcdirs.

addressed differently in tools/Makefile r1.204.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/rump/listsrcdirs

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

Modified files:

Index: src/sys/rump/listsrcdirs
diff -u src/sys/rump/listsrcdirs:1.45 src/sys/rump/listsrcdirs:1.46
--- src/sys/rump/listsrcdirs:1.45	Thu Sep 12 21:37:06 2019
+++ src/sys/rump/listsrcdirs	Thu Sep 26 22:39:55 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: listsrcdirs,v 1.45 2019/09/12 21:37:06 bad Exp $
+#	$NetBSD: listsrcdirs,v 1.46 2019/09/26 22:39:55 bad Exp $
 #
 
 #
@@ -99,14 +99,12 @@ lsrc sys /lib/lib		c util
 lsrc sys /external/bsd/		flex mdocml byacc
 lsrc sys /external/cddl/	osnet
 lsrc sys /external/historical/	nawk
-lsrc sys /external/public-domain/	xz
-lsrc sys /bin/			cat pax
+lsrc sys /bin/			cat
 lsrc sys /usr.bin/		make xinstall config mktemp sed tsort
 lsrc sys /usr.bin/		lorder join cksum m4 mkdep Makefile.inc
 lsrc sys /usr.bin/		rpcgen rump_wmd
-lsrc sys /usr.bin/		genassym grep stat uname
+lsrc sys /usr.bin/		genassym stat uname
 lsrc sys /usr.sbin/		mtree
-lsrc sys /sbin/			mknod
 
 # sources hosted in the NetBSD tree that are required/useful
 # when targeting POSIX-y platforms
@@ -121,12 +119,12 @@ lsrc usr /lib/			i18n_module
 lsrc usr /lib/lib		crypt ipsec kvm m npf pci prop
 lsrc usr /lib/lib		pthread rmt y z
 lsrc usr /libexec/		ld.elf_so
-lsrc usr /bin/			chmod cp dd df ed ln ls mkdir mv
+lsrc usr /bin/			chmod cp dd df ed ln ls mkdir mv pax
 lsrc usr /bin/			rm rmdir
 lsrc usr /sbin/			brconfig cgdconfig chown
 lsrc usr /sbin/			disklabel dump fdisk
 lsrc usr /sbin/			fsck fsck_ext2fs fsck_ffs fsck_msdos
-lsrc usr /sbin/			ifconfig
+lsrc usr /sbin/			ifconfig mknod
 lsrc usr /sbin/			modstat mount
 lsrc usr /sbin/			mount_ext2fs mount_ffs mount_msdos mount_tmpfs
 lsrc usr /sbin/			newfs newfs_ext2fs newfs_msdos



CVS commit: src/sys/rump

2019-09-26 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 26 22:39:55 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
revert r1.35-r1.40 of sys/rump/listsrcdirs.

addressed differently in tools/Makefile r1.204.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/rump/listsrcdirs

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



CVS commit: src/sys/rump/librump/rumpkern

2019-09-26 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 26 17:52:51 UTC 2019

Modified Files:
src/sys/rump/librump/rumpkern: emul.c

Log Message:
Provide a weak alias for vnode_to_path to be used unless librumpvfs is present.


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/sys/rump/librump/rumpkern/emul.c

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



CVS commit: src/sys/rump/librump/rumpkern

2019-09-26 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 26 17:52:51 UTC 2019

Modified Files:
src/sys/rump/librump/rumpkern: emul.c

Log Message:
Provide a weak alias for vnode_to_path to be used unless librumpvfs is present.


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/sys/rump/librump/rumpkern/emul.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/rump/librump/rumpkern/emul.c
diff -u src/sys/rump/librump/rumpkern/emul.c:1.191 src/sys/rump/librump/rumpkern/emul.c:1.192
--- src/sys/rump/librump/rumpkern/emul.c:1.191	Sun Jun  2 19:41:51 2019
+++ src/sys/rump/librump/rumpkern/emul.c	Thu Sep 26 17:52:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: emul.c,v 1.191 2019/06/02 19:41:51 kre Exp $	*/
+/*	$NetBSD: emul.c,v 1.192 2019/09/26 17:52:50 bad Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.191 2019/06/02 19:41:51 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.192 2019/09/26 17:52:50 bad Exp $");
 
 #include 
 #include 
@@ -269,6 +269,20 @@ rump_getcwd_common(struct vnode *lvp, st
 }
 __weak_alias(getcwd_common,rump_getcwd_common);
 
+/* Weak alias for vnode_to_path to be used unless librumpvfs is present. */
+
+int rump_vnode_to_path(char *, size_t, struct vnode *, struct lwp *,
+struct proc *);
+int
+rump_vnode_to_path(char *path, size_t len, struct vnode *vp, struct lwp *curl,
+struct proc *p)
+{
+
+	return ENOENT; /* pretend getcwd_common() failed. */
+}
+__weak_alias(vnode_to_path,rump_vnode_to_path);
+
+
 /* Weak aliases for fstrans to be used unless librumpvfs is present. */
 
 void rump_fstrans_start(struct mount *);



CVS commit: src/tools

2019-09-26 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 26 09:21:34 UTC 2019

Modified Files:
src/tools: Makefile

Log Message:
Exclude more subdirs if TOOLS_BUILDRUMP=yes.

Exclude subdirs added in the last 3 years but not need for rumpkernel builds.


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 src/tools/Makefile

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



CVS commit: src/tools

2019-09-26 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 26 09:21:34 UTC 2019

Modified Files:
src/tools: Makefile

Log Message:
Exclude more subdirs if TOOLS_BUILDRUMP=yes.

Exclude subdirs added in the last 3 years but not need for rumpkernel builds.


To generate a diff of this commit:
cvs rdiff -u -r1.203 -r1.204 src/tools/Makefile

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

Modified files:

Index: src/tools/Makefile
diff -u src/tools/Makefile:1.203 src/tools/Makefile:1.204
--- src/tools/Makefile:1.203	Tue May  7 10:22:54 2019
+++ src/tools/Makefile	Thu Sep 26 09:21:34 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.203 2019/05/07 10:22:54 hannken Exp $
+#	$NetBSD: Makefile,v 1.204 2019/09/26 09:21:34 bad Exp $
 
 .include 
 .include 
@@ -100,10 +100,10 @@ SUBDIR+= cap_mkdb crunchgen ctags gencat
 		makewhatis mtree nbperf .WAIT uudecode
 .endif
 
-SUBDIR+= cat rpcgen join lorder m4 mkdep tsort xz-include .WAIT yacc .WAIT awk .WAIT lex
-SUBDIR+= grep xz-lib pax .WAIT libprop
-
+SUBDIR+= cat rpcgen join lorder m4 mkdep tsort .WAIT yacc .WAIT awk .WAIT lex
 .if ${TOOLS_BUILDRUMP} == "no"
+SUBDIR+= xz-include .WAIT grep xz-lib pax .WAIT libprop
+
 SUBDIR += .WAIT texinfo \
 	.WAIT tic \
 	.WAIT ${TOOLCHAIN_BITS} \
@@ -118,7 +118,10 @@ SUBDIR += .WAIT texinfo \
 		.WAIT installboot \
 		pwd_mkdb strfile sunlabel vgrind zic
 .endif
-SUBDIR+= stat .WAIT config xz-bin
+SUBDIR+= stat .WAIT config
+.if ${TOOLS_BUILDRUMP} == "no"
+SUBDIR+= xz-bin
+.endif
 
 .if ${MKLLVM} != "no" || ${MKLLVMRT} != "no"
 SUBDIR+= \



CVS commit: src/share/mk

2019-09-15 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Sun Sep 15 21:17:08 UTC 2019

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

Log Message:
Also don't add a sysroot at all if a rumpkernel build.


To generate a diff of this commit:
cvs rdiff -u -r1.1151 -r1.1152 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-09-15 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Sun Sep 15 21:17:08 UTC 2019

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

Log Message:
Also don't add a sysroot at all if a rumpkernel build.


To generate a diff of this commit:
cvs rdiff -u -r1.1151 -r1.1152 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.1151 src/share/mk/bsd.own.mk:1.1152
--- src/share/mk/bsd.own.mk:1.1151	Fri Aug 23 08:17:27 2019
+++ src/share/mk/bsd.own.mk	Sun Sep 15 21:17:08 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1151 2019/08/23 08:17:27 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1152 2019/09/15 21:17:08 bad Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -329,7 +329,8 @@ DESTDIR?=
 # Don't append another copy of sysroot (coming from COMPATCPPFLAGS etc.)
 # because it confuses Coverity. Still we need to cov-configure specially
 # for each specific sysroot argument.
-.if !defined(HOSTPROG) && !defined(HOSTLIB)
+# Also don't add a sysroot at all if a rumpkernel build.
+.if !defined(HOSTPROG) && !defined(HOSTLIB) && !defined(RUMPRUN)
 .  if ${DESTDIR} != ""
 .	if empty(CPPFLAGS:M*--sysroot=*)
 CPPFLAGS+=	--sysroot=${DESTDIR}



CVS commit: src/sys/rump

2019-09-12 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 21:37:06 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
typo: ARCH_EXTRA -> ARCHS_EXTRA


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/rump/listsrcdirs

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

Modified files:

Index: src/sys/rump/listsrcdirs
diff -u src/sys/rump/listsrcdirs:1.44 src/sys/rump/listsrcdirs:1.45
--- src/sys/rump/listsrcdirs:1.44	Thu Sep 12 21:10:19 2019
+++ src/sys/rump/listsrcdirs	Thu Sep 12 21:37:06 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: listsrcdirs,v 1.44 2019/09/12 21:10:19 bad Exp $
+#	$NetBSD: listsrcdirs,v 1.45 2019/09/12 21:37:06 bad Exp $
 #
 
 #
@@ -81,7 +81,7 @@ include_headerlist ()
 ARCHS="amd64 i386 x86 arm evbarm sparc sparc64 powerpc evbppc mips evbmips aarch64 riscv"
 ARCHS_EXTRA="arm/arm32 Makefile"
 # files listed in src/tools/Makefile.nbincludes
-ARCH_EXTRA="$ARCH_EXTRA ews4800mips/include/pdinfo.h
+ARCHS_EXTRA="$ARCHS_EXTRA ews4800mips/include/pdinfo.h
 ews4800mips/include/vtoc.h
 dreamcast/include/endian_machdep.h
 evbsh3/include/endian_machdep.h



CVS commit: src/sys/rump

2019-09-12 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 21:37:06 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
typo: ARCH_EXTRA -> ARCHS_EXTRA


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/rump/listsrcdirs

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



CVS commit: src/sys/rump

2019-09-12 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 21:10:19 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Add ews4800mips and sh3 heads only listed in src/tools/Makefile.nbincludes.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/rump/listsrcdirs

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

Modified files:

Index: src/sys/rump/listsrcdirs
diff -u src/sys/rump/listsrcdirs:1.43 src/sys/rump/listsrcdirs:1.44
--- src/sys/rump/listsrcdirs:1.43	Thu Sep 12 20:10:00 2019
+++ src/sys/rump/listsrcdirs	Thu Sep 12 21:10:19 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: listsrcdirs,v 1.43 2019/09/12 20:10:00 bad Exp $
+#	$NetBSD: listsrcdirs,v 1.44 2019/09/12 21:10:19 bad Exp $
 #
 
 #
@@ -80,6 +80,15 @@ include_headerlist ()
 
 ARCHS="amd64 i386 x86 arm evbarm sparc sparc64 powerpc evbppc mips evbmips aarch64 riscv"
 ARCHS_EXTRA="arm/arm32 Makefile"
+# files listed in src/tools/Makefile.nbincludes
+ARCH_EXTRA="$ARCH_EXTRA ews4800mips/include/pdinfo.h
+ews4800mips/include/vtoc.h
+dreamcast/include/endian_machdep.h
+evbsh3/include/endian_machdep.h
+hpcsh/include/endian_machdep.h
+landisk/include/endian_machdep.h
+mmeye/include/endian_machdep.h
+sh3/include/endian_machdep.h"
 
 # sources necessary for building rump kernel components.  This list
 # depends on TOOLS_BUILDRUMP=yes.



CVS commit: src/sys/rump

2019-09-12 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 21:10:19 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Add ews4800mips and sh3 heads only listed in src/tools/Makefile.nbincludes.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/rump/listsrcdirs

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



CVS commit: src/sys/rump

2019-09-12 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 20:10:00 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Make include_headerlist ignore files in already exported directories.
Invoke include_headerlist after exporting the ARCHS directories.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/rump/listsrcdirs

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

Modified files:

Index: src/sys/rump/listsrcdirs
diff -u src/sys/rump/listsrcdirs:1.42 src/sys/rump/listsrcdirs:1.43
--- src/sys/rump/listsrcdirs:1.42	Thu Sep 12 18:28:05 2019
+++ src/sys/rump/listsrcdirs	Thu Sep 12 20:10:00 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: listsrcdirs,v 1.42 2019/09/12 18:28:05 bad Exp $
+#	$NetBSD: listsrcdirs,v 1.43 2019/09/12 20:10:00 bad Exp $
 #
 
 #
@@ -73,7 +73,8 @@ include_headerlist ()
 		[ -f headerlist ] \
 			|| { echo 'missing file: headerlist' 1>&2; exit 1; }
 		sed -E -e '/^#/d' -e '/^[  ]*$/d' \
-		-e "/^\.?\/?/s##src${pfx}#" headerlist
+		-e "/^\.?\/?/s##src${pfx}#" headerlist \
+		| egrep -v "^src${pfx}($(echo "$@" | tr ' ' \|))/include"
 	fi
 }
 
@@ -140,15 +141,14 @@ if ${cvsmode}; then
 	echo \!src/external/bsd/libc++/dist/libcxx/test \
 	   src/external/bsd/libc++
 
-	# the includes mentioned in src/tools/headerlist are required.
-	# pull them in first or else CVS export will complain if they
-	# have been checked out as one of the usefule archs.
-	include_headerlist sys /sys/arch/
-
 	# pick a few useful archs, namely those mentioned in buildrump.sh
 	for arch in ${ARCHS}; do
 		lsrc sys /sys/arch/${arch}/ include ${arch} Makefile
 	done
+	# the includes mentioned in src/tools/headerlist are required.
+	# but pull in only those that have not been pulled in by the previous
+	# loop
+	include_headerlist sys /sys/arch/ ${ARCHS}
 	for extra in ${ARCHS_EXTRA}; do
 		lsrc sys /sys/arch/ ${extra}
 	done



CVS commit: src/sys/rump

2019-09-12 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 20:10:00 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Make include_headerlist ignore files in already exported directories.
Invoke include_headerlist after exporting the ARCHS directories.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/rump/listsrcdirs

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



CVS commit: src/sys/rump

2019-09-12 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 18:28:05 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Summary: export the files from headerlist before the ARCHS's includes.
Or else cvs export will complain about them being in the way.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/rump/listsrcdirs

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

Modified files:

Index: src/sys/rump/listsrcdirs
diff -u src/sys/rump/listsrcdirs:1.41 src/sys/rump/listsrcdirs:1.42
--- src/sys/rump/listsrcdirs:1.41	Thu Sep 12 17:35:58 2019
+++ src/sys/rump/listsrcdirs	Thu Sep 12 18:28:05 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: listsrcdirs,v 1.41 2019/09/12 17:35:58 bad Exp $
+#	$NetBSD: listsrcdirs,v 1.42 2019/09/12 18:28:05 bad Exp $
 #
 
 #
@@ -140,6 +140,11 @@ if ${cvsmode}; then
 	echo \!src/external/bsd/libc++/dist/libcxx/test \
 	   src/external/bsd/libc++
 
+	# the includes mentioned in src/tools/headerlist are required.
+	# pull them in first or else CVS export will complain if they
+	# have been checked out as one of the usefule archs.
+	include_headerlist sys /sys/arch/
+
 	# pick a few useful archs, namely those mentioned in buildrump.sh
 	for arch in ${ARCHS}; do
 		lsrc sys /sys/arch/${arch}/ include ${arch} Makefile
@@ -147,8 +152,6 @@ if ${cvsmode}; then
 	for extra in ${ARCHS_EXTRA}; do
 		lsrc sys /sys/arch/ ${extra}
 	done
-	# the includes mentioned in src/tools/headerlist are required
-	include_headerlist sys /sys/arch/
 else
 	lsrc sys / sys
 



CVS commit: src/sys/rump

2019-09-12 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 18:28:05 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Summary: export the files from headerlist before the ARCHS's includes.
Or else cvs export will complain about them being in the way.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/rump/listsrcdirs

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



CVS commit: src/sys/rump

2019-09-12 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 17:35:58 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Summary: add the files from src/tools/headerlist to the output.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/rump/listsrcdirs

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



CVS commit: src/sys/rump

2019-09-12 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 17:35:58 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Summary: add the files from src/tools/headerlist to the output.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/rump/listsrcdirs

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

Modified files:

Index: src/sys/rump/listsrcdirs
diff -u src/sys/rump/listsrcdirs:1.40 src/sys/rump/listsrcdirs:1.41
--- src/sys/rump/listsrcdirs:1.40	Thu Sep 12 15:17:08 2019
+++ src/sys/rump/listsrcdirs	Thu Sep 12 17:35:58 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: listsrcdirs,v 1.40 2019/09/12 15:17:08 bad Exp $
+#	$NetBSD: listsrcdirs,v 1.41 2019/09/12 17:35:58 bad Exp $
 #
 
 #
@@ -63,6 +63,20 @@ lsrc ()
 	iswanted ${what} && for arg in $* ; do echo src${pfx}${arg} ; done
 }
 
+include_headerlist ()
+{
+	what=$1
+	pfx=$2
+	shift 2
+
+	if iswanted ${what}; then
+		[ -f headerlist ] \
+			|| { echo 'missing file: headerlist' 1>&2; exit 1; }
+		sed -E -e '/^#/d' -e '/^[  ]*$/d' \
+		-e "/^\.?\/?/s##src${pfx}#" headerlist
+	fi
+}
+
 ARCHS="amd64 i386 x86 arm evbarm sparc sparc64 powerpc evbppc mips evbmips aarch64 riscv"
 ARCHS_EXTRA="arm/arm32 Makefile"
 
@@ -133,6 +147,8 @@ if ${cvsmode}; then
 	for extra in ${ARCHS_EXTRA}; do
 		lsrc sys /sys/arch/ ${extra}
 	done
+	# the includes mentioned in src/tools/headerlist are required
+	include_headerlist sys /sys/arch/
 else
 	lsrc sys / sys
 



CVS commit: src/sys/rump

2019-09-12 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 15:17:08 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Summary: pax needs pack_dev.h from mknod. move mknod to sys sources


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/rump/listsrcdirs

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

Modified files:

Index: src/sys/rump/listsrcdirs
diff -u src/sys/rump/listsrcdirs:1.39 src/sys/rump/listsrcdirs:1.40
--- src/sys/rump/listsrcdirs:1.39	Thu Sep 12 00:56:05 2019
+++ src/sys/rump/listsrcdirs	Thu Sep 12 15:17:08 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: listsrcdirs,v 1.39 2019/09/12 00:56:05 bad Exp $
+#	$NetBSD: listsrcdirs,v 1.40 2019/09/12 15:17:08 bad Exp $
 #
 
 #
@@ -82,6 +82,7 @@ lsrc sys /usr.bin/		lorder join cksum m4
 lsrc sys /usr.bin/		rpcgen rump_wmd
 lsrc sys /usr.bin/		genassym grep stat uname
 lsrc sys /usr.sbin/		mtree
+lsrc sys /sbin/			mknod
 
 # sources hosted in the NetBSD tree that are required/useful
 # when targeting POSIX-y platforms
@@ -101,7 +102,7 @@ lsrc usr /bin/			rm rmdir
 lsrc usr /sbin/			brconfig cgdconfig chown
 lsrc usr /sbin/			disklabel dump fdisk
 lsrc usr /sbin/			fsck fsck_ext2fs fsck_ffs fsck_msdos
-lsrc usr /sbin/			ifconfig mknod
+lsrc usr /sbin/			ifconfig
 lsrc usr /sbin/			modstat mount
 lsrc usr /sbin/			mount_ext2fs mount_ffs mount_msdos mount_tmpfs
 lsrc usr /sbin/			newfs newfs_ext2fs newfs_msdos



CVS commit: src/sys/rump

2019-09-12 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 15:17:08 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Summary: pax needs pack_dev.h from mknod. move mknod to sys sources


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/rump/listsrcdirs

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



CVS commit: src/sys/rump

2019-09-11 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 00:56:05 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Summary: ammend previous. remove pax from userspace sources.

CVS: --
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/rump/listsrcdirs

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

Modified files:

Index: src/sys/rump/listsrcdirs
diff -u src/sys/rump/listsrcdirs:1.38 src/sys/rump/listsrcdirs:1.39
--- src/sys/rump/listsrcdirs:1.38	Thu Sep 12 00:17:03 2019
+++ src/sys/rump/listsrcdirs	Thu Sep 12 00:56:05 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: listsrcdirs,v 1.38 2019/09/12 00:17:03 bad Exp $
+#	$NetBSD: listsrcdirs,v 1.39 2019/09/12 00:56:05 bad Exp $
 #
 
 #
@@ -96,7 +96,7 @@ lsrc usr /lib/			i18n_module
 lsrc usr /lib/lib		crypt ipsec kvm m npf pci prop
 lsrc usr /lib/lib		pthread rmt y z
 lsrc usr /libexec/		ld.elf_so
-lsrc usr /bin/			chmod cp dd df ed ln ls mkdir mv pax
+lsrc usr /bin/			chmod cp dd df ed ln ls mkdir mv
 lsrc usr /bin/			rm rmdir
 lsrc usr /sbin/			brconfig cgdconfig chown
 lsrc usr /sbin/			disklabel dump fdisk



CVS commit: src/sys/rump

2019-09-11 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 00:56:05 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Summary: ammend previous. remove pax from userspace sources.

CVS: --
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/rump/listsrcdirs

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



CVS commit: src/sys/rump

2019-09-11 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 00:17:03 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Summary: add grep and stat.

CVS: --
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/rump/listsrcdirs

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



CVS commit: src/sys/rump

2019-09-11 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Sep 12 00:17:03 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
Summary: add grep and stat.

CVS: --
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/rump/listsrcdirs

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

Modified files:

Index: src/sys/rump/listsrcdirs
diff -u src/sys/rump/listsrcdirs:1.37 src/sys/rump/listsrcdirs:1.38
--- src/sys/rump/listsrcdirs:1.37	Wed Sep 11 22:30:16 2019
+++ src/sys/rump/listsrcdirs	Thu Sep 12 00:17:03 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: listsrcdirs,v 1.37 2019/09/11 22:30:16 bad Exp $
+#	$NetBSD: listsrcdirs,v 1.38 2019/09/12 00:17:03 bad Exp $
 #
 
 #
@@ -76,11 +76,11 @@ lsrc sys /external/bsd/		flex mdocml bya
 lsrc sys /external/cddl/	osnet
 lsrc sys /external/historical/	nawk
 lsrc sys /external/public-domain/	xz
-lsrc sys /bin/			cat
+lsrc sys /bin/			cat pax
 lsrc sys /usr.bin/		make xinstall config mktemp sed tsort
 lsrc sys /usr.bin/		lorder join cksum m4 mkdep Makefile.inc
 lsrc sys /usr.bin/		rpcgen rump_wmd
-lsrc sys /usr.bin/		genassym stat uname
+lsrc sys /usr.bin/		genassym grep stat uname
 lsrc sys /usr.sbin/		mtree
 
 # sources hosted in the NetBSD tree that are required/useful



CVS commit: src/sys/rump

2019-09-11 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Sep 11 22:30:16 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
add src/external/public-domain/xz.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/rump/listsrcdirs

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

Modified files:

Index: src/sys/rump/listsrcdirs
diff -u src/sys/rump/listsrcdirs:1.36 src/sys/rump/listsrcdirs:1.37
--- src/sys/rump/listsrcdirs:1.36	Sun Feb 17 23:50:53 2019
+++ src/sys/rump/listsrcdirs	Wed Sep 11 22:30:16 2019
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: listsrcdirs,v 1.36 2019/02/17 23:50:53 bad Exp $
+#	$NetBSD: listsrcdirs,v 1.37 2019/09/11 22:30:16 bad Exp $
 #
 
 #
@@ -75,6 +75,7 @@ lsrc sys /lib/lib		c util
 lsrc sys /external/bsd/		flex mdocml byacc
 lsrc sys /external/cddl/	osnet
 lsrc sys /external/historical/	nawk
+lsrc sys /external/public-domain/	xz
 lsrc sys /bin/			cat
 lsrc sys /usr.bin/		make xinstall config mktemp sed tsort
 lsrc sys /usr.bin/		lorder join cksum m4 mkdep Makefile.inc



CVS commit: src/sys/rump

2019-09-11 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Sep 11 22:30:16 UTC 2019

Modified Files:
src/sys/rump: listsrcdirs

Log Message:
add src/external/public-domain/xz.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/rump/listsrcdirs

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



CVS commit: src/sys/rump/kern/lib

2019-09-11 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Sep 11 20:31:30 UTC 2019

Modified Files:
src/sys/rump/kern/lib/libsys_cygwin: syscalls.conf
src/sys/rump/kern/lib/libsys_linux: syscalls.conf
src/sys/rump/kern/lib/libsys_sunos: syscalls.conf

Log Message:
define sysautoload here too, to catch up with kern/makesyscalls.sh r1.173
XXX: This needs to be re-thought


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/kern/lib/libsys_cygwin/syscalls.conf
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/kern/lib/libsys_linux/syscalls.conf
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/kern/lib/libsys_sunos/syscalls.conf

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



CVS commit: src/sys/rump/kern/lib

2019-09-11 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Sep 11 20:31:30 UTC 2019

Modified Files:
src/sys/rump/kern/lib/libsys_cygwin: syscalls.conf
src/sys/rump/kern/lib/libsys_linux: syscalls.conf
src/sys/rump/kern/lib/libsys_sunos: syscalls.conf

Log Message:
define sysautoload here too, to catch up with kern/makesyscalls.sh r1.173
XXX: This needs to be re-thought


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/kern/lib/libsys_cygwin/syscalls.conf
cvs rdiff -u -r1.2 -r1.3 src/sys/rump/kern/lib/libsys_linux/syscalls.conf
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/kern/lib/libsys_sunos/syscalls.conf

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

Modified files:

Index: src/sys/rump/kern/lib/libsys_cygwin/syscalls.conf
diff -u src/sys/rump/kern/lib/libsys_cygwin/syscalls.conf:1.1 src/sys/rump/kern/lib/libsys_cygwin/syscalls.conf:1.2
--- src/sys/rump/kern/lib/libsys_cygwin/syscalls.conf:1.1	Wed Apr 10 16:44:54 2013
+++ src/sys/rump/kern/lib/libsys_cygwin/syscalls.conf	Wed Sep 11 20:31:30 2019
@@ -1,10 +1,11 @@
-#	$NetBSD: syscalls.conf,v 1.1 2013/04/10 16:44:54 pooka Exp $
+#	$NetBSD: syscalls.conf,v 1.2 2019/09/11 20:31:30 bad Exp $
 #
 
 sysnames="rump_cygwin_syscalls.c"
 sysnumhdr="rump_cygwin_syscall.h"
 syssw="rump_cygwin_sysent.c"
 sysarghdr="rump_cygwin_syscallargs.h"
+sysautoload="rump_cygwin_syscalls_autoload.c"
 compatopts=""
 libcompatopts=""
 

Index: src/sys/rump/kern/lib/libsys_linux/syscalls.conf
diff -u src/sys/rump/kern/lib/libsys_linux/syscalls.conf:1.2 src/sys/rump/kern/lib/libsys_linux/syscalls.conf:1.3
--- src/sys/rump/kern/lib/libsys_linux/syscalls.conf:1.2	Thu Mar  7 19:08:54 2013
+++ src/sys/rump/kern/lib/libsys_linux/syscalls.conf	Wed Sep 11 20:31:30 2019
@@ -1,10 +1,11 @@
-#	$NetBSD: syscalls.conf,v 1.2 2013/03/07 19:08:54 pooka Exp $
+#	$NetBSD: syscalls.conf,v 1.3 2019/09/11 20:31:30 bad Exp $
 #
 
 sysnames="rump_linux_syscalls.c"
 sysnumhdr="rump_linux_syscall.h"
 syssw="rump_linux_sysent.c"
 sysarghdr="rump_linux_syscallargs.h"
+sysautoload="rump_linux_syscalls_autoload.c"
 compatopts=""
 libcompatopts=""
 

Index: src/sys/rump/kern/lib/libsys_sunos/syscalls.conf
diff -u src/sys/rump/kern/lib/libsys_sunos/syscalls.conf:1.1 src/sys/rump/kern/lib/libsys_sunos/syscalls.conf:1.2
--- src/sys/rump/kern/lib/libsys_sunos/syscalls.conf:1.1	Tue Apr  9 13:08:33 2013
+++ src/sys/rump/kern/lib/libsys_sunos/syscalls.conf	Wed Sep 11 20:31:30 2019
@@ -1,10 +1,11 @@
-#	$NetBSD: syscalls.conf,v 1.1 2013/04/09 13:08:33 pooka Exp $
+#	$NetBSD: syscalls.conf,v 1.2 2019/09/11 20:31:30 bad Exp $
 #
 
 sysnames="rump_sunos_syscalls.c"
 sysnumhdr="rump_sunos_syscall.h"
 syssw="rump_sunos_sysent.c"
 sysarghdr="rump_sunos_syscallargs.h"
+sysautoload="rump_sunos_syscalls_autoload.c"
 compatopts=""
 libcompatopts=""
 



CVS commit: src

2019-05-13 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Mon May 13 17:55:09 UTC 2019

Modified Files:
src/tests/fs/nfs: t_rquotad.sh
src/tests/include/sys: Makefile
src/tests/lib/librumpclient: Makefile t_exec.sh t_fd.c
src/tests/lib/librumphijack: t_tcpip.sh
src/tests/net: net_common.sh
src/tests/net/arp: t_arp.sh
src/tests/net/bpfjit: Makefile
src/tests/net/icmp: Makefile t_ping2.sh
src/tests/net/if: Makefile t_ifconf.sh t_ifconfig.sh
src/tests/net/if_loop: Makefile
src/tests/net/if_tap: t_tap.sh
src/tests/net/if_tun: t_tun.sh
src/tests/net/mpls: t_ldp_regen.sh t_mpls_fw.sh t_mpls_fw6.sh
t_mpls_fw64.sh t_rfc4182.sh
src/tests/net/net: Makefile t_ipv6address.sh
src/tests/net/route: t_change.sh
src/tests/rump/rumpkern: t_sp.sh
src/tests/rump/rumpnet: t_shmif.sh
src/tests/usr.sbin/traceroute: t_traceroute.sh
src/usr.sbin/npf/npftest: Makefile

Log Message:
Get rid of all the -lrumpdev and -lrumpvfs that are no longer needed
after moving rump's mainbus from rumpdev to rumpkern.

Produces the same atf-run results as before.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/nfs/t_rquotad.sh
cvs rdiff -u -r1.13 -r1.14 src/tests/include/sys/Makefile
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/librumpclient/Makefile \
src/tests/lib/librumpclient/t_exec.sh
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/librumpclient/t_fd.c
cvs rdiff -u -r1.18 -r1.19 src/tests/lib/librumphijack/t_tcpip.sh
cvs rdiff -u -r1.30 -r1.31 src/tests/net/net_common.sh
cvs rdiff -u -r1.36 -r1.37 src/tests/net/arp/t_arp.sh
cvs rdiff -u -r1.6 -r1.7 src/tests/net/bpfjit/Makefile
cvs rdiff -u -r1.9 -r1.10 src/tests/net/icmp/Makefile
cvs rdiff -u -r1.5 -r1.6 src/tests/net/icmp/t_ping2.sh
cvs rdiff -u -r1.7 -r1.8 src/tests/net/if/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tests/net/if/t_ifconf.sh
cvs rdiff -u -r1.18 -r1.19 src/tests/net/if/t_ifconfig.sh
cvs rdiff -u -r1.4 -r1.5 src/tests/net/if_loop/Makefile
cvs rdiff -u -r1.8 -r1.9 src/tests/net/if_tap/t_tap.sh
cvs rdiff -u -r1.5 -r1.6 src/tests/net/if_tun/t_tun.sh
cvs rdiff -u -r1.7 -r1.8 src/tests/net/mpls/t_ldp_regen.sh
cvs rdiff -u -r1.5 -r1.6 src/tests/net/mpls/t_mpls_fw.sh
cvs rdiff -u -r1.3 -r1.4 src/tests/net/mpls/t_mpls_fw6.sh \
src/tests/net/mpls/t_mpls_fw64.sh
cvs rdiff -u -r1.4 -r1.5 src/tests/net/mpls/t_rfc4182.sh
cvs rdiff -u -r1.21 -r1.22 src/tests/net/net/Makefile
cvs rdiff -u -r1.14 -r1.15 src/tests/net/net/t_ipv6address.sh
cvs rdiff -u -r1.13 -r1.14 src/tests/net/route/t_change.sh
cvs rdiff -u -r1.13 -r1.14 src/tests/rump/rumpkern/t_sp.sh
cvs rdiff -u -r1.3 -r1.4 src/tests/rump/rumpnet/t_shmif.sh
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.sbin/traceroute/t_traceroute.sh
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/npf/npftest/Makefile

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



CVS commit: src

2019-05-13 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Mon May 13 17:55:09 UTC 2019

Modified Files:
src/tests/fs/nfs: t_rquotad.sh
src/tests/include/sys: Makefile
src/tests/lib/librumpclient: Makefile t_exec.sh t_fd.c
src/tests/lib/librumphijack: t_tcpip.sh
src/tests/net: net_common.sh
src/tests/net/arp: t_arp.sh
src/tests/net/bpfjit: Makefile
src/tests/net/icmp: Makefile t_ping2.sh
src/tests/net/if: Makefile t_ifconf.sh t_ifconfig.sh
src/tests/net/if_loop: Makefile
src/tests/net/if_tap: t_tap.sh
src/tests/net/if_tun: t_tun.sh
src/tests/net/mpls: t_ldp_regen.sh t_mpls_fw.sh t_mpls_fw6.sh
t_mpls_fw64.sh t_rfc4182.sh
src/tests/net/net: Makefile t_ipv6address.sh
src/tests/net/route: t_change.sh
src/tests/rump/rumpkern: t_sp.sh
src/tests/rump/rumpnet: t_shmif.sh
src/tests/usr.sbin/traceroute: t_traceroute.sh
src/usr.sbin/npf/npftest: Makefile

Log Message:
Get rid of all the -lrumpdev and -lrumpvfs that are no longer needed
after moving rump's mainbus from rumpdev to rumpkern.

Produces the same atf-run results as before.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/nfs/t_rquotad.sh
cvs rdiff -u -r1.13 -r1.14 src/tests/include/sys/Makefile
cvs rdiff -u -r1.9 -r1.10 src/tests/lib/librumpclient/Makefile \
src/tests/lib/librumpclient/t_exec.sh
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/librumpclient/t_fd.c
cvs rdiff -u -r1.18 -r1.19 src/tests/lib/librumphijack/t_tcpip.sh
cvs rdiff -u -r1.30 -r1.31 src/tests/net/net_common.sh
cvs rdiff -u -r1.36 -r1.37 src/tests/net/arp/t_arp.sh
cvs rdiff -u -r1.6 -r1.7 src/tests/net/bpfjit/Makefile
cvs rdiff -u -r1.9 -r1.10 src/tests/net/icmp/Makefile
cvs rdiff -u -r1.5 -r1.6 src/tests/net/icmp/t_ping2.sh
cvs rdiff -u -r1.7 -r1.8 src/tests/net/if/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tests/net/if/t_ifconf.sh
cvs rdiff -u -r1.18 -r1.19 src/tests/net/if/t_ifconfig.sh
cvs rdiff -u -r1.4 -r1.5 src/tests/net/if_loop/Makefile
cvs rdiff -u -r1.8 -r1.9 src/tests/net/if_tap/t_tap.sh
cvs rdiff -u -r1.5 -r1.6 src/tests/net/if_tun/t_tun.sh
cvs rdiff -u -r1.7 -r1.8 src/tests/net/mpls/t_ldp_regen.sh
cvs rdiff -u -r1.5 -r1.6 src/tests/net/mpls/t_mpls_fw.sh
cvs rdiff -u -r1.3 -r1.4 src/tests/net/mpls/t_mpls_fw6.sh \
src/tests/net/mpls/t_mpls_fw64.sh
cvs rdiff -u -r1.4 -r1.5 src/tests/net/mpls/t_rfc4182.sh
cvs rdiff -u -r1.21 -r1.22 src/tests/net/net/Makefile
cvs rdiff -u -r1.14 -r1.15 src/tests/net/net/t_ipv6address.sh
cvs rdiff -u -r1.13 -r1.14 src/tests/net/route/t_change.sh
cvs rdiff -u -r1.13 -r1.14 src/tests/rump/rumpkern/t_sp.sh
cvs rdiff -u -r1.3 -r1.4 src/tests/rump/rumpnet/t_shmif.sh
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.sbin/traceroute/t_traceroute.sh
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/npf/npftest/Makefile

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

Modified files:

Index: src/tests/fs/nfs/t_rquotad.sh
diff -u src/tests/fs/nfs/t_rquotad.sh:1.6 src/tests/fs/nfs/t_rquotad.sh:1.7
--- src/tests/fs/nfs/t_rquotad.sh:1.6	Fri Mar  8 08:35:58 2019
+++ src/tests/fs/nfs/t_rquotad.sh	Mon May 13 17:55:07 2019
@@ -1,4 +1,4 @@
-# $NetBSD: t_rquotad.sh,v 1.6 2019/03/08 08:35:58 msaitoh Exp $ 
+# $NetBSD: t_rquotad.sh,v 1.7 2019/05/13 17:55:07 bad Exp $ 
 #
 #  Copyright (c) 2011 Manuel Bouyer
 #  All rights reserved.
@@ -114,7 +114,7 @@ get_nfs_quota()
 	unset RUMPHIJACK
 	unset LD_PRELOAD
 
-	atf_check -s exit:0 rump_server -lrumpvfs -lrumpnet -lrumpdev   \
+	atf_check -s exit:0 rump_server -lrumpvfs -lrumpnet		\
 -lrumpnet_net -lrumpnet_netinet -lrumpnet_shmif -lrumpfs_nfs\
 ${RUMP_SERVER}
 

Index: src/tests/include/sys/Makefile
diff -u src/tests/include/sys/Makefile:1.13 src/tests/include/sys/Makefile:1.14
--- src/tests/include/sys/Makefile:1.13	Mon Oct  2 04:15:56 2017
+++ src/tests/include/sys/Makefile	Mon May 13 17:55:08 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2017/10/02 04:15:56 pgoyette Exp $
+# $NetBSD: Makefile,v 1.14 2019/05/13 17:55:08 bad Exp $
 
 NOMAN=		# defined
 
@@ -21,7 +21,7 @@ LDADD.t_bitops+=	-lm
 TESTS_C+= t_socket
 CPPFLAGS.t_socket.c+=	-D_KERNTYPES
 LDADD.t_socket+=	-lrumpnet_local -lrumpnet_net -lrumpnet
-LDADD.t_socket+=	-lrumpvfs -lrump -lrumpuser -lpthread -lrumpdev
+LDADD.t_socket+=	-lrumpvfs -lrump -lrumpuser -lpthread
 .endif
 
 .include 

Index: src/tests/lib/librumpclient/Makefile
diff -u src/tests/lib/librumpclient/Makefile:1.9 src/tests/lib/librumpclient/Makefile:1.10
--- src/tests/lib/librumpclient/Makefile:1.9	Thu Oct  6 20:14:11 2016
+++ src/tests/lib/librumpclient/Makefile	Mon May 13 17:55:08 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.9 2016/10/06 20:14:11 christos Exp $
+#	$NetBSD: Makefile,v 1.10 2019/05/13 17:55:08 bad Exp $
 #
 
 .include 
@@ -17,8 +17,6 @@ PROGS+=		h_execthr
 CPPFLAGS+=	-D_KERNTYPES
 
 LDADD+= -lrumpclient
-LDADD+= -lrumpdev
-LDADD+= 

CVS commit: src/sys/rump/librump

2019-05-13 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Mon May 13 17:49:05 UTC 2019

Modified Files:
src/sys/rump/librump/rumpdev: Makefile.rumpdev
src/sys/rump/librump/rumpkern: Makefile.rumpkern
Added Files:
src/sys/rump/librump/rumpkern: MAINBUS.ioconf rump_autoconf.c
Removed Files:
src/sys/rump/librump/rumpdev: MAINBUS.ioconf autoconf.c

Log Message:
On the one thousand and ninth day rump's mainbus was moved from
rumpdev to rumpkern, liberating all rumpnet users from the need to
-lrumpdev -lrumpvfs just because a loopback interface is mandatory.

Rename rumpdev/autoconf.c to rumpkern/rump_autoconf.c to avoid
accidentally picking up e.g. sys/arch/amd64/amd64/autoconf.c through
make's .PATH.
Move rumpdev/MAINBUS.ioconf to rumpkern.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/sys/rump/librump/rumpdev/MAINBUS.ioconf
cvs rdiff -u -r1.12 -r1.13 src/sys/rump/librump/rumpdev/Makefile.rumpdev
cvs rdiff -u -r1.9 -r0 src/sys/rump/librump/rumpdev/autoconf.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/librump/rumpkern/MAINBUS.ioconf \
src/sys/rump/librump/rumpkern/rump_autoconf.c
cvs rdiff -u -r1.174 -r1.175 src/sys/rump/librump/rumpkern/Makefile.rumpkern

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

Modified files:

Index: src/sys/rump/librump/rumpdev/Makefile.rumpdev
diff -u src/sys/rump/librump/rumpdev/Makefile.rumpdev:1.12 src/sys/rump/librump/rumpdev/Makefile.rumpdev:1.13
--- src/sys/rump/librump/rumpdev/Makefile.rumpdev:1.12	Mon Oct 19 16:16:38 2015
+++ src/sys/rump/librump/rumpdev/Makefile.rumpdev	Mon May 13 17:49:05 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpdev,v 1.12 2015/10/19 16:16:38 pooka Exp $
+#	$NetBSD: Makefile.rumpdev,v 1.13 2019/05/13 17:49:05 bad Exp $
 #
 
 LIB=	rumpdev
@@ -8,13 +8,10 @@ COMMENT=Rump kernel device faction
 	${RUMPTOP}/../kern	\
 	${RUMPTOP}/../dev
 
-IOCONFDIR:=	${.PARSEDIR}
-IOCONF=		MAINBUS.ioconf
-
-SRCS=	rump_dev.c autoconf.c
+SRCS=	rump_dev.c
 
 # sys/kern
-SRCS+=	kern_pmf.c subr_autoconf.c
+SRCS+=	kern_pmf.c
 
 # sys/dev
 SRCS+=	dev_verbose.c

Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern
diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.174 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.175
--- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.174	Sun Jan 27 02:08:49 2019
+++ src/sys/rump/librump/rumpkern/Makefile.rumpkern	Mon May 13 17:49:05 2019
@@ -1,9 +1,8 @@
-#	$NetBSD: Makefile.rumpkern,v 1.174 2019/01/27 02:08:49 pgoyette Exp $
+#	$NetBSD: Makefile.rumpkern,v 1.175 2019/05/13 17:49:05 bad Exp $
 #
 
-.include "${RUMPTOP}/Makefile.rump"
-
-.include 
+IOCONFDIR:=	${.PARSEDIR}
+IOCONF=		MAINBUS.ioconf
 
 LIB=		rump
 COMMENT=	Rump kernel base
@@ -31,7 +30,7 @@ SRCS+=	rump.c rumpcopy.c cons.c emul.c e
 	signals.c sleepq.c threads.c vm.c hyperentropy.c	\
 	accessors.c
 
-SRCS+=	rumpkern_syscalls.c
+SRCS+=	rump_autoconf.c rumpkern_syscalls.c
 
 # autogenerated into the correct namespace
 RUMPOBJ_NORENAME= rump_syscalls.o rump_syscalls.pico rump_syscalls.po
@@ -99,6 +98,7 @@ SRCS+=	init_sysctl_base.c	\
 	kern_timeout.c		\
 	kern_uidinfo.c		\
 	param.c			\
+	subr_autoconf.c		\
 	subr_callback.c		\
 	subr_copy.c		\
 	subr_cprng.c		\
@@ -160,6 +160,9 @@ SRCS+=	rijndael-api-fst.c
 SRCS+=	rijndael.c
 SRCS+=	cprng_fast.c
 
+.include "${RUMPTOP}/Makefile.rump"
+.include 
+
 # compat
 .if !empty(RUMP_NBCOMPAT:M50)
 SRCS+=	kern_select_50.c

Added files:

Index: src/sys/rump/librump/rumpkern/MAINBUS.ioconf
diff -u /dev/null src/sys/rump/librump/rumpkern/MAINBUS.ioconf:1.1
--- /dev/null	Mon May 13 17:49:05 2019
+++ src/sys/rump/librump/rumpkern/MAINBUS.ioconf	Mon May 13 17:49:05 2019
@@ -0,0 +1,6 @@
+ioconf mainbus
+
+include "conf/files"
+include "rump/dev/files.rump"
+
+mainbus0 at root
Index: src/sys/rump/librump/rumpkern/rump_autoconf.c
diff -u /dev/null src/sys/rump/librump/rumpkern/rump_autoconf.c:1.1
--- /dev/null	Mon May 13 17:49:05 2019
+++ src/sys/rump/librump/rumpkern/rump_autoconf.c	Mon May 13 17:49:05 2019
@@ -0,0 +1,140 @@
+/*	$NetBSD: rump_autoconf.c,v 1.1 2019/05/13 17:49:05 bad Exp $	*/
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR 

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

2019-01-29 Thread Christoph Badura
On Tue, Jan 29, 2019 at 04:16:30PM +0900, Masanobu SAITOH wrote:
> On 2019/01/29 2:51, Christoph Badura wrote:
> >Wouldn't it be better to prevent this kind of bug in the future by putting
> >the decision which method to use into a switch-statement and have the
> >compiler worry about ordering? (And duplicates and omissions.)
> 
> I think so and I'm going to simplify such type of checks (I have unfinished 
> code
> in locally). The reason why I committed the above change only is to make
> the change understandable by separating from other changes.

I wasn't aware that you were planning to do that.  Excellent!
Thank you for doing that.

--chris


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

2019-01-28 Thread Christoph Badura
On Fri, Jan 25, 2019 at 08:04:07AM +, SAITOH Masanobu wrote:
> Modified Files:
>   src/sys/dev/pci: if_wm.c
> 
> Log Message:
>  80003's SERDES is not the same as 82575's but the same as legacy devices.
> Use the old methods on 80003.
> 
> XXX The reason why this bug existed is that our order of WM_T_* was little
> different from FreeBSD's enum e1000_mac_type. From 80003 to PCH_CNP and from
> 82575 to I211 are swapped.

Wouldn't it be better to prevent this kind of bug in the future by putting
the decision which method to use into a switch-statement and have the
compiler worry about ordering? (And duplicates and omissions.)

--chris


Re: CVS commit: src/sys/kern

2019-01-11 Thread Christoph Badura
On Fri, Jan 11, 2019 at 12:41:36AM +0100, Michael van Elst wrote:
> On Thu, Jan 10, 2019 at 05:50:30PM +0100, Christoph Badura wrote:
> > 
> > If you hadn't reversed the order of
> > 
> > tftproot_dhcpboot()
> > if (md_is_root) ...
> > rootspec = bootspec
> > 
> > that would wouldn't have need fixing because tftproot_dhcpboot() sets
> > md_is_root.
> 
> It needed fixing because:

You are quoting slightly out of context, but it was poor wording on my
part too.  What I meant was "if you had not removed the old functionality
it wouldn't have need fixing".  Apologies.

> - md0 doesn't exist before it is opened for the first time.

Yes, that's why the old code did open it.  But you still haven't restored
the full functionality.  Or explained why you dropped it.

> - that's one reason why setting rootspec didn't work as intendend

> > Why was the order reversed anyway?  Can you please explain?
> 
> It's not about the order but about separating different cases.

Well, if it is not about the order, then you do not need to change the
order, don't you?

> The setroot code is riddled with side effects.

Sure it is.  A good starting point would have been to add comments that
explain the side effects.  And changing functions to not rely on side
effects.  All without changing functionality.

What exactly did your change do to improve the awareness of these side
effects?  I'm at a loss when it comes to that.

Here's more defects and functionality changes:

- The old code did "if (md_is_root) configure md0 as root or panic".  Now
  it does something different.
- The old code did "if (tftproot_dhcpboot(bootdv) != 0) boothowto |= 
RB_ASKNAME;".
  Now it does something different.  It isn't even guaranteed that
  RB_ASKNAME gets set, because bootdv is likely not null.
- tftproot_dhcpboot() returning 0 does not always indicate that the
  memory disk was successfully initialized.  md_is_root being set, however,
  reliably does.  Now md0 is configured anyway.
- The order *does* matter, because the first thing tftproot_dhcpboot()
  does is check for rootspec != NULL.  In the old code rootspec should
  only have been set by config(8).  Now it can be overridden by bootspec.
  Another functional change.
- Overriding rootspec with bootspec doesn't obey the necessary protocol.
  See my message to tech-kern from yesterday.  (This one is old, though.)

I'm getting the impression, that you do not understand the code very well.
It seems to me that you did not understand the protocol regarding changing
bootspec when you introduced the code to override it 4 years ago.
It seems to me that you did not test the changes related to md_is_root r1.221
at all.

> > Can you also please respond to the review remarks?
> I asked you for a review, it never appeared.

You asked me privately to review a file for you with no indication
whatsoever that there was any urgency to it or that you wanted to commit
soon.  Nevertheless I made time that same day to review it, but ran out of
time to write it up for you.  You didn't come back to me before
committing, so I commented publically.

https://mail-index.netbsd.org/source-changes-d/2019/01/05/msg010893.html

> I am working on this since a few months and committed it now before the branch
> to -9 after asking (several times) for a review.

You did ask several times for review?  Am I supposed to find these
requests in the tech-kern list archive?  Because I can't.  Of the 48
messages from you since 1/1/18 not one did so much as hint at you having
changes that you want reviewed or commit.

Anyway, what was the urgency?  Were you somehow under the impression that
the branch was taking place last weekend and you had to rush these
poorly tested and poorly understood changes in without you having the time to
contact the private reviewer about the status?

--chris


Re: CVS commit: src/sys/kern

2019-01-10 Thread Christoph Badura
On Sat, Jan 05, 2019 at 06:03:41PM +, Michael van Elst wrote:
> Modified Files:
>   src/sys/kern: kern_subr.c
> Log Message:
> Restore code to create md0, this fixes booting an INSTALL kernel.

This still does not restore the original functionality that was removed
without explanation or discussion.

If you hadn't reversed the order of

tftproot_dhcpboot()
if (md_is_root) ...
rootspec = bootspec

that would wouldn't have need fixing because tftproot_dhcpboot() sets
md_is_root.

Why was the order reversed anyway?  Can you please explain?

Can you also please respond to the review remarks?

And what about the timing?  Can you please explain what exactly the
idea was to jump in, make these changes, and rush in after you noticed
someone else was working on that code?  That seemed pretty rude to me.
These changes don't look like they were particularly urgent.

I ask you to kindly refrain from making uncoordinated changes to code that
other people are working on.

--chris


Re: CVS commit: src/sys/kern

2019-01-08 Thread Christoph Badura
On Tue, Jan 08, 2019 at 04:03:14PM +0100, Manuel Bouyer wrote:
> On Tue, Jan 08, 2019 at 03:40:23PM +0100, Christoph Badura wrote:
> > On Mon, Jan 07, 2019 at 03:08:38PM +0100, Manuel Bouyer wrote:
> > > it looks like this broke Xen domU:
> > > http://www-soc.lip6.fr/~bouyer/NetBSD-tests/xen/HEAD/
> > > 
> > > [   1.0800662] boot device: xbd0
> > > [   1.0800662] xenbus: can't get state for device/suspend/event-channel 
> > > (2)
> > > [   1.0800662] unknown device major 0x
> > > [   1.0800662] root device (default xbd0a):
> > > 
> > > and it waits for the user to press enter
> > > do you have an idea ?
> > 
> > Really?  Are you sure that change makes a difference?
> 
> No, but it happended at about the same time.
> But a run with a 2019-01-06 13:20 UTC build installs and completes the tests
> successfully, so I guess something after this commit fixed it.

Are you going to test with kern_subr.c reverted to r1.220?  That would be
interesting.

> > I spent Wednesday/Thursday instrumenting that code and figuring out the
> > same symptom (unknown device major) for dom0.  And the cause there is
> > not changed by Michael's change.
> 
> I'm not sure that the "unknown device major" message is a problem, it
> may have been this way before.

You get that message because rootdev isn't set.  setroot_root() return,
root_device is still NULL and RB_ASKNAME gets set in boothowto.  After
that it should sit at a prompt and wait for someone to enter a root device
name.  The system shouldn't boot automatically.


Re: CVS commit: src/sys/kern

2019-01-08 Thread Christoph Badura
On Mon, Jan 07, 2019 at 03:08:38PM +0100, Manuel Bouyer wrote:
> it looks like this broke Xen domU:
> http://www-soc.lip6.fr/~bouyer/NetBSD-tests/xen/HEAD/
> 
> [   1.0800662] boot device: xbd0
> [   1.0800662] xenbus: can't get state for device/suspend/event-channel (2)
> [   1.0800662] unknown device major 0x
> [   1.0800662] root device (default xbd0a):
> 
> and it waits for the user to press enter
> do you have an idea ?

Really?  Are you sure that change makes a difference?

I spent Wednesday/Thursday instrumenting that code and figuring out the
same symptom (unknown device major) for dom0.  And the cause there is
not changed by Michael's change.

--chris


Re: CVS commit: src/sys/kern

2019-01-05 Thread Christoph Badura
On Sat, Jan 05, 2019 at 09:39:56AM +, Michael van Elst wrote:
> Modified Files:
>   src/sys/kern: kern_subr.c
> 
> Log Message:
> Refactor setroot, no functional change intended.

I'm surprised this change to a part as critical as set_root() didn't go
through tech-kern for review.  Particularly because this does change
functionality.

You asked me privately for review and I spend Thursday afternoon on that
but haven't had time to write it up yet.  I was just sitting down to do
that when I noticed your commit.  You could have contacted me about the
status of the review.  I was going to offer you to discuss this face to
face at MeKA.  I'm still offering to do that.

Also, may I ask what the purpose of these changes is?  Is there,
perhaps, a plan to make further changes?
XXX Or was it done just because you didn't like the current code.

The good news is that the test cases I was dealing with earlier this week
still work and break as before.  Also the change I mentioned on ICB still
does fix the broken case.

Index: src/sys/kern/kern_subr.c
diff -u src/sys/kern/kern_subr.c:1.220 src/sys/kern/kern_subr.c:1.221
--- src/sys/kern/kern_subr.c:1.220  Sun Oct  7 11:24:16 2018
+++ src/sys/kern/kern_subr.cSat Jan  5 09:39:56 2019
 */
-   if (md_is_root) {
-   int md_major;
-   dev_t md_dev;
-
-   bootdv = NULL;
-   md_major = devsw_name2blk("md", NULL, 0);
-   if (md_major >= 0) {
-   md_dev = MAKEDISKDEV(md_major, 0, RAW_PART);
-   if (bdev_open(md_dev, FREAD, S_IFBLK, curlwp) == 0)
-   bootdv = device_find_by_xname("md0");
-   }
-   if (bootdv == NULL)
-   panic("Cannot open \"md0\" (root)");
-   }

Here, functionality got removed without explanation.

 
+   do {
+   if (boothowto & RB_ASKNAME)
+   setroot_ask(bootdv, bootpartition);
+   else
+   setroot_root(bootdv, bootpartition);
+

I don't like the style of this.  It conveys the false impression that
bootdv and bootpartition are the only input parameters to these functions.
That is not true, though.  They still take the globals as input and set a
bunch of them.  At least that much was clear from the old code.


setroot_ask() now:

+   dv = getdisk(buf, len, bootpartition, , 0);
+   if (dv != NULL) {
+   rootdv = dv;
+   break;
+   }
+   }
+   rootdev = nrootdev;

Here the global rootdev becomes the new canoncical place...
 
+   ndumpdev = MAKEDISKDEV(major(nrootdev),
+   DISKUNIT(nrootdev), 1);

... but you continue to use the local variable nrootdev.  That doesn't
help clarity.

+   if (len == 4 && strcmp(buf, "halt") == 0)
+   cpu_reboot(RB_HALT, NULL);
+   else if (len == 6 && strcmp(buf, "reboot") == 0)
+   cpu_reboot(0, NULL);
 #if defined(DDB)
+   else if (len == 3 && strcmp(buf, "ddb") == 0) {
+   console_debugger();
+   }
 #endif

This hunk of code is an obvious candidate to factor out from here and
parsedisk().

I do appreciate the updated comments.

The comment block about the "quirt" before the call to setroot_nfs()
would be better before the the function definition itself as that's where
one wants the explanation of the behaviour.

setroot_ask() doesn't have any comment, documenting what it does.  It
would benefit from one, though.

The comment before the definition of setroot_root documents a return value
from a void function.

This was perhaps unfinished work?

The old setroot() was a large function.  But it had a clear structure of
multiple steps.  It had the advantage of not hiding which globals were
modified where in the function.  Also, it didn't take me more than an hour
to understand what it was doing.  In contrast to needing more to an hour
to review you proposed change.

My advice is to revert this, go back to the drawing board, come up with
clear goals that bring us forward, and discuss the proposal on tech-kern.

Also, I have changes to setroot() that I want to get out of my local tree,
so a decision to revert or not should be made soonish.

--chris


Re: CVS commit: src/sys/arch

2019-01-02 Thread Christoph Badura
On Sun, Dec 30, 2018 at 06:42:29PM +0530, Cherry G.Mathew wrote:
> Christoph Badura  writes:
> > On Tue, Dec 25, 2018 at 11:45:42AM +0530, Cherry G.Mathew wrote:
> >> Here's the scenario above:
> >> 
> >> let's take lcr3(). On native this is a ring3 operation, implemented in
> >> assembler. On xen, this is a PV call. Currently there's no need to have
> >> both implementations in a single binary, since PV and native binaries
> >> are distinct. With PVHVM, we have a situation where at boot time, the
> >> native version is required, and after XEN is detected, we can use the
> >> XEN version of the call. I've taken the approach of naming the
> >> individual functions distinctly, eg: i386_lcr3(), or xen_lcr3(), while
> >> and exporting them weakly as the consumed version, ie; lcr3().
> >> 
> >> What happens is that when the individual binary is compiled, the
> >> appropriate weakly exported symbol takes over, and things work as
> >> expected. When  the combined binary for PVHVM is required, we write a
> >> strongly exported "switch" function, called lcr3() (I haven't committed
> >> this yet) which overrides both the weak symbols. It can then do the
> >> runtime calls by calling into the appropriate i386_lcr3() or xen_lcr3(),
> >> depending on the mode in which it is running.
> >
> > I don't find this argument for weak aliases convincing.  You plan to
> > write the function that makes a runtime decision between the
> > implemenation anyway.  You might as well write that function now and avoid
> > another bit of hidden magic.
> >
> 
> The other options have been suggested earlier (function pointers and
> hotpatching).

I know, and I know that the don't work in your scenario because you need
both versions of the functions.  I was hoping that implicit about
acknowleding your plan to do runtime selection between several versions.

> > You can have multiple versions of that "switch" function and select the
> > appropriate one with config(8) logic.  
> 
> It's too late for that. Things like lcr3() need to work way before
> config(8) is a twinkle in boot(8)s eyes.

config(8) runs before the kernel is compiled.  And there you can select
what sources get compiled.

> > Or you can select with #ifdef.  Somewhere you have to place the logic
> > for conditional compilation/linking.  Having that logic concentrated
> > in a single place instead of N seems preferable to me.
> 
> Yes, it's pretty intense - see x86/mainbus.c:mainbus_attach() for a
> sample of what is to come.

I did look.  I think it is pretty straight forward to read.  I had to
look at much more complicated code today.

The only real sore is the "if (!mpacpi_active) {" bit.  I would move
that bit out of the #ifdef and stop worrying.  It is not time critical.
And we waste way more space with aprint_naive/aprint_normal duplication.

It does have the benefit that I have all the conditionals in one place,
so I can look at them and reason about them without having lots of
editor windows open or working out call graphs on paper.

Here we're having a fairly moderately abstract conversation about whether,
essentially,

#if defined(XEN_PHVM)
void *
intr_establish_xname(...)
{
if (need_native_interrupt)
return x86_intr_establish_xname(...);
else
return xen_intr_establish_xname(...);
}
#endif
intr_establish_xname(...);  /* WTH does intr_establish_xname come
/* from in the non-PVHWM case? */

or


void *
intr_establish_xname(...)
#if !defined(XEN_PV) && !defined(XEN_PVHVM) 
if (need_native_interrupt)
return x86_intr_establish_xname(...);
else
#else
return xen_intr_establish_xname(...);
#endif
}

is better.  We're not critically reducing the #ifdef impact either.

However, we are already losing track where intr_establish_xname is
coming from.  IMHO, that does not bode well for this approach.  I believe
Martin is trying to make the same point.

NB, my argument is not about disentangling the code.  Only about the
maintainability aspect of using weak aliases.

--chris


Re: CVS commit: src/sys/arch

2018-12-29 Thread Christoph Badura
On Tue, Dec 25, 2018 at 11:45:42AM +0530, Cherry G.Mathew wrote:
> Joerg Sonnenberger  writes:
> > On Sat, Dec 22, 2018 at 09:27:22PM +, Cherry G. Mathew wrote:
> >> Modified Files:
> >>src/sys/arch/amd64/amd64: cpufunc.S
> >>src/sys/arch/i386/i386: cpufunc.S i386func.S
> >>src/sys/arch/xen/x86: xenfunc.c
> >> Log Message:
> >> Introduce a weak alias method of exporting different implementations
> >> of the same API.
> > Why? As in: what's the advantage of making them weak.
> I'd posted separately before this commit explaining the rationale.

It took me a while to check the most obvious places and figure out which
message it might have been.  A more precise reference would have helped.

> Here's the scenario above:
> 
> let's take lcr3(). On native this is a ring3 operation, implemented in
> assembler. On xen, this is a PV call. Currently there's no need to have
> both implementations in a single binary, since PV and native binaries
> are distinct. With PVHVM, we have a situation where at boot time, the
> native version is required, and after XEN is detected, we can use the
> XEN version of the call. I've taken the approach of naming the
> individual functions distinctly, eg: i386_lcr3(), or xen_lcr3(), while
> and exporting them weakly as the consumed version, ie; lcr3().
> 
> What happens is that when the individual binary is compiled, the
> appropriate weakly exported symbol takes over, and things work as
> expected. When  the combined binary for PVHVM is required, we write a
> strongly exported "switch" function, called lcr3() (I haven't committed
> this yet) which overrides both the weak symbols. It can then do the
> runtime calls by calling into the appropriate i386_lcr3() or xen_lcr3(),
> depending on the mode in which it is running.

I don't find this argument for weak aliases convincing.  You plan to
write the function that makes a runtime decision between the
implemenation anyway.  You might as well write that function now and avoid
another bit of hidden magic.

You can have multiple versions of that "switch" function and select the
appropriate one with config(8) logic.  Or you can select with #ifdef.
Somewhere you have to place the logic for conditional compilation/linking.
Having that logic concentrated in a single place instead of N seems
preferable to me.

--chris


Re: CVS commit: src/sbin/cgdconfig

2018-12-29 Thread Christoph Badura
On Sat, Dec 29, 2018 at 01:33:23PM +, Alexander Nasonov wrote:
> Christoph Badura wrote:
> > On Thu, Dec 27, 2018 at 10:41:55PM +, Alexander Nasonov wrote:
> > > Perhaps the simplest change would be to pass an unresolved (original)
> > > name when composing a paramsfile. E.g.
> > > 
> > > /etc/cgd/NAME=mylabel
> > > /etc/cgd/ROOT.e
> > 
> > Alas, this will break existing installations that e.g. use /etc/cgd/dkNN 
> > when
> > using NAME=label in fstab.
> 
> You can't use the same dkNN in fstab and in cgd.conf because mount will
> refuse to mount an encrypted partition.

Hmm. Right.

> I think it will only break setups that use NAME=label in _cgd.conf_ and
> don't specify a paramsfile. These setups are rare because NAME=label
> syntax was documented only a couple of days ago ;-) Though, some people
> may have figured it out before me.

I think you are right.  If it requires an explicit configuration change in
cgd.conf we're good.

--chris


Re: CVS commit: src/sbin/cgdconfig

2018-12-29 Thread Christoph Badura
On Thu, Dec 27, 2018 at 10:41:55PM +, Alexander Nasonov wrote:
> Perhaps the simplest change would be to pass an unresolved (original)
> name when composing a paramsfile. E.g.
> 
> /etc/cgd/NAME=mylabel
> /etc/cgd/ROOT.e

Alas, this will break existing installations that e.g. use /etc/cgd/dkNN when
using NAME=label in fstab.
For compatibility it may be necessary to try the resolved named when the
unresolved form does not exist.

I would prefer /etc/cgd/mylabel, btw.

--chris


Removal of M_COPY_PKTHDR etc.

2018-12-27 Thread Christoph Badura
Doesn't that trigger a kernel version bump?
And shouldn't changes like this be documented in src/CHANGES?

--chris

On Thu, Dec 27, 2018 at 02:03:55PM +, Maxime Villard wrote:
> Module Name:  src
> Committed By: maxv
> Date: Thu Dec 27 14:03:55 UTC 2018
> 
> Modified Files:
>   src/sys/dev/pci: hifn7751.c
>   src/sys/kern: uipc_mbuf.c
>   src/sys/netmpls: mpls_ttl.c
>   src/sys/sys: mbuf.h
> 
> Log Message:
> Remove M_COPY_PKTHDR, M_MOVE_PKTHDR, M_ALIGN and MH_ALIGN.


Re: CVS commit: src/sbin/cgdconfig

2018-12-27 Thread Christoph Badura
On Thu, Dec 27, 2018 at 09:53:44PM +, Alexander Nasonov wrote:
> Alexander Nasonov wrote:
> > XXX Default paramsfile for NAME=label is /etc/cgd/dkNN (resolved wedge
> > partition) and /etc/cgd/ROOT. for ROOT.. This isn't yet
> > documented. IMO, it should be the other way around: /etc/cgd/label
> > for the former and /et/cgd/[root-device] for the latter.
> 
> This is true for NetBSD-8 which doesn't support ROOT. prefix.
> Both prefixes are resolved to real device names before composing
> a default paramsfile in NetBSD-current.

Using /etc/cgd/ROOT. has the advantage that the cgd will configure
if the root device changes name, thus upholding POLA.

E.g. moving disks from a controller that attaches sd(4)s to one that
attaches ld(4)s.  I believe you can see that when dd'ing an image from
SDcard to MMC on Pinebook.

It seems to me that similar behaviour for NAME=label would be more useful
too. dk(4) attachments move around in practice.

--chris


Re: CVS commit: src

2018-11-16 Thread Christoph Badura
Doesn't that require a kernel version bump?

On Thu, Nov 15, 2018 at 10:06:07AM +, Maxime Villard wrote:
> Simplify the mtag API:
>  - Remove m_tag_init(), m_tag_first(), m_tag_next() and
>m_tag_delete_nonpersistent().
>  - Remove the 't' argument from m_tag_delete_chain().

> Remove the 'copy' argument from m_devget(), unused. While here rename
> off0->off.


Re: CVS commit: src/sys/net

2015-09-30 Thread Christoph Badura
On Wed, Sep 30, 2015 at 07:12:32AM +, Ryota Ozaki wrote:
> Modified Files:
>   src/sys/net: if.h if_llatbl.c if_llatbl.h
> 
> Log Message:
> Make GATEWAY (fastforward) work again
> 
> With GATEWAY (fastforward), the whole forwarding processing runs in
> hardware interrupt context. So we cannot use rwlock for lltable and
> llentry in that case.
> 
> This change replaces rwlock with mutex(IPL_NET) for lltable and llentry
> when GATEWAY is enabled. We need to tweak locking only around rtree
> in lltable_free. Other than that, what we need to do is to change macros
> for locks.
> 
> I hope fastforward runs in softint some day in the future...

Well, the point of the fast forwarding code was that the fast forwarding
is done in interrupt context.  If no flow exists the normal (slow)
forwarding path running in softint is used.

--chris


Re: CVS commit: src/sys/dev/sysmon

2015-06-23 Thread Christoph Badura
On Tue, Jun 23, 2015 at 10:41:42AM +, Paul Goyette wrote:
 Committed By: pgoyette
 Date: Tue Jun 23 10:41:42 UTC 2015
 
 Modified Files:
   src/sys/dev/sysmon: sysmon_envsys_events.c
 
 Log Message:
 Fix the KASSERT - we want to make sure that _both_ pointers are non-NULL,
 not just that one or the other is non-NULL!

Wouldn't it be better written as:

KASSERT(sme != NULL);
KASSERT(edata != NULL);

Same effect, but when one of the triggers you know immediately which pointer
was NULL.

--chris


Re: CVS commit: src/sys/net/if_vlan.c

2015-03-31 Thread Christoph Badura
On Tue, Mar 31, 2015 at 11:09:02AM +0900, Ryota Ozaki wrote:
 On Tue, Mar 31, 2015 at 1:42 AM, Matt Thomas m...@3am-software.com wrote:
  It lacks compensating for the fact the CRC has been stripped by the
  time vlan gets the packet.

 # matt@ explained well than me...

 Note that the issue was found by some strict packet capture software
 (not by me, so I don't know what it is); typical OSes don't complain
 the extra padding, so we didn't notice the issue until recently.

Yeah.  I misunderstood your message in the PR.  I read it as if
if_vlan.c should be sending 72 byte minimum size packets and the code
was doing something different.  That's why I asked.

Maybe we should update the PR.

--chris


Re: CVS commit: src/sys/net/if_vlan.c

2015-03-30 Thread Christoph Badura
On Sun, Mar 29, 2015 at 01:30:43PM +, Ryota Ozaki wrote:
 Module Name:  src
 Committed By: ozaki-r
 Date: Sun Mar 29 13:30:43 UTC 2015
 
 Modified Files:
   src/sys/net: if_vlan.c
 
 Log Message:
 Correct frame padding length
 
 vlan pads a frame with zeros up to 68 bytes
 (ETHER_MIN_LEN + ETHER_VLAN_ENCAP_LEN). It expects
 that even if the frame is untagged, it keeps 64 bytes
 at least. However, it lacks concern about CRC
 (4 bytes). So a sending frame can be 72 (68 + 4) bytes.

I don't get it. ETHER_MIN_LEN includes the 4 bytes for the CRC of a
minimum sized packet.  Therefore ETHER_MIN_LEN + ETHER_VLAN_ENCAP_LEN is
the right size, isn't it?

BTW, what do you mean by it lacks concern about CRC?

--chris


Re: CVS commit: src/sys/modules/lua

2013-10-22 Thread Christoph Badura
On Tue, Oct 22, 2013 at 09:25:19AM +0100, Alexander Nasonov wrote:
 We just need to make sure that all entry points to Lua are protected and
 hope that the above panic will never trigger.

Actually, I would prefer if that call to panic wasn't there at all.
Instead the script/state should be aborted noisily.

--chris


Re: CVS commit: [tls-maxphys] src/sys/ufs/ufs

2012-10-19 Thread Christoph Badura
On Wed, Oct 17, 2012 at 02:39:55AM +, Thor Lancelot Simon wrote:
 What I'm more worried about is that it may _never_ be a good idea, in the
 general case, to put 1M transfers on the bus, particularly single writes,
 since they may delay things like log transactions in the disk's write
 cache.  

I'm sure there is a tradeoff somewhere.  But lacking any data I have no
idea where it might be.

For non-serial SCSI it is not so difficult to do a back of the envelope
calculation.  The tradeoff there is between CDB transmission and data
transfer.  CDB transmission is always async while data transmission can
proceed at full sync speed.  So the basic break-even point seems to be to
me the amount of data that you can transfer at full sync speed in the time
you can negotiate the bus and transfer another CDB.  Then there's the
buffer full/empty ratios that you can set that determine when the target
starts and stops reconnected data transfers so other devices on the bus
have a chance to sneak in traffic between the data transmissions.

I have no idea what it is like on SATA/SAS where the link runs at constant
speed and you usually don't have multiple devices on the same link. Of
course with SATA port multipliers things look different again.

My syggestino is to introduce a sysctl'able limit to clamp the maximum
transfer size at the hardware level so that people can experiment easily
and start gathering data.  Maybe a different sysctl variable for RAIDframe
and/or other pseudo devices.

--chris


Re: curses and terminfo changes

2011-10-04 Thread Christoph Badura
On Tue, Oct 04, 2011 at 02:25:48PM +0200, Alan Barrett wrote:
 You have made a lot of changes recently.  What are you doing about
 compatibility for programs linked against old versions of the
 libraries but running with new versions of the libraries?

Also, aren't the minor numbers of the affected libraries to be bumped?

--chris


Re: CVS commit: src/sys/net

2010-05-03 Thread Christoph Badura
On Sun, May 02, 2010 at 07:17:56PM +, Mihai Chelaru wrote:
 Committed By: kefren
 Date: Sun May  2 19:17:56 UTC 2010
 
 Modified Files:
   src/sys/net: route.c rtsock.c
 
 Log Message:
 Permit the existence of a route with unlinked ifp and ifa,
 enabling this way the posibility to send a packet on an interface with
 source address from another interface.

What is this about?  Why is it necessary?  Was it discussed somewhere?

--chris


Re: socket credentials [Was: CVS commit: src/sys]

2009-12-29 Thread Christoph Badura
I have a couple of questions regarding this change.

Was it intentional that the hack of setting socket credentials only after
the socket is attached to a file descriptor is left undocumented?

On Tue, Dec 29, 2009 at 04:23:43AM +, Elad Efrat wrote:
 Modified Files:
   src/sys/kern: uipc_socket.c uipc_syscalls.c
   src/sys/sys: socketvar.h
 
 Log Message:
 Add credentials to to sockets.

 Modified files:
 
 Index: src/sys/kern/uipc_socket.c
 diff -u src/sys/kern/uipc_socket.c:1.197 src/sys/kern/uipc_socket.c:1.198
 @@ -582,6 +582,7 @@
   sofree(so);
   return error;
   }
 + so-so_cred = kauth_cred_dup(l-l_cred);
   sounlock(so);
   *aso = so;
   return 0;

Why are you using kauth_cred_dup() instead of the normal kauth_cred_hold()?
If there is a reason, shouldn't it be documented?

 diff -u src/sys/kern/uipc_syscalls.c:1.138 src/sys/kern/uipc_syscalls.c:1.139
 --- src/sys/kern/uipc_syscalls.c:1.138Sun Dec 20 09:36:06 2009
 +++ src/sys/kern/uipc_syscalls.c  Tue Dec 29 04:23:43 2009
 @@ -228,9 +229,11 @@
   fp2-f_ops = socketops;
   fp2-f_data = so2;
   error = soaccept(so2, nam);
 + so2-so_cred = kauth_cred_dup(so-so_cred);

The same applies here, of course.

   sounlock(so);
   if (error) {
   /* an error occurred, free the file descriptor and mbuf */
 + kauth_cred_free(so2-so_cred);
   m_freem(nam);
   mutex_enter(fp2-f_lock);
   fp2-f_count++;

Was it intentional to leave the comment misleading after the change?

And lastly some broader questions:

In how many places do you think we should keep credentials in the socket
structure?  E.g. is there a reason to keep so_egid after the the
introduction of so_cred?  What about using so_uidinfo-ui_uid for
authentication?  Stuff like:


if (so-so_uidinfo-ui_uid == 0)/* XXX-kauth */
new-priv = 1;
else
new-priv = 0;

in netinet6/ipsec.c  or

#ifdef __NetBSD__
/* superuser opened socket? */
#define IPSEC_PRIVILEGED_SO(so) ((so)-so_uidinfo-ui_uid == 0)
#endif  /* __NetBSD__ */

in netipsec/ipsec_osdep.h to pick two places at random.

--chris


Re: CVS commit: src/sys/ufs/lfs

2009-10-29 Thread Christoph Badura
On Thu, Oct 29, 2009 at 01:10:32PM -0400, Christos Zoulas wrote:
 Modified Files:
   src/sys/ufs/lfs: lfs.h lfs_vnops.c
 Log Message:
 PR/42246: NAKAJIMA Yoshihiro: provide COMPAT_50 for LFS

Is this pull-up fodder?

--chris