CVS commit: src/sys/dev/sdmmc

2019-09-23 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Sep 24 04:56:54 UTC 2019

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

Log Message:
Remove debug printf.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/sdmmc/sdmmc_cis.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/sdmmc_cis.c
diff -u src/sys/dev/sdmmc/sdmmc_cis.c:1.6 src/sys/dev/sdmmc/sdmmc_cis.c:1.7
--- src/sys/dev/sdmmc/sdmmc_cis.c:1.6	Sun Sep  1 05:45:42 2019
+++ src/sys/dev/sdmmc/sdmmc_cis.c	Tue Sep 24 04:56:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdmmc_cis.c,v 1.6 2019/09/01 05:45:42 mlelstv Exp $	*/
+/*	$NetBSD: sdmmc_cis.c,v 1.7 2019/09/24 04:56:54 mlelstv Exp $	*/
 /*	$OpenBSD: sdmmc_cis.c,v 1.1 2006/06/01 21:53:41 uwe Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Routines to decode the Card Information Structure of SD I/O cards */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdmmc_cis.c,v 1.6 2019/09/01 05:45:42 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc_cis.c,v 1.7 2019/09/24 04:56:54 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -130,7 +130,6 @@ decode_funce_function(struct sdmmc_funct
 	max_blk_size = sdmmc_io_read_1(sf0, reg + 11);
 	max_blk_size |= sdmmc_io_read_1(sf0, reg + 12) << 8;
 
-device_printf(dev, "MAX_BLK_SIZE%d = %d\n", sf->number, max_blk_size);
 	DPRINTF(("CISTPL_FUNCE: MAX_BLK_SIZE=0x%x\n", max_blk_size));
 }
 



CVS commit: src/sys/dev/sdmmc

2019-09-23 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Sep 24 04:56:54 UTC 2019

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

Log Message:
Remove debug printf.


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

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



CVS commit: [netbsd-9] src/doc

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 03:11:58 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #234 - #238


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.57 -r1.1.2.58 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/doc

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 03:11:58 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #234 - #238


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.57 -r1.1.2.58 src/doc/CHANGES-9.0

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-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.57 src/doc/CHANGES-9.0:1.1.2.58
--- src/doc/CHANGES-9.0:1.1.2.57	Mon Sep 23 15:27:52 2019
+++ src/doc/CHANGES-9.0	Tue Sep 24 03:11:58 2019
@@ -1,5 +1,5 @@
 
-# $NetBSD: CHANGES-9.0,v 1.1.2.57 2019/09/23 15:27:52 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.58 2019/09/24 03:11:58 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -3902,3 +3902,57 @@ sys/dev/acpi/dwiic_acpi.c			1.3
 	Match Ampere eMAG hardware ID (APMC0D0F).
 	[jmcneill, ticket #233]
 
+share/man/man4/mcx.41.2
+
+	mcx(4) will appear in 9.0
+	[jmcneill, ticket #234]
+
+sys/arch/arm/rockchip/rk_i2c.c			1.5
+
+	rkiic: coalesce smbus-style writes into a single transaction.
+	[tnn, ticket #235]
+
+sys/arch/arm/arm32/bus_dma.c			1.116
+
+	bus_dmamap_load_raw: support coherent mappings.
+	bus_dmamap_sync: support syncing "raw" buffer types.
+	[jmcneill, ticket #236]
+
+sys/dev/pci/pcidevs1.1385
+sys/dev/pci/pcidevs.hregen
+sys/dev/pci/pcidevs_data.h			regen
+
+	Add Mellanox ConnectX-4, ConnectX-4 Lx, ConnectX-5, and ConnectX-5 Ex.
+	[jmcneill, ticket #237]
+
+sys/net/if.c	1.461
+sys/net/if.h	1.277
+sys/net/if_gif.c1.149
+sys/net/if_gif.h1.33
+sys/net/if_ipsec.c1.24
+sys/net/if_ipsec.h1.5
+sys/net/if_l2tp.c1.37
+sys/net/if_l2tp.c1.38
+sys/net/if_l2tp.c1.39
+sys/net/if_l2tp.h1.7
+sys/net/if_l2tp.h1.8
+sys/net/route.c	1.220,1.221
+sys/net/route.h	1.125
+sys/netinet/in_gif.c1.95
+sys/netinet/in_l2tp.c1.17
+sys/netinet/ip_input.c1.391,1.392
+sys/netinet/wqinput.c1.6
+sys/netinet6/in6_gif.c1.94
+sys/netinet6/in6_l2tp.c1.18
+sys/netinet6/ip6_forward.c			1.97
+sys/netinet6/ip6_input.c			1.210,1.211
+sys/netipsec/ipsec_output.c			1.83
+sys/netipsec/ipsecif.c1.17
+
+	Avoid having a rtcache directly in a percpu storage, which
+	violates percpu constraints and could cause use-after-free.
+	Same for wqinput_worklist.
+	l2tp(4): divide Tx context of l2tp(4) to improve performance
+	and avoid having struct ifqueue directly in a percpu storage.
+	[ozaki-r, ticket #238]
+



CVS commit: [netbsd-9] src/sys

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 03:10:36 UTC 2019

Modified Files:
src/sys/net [netbsd-9]: if.c if.h if_gif.c if_gif.h if_ipsec.c
if_ipsec.h if_l2tp.c if_l2tp.h route.c route.h
src/sys/netinet [netbsd-9]: in_gif.c in_l2tp.c ip_input.c wqinput.c
src/sys/netinet6 [netbsd-9]: in6_gif.c in6_l2tp.c ip6_forward.c
ip6_input.c
src/sys/netipsec [netbsd-9]: ipsec_output.c ipsecif.c

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

sys/netipsec/ipsec_output.c: revision 1.83
sys/net/route.h: revision 1.125
sys/netinet6/ip6_input.c: revision 1.210
sys/netinet6/ip6_input.c: revision 1.211
sys/net/if.c: revision 1.461
sys/net/if_gif.h: revision 1.33
sys/net/route.c: revision 1.220
sys/net/route.c: revision 1.221
sys/net/if.h: revision 1.277
sys/netinet6/ip6_forward.c: revision 1.97
sys/netinet/wqinput.c: revision 1.6
sys/net/if_ipsec.h: revision 1.5
sys/netinet6/in6_l2tp.c: revision 1.18
sys/netinet6/in6_gif.c: revision 1.94
sys/net/if_l2tp.h: revision 1.7
sys/net/if_gif.c: revision 1.149
sys/net/if_l2tp.h: revision 1.8
sys/netinet/in_gif.c: revision 1.95
sys/netinet/in_l2tp.c: revision 1.17
sys/netipsec/ipsecif.c: revision 1.17
sys/net/if_ipsec.c: revision 1.24
sys/net/if_l2tp.c: revision 1.37
sys/netinet/ip_input.c: revision 1.391
sys/net/if_l2tp.c: revision 1.38
sys/netinet/ip_input.c: revision 1.392
sys/net/if_l2tp.c: revision 1.39

Avoid having a rtcache directly in a percpu storage

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.
Reviewed by knakahara@ and yamaguchi@

 -

wqinput: avoid having struct wqinput_worklist directly in a percpu storage

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Input handlers of wqinput normally involves sleepable operations so we must
avoid dereferencing a percpu data (struct wqinput_worklist) after executing
an input handler.  Address this situation by having just a pointer to the data
in a percpu storage instead.
Reviewed by knakahara@ and yamaguchi@

 -

Add missing #include 

 -

Divide Tx context of l2tp(4) to improve performance.

It seems l2tp(4) call path is too long for instruction cache. So, dividing
l2tp(4) Tx context improves CPU use efficiency.

After this commit, l2tp(4) throughput gains 10% on my machine(Atom C3000).

 -

Apply some missing changes lost on the previous commit

 -

Avoid having a rtcache directly in a percpu storage for tunnel protocols.
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.

Reviewed by ozaki-r@ and yamaguchi@

 -

l2tp(4): avoid having struct ifqueue directly in a percpu storage.
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Tx processing of l2tp(4) uses normally involves sleepable 

CVS commit: [netbsd-9] src/sys

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 03:10:36 UTC 2019

Modified Files:
src/sys/net [netbsd-9]: if.c if.h if_gif.c if_gif.h if_ipsec.c
if_ipsec.h if_l2tp.c if_l2tp.h route.c route.h
src/sys/netinet [netbsd-9]: in_gif.c in_l2tp.c ip_input.c wqinput.c
src/sys/netinet6 [netbsd-9]: in6_gif.c in6_l2tp.c ip6_forward.c
ip6_input.c
src/sys/netipsec [netbsd-9]: ipsec_output.c ipsecif.c

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

sys/netipsec/ipsec_output.c: revision 1.83
sys/net/route.h: revision 1.125
sys/netinet6/ip6_input.c: revision 1.210
sys/netinet6/ip6_input.c: revision 1.211
sys/net/if.c: revision 1.461
sys/net/if_gif.h: revision 1.33
sys/net/route.c: revision 1.220
sys/net/route.c: revision 1.221
sys/net/if.h: revision 1.277
sys/netinet6/ip6_forward.c: revision 1.97
sys/netinet/wqinput.c: revision 1.6
sys/net/if_ipsec.h: revision 1.5
sys/netinet6/in6_l2tp.c: revision 1.18
sys/netinet6/in6_gif.c: revision 1.94
sys/net/if_l2tp.h: revision 1.7
sys/net/if_gif.c: revision 1.149
sys/net/if_l2tp.h: revision 1.8
sys/netinet/in_gif.c: revision 1.95
sys/netinet/in_l2tp.c: revision 1.17
sys/netipsec/ipsecif.c: revision 1.17
sys/net/if_ipsec.c: revision 1.24
sys/net/if_l2tp.c: revision 1.37
sys/netinet/ip_input.c: revision 1.391
sys/net/if_l2tp.c: revision 1.38
sys/netinet/ip_input.c: revision 1.392
sys/net/if_l2tp.c: revision 1.39

Avoid having a rtcache directly in a percpu storage

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.
Reviewed by knakahara@ and yamaguchi@

 -

wqinput: avoid having struct wqinput_worklist directly in a percpu storage

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Input handlers of wqinput normally involves sleepable operations so we must
avoid dereferencing a percpu data (struct wqinput_worklist) after executing
an input handler.  Address this situation by having just a pointer to the data
in a percpu storage instead.
Reviewed by knakahara@ and yamaguchi@

 -

Add missing #include 

 -

Divide Tx context of l2tp(4) to improve performance.

It seems l2tp(4) call path is too long for instruction cache. So, dividing
l2tp(4) Tx context improves CPU use efficiency.

After this commit, l2tp(4) throughput gains 10% on my machine(Atom C3000).

 -

Apply some missing changes lost on the previous commit

 -

Avoid having a rtcache directly in a percpu storage for tunnel protocols.
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.

Reviewed by ozaki-r@ and yamaguchi@

 -

l2tp(4): avoid having struct ifqueue directly in a percpu storage.
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Tx processing of l2tp(4) uses normally involves sleepable 

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

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 03:02:05 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
regen for ticket #237 (Mellanox device IDs added)


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.1 -r1.1371.2.2 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.1 -r1.1370.2.2 src/sys/dev/pci/pcidevs_data.h

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



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

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 02:59:35 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #237):

sys/dev/pci/pcidevs: revision 1.1385

Add Mellanox ConnectX-4, ConnectX-4 Lx, ConnectX-5, and ConnectX-5 Ex


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.1 -r1.1383.2.2 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1383.2.1 src/sys/dev/pci/pcidevs:1.1383.2.2
--- src/sys/dev/pci/pcidevs:1.1383.2.1	Mon Aug 26 13:58:19 2019
+++ src/sys/dev/pci/pcidevs	Tue Sep 24 02:59:35 2019
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1383.2.1 2019/08/26 13:58:19 martin Exp $
+$NetBSD: pcidevs,v 1.1383.2.2 2019/09/24 02:59:35 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5869,6 +5869,10 @@ product MATROX G550_AGP		0x2527	MGA G550
 product MEDIAQ MQ200		0x0200	MQ200
 
 /* Mellanox Technologies */
+product MELLANOX MT27700	0x1013	ConnectX-4
+product MELLANOX MT27710	0x1015	ConnectX-4 Lx
+product MELLANOX MT27800	0x1017	ConnectX-5
+product MELLANOX MT28800	0x1019	ConnectX-5 Ex
 product MELLANOX MT23108	0x5a44	InfiniHost (Tavor)
 product MELLANOX MT23108_PCI	0x5a46	InfiniHost PCI Bridge (Tavor)
 product MELLANOX MT25204_OLD	0x5e8c	InfiniHost III Lx (old Sinai)



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

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 02:59:35 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #237):

sys/dev/pci/pcidevs: revision 1.1385

Add Mellanox ConnectX-4, ConnectX-4 Lx, ConnectX-5, and ConnectX-5 Ex


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.1 -r1.1383.2.2 src/sys/dev/pci/pcidevs

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



CVS commit: [netbsd-9] src/sys/arch/arm/arm32

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 02:52:09 UTC 2019

Modified Files:
src/sys/arch/arm/arm32 [netbsd-9]: bus_dma.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #236):

sys/arch/arm/arm32/bus_dma.c: revision 1.116

bus_dmamap_load_raw: support coherent mappings
bus_dmamap_sync: support syncing "raw" buffer types


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.115.2.1 src/sys/arch/arm/arm32/bus_dma.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/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.115 src/sys/arch/arm/arm32/bus_dma.c:1.115.2.1
--- src/sys/arch/arm/arm32/bus_dma.c:1.115	Fri Jun 14 09:09:12 2019
+++ src/sys/arch/arm/arm32/bus_dma.c	Tue Sep 24 02:52:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.115 2019/06/14 09:09:12 skrll Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.115.2.1 2019/09/24 02:52:09 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #include "opt_cputypes.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.115 2019/06/14 09:09:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.115.2.1 2019/09/24 02:52:09 martin Exp $");
 
 #include 
 #include 
@@ -750,8 +750,10 @@ _bus_dmamap_load_raw(bus_dma_tag_t t, bu
 		sgsize = MIN(ds->ds_len, size);
 		if (sgsize == 0)
 			continue;
+		const bool coherent =
+		(ds->_ds_flags & _BUS_DMAMAP_COHERENT) != 0;
 		error = _bus_dmamap_load_paddr(t, map, ds->ds_addr,
-		sgsize, false);
+		sgsize, coherent);
 		if (error != 0)
 			break;
 		size -= sgsize;
@@ -766,6 +768,9 @@ _bus_dmamap_load_raw(bus_dma_tag_t t, bu
 	/* XXX TBD bounce */
 
 	map->dm_mapsize = size0;
+	map->_dm_origbuf = NULL;
+	map->_dm_buftype = _BUS_DMA_BUFTYPE_RAW;
+	map->_dm_vmspace = NULL;
 	return 0;
 }
 
@@ -1165,6 +1170,7 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 
 	switch (buftype) {
 	case _BUS_DMA_BUFTYPE_LINEAR:
+	case _BUS_DMA_BUFTYPE_RAW:
 		_bus_dmamap_sync_linear(t, map, offset, len, ops);
 		break;
 
@@ -1176,10 +1182,6 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
 		_bus_dmamap_sync_uio(t, map, offset, len, ops);
 		break;
 
-	case _BUS_DMA_BUFTYPE_RAW:
-		panic("_bus_dmamap_sync: _BUS_DMA_BUFTYPE_RAW");
-		break;
-
 	case _BUS_DMA_BUFTYPE_INVALID:
 		panic("_bus_dmamap_sync: _BUS_DMA_BUFTYPE_INVALID");
 		break;



CVS commit: [netbsd-9] src/sys/arch/arm/arm32

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 02:52:09 UTC 2019

Modified Files:
src/sys/arch/arm/arm32 [netbsd-9]: bus_dma.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #236):

sys/arch/arm/arm32/bus_dma.c: revision 1.116

bus_dmamap_load_raw: support coherent mappings
bus_dmamap_sync: support syncing "raw" buffer types


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.115.2.1 src/sys/arch/arm/arm32/bus_dma.c

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



CVS commit: [netbsd-9] src/sys/arch/arm/rockchip

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 02:50:36 UTC 2019

Modified Files:
src/sys/arch/arm/rockchip [netbsd-9]: rk_i2c.c

Log Message:
Pull up following revision(s) (requested by tnn in ticket #235):

sys/arch/arm/rockchip/rk_i2c.c: revision 1.5

rkiic: coalesce smbus-style writes into a single transaction

There seems to be a hw controller bug. Split cmd/data writes caused corrupt
transfers, with junk bytes witten into the rk808 pmic registers.

This may have caused us to operate with out-of-spec core voltage.


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

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



CVS commit: [netbsd-9] src/sys/arch/arm/rockchip

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 02:50:36 UTC 2019

Modified Files:
src/sys/arch/arm/rockchip [netbsd-9]: rk_i2c.c

Log Message:
Pull up following revision(s) (requested by tnn in ticket #235):

sys/arch/arm/rockchip/rk_i2c.c: revision 1.5

rkiic: coalesce smbus-style writes into a single transaction

There seems to be a hw controller bug. Split cmd/data writes caused corrupt
transfers, with junk bytes witten into the rk808 pmic registers.

This may have caused us to operate with out-of-spec core voltage.


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

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

Modified files:

Index: src/sys/arch/arm/rockchip/rk_i2c.c
diff -u src/sys/arch/arm/rockchip/rk_i2c.c:1.4 src/sys/arch/arm/rockchip/rk_i2c.c:1.4.6.1
--- src/sys/arch/arm/rockchip/rk_i2c.c:1.4	Sun Sep  2 10:07:17 2018
+++ src/sys/arch/arm/rockchip/rk_i2c.c	Tue Sep 24 02:50:36 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_i2c.c,v 1.4 2018/09/02 10:07:17 jmcneill Exp $ */
+/* $NetBSD: rk_i2c.c,v 1.4.6.1 2019/09/24 02:50:36 martin Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: rk_i2c.c,v 1.4 2018/09/02 10:07:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_i2c.c,v 1.4.6.1 2019/09/24 02:50:36 martin Exp $");
 
 #include 
 #include 
@@ -244,8 +244,8 @@ rk_i2c_stop(struct rk_i2c_softc *sc)
 }
 
 static int
-rk_i2c_write(struct rk_i2c_softc *sc, i2c_addr_t addr, const uint8_t *buf,
-size_t buflen, int flags, bool send_start)
+rk_i2c_write(struct rk_i2c_softc *sc, i2c_addr_t addr, const uint8_t *cmd,
+size_t cmdlen, const uint8_t *buf, size_t buflen, int flags, bool send_start)
 {
 	union {
 		uint8_t data8[32];
@@ -254,8 +254,10 @@ rk_i2c_write(struct rk_i2c_softc *sc, i2
 	uint32_t con;
 	u_int mode;
 	int error;
+	size_t len;
 
-	if (buflen > 31)
+	len = cmdlen + buflen;
+	if (len > 31)
 		return EINVAL;
 
 	mode = RKI2C_CON_I2C_MODE_TX;
@@ -267,10 +269,11 @@ rk_i2c_write(struct rk_i2c_softc *sc, i2
 
 	/* Transmit data. Slave address goes in the lower 8 bits of TXDATA0 */
 	txdata.data8[0] = addr << 1;
-	memcpy([1], buf, buflen);
+	memcpy([1], cmd, cmdlen);
+	memcpy([1 + cmdlen], buf, buflen);
 	bus_space_write_region_4(sc->sc_bst, sc->sc_bsh, RKI2C_TXDATA(0),
-	txdata.data32, howmany(buflen + 1, 4));
-	WR4(sc, RKI2C_MTXCNT, __SHIFTIN(buflen + 1, RKI2C_MTXCNT_MTXCNT));
+	txdata.data32, howmany(len + 1, 4));
+	WR4(sc, RKI2C_MTXCNT, __SHIFTIN(len + 1, RKI2C_MTXCNT_MTXCNT));
 
 	if ((error = rk_i2c_wait(sc, RKI2C_IPD_MBTFIPD)) != 0)
 		return error;
@@ -338,16 +341,9 @@ rk_i2c_exec(void *priv, i2c_op_t op, i2c
 	if (I2C_OP_READ_P(op)) {
 		error = rk_i2c_read(sc, addr, cmdbuf, cmdlen, buf, buflen, flags, send_start);
 	} else {
-		if (cmdlen > 0) {
-			error = rk_i2c_write(sc, addr, cmdbuf, cmdlen, flags, send_start);
-			if (error != 0)
-goto done;
-			send_start = false;
-		}
-		error = rk_i2c_write(sc, addr, buf, buflen, flags, send_start);
+		error = rk_i2c_write(sc, addr, cmdbuf, cmdlen, buf, buflen, flags, send_start);
 	}
 
-done:
 	if (error != 0 || I2C_OP_STOP_P(op))
 		rk_i2c_stop(sc);
 



CVS commit: [netbsd-9] src/share/man/man4

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 02:48:51 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-9]: mcx.4

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #234):

share/man/man4/mcx.4: revision 1.2

mcx(4) will appear in 9.0


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/share/man/man4/mcx.4

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

Modified files:

Index: src/share/man/man4/mcx.4
diff -u src/share/man/man4/mcx.4:1.1.2.2 src/share/man/man4/mcx.4:1.1.2.3
--- src/share/man/man4/mcx.4:1.1.2.2	Mon Sep 23 07:04:40 2019
+++ src/share/man/man4/mcx.4	Tue Sep 24 02:48:51 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: mcx.4,v 1.1.2.2 2019/09/23 07:04:40 martin Exp $
+.\" $NetBSD: mcx.4,v 1.1.2.3 2019/09/24 02:48:51 martin Exp $
 .\"
 .\" Copyright (c) 2019 David Gwynne 
 .\"
@@ -14,7 +14,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd September 21, 2019
+.Dd September 23, 2019
 .Dt MCX 4
 .Os
 .Sh NAME
@@ -50,7 +50,7 @@ The
 driver first appeared in
 .Ox 6.6
 and in
-.Nx 10.0 .
+.Nx 9.0 .
 .Sh AUTHORS
 The
 .Nm



CVS commit: [netbsd-9] src/share/man/man4

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 24 02:48:51 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-9]: mcx.4

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #234):

share/man/man4/mcx.4: revision 1.2

mcx(4) will appear in 9.0


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/share/man/man4/mcx.4

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



CVS commit: src/sys/arch/i386/stand/efiboot/bootia32

2019-09-23 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Tue Sep 24 00:47:46 UTC 2019

Modified Files:
src/sys/arch/i386/stand/efiboot/bootia32: multiboot32.S

Log Message:
Fix multiboot32 argument usage


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/arch/i386/stand/efiboot/bootia32/multiboot32.S

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

Modified files:

Index: src/sys/arch/i386/stand/efiboot/bootia32/multiboot32.S
diff -u src/sys/arch/i386/stand/efiboot/bootia32/multiboot32.S:1.1 src/sys/arch/i386/stand/efiboot/bootia32/multiboot32.S:1.2
--- src/sys/arch/i386/stand/efiboot/bootia32/multiboot32.S:1.1	Fri Sep 13 02:19:45 2019
+++ src/sys/arch/i386/stand/efiboot/bootia32/multiboot32.S	Tue Sep 24 00:47:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: multiboot32.S,v 1.1 2019/09/13 02:19:45 manu Exp $ */
+/*	$NetBSD: multiboot32.S,v 1.2 2019/09/24 00:47:46 manu Exp $ */
 
 #include 
 #include 
@@ -16,12 +16,12 @@ _C_LABEL(multiboot32_size):
 	.p2align 4,,15
 
 /*
- * multiboot32(entry 8(%esp), multiboot2_info 12(%esp), magic 16(%esp))
+ * multiboot32(entry 4(%esp), multiboot2_info 8(%esp), magic 12(%esp))
  */
 ENTRY(multiboot32_start)
 start:
-movl16(%esp),%eax
-movl12(%esp),%ebx
-movl8(%esp),%edx
+movl12(%esp),%eax
+movl8(%esp),%ebx
+movl4(%esp),%edx
 jmp*%edx
 multiboot32_end:



CVS commit: src/sys/arch/i386/stand/efiboot/bootia32

2019-09-23 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Tue Sep 24 00:47:46 UTC 2019

Modified Files:
src/sys/arch/i386/stand/efiboot/bootia32: multiboot32.S

Log Message:
Fix multiboot32 argument usage


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/arch/i386/stand/efiboot/bootia32/multiboot32.S

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



CVS commit: src/sys/netinet6

2019-09-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Sep 23 23:12:47 UTC 2019

Modified Files:
src/sys/netinet6: scope6.c

Log Message:
Remove __noubsan from in6_clearscope()

The alignment issues for x86 should be handled by
 - src/sys/arch/amd64/include/types.h r. 1.62 and
 - src/sys/arch/i386/include/types.h r. 1.90


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/netinet6/scope6.c

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



CVS commit: src/sys/netinet6

2019-09-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Sep 23 23:12:47 UTC 2019

Modified Files:
src/sys/netinet6: scope6.c

Log Message:
Remove __noubsan from in6_clearscope()

The alignment issues for x86 should be handled by
 - src/sys/arch/amd64/include/types.h r. 1.62 and
 - src/sys/arch/i386/include/types.h r. 1.90


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/netinet6/scope6.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/netinet6/scope6.c
diff -u src/sys/netinet6/scope6.c:1.21 src/sys/netinet6/scope6.c:1.22
--- src/sys/netinet6/scope6.c:1.21	Fri Sep 20 14:53:24 2019
+++ src/sys/netinet6/scope6.c	Mon Sep 23 23:12:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: scope6.c,v 1.21 2019/09/20 14:53:24 kamil Exp $	*/
+/*	$NetBSD: scope6.c,v 1.22 2019/09/23 23:12:47 kamil Exp $	*/
 /*	$KAME$	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scope6.c,v 1.21 2019/09/20 14:53:24 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scope6.c,v 1.22 2019/09/23 23:12:47 kamil Exp $");
 
 #include 
 #include 
@@ -472,7 +472,6 @@ in6_getscopename(const struct in6_addr *
  * Just clear the embedded scope identifier.  Return 0 if the original address
  * is intact; return non 0 if the address is modified.
  */
-__noubsan
 int
 in6_clearscope(struct in6_addr *in6)
 {



CVS commit: src/sys/arch

2019-09-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Sep 23 23:06:26 UTC 2019

Modified Files:
src/sys/arch/amd64/include: types.h
src/sys/arch/i386/include: types.h

Log Message:
Disable __NO_STRICT_ALIGNMENT on amd64/i386 for UBSan builds

This change allows to pick code paths in the kernel that are tuned for
alignment sensitive (and stricted in C meaning) code paths. In particular
the IPv6 code uses this heavily and skips whenever possible the process
of aligning of networking data.

With this modification all ATF tests are executed on amd64 without
triggering any UBSan reports in dmesg.

In theory __NO_STRICT_ALIGNMENT could be tuned for vax and m68k, however
these machines are still unsupported in LLVM sanitizers and syzkaller.

sys/netinet6/scope6.c:404:6, member access within misaligned address 
0xfaea81276086 for type 'struct in6_addr' which requires 4 byte alignment
Reported-by: syzbot+a86f58d17685317b3...@syzkaller.appspotmail.com

sys/net/rtsock_shared.c:629:41, member access within misaligned address 
0xddb5db3ff04c for type 'struct rt_msghdr50' which requires 8 byte alignment
Reported-by: syzbot+0a3a022bc9d2b8880...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/amd64/include/types.h
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/i386/include/types.h

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

Modified files:

Index: src/sys/arch/amd64/include/types.h
diff -u src/sys/arch/amd64/include/types.h:1.61 src/sys/arch/amd64/include/types.h:1.62
--- src/sys/arch/amd64/include/types.h:1.61	Sun Sep 22 10:35:12 2019
+++ src/sys/arch/amd64/include/types.h	Mon Sep 23 23:06:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.61 2019/09/22 10:35:12 maxv Exp $	*/
+/*	$NetBSD: types.h,v 1.62 2019/09/23 23:06:26 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -74,8 +74,11 @@ typedef	unsigned char		__cpu_simple_lock
 #define	__SIMPLELOCK_LOCKED	1
 #define	__SIMPLELOCK_UNLOCKED	0
 
+#if !__has_feature(undefined_behavior_sanitizer) && \
+	!defined(__SANITIZE_UNDEFINED__)
 /* The amd64 does not have strict alignment requirements. */
 #define	__NO_STRICT_ALIGNMENT
+#endif
 
 #define	__HAVE_NEW_STYLE_BUS_H
 #define	__HAVE_CPU_COUNTER

Index: src/sys/arch/i386/include/types.h
diff -u src/sys/arch/i386/include/types.h:1.89 src/sys/arch/i386/include/types.h:1.90
--- src/sys/arch/i386/include/types.h:1.89	Sat Apr  6 03:06:25 2019
+++ src/sys/arch/i386/include/types.h	Mon Sep 23 23:06:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.89 2019/04/06 03:06:25 thorpej Exp $	*/
+/*	$NetBSD: types.h,v 1.90 2019/09/23 23:06:26 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -99,8 +99,11 @@ typedef __register_t	register_t;
 #define	__SIMPLELOCK_LOCKED	1
 #define	__SIMPLELOCK_UNLOCKED	0
 
+#if !__has_feature(undefined_behavior_sanitizer) && \
+	!defined(__SANITIZE_UNDEFINED__)
 /* The x86 does not have strict alignment requirements. */
 #define	__NO_STRICT_ALIGNMENT
+#endif
 
 #define	__HAVE_NEW_STYLE_BUS_H
 #define	__HAVE_CPU_DATA_FIRST



CVS commit: src/sys/arch

2019-09-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Sep 23 23:06:26 UTC 2019

Modified Files:
src/sys/arch/amd64/include: types.h
src/sys/arch/i386/include: types.h

Log Message:
Disable __NO_STRICT_ALIGNMENT on amd64/i386 for UBSan builds

This change allows to pick code paths in the kernel that are tuned for
alignment sensitive (and stricted in C meaning) code paths. In particular
the IPv6 code uses this heavily and skips whenever possible the process
of aligning of networking data.

With this modification all ATF tests are executed on amd64 without
triggering any UBSan reports in dmesg.

In theory __NO_STRICT_ALIGNMENT could be tuned for vax and m68k, however
these machines are still unsupported in LLVM sanitizers and syzkaller.

sys/netinet6/scope6.c:404:6, member access within misaligned address 
0xfaea81276086 for type 'struct in6_addr' which requires 4 byte alignment
Reported-by: syzbot+a86f58d17685317b3...@syzkaller.appspotmail.com

sys/net/rtsock_shared.c:629:41, member access within misaligned address 
0xddb5db3ff04c for type 'struct rt_msghdr50' which requires 8 byte alignment
Reported-by: syzbot+0a3a022bc9d2b8880...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/amd64/include/types.h
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/i386/include/types.h

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



CVS commit: src/sys/compat/sunos32

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 21:07:39 UTC 2019

Modified Files:
src/sys/compat/sunos32: sunos32_misc.c

Log Message:
make this compile again


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/sunos32/sunos32_misc.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/compat/sunos32/sunos32_misc.c
diff -u src/sys/compat/sunos32/sunos32_misc.c:1.81 src/sys/compat/sunos32/sunos32_misc.c:1.82
--- src/sys/compat/sunos32/sunos32_misc.c:1.81	Tue Sep 17 11:19:27 2019
+++ src/sys/compat/sunos32/sunos32_misc.c	Mon Sep 23 17:07:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunos32_misc.c,v 1.81 2019/09/17 15:19:27 christos Exp $	*/
+/*	$NetBSD: sunos32_misc.c,v 1.82 2019/09/23 21:07:39 christos Exp $	*/
 /* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp	*/
 
 /*
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.81 2019/09/17 15:19:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.82 2019/09/23 21:07:39 christos Exp $");
 
 #define COMPAT_SUNOS 1
 
@@ -838,7 +838,7 @@ sunos32_sys_setsockopt(struct lwp *l, co
 			name = ipoptxlat[name - SUNOS_IP_MULTICAST_IF];
 		}
 	}
-	if (SCARG(uap, valsize) > MLEN) {
+	if ((unsigned)SCARG(uap, valsize) > MLEN) {
 		error = EINVAL;
 		goto out;
 	}
@@ -1081,25 +1081,15 @@ sunos32_sys_statfs(struct lwp *l, const 
 		syscallarg(const netbsd32_charp) path;
 		syscallarg(sunos32_statfsp_t) buf;
 	} */
-	struct mount *mp;
 	struct statvfs *sp;
 	int error;
-	struct vnode *vp;
-	struct sys_statvfs1_args ua;
-
-	SUNOS32TOP_UAP(path, const char);
 
-	error = namei_simple_user(SCARG(, path),
-NSM_FOLLOW_TRYEMULROOT, );
-	if (error != 0)
-		return (error);
-	mp = vp->v_mount;
-	sp = >mnt_stat;
-	vrele(vp);
-	if ((error = VFS_STATVFS(mp, sp)) != 0)
-		return (error);
-	sp->f_flag = mp->mnt_flag & MNT_VISFLAGMASK;
-	return sunstatfs(sp, SCARG_P32(uap, buf));
+	sp = STATVFSBUF_GET();
+	error = do_sys_pstatvfs(l, SCARG_P32(uap, path), 0, sp);
+	if (error == 0)
+		error = sunstatfs(sp, SCARG_P32(uap, buf));
+	STATVFSBUF_PUT(sp);
+	return error;
 }
 
 int
@@ -1109,23 +1099,15 @@ sunos32_sys_fstatfs(struct lwp *l, const
 		syscallarg(int) fd;
 		syscallarg(sunos32_statfsp_t) buf;
 	} */
-	file_t *fp;
-	struct mount *mp;
 	struct statvfs *sp;
 	int error;
 
-	/* fd_getvnode() will use the descriptor for us */
-	if ((error = fd_getvnode(SCARG(uap, fd), )) != 0)
-		return (error);
-	mp = fp->f_vnode->v_mount;
-	sp = >mnt_stat;
-	if ((error = VFS_STATVFS(mp, sp)) != 0)
-		goto out;
-	sp->f_flag = mp->mnt_flag & MNT_VISFLAGMASK;
-	error = sunstatfs(sp, SCARG_P32(uap, buf));
- out:
- 	fd_putfile(SCARG(uap, fd));
-	return (error);
+	sp = STATVFSBUF_GET();
+	error = do_sys_fstatvfs(l, SCARG(uap, fd), 0, sp);
+	if (error == 0)
+		error = sunstatfs(sp, SCARG_P32(uap, buf));
+	STATVFSBUF_PUT(sp);
+	return error;
 }
 
 int
@@ -1258,7 +1240,7 @@ static const int sreq2breq[] = {
 	PT_KILL,-1, PT_ATTACH,  PT_DETACH,
 	PT_GETREGS, PT_SETREGS, PT_GETFPREGS,   PT_SETFPREGS
 };
-static const int nreqs = sizeof(sreq2breq) / sizeof(sreq2breq[0]);
+static const size_t nreqs = __arraycount(sreq2breq);
 
 int
 sunos32_sys_ptrace(struct lwp *l, const struct sunos32_sys_ptrace_args *uap, register_t *retval)



CVS commit: src/sys/compat/sunos32

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 21:07:39 UTC 2019

Modified Files:
src/sys/compat/sunos32: sunos32_misc.c

Log Message:
make this compile again


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/sunos32/sunos32_misc.c

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



CVS commit: src/sys/compat/sunos

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 21:07:50 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_misc.c

Log Message:
make this compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/compat/sunos/sunos_misc.c

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



CVS commit: src/sys/compat/sunos

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 21:07:50 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_misc.c

Log Message:
make this compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/compat/sunos/sunos_misc.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/compat/sunos/sunos_misc.c
diff -u src/sys/compat/sunos/sunos_misc.c:1.173 src/sys/compat/sunos/sunos_misc.c:1.174
--- src/sys/compat/sunos/sunos_misc.c:1.173	Wed Jul  3 14:24:50 2019
+++ src/sys/compat/sunos/sunos_misc.c	Mon Sep 23 17:07:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunos_misc.c,v 1.173 2019/07/03 18:24:50 dholland Exp $	*/
+/*	$NetBSD: sunos_misc.c,v 1.174 2019/09/23 21:07:50 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.173 2019/07/03 18:24:50 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.174 2019/09/23 21:07:50 christos Exp $");
 
 #include 
 #include 
@@ -277,8 +277,12 @@ sunos_sys_mount(struct lwp *l, const str
 		}
 		na.timeo = sna.timeo;
 		na.retrans = sna.retrans;
-		na.hostname = /* (char *)(u_long) */ sna.hostname;
-
+#ifdef __arch64__
+		/* XXX */
+		na.hostname = (char *)(intptr_t)sna.hostname;
+#else
+		na.hostname = sna.hostname;
+#endif
 		return do_sys_mount(l, "nfs", UIO_SYSSPACE,
 		SCARG(uap, dir), nflags, ,
 		UIO_SYSSPACE, sizeof na, );
@@ -565,7 +569,7 @@ sunos_sys_setsockopt(struct lwp *l, cons
 			name = ipoptxlat[name - SUNOS_IP_MULTICAST_IF];
 		}
 	}
-	if (SCARG(uap, valsize) > MLEN) {
+	if ((unsigned)SCARG(uap, valsize) > MLEN) {
 		error = EINVAL;
 		goto out;
 	}



CVS commit: src/sys/compat/sunos

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 20:42:29 UTC 2019

Modified Files:
src/sys/compat/sunos: syscalls.master

Log Message:
Treat valsize as unsigned


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/sunos/syscalls.master

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



CVS commit: src/sys/compat/sunos

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 20:42:29 UTC 2019

Modified Files:
src/sys/compat/sunos: syscalls.master

Log Message:
Treat valsize as unsigned


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/sunos/syscalls.master

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

Modified files:

Index: src/sys/compat/sunos/syscalls.master
diff -u src/sys/compat/sunos/syscalls.master:1.81 src/sys/compat/sunos/syscalls.master:1.82
--- src/sys/compat/sunos/syscalls.master:1.81	Sat Jan 26 21:08:40 2019
+++ src/sys/compat/sunos/syscalls.master	Mon Sep 23 16:42:29 2019
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.81 2019/01/27 02:08:40 pgoyette Exp $
+	$NetBSD: syscalls.master,v 1.82 2019/09/23 20:42:29 christos Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -178,7 +178,7 @@
 103	UNIMPL		old socketaddr
 104	NOARGS		{ int|sys||bind(int s, void *name, int namelen); }
 105	STD		{ int|sunos_sys||setsockopt(int s, int level, int name, \
-			void *val, int valsize); }
+			void *val, u_int valsize); }
 106	NOARGS		{ int|sys||listen(int s, int backlog); }
 107	UNIMPL		vtimes
 108	STD		{ int|sunos_sys||sigvec(int signum, struct sigvec *nsv, \



CVS commit: src/sys/compat/sunos

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 20:38:27 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_ioctl.c

Log Message:
Add missing break


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/compat/sunos/sunos_ioctl.c

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

Modified files:

Index: src/sys/compat/sunos/sunos_ioctl.c
diff -u src/sys/compat/sunos/sunos_ioctl.c:1.69 src/sys/compat/sunos/sunos_ioctl.c:1.70
--- src/sys/compat/sunos/sunos_ioctl.c:1.69	Tue Apr 23 03:45:06 2019
+++ src/sys/compat/sunos/sunos_ioctl.c	Mon Sep 23 16:38:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunos_ioctl.c,v 1.69 2019/04/23 07:45:06 msaitoh Exp $	*/
+/*	$NetBSD: sunos_ioctl.c,v 1.70 2019/09/23 20:38:27 christos Exp $	*/
 
 /*
  * Copyright (c) 1993 Markus Wild.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunos_ioctl.c,v 1.69 2019/04/23 07:45:06 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_ioctl.c,v 1.70 2019/09/23 20:38:27 christos Exp $");
 
 #include 
 #include 
@@ -439,6 +439,7 @@ sunos_sys_ioctl(struct lwp *l, const str
 		}
 
 		error = (*ctl)(fp, TIOCSETD, );
+		break;
 	}
 	case _IOW('t', 101, int):	/* sun SUNOS_TIOCSSOFTCAR */
 	{



CVS commit: src/sys/compat/sunos

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 20:38:27 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_ioctl.c

Log Message:
Add missing break


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/compat/sunos/sunos_ioctl.c

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



CVS commit: src/usr.sbin/intrctl

2019-09-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep 23 20:15:31 UTC 2019

Modified Files:
src/usr.sbin/intrctl: intrctl.8 intrctl.c

Log Message:
add -z flag to intrctl list, which elides all-zero rows.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/intrctl/intrctl.8
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/intrctl/intrctl.c

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

Modified files:

Index: src/usr.sbin/intrctl/intrctl.8
diff -u src/usr.sbin/intrctl/intrctl.8:1.5 src/usr.sbin/intrctl/intrctl.8:1.6
--- src/usr.sbin/intrctl/intrctl.8:1.5	Mon Sep 23 09:17:19 2019
+++ src/usr.sbin/intrctl/intrctl.8	Mon Sep 23 20:15:31 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: intrctl.8,v 1.5 2019/09/23 09:17:19 mrg Exp $
+.\" $NetBSD: intrctl.8,v 1.6 2019/09/23 20:15:31 mrg Exp $
 .\"
 .\" Copyright (c) 2015 Internet Initiative Japan Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 22, 2019
+.Dd September 23, 2019
 .Dt INTRCTL 8
 .Os
 .Sh NAME
@@ -56,7 +56,7 @@ enable to set an interrupt's affinity to
 If
 .Ar cpu_index
 is already enabled, this command has no effect.
-.It list Oo Fl c Oc Op Fl w Ar wait
+.It list Oo Fl c Oc Oo Fl w Ar wait Oc Op Fl z
 for each intrid in the system, display interrupt counts per CPU.
 The intrid is an interrupt name such as "ioapic0 pin 22" for x86.
 .Pp
@@ -72,6 +72,10 @@ is specified then
 display the data continuously with a
 .Ar wait
 seconds delay between each iteration.
+.Pp
+If
+.Fl z
+is specified then rows with all CPUs having zero interrupts will be skipped.
 .It nointr Fl c Ar cpu_index
 disable to set an interrupt's affinity to
 .Ar cpu_index .

Index: src/usr.sbin/intrctl/intrctl.c
diff -u src/usr.sbin/intrctl/intrctl.c:1.9 src/usr.sbin/intrctl/intrctl.c:1.10
--- src/usr.sbin/intrctl/intrctl.c:1.9	Mon Sep 23 09:17:19 2019
+++ src/usr.sbin/intrctl/intrctl.c	Mon Sep 23 20:15:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: intrctl.c,v 1.9 2019/09/23 09:17:19 mrg Exp $	*/
+/*	$NetBSD: intrctl.c,v 1.10 2019/09/23 20:15:31 mrg Exp $	*/
 
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: intrctl.c,v 1.9 2019/09/23 09:17:19 mrg Exp $");
+__RCSID("$NetBSD: intrctl.c,v 1.10 2019/09/23 20:15:31 mrg Exp $");
 
 #include 
 #include 
@@ -99,8 +99,9 @@ usage(void)
 {
 	const char *progname = getprogname();
 
-	fprintf(stderr, "usage: %s list [-c] [-w secs]\n", progname);
-	fprintf(stderr, "   %s affinity -i interrupt_name -c cpu_index\n", progname);
+	fprintf(stderr, "usage: %s list [-c] [-w secs] [-z]\n", progname);
+	fprintf(stderr, "   %s affinity -i interrupt_name -c cpu_index\n",
+	progname);
 	fprintf(stderr, "   %s intr -c cpu_index\n", progname);
 	fprintf(stderr, "   %s nointr -c cpu_index\n", progname);
 	exit(EXIT_FAILURE);
@@ -110,7 +111,7 @@ usage(void)
 static int intrctl_io_alloc_retry_count = 4;
 
 static void
-intrctl_list_one(int compact)
+intrctl_list_one(bool compact, bool skipzero)
 {
 	char buf[64];
 	struct intrio_list_line *illine;
@@ -169,6 +170,20 @@ intrctl_list_one(int compact)
 	illine = intrctl_io_nextline(handle, illine)) {
 		struct intrio_list_line_cpu *illc;
 
+		if (skipzero) {
+			bool is_zero = true;
+
+			for (i = 0; i < ncpus; i++) {
+illc = >ill_cpu[i];
+if (illc->illc_count != 0) {
+	is_zero = false;
+	break;
+}
+			}
+			if (is_zero)
+continue;
+		}
+
 		printf("%-*s ", (int)intridlen, illine->ill_intrid);
 		if (compact) {
 			uint64_t total = 0;
@@ -209,13 +224,17 @@ intrctl_list(int argc, char **argv)
 {
 	int seconds = 0;
 	bool compact = false;
+	bool skipzero = false;
 	int ch;
 
-	while ((ch = getopt(argc, argv, "cw:")) != -1) {
+	while ((ch = getopt(argc, argv, "cw:z")) != -1) {
 		switch (ch) {
 		case 'c':
 			compact = true;
 			break;
+		case 'z':
+			skipzero = true;
+			break;
 		case 'w':
 			seconds = atoi(optarg);
 			if (seconds < 0)
@@ -226,10 +245,12 @@ intrctl_list(int argc, char **argv)
 		}
 	}
 
-	do {
-		intrctl_list_one(compact);
+	for (;;) {
+		intrctl_list_one(compact, skipzero);
+		if (seconds == 0)
+			break;
 		sleep(seconds);
-	} while (seconds);
+	}
 }
 
 static void



CVS commit: src/usr.sbin/intrctl

2019-09-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep 23 20:15:31 UTC 2019

Modified Files:
src/usr.sbin/intrctl: intrctl.8 intrctl.c

Log Message:
add -z flag to intrctl list, which elides all-zero rows.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/intrctl/intrctl.8
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/intrctl/intrctl.c

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



CVS commit: src/share/man/man4

2019-09-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep 23 18:43:59 UTC 2019

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

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/ustir.4

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



CVS commit: src/share/man/man4

2019-09-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Sep 23 18:43:59 UTC 2019

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

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/ustir.4

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

Modified files:

Index: src/share/man/man4/ustir.4
diff -u src/share/man/man4/ustir.4:1.6 src/share/man/man4/ustir.4:1.7
--- src/share/man/man4/ustir.4:1.6	Sun Sep 22 07:42:28 2019
+++ src/share/man/man4/ustir.4	Mon Sep 23 18:43:59 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: ustir.4,v 1.6 2019/09/22 07:42:28 dsainty Exp $
+.\" $NetBSD: ustir.4,v 1.7 2019/09/23 18:43:59 wiz Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -67,6 +67,7 @@ driver was written by
 .An David Sainty Aq Mt dsai...@netbsd.org .
 .Sh BUGS
 The STIr4200 cannot notify the driver when it has received data, instead it
-has to be continuously polled.  This driver polls (when idle) at a fairly low
+has to be continuously polled.
+This driver polls (when idle) at a fairly low
 rate of 10 times per second, which means that system performance is not overly
 affected by rapid polling, but latency is fairly high.



CVS commit: src/share/man/man4

2019-09-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Sep 23 18:26:52 UTC 2019

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

Log Message:
mcx(4) will appear in 9.0


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

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

Modified files:

Index: src/share/man/man4/mcx.4
diff -u src/share/man/man4/mcx.4:1.1 src/share/man/man4/mcx.4:1.2
--- src/share/man/man4/mcx.4:1.1	Sat Sep 21 14:04:12 2019
+++ src/share/man/man4/mcx.4	Mon Sep 23 18:26:52 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: mcx.4,v 1.1 2019/09/21 14:04:12 jmcneill Exp $
+.\" $NetBSD: mcx.4,v 1.2 2019/09/23 18:26:52 jmcneill Exp $
 .\"
 .\" Copyright (c) 2019 David Gwynne 
 .\"
@@ -14,7 +14,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd September 21, 2019
+.Dd September 23, 2019
 .Dt MCX 4
 .Os
 .Sh NAME
@@ -50,7 +50,7 @@ The
 driver first appeared in
 .Ox 6.6
 and in
-.Nx 10.0 .
+.Nx 9.0 .
 .Sh AUTHORS
 The
 .Nm



CVS commit: src/share/man/man4

2019-09-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Sep 23 18:26:52 UTC 2019

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

Log Message:
mcx(4) will appear in 9.0


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

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



CVS commit: src/sys/uvm/pmap

2019-09-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 23 18:20:08 UTC 2019

Modified Files:
src/sys/uvm/pmap: pmap_segtab.c

Log Message:
Use "segmap" for uvm_wait message in pmap_segtab_alloc


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/uvm/pmap/pmap_segtab.c

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



CVS commit: src/sys/uvm/pmap

2019-09-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 23 18:20:08 UTC 2019

Modified Files:
src/sys/uvm/pmap: pmap_segtab.c

Log Message:
Use "segmap" for uvm_wait message in pmap_segtab_alloc


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/uvm/pmap/pmap_segtab.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/uvm/pmap/pmap_segtab.c
diff -u src/sys/uvm/pmap/pmap_segtab.c:1.9 src/sys/uvm/pmap/pmap_segtab.c:1.10
--- src/sys/uvm/pmap/pmap_segtab.c:1.9	Wed Sep 18 18:29:58 2019
+++ src/sys/uvm/pmap/pmap_segtab.c	Mon Sep 23 18:20:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_segtab.c,v 1.9 2019/09/18 18:29:58 skrll Exp $	*/
+/*	$NetBSD: pmap_segtab.c,v 1.10 2019/09/23 18:20:07 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.9 2019/09/18 18:29:58 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.10 2019/09/23 18:20:07 skrll Exp $");
 
 /*
  *	Manages physical address maps.
@@ -299,7 +299,7 @@ pmap_segtab_alloc(void)
 			/*
 			 * XXX What else can we do?  Could we deadlock here?
 			 */
-			uvm_wait("pmap_create");
+			uvm_wait("segtab");
 			goto again;
 		}
 		SEGTAB_ADD(npage, 1);



CVS commit: src/lib/libc/gen

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 18:17:03 UTC 2019

Modified Files:
src/lib/libc/gen: arc4random.c

Log Message:
lint is not smart enough to figure out that ilog2() is constant.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libc/gen/arc4random.c

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

Modified files:

Index: src/lib/libc/gen/arc4random.c
diff -u src/lib/libc/gen/arc4random.c:1.31 src/lib/libc/gen/arc4random.c:1.32
--- src/lib/libc/gen/arc4random.c:1.31	Fri Mar 25 18:13:23 2016
+++ src/lib/libc/gen/arc4random.c	Mon Sep 23 14:17:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: arc4random.c,v 1.31 2016/03/25 22:13:23 riastradh Exp $	*/
+/*	$NetBSD: arc4random.c,v 1.32 2019/09/23 18:17:03 christos Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: arc4random.c,v 1.31 2016/03/25 22:13:23 riastradh Exp $");
+__RCSID("$NetBSD: arc4random.c,v 1.32 2019/09/23 18:17:03 christos Exp $");
 
 #include "namespace.h"
 #include "reentrant.h"
@@ -355,9 +355,10 @@ crypto_onetimestream(const void *seed, v
 	 *	log_2 (o 2^(8 i)) = log_2 o + log_2 2^(8 i)
 	 *	  = log_2 o + 8 i.
 	 */
-	__CTASSERT(CHAR_BIT * sizeof n <=
-	(/*LINTED*/ilog2(crypto_core_OUTPUTBYTES) +
-		8*crypto_core_INPUTBYTES));
+#ifndef __lint__
+	__CTASSERT(CHAR_BIT * sizeof n <= (ilog2(crypto_core_OUTPUTBYTES) +
+		8 * crypto_core_INPUTBYTES));
+#endif
 
 	p8 = buf;
 	p32 = (uint8_t *)roundup2((uintptr_t)p8, 4);



CVS commit: src/lib/libc/gen

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 18:17:03 UTC 2019

Modified Files:
src/lib/libc/gen: arc4random.c

Log Message:
lint is not smart enough to figure out that ilog2() is constant.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libc/gen/arc4random.c

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



CVS commit: src/bin/cp

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 18:01:09 UTC 2019

Modified Files:
src/bin/cp: utils.c

Log Message:
PR/54564: Jan Schaumann: cp of a fifo yields an empty file
Don't short-circuit 0 sized stat entries if they don't belong to regular files.
Also don't try to mmap non-regular files.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/bin/cp/utils.c

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



CVS commit: src/bin/cp

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 18:01:09 UTC 2019

Modified Files:
src/bin/cp: utils.c

Log Message:
PR/54564: Jan Schaumann: cp of a fifo yields an empty file
Don't short-circuit 0 sized stat entries if they don't belong to regular files.
Also don't try to mmap non-regular files.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/bin/cp/utils.c

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

Modified files:

Index: src/bin/cp/utils.c
diff -u src/bin/cp/utils.c:1.46 src/bin/cp/utils.c:1.47
--- src/bin/cp/utils.c:1.46	Tue Jul 17 09:04:58 2018
+++ src/bin/cp/utils.c	Mon Sep 23 14:01:09 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: utils.c,v 1.46 2018/07/17 13:04:58 darcy Exp $ */
+/* $NetBSD: utils.c,v 1.47 2019/09/23 18:01:09 christos Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)utils.c	8.3 (Berkeley) 4/1/94";
 #else
-__RCSID("$NetBSD: utils.c,v 1.46 2018/07/17 13:04:58 darcy Exp $");
+__RCSID("$NetBSD: utils.c,v 1.47 2019/09/23 18:01:09 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -174,87 +174,83 @@ copy_file(FTSENT *entp, int dne)
 
 	rval = 0;
 
-	/*
+	/* 
 	 * There's no reason to do anything other than close the file
-	 * now if it's empty, so let's not bother.
+	 * now if it's regular and empty, so let's not bother.
 	 */
-	if (fs->st_size > 0) {
-		struct finfo fi;
-
-		fi.from = entp->fts_path;
-		fi.to = to.p_path;
-		fi.size = fs->st_size;
-
-		/*
-		 * Mmap and write if less than 8M (the limit is so
-		 * we don't totally trash memory on big files).
-		 * This is really a minor hack, but it wins some CPU back.
-		 */
-		bool use_read;
+	bool need_copy = !S_ISREG(fs->st_mode) || fs->st_size > 0;
 
-		use_read = true;
-		if (fs->st_size <= MMAP_MAX_SIZE) {
-			size_t fsize = (size_t)fs->st_size;
-			p = mmap(NULL, fsize, PROT_READ, MAP_FILE|MAP_SHARED,
-			from_fd, (off_t)0);
-			if (p != MAP_FAILED) {
-size_t remainder;
-
-use_read = false;
-
-(void) madvise(p, (size_t)fs->st_size,
- MADV_SEQUENTIAL);
-
-/*
- * Write out the data in small chunks to
- * avoid locking the output file for a
- * long time if the reading the data from
- * the source is slow.
- */
-remainder = fsize;
-do {
-	ssize_t chunk;
-
-	chunk = (remainder > MMAP_MAX_WRITE) ?
-	MMAP_MAX_WRITE : remainder;
-	if (write(to_fd, [fsize - remainder],
-	chunk) != chunk) {
-		warn("%s", to.p_path);
-		rval = 1;
-		break;
-	}
-	remainder -= chunk;
-	ptotal += chunk;
-	if (pinfo)
-		progress(, ptotal);
-} while (remainder > 0);
+	struct finfo fi;
 
-if (munmap(p, fsize) < 0) {
-	warn("%s", entp->fts_path);
-	rval = 1;
-}
-			}
-		}
+	fi.from = entp->fts_path;
+	fi.to = to.p_path;
+	fi.size = fs->st_size;
 
-		if (use_read) {
-			while ((rcount = read(from_fd, buf, MAXBSIZE)) > 0) {
-wcount = write(to_fd, buf, (size_t)rcount);
-if (rcount != wcount || wcount == -1) {
+	/*
+	 * Mmap and write if less than 8M (the limit is so
+	 * we don't totally trash memory on big files).
+	 * This is really a minor hack, but it wins some CPU back.
+	 */
+	if (S_ISREG(fs->st_mode) && fs->st_size && fs->st_size <= MMAP_MAX_SIZE) {
+		size_t fsize = (size_t)fs->st_size;
+		p = mmap(NULL, fsize, PROT_READ, MAP_FILE|MAP_SHARED,
+		from_fd, (off_t)0);
+		if (p != MAP_FAILED) {
+			size_t remainder;
+
+			need_copy = false;
+
+			(void) madvise(p, (size_t)fs->st_size, MADV_SEQUENTIAL);
+
+			/*
+			 * Write out the data in small chunks to
+			 * avoid locking the output file for a
+			 * long time if the reading the data from
+			 * the source is slow.
+			 */
+			remainder = fsize;
+			do {
+ssize_t chunk;
+
+chunk = (remainder > MMAP_MAX_WRITE) ?
+MMAP_MAX_WRITE : remainder;
+if (write(to_fd, [fsize - remainder],
+chunk) != chunk) {
 	warn("%s", to.p_path);
 	rval = 1;
 	break;
 }
-ptotal += wcount;
+remainder -= chunk;
+ptotal += chunk;
 if (pinfo)
 	progress(, ptotal);
-			}
-			if (rcount < 0) {
+			} while (remainder > 0);
+
+			if (munmap(p, fsize) < 0) {
 warn("%s", entp->fts_path);
 rval = 1;
 			}
 		}
 	}
 
+	if (need_copy) {
+		while ((rcount = read(from_fd, buf, MAXBSIZE)) > 0) {
+			wcount = write(to_fd, buf, (size_t)rcount);
+			if (rcount != wcount || wcount == -1) {
+warn("%s", to.p_path);
+rval = 1;
+break;
+			}
+			ptotal += wcount;
+			if (pinfo)
+progress(, ptotal);
+		}
+		if (rcount < 0) {
+			warn("%s", entp->fts_path);
+			rval = 1;
+		}
+	}
+
 	if (pflag && (fcpxattr(from_fd, to_fd) != 0))
 		warn("%s: error copying extended attributes", to.p_path);
 



CVS commit: src/sys/dev/ic

2019-09-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Sep 23 17:37:04 UTC 2019

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

Log Message:
Move the timeout check out of the loop, otherwise it is never reached.
Found by the lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/ic/an.c

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



CVS commit: src/sys/dev/ic

2019-09-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Sep 23 17:37:04 UTC 2019

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

Log Message:
Move the timeout check out of the loop, otherwise it is never reached.
Found by the lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/ic/an.c

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

Modified files:

Index: src/sys/dev/ic/an.c
diff -u src/sys/dev/ic/an.c:1.71 src/sys/dev/ic/an.c:1.72
--- src/sys/dev/ic/an.c:1.71	Fri Sep 20 11:29:47 2019
+++ src/sys/dev/ic/an.c	Mon Sep 23 17:37:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: an.c,v 1.71 2019/09/20 11:29:47 maxv Exp $	*/
+/*	$NetBSD: an.c,v 1.72 2019/09/23 17:37:04 maxv Exp $	*/
 /*
  * Copyright (c) 1997, 1998, 1999
  *	Bill Paul .  All rights reserved.
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.71 2019/09/20 11:29:47 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: an.c,v 1.72 2019/09/23 17:37:04 maxv Exp $");
 
 
 #include 
@@ -1796,12 +1796,12 @@ an_alloc_fid(struct an_softc *sc, int le
 	for (i = 0; i < AN_TIMEOUT; i++) {
 		if (CSR_READ_2(sc, AN_EVENT_STAT) & AN_EV_ALLOC)
 			break;
-		if (i == AN_TIMEOUT) {
-			printf("%s: timeout in alloc\n", device_xname(sc->sc_dev));
-			return ETIMEDOUT;
-		}
 		DELAY(10);
 	}
+	if (i == AN_TIMEOUT) {
+		printf("%s: timeout in alloc\n", device_xname(sc->sc_dev));
+		return ETIMEDOUT;
+	}
 
 	*idp = CSR_READ_2(sc, AN_ALLOC_FID);
 	CSR_WRITE_2(sc, AN_EVENT_ACK, AN_EV_ALLOC);



CVS commit: src/external/mit/expat/lib/libexpat

2019-09-23 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Sep 23 17:20:41 UTC 2019

Modified Files:
src/external/mit/expat/lib/libexpat: Makefile

Log Message:
Now that expat_config.h uses a header that is OS-specific, using the HOST_CC
breaks for some setups which lack it (netbsd<8, possibly other things).

Use the compiler targetting netbsd that uses netbsd headers to figure out
PACKAGE_VERSION to avoid this problem.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mit/expat/lib/libexpat/Makefile

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

Modified files:

Index: src/external/mit/expat/lib/libexpat/Makefile
diff -u src/external/mit/expat/lib/libexpat/Makefile:1.2 src/external/mit/expat/lib/libexpat/Makefile:1.3
--- src/external/mit/expat/lib/libexpat/Makefile:1.2	Sat May 14 14:39:39 2016
+++ src/external/mit/expat/lib/libexpat/Makefile	Mon Sep 23 17:20:41 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2016/05/14 14:39:39 spz Exp $
+#	$NetBSD: Makefile,v 1.3 2019/09/23 17:20:41 maya Exp $
 
 .include 
 
@@ -36,7 +36,7 @@ dependall: all
 
 expat.pc: expat_config.h expat.pc.in
 	@(V=$$( (echo '#include '; echo PACKAGE_VERSION) | \
-	${HOST_CC} -E -I${.CURDIR} - | tail -1 | tr -d '"') && \
+	${CC} -E -I${.CURDIR} - | tail -1 | tr -d '"') && \
 	${TOOL_SED} -e s/@VERSION@/$$V/ < ${.CURDIR}/expat.pc.in \
 	> ${.TARGET})
 



CVS commit: src/external/mit/expat/lib/libexpat

2019-09-23 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Sep 23 17:20:41 UTC 2019

Modified Files:
src/external/mit/expat/lib/libexpat: Makefile

Log Message:
Now that expat_config.h uses a header that is OS-specific, using the HOST_CC
breaks for some setups which lack it (netbsd<8, possibly other things).

Use the compiler targetting netbsd that uses netbsd headers to figure out
PACKAGE_VERSION to avoid this problem.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mit/expat/lib/libexpat/Makefile

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



CVS commit: src/sys/dev/ic

2019-09-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 23 16:19:33 UTC 2019

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

Log Message:
Use PRIxBUSADDR


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ic/mpt.c

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

Modified files:

Index: src/sys/dev/ic/mpt.c
diff -u src/sys/dev/ic/mpt.c:1.20 src/sys/dev/ic/mpt.c:1.21
--- src/sys/dev/ic/mpt.c:1.20	Sat Sep 21 12:57:25 2019
+++ src/sys/dev/ic/mpt.c	Mon Sep 23 16:19:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mpt.c,v 1.20 2019/09/21 12:57:25 kre Exp $	*/
+/*	$NetBSD: mpt.c,v 1.21 2019/09/23 16:19:33 skrll Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 by Greg Ansley
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mpt.c,v 1.20 2019/09/21 12:57:25 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpt.c,v 1.21 2019/09/23 16:19:33 skrll Exp $");
 
 #include 
 
@@ -327,8 +327,8 @@ mpt_send_cmd(mpt_softc_t *mpt, request_t
 	if (mpt->verbose > 1) {
 		u_int32_t *pReq;
 		pReq = req->req_vbuf;
-		mpt_prt(mpt, "Send Request %d (%#jx):",
-		req->index, (intmax_t)req->req_pbuf);
+		mpt_prt(mpt, "Send Request %d (%#" PRIxBUSADDR "):",
+		req->index, req->req_pbuf);
 		mpt_prt(mpt, "%08x %08x %08x %08x",
 		pReq[0], pReq[1], pReq[2], pReq[3]);
 		mpt_prt(mpt, "%08x %08x %08x %08x",



CVS commit: src/sys/dev/ic

2019-09-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 23 16:19:33 UTC 2019

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

Log Message:
Use PRIxBUSADDR


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ic/mpt.c

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



CVS commit: src/sys/arch

2019-09-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 23 16:17:58 UTC 2019

Modified Files:
src/sys/arch/alpha/include: bus_defs.h bus_user.h
src/sys/arch/amiga/include: bus.h
src/sys/arch/amigappc/include: bus_defs.h
src/sys/arch/arc/include: bus_defs.h
src/sys/arch/atari/include: bus_defs.h
src/sys/arch/cesfic/include: bus.h
src/sys/arch/dreamcast/include: bus_defs.h
src/sys/arch/emips/include: bus.h
src/sys/arch/evbcf/include: bus_space.h
src/sys/arch/evbsh3/include: bus_defs.h
src/sys/arch/ews4800mips/include: bus.h
src/sys/arch/hp300/include: bus.h
src/sys/arch/hpcmips/include: bus_types.h
src/sys/arch/hpcsh/include: bus_defs.h
src/sys/arch/hppa/include: bus_defs.h
src/sys/arch/ia64/include: bus.h
src/sys/arch/landisk/include: bus_defs.h
src/sys/arch/luna68k/include: bus.h
src/sys/arch/mac68k/include: bus.h
src/sys/arch/mipsco/include: bus.h
src/sys/arch/mvme68k/include: bus_space.h
src/sys/arch/news68k/include: bus.h
src/sys/arch/newsmips/include: bus.h
src/sys/arch/next68k/include: bus_space.h
src/sys/arch/or1k/include: bus_defs.h
src/sys/arch/playstation2/include: bus.h
src/sys/arch/powerpc/include: bus_defs.h
src/sys/arch/riscv/include: bus.h
src/sys/arch/sh3/include: bus_defs.h
src/sys/arch/sparc/include: bus_defs.h
src/sys/arch/sparc64/include: bus_defs.h
src/sys/arch/sun68k/include: bus.h
src/sys/arch/usermode/include: bus.h
src/sys/arch/vax/include: bus.h
src/sys/arch/x68k/include: bus.h
src/sys/arch/x86/include: bus_defs.h

Log Message:
Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all arches
to follow arm and (generic) mips.

Reviewed by christos.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/alpha/include/bus_defs.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/alpha/include/bus_user.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amiga/include/bus.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amigappc/include/bus_defs.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arc/include/bus_defs.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/atari/include/bus_defs.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/cesfic/include/bus.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/dreamcast/include/bus_defs.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/include/bus.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbcf/include/bus_space.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbsh3/include/bus_defs.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ews4800mips/include/bus.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp300/include/bus.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hpcmips/include/bus_types.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hpcsh/include/bus_defs.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hppa/include/bus_defs.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/include/bus.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/landisk/include/bus_defs.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/luna68k/include/bus.h
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/mac68k/include/bus.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/mipsco/include/bus.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/mvme68k/include/bus_space.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/news68k/include/bus.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/newsmips/include/bus.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/next68k/include/bus_space.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/or1k/include/bus_defs.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/playstation2/include/bus.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/include/bus_defs.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/include/bus.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sh3/include/bus_defs.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sparc/include/bus_defs.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sparc64/include/bus_defs.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/sun68k/include/bus.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/usermode/include/bus.h
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/vax/include/bus.h
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/x68k/include/bus.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/include/bus_defs.h

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

Modified files:

Index: src/sys/arch/alpha/include/bus_defs.h
diff -u src/sys/arch/alpha/include/bus_defs.h:1.4 src/sys/arch/alpha/include/bus_defs.h:1.5
--- src/sys/arch/alpha/include/bus_defs.h:1.4	Thu Jun 22 16:46:52 2017
+++ src/sys/arch/alpha/include/bus_defs.h	Mon Sep 23 16:17:54 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_defs.h,v 1.4 2017/06/22 16:46:52 flxd Exp $ */
+/* $NetBSD: bus_defs.h,v 1.5 2019/09/23 16:17:54 skrll Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -113,6 +113,8 @@ struct alpha_bus_space_translation;
 typedef struct alpha_bus_space *bus_space_tag_t;
 typedef 

CVS commit: src/sys/arch

2019-09-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 23 16:17:58 UTC 2019

Modified Files:
src/sys/arch/alpha/include: bus_defs.h bus_user.h
src/sys/arch/amiga/include: bus.h
src/sys/arch/amigappc/include: bus_defs.h
src/sys/arch/arc/include: bus_defs.h
src/sys/arch/atari/include: bus_defs.h
src/sys/arch/cesfic/include: bus.h
src/sys/arch/dreamcast/include: bus_defs.h
src/sys/arch/emips/include: bus.h
src/sys/arch/evbcf/include: bus_space.h
src/sys/arch/evbsh3/include: bus_defs.h
src/sys/arch/ews4800mips/include: bus.h
src/sys/arch/hp300/include: bus.h
src/sys/arch/hpcmips/include: bus_types.h
src/sys/arch/hpcsh/include: bus_defs.h
src/sys/arch/hppa/include: bus_defs.h
src/sys/arch/ia64/include: bus.h
src/sys/arch/landisk/include: bus_defs.h
src/sys/arch/luna68k/include: bus.h
src/sys/arch/mac68k/include: bus.h
src/sys/arch/mipsco/include: bus.h
src/sys/arch/mvme68k/include: bus_space.h
src/sys/arch/news68k/include: bus.h
src/sys/arch/newsmips/include: bus.h
src/sys/arch/next68k/include: bus_space.h
src/sys/arch/or1k/include: bus_defs.h
src/sys/arch/playstation2/include: bus.h
src/sys/arch/powerpc/include: bus_defs.h
src/sys/arch/riscv/include: bus.h
src/sys/arch/sh3/include: bus_defs.h
src/sys/arch/sparc/include: bus_defs.h
src/sys/arch/sparc64/include: bus_defs.h
src/sys/arch/sun68k/include: bus.h
src/sys/arch/usermode/include: bus.h
src/sys/arch/vax/include: bus.h
src/sys/arch/x68k/include: bus.h
src/sys/arch/x86/include: bus_defs.h

Log Message:
Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all arches
to follow arm and (generic) mips.

Reviewed by christos.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/alpha/include/bus_defs.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/alpha/include/bus_user.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amiga/include/bus.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amigappc/include/bus_defs.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arc/include/bus_defs.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/atari/include/bus_defs.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/cesfic/include/bus.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/dreamcast/include/bus_defs.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/emips/include/bus.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbcf/include/bus_space.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbsh3/include/bus_defs.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ews4800mips/include/bus.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp300/include/bus.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hpcmips/include/bus_types.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hpcsh/include/bus_defs.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hppa/include/bus_defs.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/include/bus.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/landisk/include/bus_defs.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/luna68k/include/bus.h
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/mac68k/include/bus.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/mipsco/include/bus.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/mvme68k/include/bus_space.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/news68k/include/bus.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/newsmips/include/bus.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/next68k/include/bus_space.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/or1k/include/bus_defs.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/playstation2/include/bus.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/include/bus_defs.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/include/bus.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sh3/include/bus_defs.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sparc/include/bus_defs.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sparc64/include/bus_defs.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/sun68k/include/bus.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/usermode/include/bus.h
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/vax/include/bus.h
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/x68k/include/bus.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/include/bus_defs.h

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



CVS commit: src/distrib/sets/lists/debug

2019-09-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Sep 23 16:07:07 UTC 2019

Modified Files:
src/distrib/sets/lists/debug: shl.mi

Log Message:
Fix MKDEBUG distrib sets

Add libpthread, libnvpair and ZFS libs to dynamicroot.


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.230 src/distrib/sets/lists/debug/shl.mi

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



CVS commit: [netbsd-9] src/doc

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 15:27:52 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #233


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.56 -r1.1.2.57 src/doc/CHANGES-9.0

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-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.56 src/doc/CHANGES-9.0:1.1.2.57
--- src/doc/CHANGES-9.0:1.1.2.56	Mon Sep 23 07:10:56 2019
+++ src/doc/CHANGES-9.0	Mon Sep 23 15:27:52 2019
@@ -1,5 +1,5 @@
 
-# $NetBSD: CHANGES-9.0,v 1.1.2.56 2019/09/23 07:10:56 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.57 2019/09/23 15:27:52 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -3897,3 +3897,8 @@ sys/dev/ic/wdcvar.h1.99
 	G1IDE on Dreamcast.
 	[tsutsui, ticket #232]
 
+sys/dev/acpi/dwiic_acpi.c			1.3
+
+	Match Ampere eMAG hardware ID (APMC0D0F).
+	[jmcneill, ticket #233]
+



CVS commit: [netbsd-9] src/doc

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 15:27:52 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #233


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.56 -r1.1.2.57 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/sys/dev/acpi

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 15:27:04 UTC 2019

Modified Files:
src/sys/dev/acpi [netbsd-9]: dwiic_acpi.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #233):

sys/dev/acpi/dwiic_acpi.c: revision 1.3

Match APMC0D0F compatible string.


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

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

Modified files:

Index: src/sys/dev/acpi/dwiic_acpi.c
diff -u src/sys/dev/acpi/dwiic_acpi.c:1.2 src/sys/dev/acpi/dwiic_acpi.c:1.2.6.1
--- src/sys/dev/acpi/dwiic_acpi.c:1.2	Fri Nov 16 23:18:17 2018
+++ src/sys/dev/acpi/dwiic_acpi.c	Mon Sep 23 15:27:04 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: dwiic_acpi.c,v 1.2 2018/11/16 23:18:17 jmcneill Exp $ */
+/* $NetBSD: dwiic_acpi.c,v 1.2.6.1 2019/09/23 15:27:04 martin Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwiic_acpi.c,v 1.2 2018/11/16 23:18:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwiic_acpi.c,v 1.2.6.1 2019/09/23 15:27:04 martin Exp $");
 
 #include 
 #include 
@@ -60,7 +60,8 @@ static void	dwiic_acpi_configure(struct 
 CFATTACH_DECL_NEW(dwiic_acpi, sizeof(struct dwiic_softc), dwiic_acpi_match, dwiic_acpi_attach, NULL, NULL);
 
 static const char * const compatible[] = {
-	"AMDI0510",
+	"AMDI0510",	/* AMD Seattle */
+	"APMC0D0F",	/* Ampere eMAG */
 	NULL
 };
 



CVS commit: [netbsd-9] src/sys/dev/acpi

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 15:27:04 UTC 2019

Modified Files:
src/sys/dev/acpi [netbsd-9]: dwiic_acpi.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #233):

sys/dev/acpi/dwiic_acpi.c: revision 1.3

Match APMC0D0F compatible string.


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

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



CVS commit: src/bin/df

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 15:24:44 UTC 2019

Modified Files:
src/bin/df: df.1

Log Message:
we don't need root anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/bin/df/df.1

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



CVS commit: src/bin/df

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 15:24:44 UTC 2019

Modified Files:
src/bin/df: df.1

Log Message:
we don't need root anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/bin/df/df.1

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

Modified files:

Index: src/bin/df/df.1
diff -u src/bin/df/df.1:1.53 src/bin/df/df.1:1.54
--- src/bin/df/df.1:1.53	Fri Sep 20 09:43:47 2019
+++ src/bin/df/df.1	Mon Sep 23 11:24:44 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: df.1,v 1.53 2019/09/20 13:43:47 wiz Exp $
+.\"	$NetBSD: df.1,v 1.54 2019/09/23 15:24:44 christos Exp $
 .\"
 .\" Copyright (c) 1989, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)df.1	8.2 (Berkeley) 1/13/92
 .\"
-.Dd September 18, 2019
+.Dd September 23, 2019
 .Dt DF 1
 .Os
 .Sh NAME
@@ -178,12 +178,7 @@ The wedge name is prefixed with
 .Dq NAME=
 as in
 .Xr fstab 5 .
-The .Fl W
-option needs read access on the devices to be able to access
-the wedge information.
-This is available to users with root privileges, and usually to
-members of group operator.
-If the wedge information cannot be obtained, for one or more
+If the wedge information cannot be obtained for one or more
 file systems, the
 .Fl W
 option is silently ignored for those file systems.
@@ -219,10 +214,3 @@ A
 .Nm
 utility appeared in
 .At v1 .
-.Sh BUGS
-The
-.Fl W
-option needs read access to the disk device node to
-get the wedge information.
-Perhaps this information should be exposed via a different mechanism in the
-future.



CVS commit: [netbsd-8] src/doc

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 14:37:34 UTC 2019

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

Log Message:
Update ticket #1380


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.40 -r1.1.2.41 src/doc/CHANGES-8.2

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



CVS commit: [netbsd-8] src/doc

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 14:37:34 UTC 2019

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

Log Message:
Update ticket #1380


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.40 -r1.1.2.41 src/doc/CHANGES-8.2

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

Modified files:

Index: src/doc/CHANGES-8.2
diff -u src/doc/CHANGES-8.2:1.1.2.40 src/doc/CHANGES-8.2:1.1.2.41
--- src/doc/CHANGES-8.2:1.1.2.40	Mon Sep 23 06:57:53 2019
+++ src/doc/CHANGES-8.2	Mon Sep 23 14:37:34 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.40 2019/09/23 06:57:53 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.41 2019/09/23 14:37:34 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -1043,9 +1043,8 @@ sys/netinet6/ip6_input.c			1.209 (patch)
 	m_pullup() it when needed.
 	[bouyer, ticket #1378]
 
-sys/arch/x86/acpi/acpi_machdep.c		1.27,1.28
+sys/arch/x86/acpi/acpi_machdep.c		1.27,1.28 (adapted)
 sys/arch/xen/include/xen-public/platform.h	(apply patch)
-sys/arch/xen/conf/files.xen			(parts of 1.178)
 
 	Attempt to obtain ACPI RSDP from the hypervisor for Xen PV.
 	[manu, ticket #1380]



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

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 14:36:17 UTC 2019

Modified Files:
src/sys/arch/x86/acpi [netbsd-8]: acpi_machdep.c

Log Message:
Apply patch, requested by manu in ticket #1380: add EFI specific guids
here locally for XEN (solved differently in HEAD by including more efi
support code in XEN kernels for PVHVM).


To generate a diff of this commit:
cvs rdiff -u -r1.18.6.1 -r1.18.6.2 src/sys/arch/x86/acpi/acpi_machdep.c

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

Modified files:

Index: src/sys/arch/x86/acpi/acpi_machdep.c
diff -u src/sys/arch/x86/acpi/acpi_machdep.c:1.18.6.1 src/sys/arch/x86/acpi/acpi_machdep.c:1.18.6.2
--- src/sys/arch/x86/acpi/acpi_machdep.c:1.18.6.1	Wed Sep 18 16:30:33 2019
+++ src/sys/arch/x86/acpi/acpi_machdep.c	Mon Sep 23 14:36:17 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.18.6.1 2019/09/18 16:30:33 martin Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.18.6.2 2019/09/23 14:36:17 martin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.18.6.1 2019/09/18 16:30:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.18.6.2 2019/09/23 14:36:17 martin Exp $");
 
 #include 
 #include 
@@ -102,6 +102,14 @@ acpi_md_OsGetRootPointer(void)
 
 #ifdef XEN
 	/*
+	 * This should use EFI_UUID_ACPI20 and EFI_UUID_ACPI10
+	 * from src/sys/arch/x86/x86/efi.c but we want the
+	 * ablility to build without this file included.
+	 */
+	const struct uuid UUID_ACPI20 = EFI_TABLE_ACPI20;
+	const struct uuid UUID_ACPI10 = EFI_TABLE_ACPI10;
+
+	/*
 	 * Obtain the ACPI RSDP from the hypervisor. 
 	 * This is the only way to go if Xen booted from EFI: the 
 	 * Extended BIOS Data Area (EBDA) is not mapped, and Xen 
@@ -125,7 +133,7 @@ acpi_md_OsGetRootPointer(void)
 
 		for (i = 0; i < info->cfg.nent; i++) {
 	if (memcmp([i].ct_uuid,
-			_UUID_ACPI20, sizeof(EFI_UUID_ACPI20)) == 0) {
+			_ACPI20, sizeof(UUID_ACPI20)) == 0) {
 PhysicalAddress = (ACPI_PHYSICAL_ADDRESS)
 (uintptr_t)ct[i].ct_data;
 if (PhysicalAddress)
@@ -136,7 +144,7 @@ acpi_md_OsGetRootPointer(void)
 
 		for (i = 0; i < info->cfg.nent; i++) {
 	if (memcmp([i].ct_uuid,
-			_UUID_ACPI10, sizeof(EFI_UUID_ACPI10)) == 0) {
+			_ACPI10, sizeof(UUID_ACPI10)) == 0) {
 PhysicalAddress = (ACPI_PHYSICAL_ADDRESS)
 (uintptr_t)ct[i].ct_data;
 if (PhysicalAddress)



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

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 14:36:17 UTC 2019

Modified Files:
src/sys/arch/x86/acpi [netbsd-8]: acpi_machdep.c

Log Message:
Apply patch, requested by manu in ticket #1380: add EFI specific guids
here locally for XEN (solved differently in HEAD by including more efi
support code in XEN kernels for PVHVM).


To generate a diff of this commit:
cvs rdiff -u -r1.18.6.1 -r1.18.6.2 src/sys/arch/x86/acpi/acpi_machdep.c

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



Re: Leak Sanitizer - how to suppress leaks

2019-09-23 Thread David Holland
On Mon, Sep 16, 2019 at 07:47:24AM +0700, Robert Elz wrote:
 >   | There have been OSes in the past where memory not freed yet at process
 >   | exit is _not_ freed by the system, and there might be again,
 > 
 > Please everyone, let's retain some perspective.   Systems like those
 > (Roy mentioned RTEMS as an example) require specially constructed code,
 > as in a system where process termination doesn't free all the process's
 > resources, then what

The OS I was thinking of was a desktop OS that could (and did) run
quite a bit of unix code. As I recall the various C runtimes available
took some steps to avoid gaping memory leaks, but there's still no
reason to not tidy up when one can.

 > The one reason for doing this kind of free() is so that LSan type analysers
 > can look at memory and report anything that wasn't freed.

This is, however, itself a pretty good reason.

-- 
David A. Holland
dholl...@netbsd.org


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

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 13:51:12 UTC 2019

Modified Files:
src/sys/arch/xen/conf [netbsd-8]: files.xen

Log Message:
Backout previous try to fix ticket #1380, this causes more build fallout,
will be fixed differently.


To generate a diff of this commit:
cvs rdiff -u -r1.147.2.2 -r1.147.2.3 src/sys/arch/xen/conf/files.xen

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/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.147.2.2 src/sys/arch/xen/conf/files.xen:1.147.2.3
--- src/sys/arch/xen/conf/files.xen:1.147.2.2	Mon Sep 23 06:52:21 2019
+++ src/sys/arch/xen/conf/files.xen	Mon Sep 23 13:51:12 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.147.2.2 2019/09/23 06:52:21 martin Exp $
+#	$NetBSD: files.xen,v 1.147.2.3 2019/09/23 13:51:12 martin Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -81,7 +81,6 @@ file	uvm/pmap/pmap_pvt.c
 file	arch/x86/x86/convert_xmm_s87.c
 file	arch/x86/x86/db_memrw.c		ddb | kgdb
 file	arch/x86/x86/db_trace.c		ddb
-file	arch/x86/x86/efi.c		machdep
 file	arch/x86/x86/fpu.c
 file	arch/x86/x86/dbregs.c
 file	arch/xen/x86/hypervisor_machdep.c



CVS commit: src/doc

2019-09-23 Thread Takahiro Kambe
Module Name:src
Committed By:   taca
Date:   Mon Sep 23 13:49:40 UTC 2019

Modified Files:
src/doc: 3RDPARTY

Log Message:
Postfix 3.1.14/3.2.11/3.3.6/3.4.7 released.


To generate a diff of this commit:
cvs rdiff -u -r1.1649 -r1.1650 src/doc/3RDPARTY

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



CVS commit: src/doc

2019-09-23 Thread Takahiro Kambe
Module Name:src
Committed By:   taca
Date:   Mon Sep 23 13:49:40 UTC 2019

Modified Files:
src/doc: 3RDPARTY

Log Message:
Postfix 3.1.14/3.2.11/3.3.6/3.4.7 released.


To generate a diff of this commit:
cvs rdiff -u -r1.1649 -r1.1650 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1649 src/doc/3RDPARTY:1.1650
--- src/doc/3RDPARTY:1.1649	Mon Sep 16 06:52:02 2019
+++ src/doc/3RDPARTY	Mon Sep 23 13:49:40 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1649 2019/09/16 06:52:02 maya Exp $
+#	$NetBSD: 3RDPARTY,v 1.1650 2019/09/23 13:49:40 taca Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1211,11 +1211,11 @@ now to do a new import.
 
 Package:	Postfix
 Version:	3.1.4
-Current Vers:	3.1.13/3.2.10/3.3.5/3.4.6
+Current Vers:	3.1.14/3.2.11/3.3.6/3.4.7
 Maintainer:	Wietse Venema 
 Archive Site:
 Home Page:	http://www.postfix.org/
-Date: 		2019-07-03
+Date: 		2019-09-22
 Mailing List:	postfix-us...@postfix.org
 Responsible:	christos
 License:	IBM Public License. See also src/external/ibm-public/postfix/dist.



CVS commit: src

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 13:42:37 UTC 2019

Modified Files:
src/distrib/acorn32/cdroms/installcd: Makefile
src/distrib/alpha/cdroms/installcd: Makefile
src/distrib/amd64/cdroms/installcd: Makefile
src/distrib/amiga/cdroms/installcd: Makefile
src/distrib/arc/cdroms/installcd: Makefile
src/distrib/atari/cdroms/installcd: Makefile
src/distrib/cats/cdroms/installcd: Makefile
src/distrib/cobalt/cdroms/installcd: Makefile
src/distrib/common: Makefile.bootcd
src/distrib/dreamcast/cdroms/installcd: Makefile
src/distrib/emips/cdroms/installcd: Makefile
src/distrib/evbarm/cdroms/installcd: Makefile
src/distrib/evbmips/cdroms/installcd: Makefile
src/distrib/evbppc/cdroms/installcd: Makefile
src/distrib/evbsh3/cdroms/installcd: Makefile
src/distrib/ews4800mips/cdroms/installcd: Makefile
src/distrib/hp300/cdroms/installcd: Makefile
src/distrib/hpcarm/cdroms/installcd: Makefile
src/distrib/hpcmips/cdroms/installcd: Makefile
src/distrib/hpcsh/cdroms/installcd: Makefile
src/distrib/hppa/cdroms/installcd: Makefile
src/distrib/i386/cdroms/installcd: Makefile
src/distrib/ia64/cdroms/installcd: Makefile
src/distrib/ibmnws/cdroms/installcd: Makefile
src/distrib/luna68k/cdroms/installcd: Makefile
src/distrib/macppc/cdroms/installcd: Makefile
src/distrib/mipsco/cdroms/installcd: Makefile
src/distrib/mvme68k/cdroms/installcd: Makefile
src/distrib/mvmeppc/cdroms/installcd: Makefile
src/distrib/news68k/cdroms/installcd: Makefile
src/distrib/newsmips/cdroms/installcd: Makefile
src/distrib/ofppc/cdroms/installcd: Makefile
src/distrib/playstation2/cdroms/installcd: Makefile
src/distrib/pmax/cdroms/installcd: Makefile
src/distrib/prep/cdroms/installcd: Makefile
src/distrib/sandpoint/cdroms/installcd: Makefile
src/distrib/sgimips/cdroms/installcd: Makefile
src/distrib/shark/cdroms/installcd: Makefile
src/distrib/sparc/cdroms/installcd: Makefile
src/distrib/sparc64/cdroms/installcd: Makefile
src/distrib/sun2/cdroms/installcd: Makefile
src/distrib/sun3/cdroms/installcd: Makefile
src/distrib/vax/cdroms/installcd: Makefile
src/distrib/x68k/cdroms/installcd: Makefile
src/distrib/zaurus/cdroms/installcd: Makefile
src/sys/arch/alpha/stand/netboot: Makefile
src/sys/arch/hp300/stand/inst: Makefile
src/sys/arch/hp300/stand/uboot: Makefile
src/sys/arch/i386/stand/dosboot: Makefile
src/sys/arch/i386/stand/misc: Makefile
src/sys/arch/i386/stand/pxeboot: Makefile
src/sys/arch/x68k/stand/loadbsd: Makefile
src/sys/arch/zaurus/stand/zboot: Makefile
src/sys/arch/zaurus/stand/zbsdmod: Makefile
src/sys/stand/efiboot/bootaa64: Makefile
src/sys/stand/efiboot/bootarm: Makefile

Log Message:
Consistently use ${RELEASEDIR}/${RELEASEMACHINE} instead of
${RELEASEDIR}/${MACHINE} (Paul Ripke)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/acorn32/cdroms/installcd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/distrib/alpha/cdroms/installcd/Makefile
cvs rdiff -u -r1.5 -r1.6 src/distrib/amd64/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/amiga/cdroms/installcd/Makefile
cvs rdiff -u -r1.4 -r1.5 src/distrib/arc/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/atari/cdroms/installcd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/distrib/cats/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/cobalt/cdroms/installcd/Makefile
cvs rdiff -u -r1.41 -r1.42 src/distrib/common/Makefile.bootcd
cvs rdiff -u -r1.2 -r1.3 src/distrib/dreamcast/cdroms/installcd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/distrib/emips/cdroms/installcd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/distrib/evbarm/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/evbmips/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/evbppc/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/evbsh3/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/ews4800mips/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/hp300/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/hpcarm/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/hpcmips/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/hpcsh/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/hppa/cdroms/installcd/Makefile
cvs rdiff -u -r1.9 -r1.10 src/distrib/i386/cdroms/installcd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/distrib/ia64/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/ibmnws/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/luna68k/cdroms/installcd/Makefile
cvs rdiff -u -r1.4 -r1.5 

CVS commit: src

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 13:42:37 UTC 2019

Modified Files:
src/distrib/acorn32/cdroms/installcd: Makefile
src/distrib/alpha/cdroms/installcd: Makefile
src/distrib/amd64/cdroms/installcd: Makefile
src/distrib/amiga/cdroms/installcd: Makefile
src/distrib/arc/cdroms/installcd: Makefile
src/distrib/atari/cdroms/installcd: Makefile
src/distrib/cats/cdroms/installcd: Makefile
src/distrib/cobalt/cdroms/installcd: Makefile
src/distrib/common: Makefile.bootcd
src/distrib/dreamcast/cdroms/installcd: Makefile
src/distrib/emips/cdroms/installcd: Makefile
src/distrib/evbarm/cdroms/installcd: Makefile
src/distrib/evbmips/cdroms/installcd: Makefile
src/distrib/evbppc/cdroms/installcd: Makefile
src/distrib/evbsh3/cdroms/installcd: Makefile
src/distrib/ews4800mips/cdroms/installcd: Makefile
src/distrib/hp300/cdroms/installcd: Makefile
src/distrib/hpcarm/cdroms/installcd: Makefile
src/distrib/hpcmips/cdroms/installcd: Makefile
src/distrib/hpcsh/cdroms/installcd: Makefile
src/distrib/hppa/cdroms/installcd: Makefile
src/distrib/i386/cdroms/installcd: Makefile
src/distrib/ia64/cdroms/installcd: Makefile
src/distrib/ibmnws/cdroms/installcd: Makefile
src/distrib/luna68k/cdroms/installcd: Makefile
src/distrib/macppc/cdroms/installcd: Makefile
src/distrib/mipsco/cdroms/installcd: Makefile
src/distrib/mvme68k/cdroms/installcd: Makefile
src/distrib/mvmeppc/cdroms/installcd: Makefile
src/distrib/news68k/cdroms/installcd: Makefile
src/distrib/newsmips/cdroms/installcd: Makefile
src/distrib/ofppc/cdroms/installcd: Makefile
src/distrib/playstation2/cdroms/installcd: Makefile
src/distrib/pmax/cdroms/installcd: Makefile
src/distrib/prep/cdroms/installcd: Makefile
src/distrib/sandpoint/cdroms/installcd: Makefile
src/distrib/sgimips/cdroms/installcd: Makefile
src/distrib/shark/cdroms/installcd: Makefile
src/distrib/sparc/cdroms/installcd: Makefile
src/distrib/sparc64/cdroms/installcd: Makefile
src/distrib/sun2/cdroms/installcd: Makefile
src/distrib/sun3/cdroms/installcd: Makefile
src/distrib/vax/cdroms/installcd: Makefile
src/distrib/x68k/cdroms/installcd: Makefile
src/distrib/zaurus/cdroms/installcd: Makefile
src/sys/arch/alpha/stand/netboot: Makefile
src/sys/arch/hp300/stand/inst: Makefile
src/sys/arch/hp300/stand/uboot: Makefile
src/sys/arch/i386/stand/dosboot: Makefile
src/sys/arch/i386/stand/misc: Makefile
src/sys/arch/i386/stand/pxeboot: Makefile
src/sys/arch/x68k/stand/loadbsd: Makefile
src/sys/arch/zaurus/stand/zboot: Makefile
src/sys/arch/zaurus/stand/zbsdmod: Makefile
src/sys/stand/efiboot/bootaa64: Makefile
src/sys/stand/efiboot/bootarm: Makefile

Log Message:
Consistently use ${RELEASEDIR}/${RELEASEMACHINE} instead of
${RELEASEDIR}/${MACHINE} (Paul Ripke)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/acorn32/cdroms/installcd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/distrib/alpha/cdroms/installcd/Makefile
cvs rdiff -u -r1.5 -r1.6 src/distrib/amd64/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/amiga/cdroms/installcd/Makefile
cvs rdiff -u -r1.4 -r1.5 src/distrib/arc/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/atari/cdroms/installcd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/distrib/cats/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/cobalt/cdroms/installcd/Makefile
cvs rdiff -u -r1.41 -r1.42 src/distrib/common/Makefile.bootcd
cvs rdiff -u -r1.2 -r1.3 src/distrib/dreamcast/cdroms/installcd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/distrib/emips/cdroms/installcd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/distrib/evbarm/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/evbmips/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/evbppc/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/evbsh3/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/ews4800mips/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/hp300/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/hpcarm/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/hpcmips/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/hpcsh/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/hppa/cdroms/installcd/Makefile
cvs rdiff -u -r1.9 -r1.10 src/distrib/i386/cdroms/installcd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/distrib/ia64/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/ibmnws/cdroms/installcd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/distrib/luna68k/cdroms/installcd/Makefile
cvs rdiff -u -r1.4 -r1.5 

Re: CVS commit: src

2019-09-23 Thread Kamil Rytarowski
On 23.09.2019 14:10, Christos Zoulas wrote:
> In article <39faa27a-2f79-3296-b316-513a6a3fa...@gmx.com>,
> Kamil Rytarowski   wrote:
>> -=-=-=-=-=-
>> -=-=-=-=-=-
>>
>> On 23.09.2019 00:59, Christos Zoulas wrote:
>>> Module Name:src
>>> Committed By:   christos
>>> Date:   Sun Sep 22 22:59:40 UTC 2019
>>>
>>> Modified Files:
>>> src/bin/df: df.c
>>> src/distrib/sets/lists/base: shl.mi
>>> src/distrib/sets/lists/debug: shl.mi
>>> src/distrib/sets/lists/modules: ad.arm ad.mips md.amd64 md.sparc64 mi
>>> src/lib/libc: shlib_version
>>> src/lib/libc/compat/gen: Makefile.inc compat_opendir.c
>>> src/lib/libc/compat/sys: Makefile.inc compat_fhstatvfs.c
>>> compat_fhstatvfs1.c compat_statfs.c
>>> src/lib/libc/include: namespace.h
>>> src/lib/libc/sys: Makefile.inc statvfs.c
>>> src/share/man/man5: statvfs.5
>>> src/sys/compat/common: compat_mod.h files.common vfs_syscalls_20.c
>>> vfs_syscalls_30.c
>>> src/sys/compat/netbsd32: files.netbsd32 netbsd32.h netbsd32_conv.h
>>> netbsd32_fs.c syscalls.conf syscalls.master
>>> src/sys/conf: files
>>> src/sys/kern: init_sysent.c syscalls.conf syscalls.master vfs_subr.c
>>> vfs_syscalls.c
>>> src/sys/miscfs/specfs: spec_vnops.c
>>> src/sys/modules: Makefile
>>> src/sys/sys: param.h statvfs.h
>>> src/usr.bin/ktruss: dump.c
>>> Added Files:
>>> src/lib/libc/compat/gen: compat___getmntinfo13.c
>>> src/lib/libc/compat/sys: compat___fhstatvfs140.c compat___fhstatvfs40.c
>>> compat_statvfs.c
>>> src/sys/compat/common: compat_90_mod.c vfs_syscalls_90.c
>>> src/sys/compat/netbsd32: netbsd32_compat_90.c
>>> src/sys/conf: compat_netbsd90.config
>>> src/sys/modules/compat_90: Makefile
>>> src/sys/modules/compat_netbsd32_90: Makefile
>>>
>>> Log Message:
>>> Add a new member to struct vfsstat and grow the unused members
>>> The new member is caled f_mntfromlabel and it is the dkw_wname
>>> of the corresponding wedge. This is now used by df -W to display
>>> the mountpoint name as NAME=
>>>
>>>
>>
>> I propose to add a fallback inside libc to the older syscalls. In case
>> of ENOSYS pick older syscall and zero the new struct field.
>>
>> This change breaks new userland with older kernel. I just hit this
>> problem when upgraded before upgrading the kernel and ./build.sh
>> install=/ broke in the middle leaving me with corrupted setup.
>>
> 
> New userland + old kernel is never guaranteed to work. While what you
> suggest might work in this case, it adds significant complexity because
> you need to wrap the new syscalls specially.
> 
> christos
> 

OK. I have recovered my setup and alerted other people.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src

2019-09-23 Thread Christos Zoulas
In article <39faa27a-2f79-3296-b316-513a6a3fa...@gmx.com>,
Kamil Rytarowski   wrote:
>-=-=-=-=-=-
>-=-=-=-=-=-
>
>On 23.09.2019 00:59, Christos Zoulas wrote:
>> Module Name: src
>> Committed By:christos
>> Date:Sun Sep 22 22:59:40 UTC 2019
>> 
>> Modified Files:
>>  src/bin/df: df.c
>>  src/distrib/sets/lists/base: shl.mi
>>  src/distrib/sets/lists/debug: shl.mi
>>  src/distrib/sets/lists/modules: ad.arm ad.mips md.amd64 md.sparc64 mi
>>  src/lib/libc: shlib_version
>>  src/lib/libc/compat/gen: Makefile.inc compat_opendir.c
>>  src/lib/libc/compat/sys: Makefile.inc compat_fhstatvfs.c
>>  compat_fhstatvfs1.c compat_statfs.c
>>  src/lib/libc/include: namespace.h
>>  src/lib/libc/sys: Makefile.inc statvfs.c
>>  src/share/man/man5: statvfs.5
>>  src/sys/compat/common: compat_mod.h files.common vfs_syscalls_20.c
>>  vfs_syscalls_30.c
>>  src/sys/compat/netbsd32: files.netbsd32 netbsd32.h netbsd32_conv.h
>>  netbsd32_fs.c syscalls.conf syscalls.master
>>  src/sys/conf: files
>>  src/sys/kern: init_sysent.c syscalls.conf syscalls.master vfs_subr.c
>>  vfs_syscalls.c
>>  src/sys/miscfs/specfs: spec_vnops.c
>>  src/sys/modules: Makefile
>>  src/sys/sys: param.h statvfs.h
>>  src/usr.bin/ktruss: dump.c
>> Added Files:
>>  src/lib/libc/compat/gen: compat___getmntinfo13.c
>>  src/lib/libc/compat/sys: compat___fhstatvfs140.c compat___fhstatvfs40.c
>>  compat_statvfs.c
>>  src/sys/compat/common: compat_90_mod.c vfs_syscalls_90.c
>>  src/sys/compat/netbsd32: netbsd32_compat_90.c
>>  src/sys/conf: compat_netbsd90.config
>>  src/sys/modules/compat_90: Makefile
>>  src/sys/modules/compat_netbsd32_90: Makefile
>> 
>> Log Message:
>> Add a new member to struct vfsstat and grow the unused members
>> The new member is caled f_mntfromlabel and it is the dkw_wname
>> of the corresponding wedge. This is now used by df -W to display
>> the mountpoint name as NAME=
>> 
>> 
>
>I propose to add a fallback inside libc to the older syscalls. In case
>of ENOSYS pick older syscall and zero the new struct field.
>
>This change breaks new userland with older kernel. I just hit this
>problem when upgraded before upgrading the kernel and ./build.sh
>install=/ broke in the middle leaving me with corrupted setup.
>

New userland + old kernel is never guaranteed to work. While what you
suggest might work in this case, it adds significant complexity because
you need to wrap the new syscalls specially.

christos



CVS commit: src

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 12:00:58 UTC 2019

Modified Files:
src/lib/libp2k: p2k.c
src/lib/libperfuse: ops.c perfuse_priv.h
src/lib/libpuffs: null.c puffs.h subr.c
src/lib/librefuse: refuse.c
src/sys/fs/puffs: puffs_msgif.h puffs_vfsops.c
src/tests/fs/puffs/h_dtfs: dtfs_vfsops.c
src/usr.sbin/puffs/mount_psshfs: fs.c

Log Message:
Restore binary compatibility by using the statvfs90 structure internally.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/lib/libp2k/p2k.c
cvs rdiff -u -r1.87 -r1.88 src/lib/libperfuse/ops.c
cvs rdiff -u -r1.37 -r1.38 src/lib/libperfuse/perfuse_priv.h
cvs rdiff -u -r1.33 -r1.34 src/lib/libpuffs/null.c
cvs rdiff -u -r1.127 -r1.128 src/lib/libpuffs/puffs.h
cvs rdiff -u -r1.27 -r1.28 src/lib/libpuffs/subr.c
cvs rdiff -u -r1.100 -r1.101 src/lib/librefuse/refuse.c
cvs rdiff -u -r1.84 -r1.85 src/sys/fs/puffs/puffs_msgif.h
cvs rdiff -u -r1.121 -r1.122 src/sys/fs/puffs/puffs_vfsops.c
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/puffs/h_dtfs/dtfs_vfsops.c
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/puffs/mount_psshfs/fs.c

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



CVS commit: src

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 12:00:58 UTC 2019

Modified Files:
src/lib/libp2k: p2k.c
src/lib/libperfuse: ops.c perfuse_priv.h
src/lib/libpuffs: null.c puffs.h subr.c
src/lib/librefuse: refuse.c
src/sys/fs/puffs: puffs_msgif.h puffs_vfsops.c
src/tests/fs/puffs/h_dtfs: dtfs_vfsops.c
src/usr.sbin/puffs/mount_psshfs: fs.c

Log Message:
Restore binary compatibility by using the statvfs90 structure internally.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/lib/libp2k/p2k.c
cvs rdiff -u -r1.87 -r1.88 src/lib/libperfuse/ops.c
cvs rdiff -u -r1.37 -r1.38 src/lib/libperfuse/perfuse_priv.h
cvs rdiff -u -r1.33 -r1.34 src/lib/libpuffs/null.c
cvs rdiff -u -r1.127 -r1.128 src/lib/libpuffs/puffs.h
cvs rdiff -u -r1.27 -r1.28 src/lib/libpuffs/subr.c
cvs rdiff -u -r1.100 -r1.101 src/lib/librefuse/refuse.c
cvs rdiff -u -r1.84 -r1.85 src/sys/fs/puffs/puffs_msgif.h
cvs rdiff -u -r1.121 -r1.122 src/sys/fs/puffs/puffs_vfsops.c
cvs rdiff -u -r1.3 -r1.4 src/tests/fs/puffs/h_dtfs/dtfs_vfsops.c
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/puffs/mount_psshfs/fs.c

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

Modified files:

Index: src/lib/libp2k/p2k.c
diff -u src/lib/libp2k/p2k.c:1.70 src/lib/libp2k/p2k.c:1.71
--- src/lib/libp2k/p2k.c:1.70	Tue Apr 25 23:02:48 2017
+++ src/lib/libp2k/p2k.c	Mon Sep 23 08:00:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: p2k.c,v 1.70 2017/04/26 03:02:48 riastradh Exp $	*/
+/*	$NetBSD: p2k.c,v 1.71 2019/09/23 12:00:57 christos Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008, 2009  Antti Kantee.  All Rights Reserved.
@@ -157,7 +157,7 @@ static volatile sig_atomic_t dodump;
 static void
 dumpmp(struct puffs_usermount *pu)
 {
-	struct statvfs svfsb;
+	struct puffs_statvfs svfsb;
 
 	if (dodump && p2k_fs_statvfs(pu, ) == 0) {
 		rump_pub_vfs_mount_print(svfsb.f_mntonname, dodump-1);
@@ -586,12 +586,14 @@ p2k_setup_diskfs(struct p2k_mount *p2m, 
 }
 
 int
-p2k_fs_statvfs(struct puffs_usermount *pu, struct statvfs *sbp)
+p2k_fs_statvfs(struct puffs_usermount *pu, struct puffs_statvfs *sbp)
 {
 	struct p2k_mount *p2m = puffs_getspecific(pu);
 	struct mount *mp = p2m->p2m_mp;
+	struct statvfs sb;
+	puffs_statvfs_to_statvfs(sbp, );
 
-	return rump_pub_vfs_statvfs(mp, sbp);
+	return rump_pub_vfs_statvfs(mp, );
 }
 
 /*ARGSUSED*/
@@ -606,7 +608,7 @@ p2k_fs_unmount(struct puffs_usermount *p
 
 	if (fs) {
 		if (ukfs_release(fs, 0) != 0) {
-			struct statvfs svfsb;
+			struct puffs_statvfs svfsb;
 
 			if (p2m->p2m_hasdebug
 			&& p2k_fs_statvfs(pu, ) == 0) {

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.87 src/lib/libperfuse/ops.c:1.88
--- src/lib/libperfuse/ops.c:1.87	Sat Aug 10 03:08:11 2019
+++ src/lib/libperfuse/ops.c	Mon Sep 23 08:00:57 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.87 2019/08/10 07:08:11 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.88 2019/09/23 12:00:57 christos Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -955,7 +955,7 @@ perfuse_fs_unmount(struct puffs_usermoun
 }
 
 int
-perfuse_fs_statvfs(struct puffs_usermount *pu, struct statvfs *svfsb)
+perfuse_fs_statvfs(struct puffs_usermount *pu, struct puffs_statvfs *svfsb)
 {
 	struct perfuse_state *ps;
 	perfuse_msg_t *pm;

Index: src/lib/libperfuse/perfuse_priv.h
diff -u src/lib/libperfuse/perfuse_priv.h:1.37 src/lib/libperfuse/perfuse_priv.h:1.38
--- src/lib/libperfuse/perfuse_priv.h:1.37	Thu Nov 15 21:39:02 2018
+++ src/lib/libperfuse/perfuse_priv.h	Mon Sep 23 08:00:57 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: perfuse_priv.h,v 1.37 2018/11/16 02:39:02 manu Exp $ */
+/*  $NetBSD: perfuse_priv.h,v 1.38 2019/09/23 12:00:57 christos Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -195,7 +195,7 @@ char *perfuse_fs_mount(int, ssize_t);
  * ops.c - filesystem operations
  */
 int perfuse_fs_unmount(struct puffs_usermount *, int);
-int perfuse_fs_statvfs(struct puffs_usermount *, struct statvfs *);
+int perfuse_fs_statvfs(struct puffs_usermount *, struct puffs_statvfs *);
 int perfuse_fs_sync(struct puffs_usermount *, int,
 const struct puffs_cred *);
 int perfuse_fs_fhtonode(struct puffs_usermount *, void *, size_t,

Index: src/lib/libpuffs/null.c
diff -u src/lib/libpuffs/null.c:1.33 src/lib/libpuffs/null.c:1.34
--- src/lib/libpuffs/null.c:1.33	Fri Nov 25 10:02:02 2011
+++ src/lib/libpuffs/null.c	Mon Sep 23 08:00:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: null.c,v 1.33 2011/11/25 15:02:02 manu Exp $	*/
+/*	$NetBSD: null.c,v 1.34 2019/09/23 12:00:57 christos Exp $	*/
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: null.c,v 1.33 2011/11/25 15:02:02 manu Exp $");
+__RCSID("$NetBSD: null.c,v 1.34 2019/09/23 12:00:57 christos Exp $");
 #endif /* !lint */
 
 /*
@@ -191,11 +191,12 @@ puffs_null_setops(struct puffs_ops 

Re: CVS commit: src

2019-09-23 Thread Kamil Rytarowski
On 23.09.2019 11:59, Martin Husemann wrote:
> On Mon, Sep 23, 2019 at 11:54:46AM +0200, Kamil Rytarowski wrote:
>> I propose to add a fallback inside libc to the older syscalls. In case
>> of ENOSYS pick older syscall and zero the new struct field.
> 
> This is not how we do compat. You always have to have a new kernel before
> updating userland. Why would this change be different?
> 
> Martin
> 

So far I never landed into this before and compat here would be simple
to achieve for the transition period.

Most of userland just breaks for me now. We can ignore this pitfail of
mine and the problem will be resolved by self.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src

2019-09-23 Thread Martin Husemann
On Mon, Sep 23, 2019 at 11:54:46AM +0200, Kamil Rytarowski wrote:
> I propose to add a fallback inside libc to the older syscalls. In case
> of ENOSYS pick older syscall and zero the new struct field.

This is not how we do compat. You always have to have a new kernel before
updating userland. Why would this change be different?

Martin


Re: CVS commit: src

2019-09-23 Thread Kamil Rytarowski
On 23.09.2019 00:59, Christos Zoulas wrote:
> Module Name:  src
> Committed By: christos
> Date: Sun Sep 22 22:59:40 UTC 2019
> 
> Modified Files:
>   src/bin/df: df.c
>   src/distrib/sets/lists/base: shl.mi
>   src/distrib/sets/lists/debug: shl.mi
>   src/distrib/sets/lists/modules: ad.arm ad.mips md.amd64 md.sparc64 mi
>   src/lib/libc: shlib_version
>   src/lib/libc/compat/gen: Makefile.inc compat_opendir.c
>   src/lib/libc/compat/sys: Makefile.inc compat_fhstatvfs.c
>   compat_fhstatvfs1.c compat_statfs.c
>   src/lib/libc/include: namespace.h
>   src/lib/libc/sys: Makefile.inc statvfs.c
>   src/share/man/man5: statvfs.5
>   src/sys/compat/common: compat_mod.h files.common vfs_syscalls_20.c
>   vfs_syscalls_30.c
>   src/sys/compat/netbsd32: files.netbsd32 netbsd32.h netbsd32_conv.h
>   netbsd32_fs.c syscalls.conf syscalls.master
>   src/sys/conf: files
>   src/sys/kern: init_sysent.c syscalls.conf syscalls.master vfs_subr.c
>   vfs_syscalls.c
>   src/sys/miscfs/specfs: spec_vnops.c
>   src/sys/modules: Makefile
>   src/sys/sys: param.h statvfs.h
>   src/usr.bin/ktruss: dump.c
> Added Files:
>   src/lib/libc/compat/gen: compat___getmntinfo13.c
>   src/lib/libc/compat/sys: compat___fhstatvfs140.c compat___fhstatvfs40.c
>   compat_statvfs.c
>   src/sys/compat/common: compat_90_mod.c vfs_syscalls_90.c
>   src/sys/compat/netbsd32: netbsd32_compat_90.c
>   src/sys/conf: compat_netbsd90.config
>   src/sys/modules/compat_90: Makefile
>   src/sys/modules/compat_netbsd32_90: Makefile
> 
> Log Message:
> Add a new member to struct vfsstat and grow the unused members
> The new member is caled f_mntfromlabel and it is the dkw_wname
> of the corresponding wedge. This is now used by df -W to display
> the mountpoint name as NAME=
> 
> 

I propose to add a fallback inside libc to the older syscalls. In case
of ENOSYS pick older syscall and zero the new struct field.

This change breaks new userland with older kernel. I just hit this
problem when upgraded before upgrading the kernel and ./build.sh
install=/ broke in the middle leaving me with corrupted setup.

I'm trying to recover over NFS.



signature.asc
Description: OpenPGP digital signature


CVS commit: src/usr.sbin/intrctl

2019-09-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep 23 09:17:20 UTC 2019

Modified Files:
src/usr.sbin/intrctl: intrctl.8 intrctl.c intrctl_io.c

Log Message:
add "-w wait" arg to "intrctl list" to have it loop forever.
don't bother testing poitner for NULL before calling free().


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/intrctl/intrctl.8 \
src/usr.sbin/intrctl/intrctl_io.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/intrctl/intrctl.c

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

Modified files:

Index: src/usr.sbin/intrctl/intrctl.8
diff -u src/usr.sbin/intrctl/intrctl.8:1.4 src/usr.sbin/intrctl/intrctl.8:1.5
--- src/usr.sbin/intrctl/intrctl.8:1.4	Sat Oct 15 12:06:27 2016
+++ src/usr.sbin/intrctl/intrctl.8	Mon Sep 23 09:17:19 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: intrctl.8,v 1.4 2016/10/15 12:06:27 jdolecek Exp $
+.\" $NetBSD: intrctl.8,v 1.5 2019/09/23 09:17:19 mrg Exp $
 .\"
 .\" Copyright (c) 2015 Internet Initiative Japan Inc.
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 15, 2016
+.Dd September 22, 2019
 .Dt INTRCTL 8
 .Os
 .Sh NAME
@@ -56,7 +56,7 @@ enable to set an interrupt's affinity to
 If
 .Ar cpu_index
 is already enabled, this command has no effect.
-.It list Op Fl c
+.It list Oo Fl c Oc Op Fl w Ar wait
 for each intrid in the system, display interrupt counts per CPU.
 The intrid is an interrupt name such as "ioapic0 pin 22" for x86.
 .Pp
@@ -64,6 +64,14 @@ If
 .Fl c
 is specified, display compact list with total counts per interrupt,
 and CPU affinity as comma separated list of CPU indexes.
+.Pp
+If
+.Fl w
+is specified then
+.Nm
+display the data continuously with a
+.Ar wait
+seconds delay between each iteration.
 .It nointr Fl c Ar cpu_index
 disable to set an interrupt's affinity to
 .Ar cpu_index .
Index: src/usr.sbin/intrctl/intrctl_io.c
diff -u src/usr.sbin/intrctl/intrctl_io.c:1.4 src/usr.sbin/intrctl/intrctl_io.c:1.5
--- src/usr.sbin/intrctl/intrctl_io.c:1.4	Sat Jun 23 11:11:00 2018
+++ src/usr.sbin/intrctl/intrctl_io.c	Mon Sep 23 09:17:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: intrctl_io.c,v 1.4 2018/06/23 11:11:00 jdolecek Exp $	*/
+/*	$NetBSD: intrctl_io.c,v 1.5 2019/09/23 09:17:19 mrg Exp $	*/
 
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: intrctl_io.c,v 1.4 2018/06/23 11:11:00 jdolecek Exp $");
+__RCSID("$NetBSD: intrctl_io.c,v 1.5 2019/09/23 09:17:19 mrg Exp $");
 
 #include 
 #include 
@@ -76,8 +76,7 @@ intrctl_io_alloc(int retry)
 		}
 	}
 error:
-	if (buf != NULL)
-		free(buf);
+	free(buf);
 	return NULL;
 }
 

Index: src/usr.sbin/intrctl/intrctl.c
diff -u src/usr.sbin/intrctl/intrctl.c:1.8 src/usr.sbin/intrctl/intrctl.c:1.9
--- src/usr.sbin/intrctl/intrctl.c:1.8	Fri Jun 22 22:50:53 2018
+++ src/usr.sbin/intrctl/intrctl.c	Mon Sep 23 09:17:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: intrctl.c,v 1.8 2018/06/22 22:50:53 jdolecek Exp $	*/
+/*	$NetBSD: intrctl.c,v 1.9 2019/09/23 09:17:19 mrg Exp $	*/
 
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: intrctl.c,v 1.8 2018/06/22 22:50:53 jdolecek Exp $");
+__RCSID("$NetBSD: intrctl.c,v 1.9 2019/09/23 09:17:19 mrg Exp $");
 
 #include 
 #include 
@@ -99,7 +99,7 @@ usage(void)
 {
 	const char *progname = getprogname();
 
-	fprintf(stderr, "usage: %s list [-c]\n", progname);
+	fprintf(stderr, "usage: %s list [-c] [-w secs]\n", progname);
 	fprintf(stderr, "   %s affinity -i interrupt_name -c cpu_index\n", progname);
 	fprintf(stderr, "   %s intr -c cpu_index\n", progname);
 	fprintf(stderr, "   %s nointr -c cpu_index\n", progname);
@@ -110,25 +110,13 @@ usage(void)
 static int intrctl_io_alloc_retry_count = 4;
 
 static void
-intrctl_list(int argc, char **argv)
+intrctl_list_one(int compact)
 {
 	char buf[64];
 	struct intrio_list_line *illine;
 	int i, ncpus, *cpucol;
 	void *handle;
 	size_t intridlen;
-	int compact = 0;
-	int ch;
-
-	while ((ch = getopt(argc, argv, "c")) != -1) {
-		switch (ch) {
-		case 'c':
-			compact = 1;
-			break;
-		default:
-			usage();
-		}
-	}
 
 	handle = intrctl_io_alloc(intrctl_io_alloc_retry_count);
 	if (handle == NULL)
@@ -217,6 +205,34 @@ intrctl_list(int argc, char **argv)
 }
 
 static void
+intrctl_list(int argc, char **argv)
+{
+	int seconds = 0;
+	bool compact = false;
+	int ch;
+
+	while ((ch = getopt(argc, argv, "cw:")) != -1) {
+		switch (ch) {
+		case 'c':
+			compact = true;
+			break;
+		case 'w':
+			seconds = atoi(optarg);
+			if (seconds < 0)
+errx(1, "seconds must be positive.");
+			break;
+		default:
+			usage();
+		}
+	}
+
+	do {
+		intrctl_list_one(compact);
+		sleep(seconds);
+	} while (seconds);
+}
+
+static void
 intrctl_affinity(int argc, char **argv)
 {
 	struct intrio_set iset;



CVS commit: src/usr.sbin/intrctl

2019-09-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep 23 09:17:20 UTC 2019

Modified Files:
src/usr.sbin/intrctl: intrctl.8 intrctl.c intrctl_io.c

Log Message:
add "-w wait" arg to "intrctl list" to have it loop forever.
don't bother testing poitner for NULL before calling free().


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/intrctl/intrctl.8 \
src/usr.sbin/intrctl/intrctl_io.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/intrctl/intrctl.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/acpi

2019-09-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Sep 23 08:50:52 UTC 2019

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

Log Message:
Match APMC0D0F compatible string.


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

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



CVS commit: src/sys/dev/acpi

2019-09-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Sep 23 08:50:52 UTC 2019

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

Log Message:
Match APMC0D0F compatible string.


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

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

Modified files:

Index: src/sys/dev/acpi/dwiic_acpi.c
diff -u src/sys/dev/acpi/dwiic_acpi.c:1.2 src/sys/dev/acpi/dwiic_acpi.c:1.3
--- src/sys/dev/acpi/dwiic_acpi.c:1.2	Fri Nov 16 23:18:17 2018
+++ src/sys/dev/acpi/dwiic_acpi.c	Mon Sep 23 08:50:52 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: dwiic_acpi.c,v 1.2 2018/11/16 23:18:17 jmcneill Exp $ */
+/* $NetBSD: dwiic_acpi.c,v 1.3 2019/09/23 08:50:52 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwiic_acpi.c,v 1.2 2018/11/16 23:18:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwiic_acpi.c,v 1.3 2019/09/23 08:50:52 jmcneill Exp $");
 
 #include 
 #include 
@@ -60,7 +60,8 @@ static void	dwiic_acpi_configure(struct 
 CFATTACH_DECL_NEW(dwiic_acpi, sizeof(struct dwiic_softc), dwiic_acpi_match, dwiic_acpi_attach, NULL, NULL);
 
 static const char * const compatible[] = {
-	"AMDI0510",
+	"AMDI0510",	/* AMD Seattle */
+	"APMC0D0F",	/* Ampere eMAG */
 	NULL
 };
 



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

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 08:17:24 UTC 2019

Modified Files:
src/sys/netinet6 [netbsd-8]: nd6_nbr.c

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

sys/netinet6/nd6_nbr.c: revision 1.173

nd6: remove extra pserialize_read_exit


To generate a diff of this commit:
cvs rdiff -u -r1.138.6.7 -r1.138.6.8 src/sys/netinet6/nd6_nbr.c

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



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

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 08:17:24 UTC 2019

Modified Files:
src/sys/netinet6 [netbsd-8]: nd6_nbr.c

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

sys/netinet6/nd6_nbr.c: revision 1.173

nd6: remove extra pserialize_read_exit


To generate a diff of this commit:
cvs rdiff -u -r1.138.6.7 -r1.138.6.8 src/sys/netinet6/nd6_nbr.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/netinet6/nd6_nbr.c
diff -u src/sys/netinet6/nd6_nbr.c:1.138.6.7 src/sys/netinet6/nd6_nbr.c:1.138.6.8
--- src/sys/netinet6/nd6_nbr.c:1.138.6.7	Mon May 13 09:04:38 2019
+++ src/sys/netinet6/nd6_nbr.c	Mon Sep 23 08:17:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6_nbr.c,v 1.138.6.7 2019/05/13 09:04:38 martin Exp $	*/
+/*	$NetBSD: nd6_nbr.c,v 1.138.6.8 2019/09/23 08:17:24 martin Exp $	*/
 /*	$KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.138.6.7 2019/05/13 09:04:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.138.6.8 2019/09/23 08:17:24 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -478,7 +478,6 @@ nd6_ns_output(struct ifnet *ifp, const s
 "determined: dst=%s, error=%d\n",
 IN6_PRINT(ip6buf, _sa.sin6_addr),
 error);
-pserialize_read_exit(s);
 goto bad;
 			}
 			src = _in;



Re: CVS commit: src/sys/net

2019-09-23 Thread Ryota Ozaki
On Mon, Sep 23, 2019 at 4:14 PM Kamil Rytarowski  wrote:
>
> On 23.09.2019 06:53, Rin Okuyama wrote:
> > Hi,
> >
> > On 2019/09/22 18:30, Kamil Rytarowski wrote:
> >> On 12.04.2018 06:38, Ryota Ozaki wrote:
> >>> Module Name:src
> >>> Committed By:ozaki-r
> >>> Date:Thu Apr 12 04:38:13 UTC 2018
> >>>
> >>> Modified Files:
> >>> src/sys/net: if.h route.c route.h rtsock.c
> >>>
> >>> Log Message:
> >>> Resolve tangled lock dependencies in route.c
> >>>
> >>> This change sweeps remaining lock decisions based on if locked or not
> >>> by moving
> >>> utility functions of rtentry updates from rtsock.c and ensuring
> >>> holding the
> >>> rt_lock.  It also improves the atomicity of a update of a rtentry.
> >>>
> >>
> >>> +static struct ifaddr *
> >>> +rt_update_get_ifa(const struct rt_addrinfo info, const struct
> >>> rtentry *rt,
> >>> +struct ifnet **ifp, struct psref *psref_ifp, struct psref *psref)
> >>> +{
> >>
> >>
> >> Do we need to pass info as a value? It is pretty large here (1024 bytes).
> >
> > Yeah, we were just discussing on this alert of LGTM bot.
> >
> > We can use const pointer here. I will commit the fix soon.
> >
> > Thanks,
> > rin

Thank you for the commit!

>
> Thanks for addressing it! I wonder whether there is performance impact
> here (is this hot-path code?).

The function is not used in any packet processing (hot paths)
and used only for route updates that are uncommon for most users.

  ozaki-r


CVS commit: src/sys/sys

2019-09-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Sep 23 08:04:36 UTC 2019

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

Log Message:
Use M_BUFADDR to dedup code in M_LEADINGSPACE.


To generate a diff of this commit:
cvs rdiff -u -r1.221 -r1.222 src/sys/sys/mbuf.h

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

Modified files:

Index: src/sys/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.221 src/sys/sys/mbuf.h:1.222
--- src/sys/sys/mbuf.h:1.221	Wed Sep 18 16:18:12 2019
+++ src/sys/sys/mbuf.h	Mon Sep 23 08:04:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.221 2019/09/18 16:18:12 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.222 2019/09/23 08:04:35 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -537,16 +537,11 @@ do {	\
 	(((m)->m_flags & (M_EXT|M_EXT_ROMAP)) == (M_EXT|M_EXT_ROMAP))
 
 /*
- * Compute the amount of space available
- * before the current start of data in an mbuf.
+ * Compute the amount of space available before the current start of
+ * data in an mbuf.
  */
-#define _M_LEADINGSPACE(m)		\
-	((m)->m_flags & M_EXT ? (m)->m_data - (m)->m_ext.ext_buf :	\
-	 (m)->m_flags & M_PKTHDR ? (m)->m_data - (m)->m_pktdat :	\
-	 (m)->m_data - (m)->m_dat)
-
 #define M_LEADINGSPACE(m)		\
-	(M_READONLY((m)) ? 0 : _M_LEADINGSPACE((m)))
+	(M_READONLY((m)) ? 0 : ((m)->m_data - M_BUFADDR(m)))
 
 /*
  * Compute the amount of space available



CVS commit: src/sys/sys

2019-09-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Sep 23 08:04:36 UTC 2019

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

Log Message:
Use M_BUFADDR to dedup code in M_LEADINGSPACE.


To generate a diff of this commit:
cvs rdiff -u -r1.221 -r1.222 src/sys/sys/mbuf.h

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



CVS commit: src/sys/dev/pci

2019-09-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Sep 23 07:47:45 UTC 2019

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

Log Message:
Remove (unused) reference to m_pktdat.


To generate a diff of this commit:
cvs rdiff -u -r1.337 -r1.338 src/sys/dev/pci/if_bge.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_bge.c
diff -u src/sys/dev/pci/if_bge.c:1.337 src/sys/dev/pci/if_bge.c:1.338
--- src/sys/dev/pci/if_bge.c:1.337	Fri Sep 13 07:55:07 2019
+++ src/sys/dev/pci/if_bge.c	Mon Sep 23 07:47:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bge.c,v 1.337 2019/09/13 07:55:07 msaitoh Exp $	*/
+/*	$NetBSD: if_bge.c,v 1.338 2019/09/23 07:47:45 maxv Exp $	*/
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.337 2019/09/13 07:55:07 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.338 2019/09/23 07:47:45 maxv Exp $");
 
 #include 
 #include 
@@ -4963,8 +4963,7 @@ bge_compact_dma_runt(struct mbuf *pkt)
 			if (!M_READONLY(m)) {
 if (M_LEADINGSPACE(m) < shorfall) {
 	void *m_dat;
-	m_dat = (m->m_flags & M_PKTHDR) ?
-	m->m_pktdat : m->dat;
+	m_dat = M_BUFADDR(m);
 	memmove(m_dat, mtod(m, void*),
 	m->m_len);
 	m->m_data = m_dat;



CVS commit: src/sys/dev/pci

2019-09-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Sep 23 07:47:45 UTC 2019

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

Log Message:
Remove (unused) reference to m_pktdat.


To generate a diff of this commit:
cvs rdiff -u -r1.337 -r1.338 src/sys/dev/pci/if_bge.c

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



Re: CVS commit: src/sys/net

2019-09-23 Thread Kamil Rytarowski
On 23.09.2019 06:53, Rin Okuyama wrote:
> Hi,
> 
> On 2019/09/22 18:30, Kamil Rytarowski wrote:
>> On 12.04.2018 06:38, Ryota Ozaki wrote:
>>> Module Name:    src
>>> Committed By:    ozaki-r
>>> Date:    Thu Apr 12 04:38:13 UTC 2018
>>>
>>> Modified Files:
>>> src/sys/net: if.h route.c route.h rtsock.c
>>>
>>> Log Message:
>>> Resolve tangled lock dependencies in route.c
>>>
>>> This change sweeps remaining lock decisions based on if locked or not
>>> by moving
>>> utility functions of rtentry updates from rtsock.c and ensuring
>>> holding the
>>> rt_lock.  It also improves the atomicity of a update of a rtentry.
>>>
>>
>>> +static struct ifaddr *
>>> +rt_update_get_ifa(const struct rt_addrinfo info, const struct
>>> rtentry *rt,
>>> +    struct ifnet **ifp, struct psref *psref_ifp, struct psref *psref)
>>> +{
>>
>>
>> Do we need to pass info as a value? It is pretty large here (1024 bytes).
> 
> Yeah, we were just discussing on this alert of LGTM bot.
> 
> We can use const pointer here. I will commit the fix soon.
> 
> Thanks,
> rin

Thanks for addressing it! I wonder whether there is performance impact
here (is this hot-path code?).



signature.asc
Description: OpenPGP digital signature


CVS commit: [netbsd-9] src/doc

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 07:10:56 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #229 - #232


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.55 -r1.1.2.56 src/doc/CHANGES-9.0

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-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.55 src/doc/CHANGES-9.0:1.1.2.56
--- src/doc/CHANGES-9.0:1.1.2.55	Sun Sep 22 14:29:48 2019
+++ src/doc/CHANGES-9.0	Mon Sep 23 07:10:56 2019
@@ -1,5 +1,5 @@
 
-# $NetBSD: CHANGES-9.0,v 1.1.2.55 2019/09/22 14:29:48 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.56 2019/09/23 07:10:56 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -3860,3 +3860,40 @@ external/mit/expat/lib/libexpat/expat_co
 	Actually define BYTEORDER since it is used.
 	[maya, ticket #228]
 
+sys/arch/aarch64/aarch64/pmap.c			1.47
+
+	Disable translation table walks using TTBR0 while changing its value
+	and when deactivating a pmap.
+	[jmcneill, ticket #229]
+
+distrib/sets/lists/man/mi			1.1655
+share/man/man4/Makefile1.683
+share/man/man4/mcx.41.1
+sys/arch/evbarm/conf/GENERIC64			1.107
+sys/dev/pci/files.pci1.414,1.415
+sys/dev/pci/if_mcx.c1.1
+
+	Add support for Mellanox 5th generation ethernet devices.
+	[jmcneill, ticket #230]
+
+sys/arch/arm/acpi/acpi_platform.c		1.18
+sys/arch/arm/acpi/acpi_simplefb.c		1.1
+sys/arch/arm/acpi/acpi_simplefb.h		1.1
+sys/arch/arm/acpi/files.acpi			1.7
+
+	Use vcons for simplefb preattach to speed up early console messages.
+	[jmcneill, ticket #231]
+
+sys/arch/dreamcast/dev/g1/wdc_g1.c		1.4
+sys/arch/dreamcast/dev/g1/wdc_g1.c		1.5
+sys/arch/evbppc/mpc85xx/wdc_obio.c		1.7
+sys/arch/mips/adm5120/dev/wdc_extio.c		1.11
+sys/arch/mmeye/dev/wdc_mainbus.c		1.7
+sys/dev/ic/wdc.c1.292
+sys/dev/ic/wdcvar.h1.99
+
+	Adjust several missed drivers for wdcprobe() changes of ATA NCQ branch.
+	Restore interface to pass a MD reset function to MI wdcprobe() and fix
+	G1IDE on Dreamcast.
+	[tsutsui, ticket #232]
+



CVS commit: [netbsd-9] src/doc

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 07:10:56 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #229 - #232


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.55 -r1.1.2.56 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/sys

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 07:09:47 UTC 2019

Modified Files:
src/sys/arch/dreamcast/dev/g1 [netbsd-9]: wdc_g1.c
src/sys/arch/evbppc/mpc85xx [netbsd-9]: wdc_obio.c
src/sys/arch/mips/adm5120/dev [netbsd-9]: wdc_extio.c
src/sys/arch/mmeye/dev [netbsd-9]: wdc_mainbus.c
src/sys/dev/ic [netbsd-9]: wdc.c wdcvar.h

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #232):

sys/arch/evbppc/mpc85xx/wdc_obio.c: revision 1.7
sys/arch/dreamcast/dev/g1/wdc_g1.c: revision 1.4
sys/arch/dreamcast/dev/g1/wdc_g1.c: revision 1.5
sys/arch/mmeye/dev/wdc_mainbus.c: revision 1.7
sys/dev/ic/wdcvar.h: revision 1.99
sys/dev/ic/wdc.c: revision 1.292
sys/arch/mips/adm5120/dev/wdc_extio.c: revision 1.11

adjust several missed drivers for wdcprobe() changes of ATA NCQ branch
for dreamcast g1 just drop the custom reset function, it doesn't seem to do
anything useful over the generic variant

PR kern/54538 by Izumi Tsutsui

Restore interface to pass a MD reset function to MI wdcprobe().

Fixes silent hang on G1IDE on Dreamcast. PR kern/54538
Should be pulled up to netbsd-9 with the previous changes.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.10.1 src/sys/arch/dreamcast/dev/g1/wdc_g1.c
cvs rdiff -u -r1.6 -r1.6.8.1 src/sys/arch/evbppc/mpc85xx/wdc_obio.c
cvs rdiff -u -r1.10 -r1.10.8.1 src/sys/arch/mips/adm5120/dev/wdc_extio.c
cvs rdiff -u -r1.6 -r1.6.8.1 src/sys/arch/mmeye/dev/wdc_mainbus.c
cvs rdiff -u -r1.291 -r1.291.4.1 src/sys/dev/ic/wdc.c
cvs rdiff -u -r1.98 -r1.98.10.1 src/sys/dev/ic/wdcvar.h

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

Modified files:

Index: src/sys/arch/dreamcast/dev/g1/wdc_g1.c
diff -u src/sys/arch/dreamcast/dev/g1/wdc_g1.c:1.3 src/sys/arch/dreamcast/dev/g1/wdc_g1.c:1.3.10.1
--- src/sys/arch/dreamcast/dev/g1/wdc_g1.c:1.3	Fri Oct 20 07:06:06 2017
+++ src/sys/arch/dreamcast/dev/g1/wdc_g1.c	Mon Sep 23 07:09:47 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_g1.c,v 1.3 2017/10/20 07:06:06 jdolecek Exp $ */
+/* $NetBSD: wdc_g1.c,v 1.3.10.1 2019/09/23 07:09:47 martin Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -71,25 +71,14 @@ CFATTACH_DECL_NEW(wdc_g1bus, sizeof(stru
 static int
 wdc_g1_probe(device_t parent, cfdata_t cf, void *aux)
 {
-	struct ata_channel ch;
 	struct g1bus_attach_args *ga = aux;
-	struct wdc_softc wdc;
 	struct wdc_regs wdr;
 	int result = 0, i;
-#ifdef ATADEBUG
-	struct device dev;
-#endif
 
 	*((volatile uint32_t *)0xa05f74e4) = 0x1f;
 	for (i = 0; i < 0x20 / 4; i++)
 		(void)((volatile uint32_t *)0xa000)[i];
 
-	memset(, 0, sizeof(wdc));
-	memset(, 0, sizeof(ch));
-	ch.ch_atac = _atac;
-	wdc.reset = wdc_g1_do_reset;
-	wdc.regs = 
-
 	wdr.cmd_iot = ga->ga_memt;
 	if (bus_space_map(wdr.cmd_iot, WDC_G1_CMD_ADDR,
 	WDC_G1_REG_NPORTS * 4, 0, _baseioh))
@@ -101,20 +90,14 @@ wdc_g1_probe(device_t parent, cfdata_t c
 			goto outunmap;
 	}
 
-	wdc_init_shadow_regs();
+	wdc_init_shadow_regs();
 
 	wdr.ctl_iot = ga->ga_memt;
 	if (bus_space_map(wdr.ctl_iot, WDC_G1_CTL_ADDR,
 	WDC_G1_AUXREG_NPORTS, 0, _ioh))
 	  goto outunmap;
 
-#ifdef ATADEBUG
-	/* fake up device name for ATADEBUG_PRINT() with DEBUG_PROBE */
-	memset(, 0, sizeof(dev));
-	strncat(dev.dv_xname, "wdc(g1probe)", sizeof(dev.dv_xname));
-	wdc.sc_atac.atac_dev = 
-#endif
-	result = wdcprobe();
+	result = wdcprobe_with_reset(, wdc_g1_do_reset);
 	
 	bus_space_unmap(wdr.ctl_iot, wdr.ctl_ioh, WDC_G1_AUXREG_NPORTS);
  outunmap:
@@ -181,6 +164,12 @@ wdc_g1_intr(void *arg)
 	return wdcintr(arg);
 }
 
+/*
+ * This does what the generic wdc_do_reset() does, with additional
+ * GD-ROM reset. GD-ROM is a very early ATAPI device appeared in 1998
+ * and it doesn't reset itself by the WDCTL_RST in AUX_CTLR but requires
+ * ATAPI_SOFT_RESET command to reset whole device as a master.
+ */
 static void
 wdc_g1_do_reset(struct ata_channel *chp, int poll)
 {

Index: src/sys/arch/evbppc/mpc85xx/wdc_obio.c
diff -u src/sys/arch/evbppc/mpc85xx/wdc_obio.c:1.6 src/sys/arch/evbppc/mpc85xx/wdc_obio.c:1.6.8.1
--- src/sys/arch/evbppc/mpc85xx/wdc_obio.c:1.6	Fri Oct 20 07:06:06 2017
+++ src/sys/arch/evbppc/mpc85xx/wdc_obio.c	Mon Sep 23 07:09:47 2019
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.6 2017/10/20 07:06:06 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.6.8.1 2019/09/23 07:09:47 martin Exp $");
 
 #include 
 #include 
@@ -100,8 +100,6 @@ wdc_obio_match(device_t parent, cfdata_t
 {
 	struct generic_attach_args * const ga = aux;
 	bus_size_t size = ga->ga_size;
-	struct ata_channel ch;
-	struct wdc_softc wdc;
 	struct wdc_regs wdr;
 	struct device dev;
 	int rv = 0;
@@ -115,18 +113,13 @@ wdc_obio_match(device_t parent, cfdata_t
 	 * We need to see if a CF is attached in True-IDE mode
 	 */
 	memset(, 0, sizeof(dev));
-	memset(, 0, 

CVS commit: [netbsd-9] src/sys

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 07:09:47 UTC 2019

Modified Files:
src/sys/arch/dreamcast/dev/g1 [netbsd-9]: wdc_g1.c
src/sys/arch/evbppc/mpc85xx [netbsd-9]: wdc_obio.c
src/sys/arch/mips/adm5120/dev [netbsd-9]: wdc_extio.c
src/sys/arch/mmeye/dev [netbsd-9]: wdc_mainbus.c
src/sys/dev/ic [netbsd-9]: wdc.c wdcvar.h

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #232):

sys/arch/evbppc/mpc85xx/wdc_obio.c: revision 1.7
sys/arch/dreamcast/dev/g1/wdc_g1.c: revision 1.4
sys/arch/dreamcast/dev/g1/wdc_g1.c: revision 1.5
sys/arch/mmeye/dev/wdc_mainbus.c: revision 1.7
sys/dev/ic/wdcvar.h: revision 1.99
sys/dev/ic/wdc.c: revision 1.292
sys/arch/mips/adm5120/dev/wdc_extio.c: revision 1.11

adjust several missed drivers for wdcprobe() changes of ATA NCQ branch
for dreamcast g1 just drop the custom reset function, it doesn't seem to do
anything useful over the generic variant

PR kern/54538 by Izumi Tsutsui

Restore interface to pass a MD reset function to MI wdcprobe().

Fixes silent hang on G1IDE on Dreamcast. PR kern/54538
Should be pulled up to netbsd-9 with the previous changes.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.10.1 src/sys/arch/dreamcast/dev/g1/wdc_g1.c
cvs rdiff -u -r1.6 -r1.6.8.1 src/sys/arch/evbppc/mpc85xx/wdc_obio.c
cvs rdiff -u -r1.10 -r1.10.8.1 src/sys/arch/mips/adm5120/dev/wdc_extio.c
cvs rdiff -u -r1.6 -r1.6.8.1 src/sys/arch/mmeye/dev/wdc_mainbus.c
cvs rdiff -u -r1.291 -r1.291.4.1 src/sys/dev/ic/wdc.c
cvs rdiff -u -r1.98 -r1.98.10.1 src/sys/dev/ic/wdcvar.h

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



CVS commit: [netbsd-9] src/sys/arch/arm/acpi

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 07:06:31 UTC 2019

Modified Files:
src/sys/arch/arm/acpi [netbsd-9]: acpi_platform.c files.acpi
Added Files:
src/sys/arch/arm/acpi [netbsd-9]: acpi_simplefb.c acpi_simplefb.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #231):

sys/arch/arm/acpi/acpi_platform.c: revision 1.18
sys/arch/arm/acpi/files.acpi: revision 1.7
sys/arch/arm/acpi/acpi_simplefb.c: revision 1.1
sys/arch/arm/acpi/acpi_simplefb.h: revision 1.1

Use vcons for simplefb preattach to speed up early console messages.


To generate a diff of this commit:
cvs rdiff -u -r1.15.2.1 -r1.15.2.2 src/sys/arch/arm/acpi/acpi_platform.c
cvs rdiff -u -r0 -r1.1.2.2 src/sys/arch/arm/acpi/acpi_simplefb.c \
src/sys/arch/arm/acpi/acpi_simplefb.h
cvs rdiff -u -r1.6 -r1.6.6.1 src/sys/arch/arm/acpi/files.acpi

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



CVS commit: [netbsd-9] src/sys/arch/arm/acpi

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 07:06:31 UTC 2019

Modified Files:
src/sys/arch/arm/acpi [netbsd-9]: acpi_platform.c files.acpi
Added Files:
src/sys/arch/arm/acpi [netbsd-9]: acpi_simplefb.c acpi_simplefb.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #231):

sys/arch/arm/acpi/acpi_platform.c: revision 1.18
sys/arch/arm/acpi/files.acpi: revision 1.7
sys/arch/arm/acpi/acpi_simplefb.c: revision 1.1
sys/arch/arm/acpi/acpi_simplefb.h: revision 1.1

Use vcons for simplefb preattach to speed up early console messages.


To generate a diff of this commit:
cvs rdiff -u -r1.15.2.1 -r1.15.2.2 src/sys/arch/arm/acpi/acpi_platform.c
cvs rdiff -u -r0 -r1.1.2.2 src/sys/arch/arm/acpi/acpi_simplefb.c \
src/sys/arch/arm/acpi/acpi_simplefb.h
cvs rdiff -u -r1.6 -r1.6.6.1 src/sys/arch/arm/acpi/files.acpi

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/acpi/acpi_platform.c
diff -u src/sys/arch/arm/acpi/acpi_platform.c:1.15.2.1 src/sys/arch/arm/acpi/acpi_platform.c:1.15.2.2
--- src/sys/arch/arm/acpi/acpi_platform.c:1.15.2.1	Sun Aug  4 19:24:18 2019
+++ src/sys/arch/arm/acpi/acpi_platform.c	Mon Sep 23 07:06:31 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_platform.c,v 1.15.2.1 2019/08/04 19:24:18 martin Exp $ */
+/* $NetBSD: acpi_platform.c,v 1.15.2.2 2019/09/23 07:06:31 martin Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.15.2.1 2019/08/04 19:24:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.15.2.2 2019/09/23 07:06:31 martin Exp $");
 
 #include 
 #include 
@@ -73,12 +73,8 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_platfor
 #include 
 #endif
 
-#if NWSDISPLAY > 0
-#include 
-#include 
-#include 
-#include 
-#include 
+#if NWSDISPLAY > 0 && NGENFB > 0
+#include 
 #endif
 
 #ifdef EFI_RUNTIME
@@ -134,107 +130,6 @@ acpi_platform_bootstrap(void)
 	acpi_coherent_dma_tag._nranges = __arraycount(acpi_coherent_ranges);
 }
 
-#if NWSDISPLAY > 0 && NGENFB > 0
-static struct wsscreen_descr acpi_platform_stdscreen = {
-	.name = "std",
-	.ncols = 0,
-	.nrows = 0,
-	.textops = NULL,
-	.fontwidth = 0,
-	.fontheight = 0,
-	.capabilities = 0,
-	.modecookie = NULL
-};
-
-static struct vcons_screen acpi_platform_screen;
-
-static int
-acpi_platform_find_simplefb(void)
-{
-	static const char * simplefb_compatible[] = { "simple-framebuffer", NULL };
-	int chosen_phandle, child;
-
-	chosen_phandle = OF_finddevice("/chosen");
-	if (chosen_phandle == -1)
-		return -1;
-
-	for (child = OF_child(chosen_phandle); child; child = OF_peer(child)) {
-		if (!fdtbus_status_okay(child))
-			continue;
-		if (!of_match_compatible(child, simplefb_compatible))
-			continue;
-
-		return child;
-	}
-
-	return -1;
-}
-
-static void
-acpi_platform_wsdisplay_preattach(void)
-{
-	struct rasops_info *ri = _platform_screen.scr_ri;
-	bus_space_tag_t bst = _generic_bs_tag;
-	bus_space_handle_t bsh;
-	uint32_t width, height, stride;
-	const char *format;
-	bus_addr_t addr;
-	bus_size_t size;
-	uint16_t depth;
-	long defattr;
-
-	memset(_platform_screen, 0, sizeof(acpi_platform_screen));
-
-	const int phandle = acpi_platform_find_simplefb();
-	if (phandle == -1)
-		return;
-
-	if (fdtbus_get_reg(phandle, 0, , ) != 0 || size == 0)
-		return;
-
-	if (of_getprop_uint32(phandle, "width", ) != 0 ||
-	of_getprop_uint32(phandle, "height", ) != 0 ||
-	of_getprop_uint32(phandle, "stride", ) != 0 ||
-	(format = fdtbus_get_string(phandle, "format")) == NULL)
-		return;
-
-	if (strcmp(format, "a8b8g8r8") == 0 ||
-	strcmp(format, "x8r8g8b8") == 0) {
-		depth = 32;
-	} else if (strcmp(format, "r5g6b5") == 0) {
-		depth = 16;
-	} else {
-		return;
-	}
-
-	if (bus_space_map(bst, addr, size,
-	BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE, ) != 0)
-		return;
-
-	wsfont_init();
-
-	ri->ri_width = width;
-	ri->ri_height = height;
-	ri->ri_depth = depth;
-	ri->ri_stride = stride;
-	ri->ri_bits = bus_space_vaddr(bst, bsh);
-	ri->ri_flg = RI_CENTER | RI_FULLCLEAR | RI_CLEAR;
-	rasops_init(ri, ri->ri_height / 8, ri->ri_width / 8);
-	ri->ri_caps = WSSCREEN_WSCOLORS;
-	rasops_reconfig(ri, ri->ri_height / ri->ri_font->fontheight,
-	ri->ri_width / ri->ri_font->fontwidth);
-
-	acpi_platform_stdscreen.nrows = ri->ri_rows;
-	acpi_platform_stdscreen.ncols = ri->ri_cols;
-	acpi_platform_stdscreen.textops = >ri_ops;
-	acpi_platform_stdscreen.capabilities = ri->ri_caps;
-
-	ri->ri_ops.allocattr(ri, 0, 0, 0, );
-
-	wsdisplay_preattach(_platform_stdscreen, ri, 0, 0, defattr);
-}
-#endif
-
 static void
 acpi_platform_startup(void)
 {
@@ -309,13 +204,6 @@ acpi_platform_startup(void)
 	}
 
 	/*
-	 * Setup framebuffer console, if present.
-	 */
-#if NWSDISPLAY > 0 && NGENFB > 0
-	acpi_platform_wsdisplay_preattach();
-#endif
-

CVS commit: [netbsd-9] src

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 07:04:40 UTC 2019

Modified Files:
src/distrib/sets/lists/man [netbsd-9]: mi
src/share/man/man4 [netbsd-9]: Makefile
src/sys/arch/evbarm/conf [netbsd-9]: GENERIC64
src/sys/dev/pci [netbsd-9]: files.pci
Added Files:
src/share/man/man4 [netbsd-9]: mcx.4
src/sys/dev/pci [netbsd-9]: if_mcx.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #230):

sys/dev/pci/files.pci: revision 1.415
distrib/sets/lists/man/mi: revision 1.1655
sys/dev/pci/if_mcx.c: revision 1.1
share/man/man4/Makefile: revision 1.683
share/man/man4/mcx.4: revision 1.1
sys/arch/evbarm/conf/GENERIC64: revision 1.107
sys/dev/pci/files.pci: revision 1.414

Add support for Mellanox 5th generation ethernet devices. This driver
supports the ConnectX-4 Lx EN, ConnectX-4 EN, ConnectX-5 EN, and
ConnectX-6 EN adapters.

Driver ported from OpenBSD.

add mcx attachment.

Correct mcx comment, drop mii dependency


To generate a diff of this commit:
cvs rdiff -u -r1.1649 -r1.1649.2.1 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.680 -r1.680.2.1 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1.2.2 src/share/man/man4/mcx.4
cvs rdiff -u -r1.103 -r1.103.2.1 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r1.413 -r1.413.2.1 src/sys/dev/pci/files.pci
cvs rdiff -u -r0 -r1.1.2.2 src/sys/dev/pci/if_mcx.c

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



CVS commit: [netbsd-9] src/sys/arch/aarch64/aarch64

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 07:00:35 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64 [netbsd-9]: pmap.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #229):

sys/arch/aarch64/aarch64/pmap.c: revision 1.47

Disable translation table walks using TTBR0 while changing its value and
when deactivating a pmap. Fixes stability issues on Ampere eMAG CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.41.2.1 -r1.41.2.2 src/sys/arch/aarch64/aarch64/pmap.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/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.41.2.1 src/sys/arch/aarch64/aarch64/pmap.c:1.41.2.2
--- src/sys/arch/aarch64/aarch64/pmap.c:1.41.2.1	Sun Sep 22 10:32:38 2019
+++ src/sys/arch/aarch64/aarch64/pmap.c	Mon Sep 23 07:00:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.41.2.1 2019/09/22 10:32:38 martin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.41.2.2 2019/09/23 07:00:35 martin Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.41.2.1 2019/09/22 10:32:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.41.2.2 2019/09/23 07:00:35 martin Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -1271,7 +1271,7 @@ void
 pmap_activate(struct lwp *l)
 {
 	struct pmap *pm = l->l_proc->p_vmspace->vm_map.pmap;
-	uint64_t ttbr0;
+	uint64_t ttbr0, tcr;
 
 	UVMHIST_FUNC(__func__);
 	UVMHIST_CALLED(pmaphist);
@@ -1285,6 +1285,11 @@ pmap_activate(struct lwp *l)
 
 	UVMHIST_LOG(pmaphist, "lwp=%p (pid=%d)", l, l->l_proc->p_pid, 0, 0);
 
+	/* Disable translation table walks using TTBR0 */
+	tcr = reg_tcr_el1_read();
+	reg_tcr_el1_write(tcr | TCR_EPD0);
+	__asm __volatile("isb" ::: "memory");
+
 	/* XXX */
 	CTASSERT(PID_MAX <= 65535);	/* 16bit ASID */
 	if (pm->pm_asid == -1)
@@ -1293,6 +1298,11 @@ pmap_activate(struct lwp *l)
 	ttbr0 = ((uint64_t)pm->pm_asid << 48) | pm->pm_l0table_pa;
 	cpu_set_ttbr0(ttbr0);
 
+	/* Re-enable translation table walks using TTBR0 */
+	tcr = reg_tcr_el1_read();
+	reg_tcr_el1_write(tcr & ~TCR_EPD0);
+	__asm __volatile("isb" ::: "memory");
+
 	pm->pm_activated = true;
 
 	PMAP_COUNT(activate);
@@ -1302,6 +1312,7 @@ void
 pmap_deactivate(struct lwp *l)
 {
 	struct pmap *pm = l->l_proc->p_vmspace->vm_map.pmap;
+	uint64_t tcr;
 
 	UVMHIST_FUNC(__func__);
 	UVMHIST_CALLED(pmaphist);
@@ -1311,6 +1322,11 @@ pmap_deactivate(struct lwp *l)
 
 	UVMHIST_LOG(pmaphist, "lwp=%p, asid=%d", l, pm->pm_asid, 0, 0);
 
+	/* Disable translation table walks using TTBR0 */
+	tcr = reg_tcr_el1_read();
+	reg_tcr_el1_write(tcr | TCR_EPD0);
+	__asm __volatile("isb" ::: "memory");
+
 	/* XXX */
 	pm->pm_activated = false;
 



CVS commit: [netbsd-9] src/sys/arch/aarch64/aarch64

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 07:00:35 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64 [netbsd-9]: pmap.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #229):

sys/arch/aarch64/aarch64/pmap.c: revision 1.47

Disable translation table walks using TTBR0 while changing its value and
when deactivating a pmap. Fixes stability issues on Ampere eMAG CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.41.2.1 -r1.41.2.2 src/sys/arch/aarch64/aarch64/pmap.c

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



CVS commit: [netbsd-8] src/doc

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 06:57:53 UTC 2019

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

Log Message:
Tickets #1383 and #1384, ammend #1380


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.39 -r1.1.2.40 src/doc/CHANGES-8.2

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

Modified files:

Index: src/doc/CHANGES-8.2
diff -u src/doc/CHANGES-8.2:1.1.2.39 src/doc/CHANGES-8.2:1.1.2.40
--- src/doc/CHANGES-8.2:1.1.2.39	Sat Sep 21 18:38:19 2019
+++ src/doc/CHANGES-8.2	Mon Sep 23 06:57:53 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.39 2019/09/21 18:38:19 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.40 2019/09/23 06:57:53 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -1045,6 +1045,7 @@ sys/netinet6/ip6_input.c			1.209 (patch)
 
 sys/arch/x86/acpi/acpi_machdep.c		1.27,1.28
 sys/arch/xen/include/xen-public/platform.h	(apply patch)
+sys/arch/xen/conf/files.xen			(parts of 1.178)
 
 	Attempt to obtain ACPI RSDP from the hypervisor for Xen PV.
 	[manu, ticket #1380]
@@ -1094,3 +1095,13 @@ sys/external/bsd/gnu-efi/dist/inc/efiapi
 	Add multiboot 2 support to x86 bootloaders.
 	[manu, ticket #1382]
 
+sys/netinet6/nd6_nbr.c1.173
+
+	nd6: remove extra pserialize_read_exit
+	[ozaki-r, ticket #1383]
+
+external/mit/expat/lib/libexpat/expat_config.h	1.7
+
+	Actually define BYTEORDER since it is used.
+	[maya, ticket #1384]
+



CVS commit: [netbsd-8] src/doc

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 06:57:53 UTC 2019

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

Log Message:
Tickets #1383 and #1384, ammend #1380


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.39 -r1.1.2.40 src/doc/CHANGES-8.2

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



CVS commit: [netbsd-8] src/external/mit/expat/lib/libexpat

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 06:56:57 UTC 2019

Modified Files:
src/external/mit/expat/lib/libexpat [netbsd-8]: expat_config.h

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

external/mit/expat/lib/libexpat/expat_config.h: revision 1.7

Actually define BYTEORDER since it is used.


To generate a diff of this commit:
cvs rdiff -u -r1.4.4.1 -r1.4.4.2 \
src/external/mit/expat/lib/libexpat/expat_config.h

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



CVS commit: [netbsd-8] src/external/mit/expat/lib/libexpat

2019-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep 23 06:56:57 UTC 2019

Modified Files:
src/external/mit/expat/lib/libexpat [netbsd-8]: expat_config.h

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

external/mit/expat/lib/libexpat/expat_config.h: revision 1.7

Actually define BYTEORDER since it is used.


To generate a diff of this commit:
cvs rdiff -u -r1.4.4.1 -r1.4.4.2 \
src/external/mit/expat/lib/libexpat/expat_config.h

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

Modified files:

Index: src/external/mit/expat/lib/libexpat/expat_config.h
diff -u src/external/mit/expat/lib/libexpat/expat_config.h:1.4.4.1 src/external/mit/expat/lib/libexpat/expat_config.h:1.4.4.2
--- src/external/mit/expat/lib/libexpat/expat_config.h:1.4.4.1	Tue Sep 17 18:50:07 2019
+++ src/external/mit/expat/lib/libexpat/expat_config.h	Mon Sep 23 06:56:57 2019
@@ -4,6 +4,10 @@
 /* Define if building universal (internal helper macro) */
 /* #undef AC_APPLE_UNIVERSAL_BUILD */
 
+/* 1234 = LILENDIAN, 4321 = BIGENDIAN */
+#include 
+#define BYTEORDER _BYTE_ORDER
+
 /* Define to 1 if you have the `arc4random' function. */
 /* #undef HAVE_ARC4RANDOM */
 



CVS commit: src/sys/dev/ieee1394

2019-09-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Sep 23 06:56:20 UTC 2019

Modified Files:
src/sys/dev/ieee1394: sbp.c

Log Message:
Remove unused assignment. Found by the lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/ieee1394/sbp.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/ieee1394/sbp.c
diff -u src/sys/dev/ieee1394/sbp.c:1.37 src/sys/dev/ieee1394/sbp.c:1.38
--- src/sys/dev/ieee1394/sbp.c:1.37	Mon Sep  3 16:29:31 2018
+++ src/sys/dev/ieee1394/sbp.c	Mon Sep 23 06:56:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbp.c,v 1.37 2018/09/03 16:29:31 riastradh Exp $	*/
+/*	$NetBSD: sbp.c,v 1.38 2019/09/23 06:56:20 maxv Exp $	*/
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sbp.c,v 1.37 2018/09/03 16:29:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbp.c,v 1.38 2019/09/23 06:56:20 maxv Exp $");
 
 
 #include 
@@ -2052,7 +2052,6 @@ sbp_free_sdev(struct sbp_dev *sdev)
 		bus_dmamap_destroy(sc->sc_dmat, sdev->ocb[i].dmamap);
 	fwdma_free(sdev->dma.dma_tag, sdev->dma.dma_map, sdev->dma.v_addr);
 	free(sdev, M_SBP);
-	sdev = NULL;
 }
 
 static void



CVS commit: src/sys/dev/ieee1394

2019-09-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Sep 23 06:56:20 UTC 2019

Modified Files:
src/sys/dev/ieee1394: sbp.c

Log Message:
Remove unused assignment. Found by the lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/dev/ieee1394/sbp.c

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



  1   2   >