Re: CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2019-10-14 Thread Paul Goyette

I'm now seeing a build error:

#   compile  libzpool/dmu_diff.pico
/build/netbsd-local/tools/x86_64/amd64/bin/x86_64--netbsd-gcc -O2   -std=gnu99  
  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wno-sign-compare  -Wsystem-headers   -Wno-traditional  -Wreturn-type -Wswitch 
-Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter 
-Wno-sign-compare -Wold-style-definition -Wsign-compare -Wformat=2  
-Wno-format-zero-length   -Wno-missing-field-initializers 
-Wno-strict-prototypes -Wno-cast-qual  -Wno-discarded-qualifiers  -Wno-switch 
-Wno-missing-prototypes -Wno-unused-variable -Wno-shadow 
-Wno-missing-field-initializers -Wno-parentheses   -fPIE
-Wno-unknown-pragmas -Wno-sign-compare -D_KERNTYPES -D_KERNTYPES 
--sysroot=/build/netbsd-local/dest/amd64 -std=c99 -D_SUNOS_VTOC_16 
-D_PROPLIB_ZFS_CONFLICT -I/build/netbsd-local/src_ro/external/cddl/osnet 
-I/build/netbsd-local/src_ro/external/cddl/osnet/include 
-I/build/netbsd-local/src_ro/external/cddl/osnet/sys 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/common/zfs 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/head 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/lib/libdevinfo 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/lib/libnvpair 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/lib/libshare/common 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/lib/libumem 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/lib/libuutil/common 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/lib/libzfs/common 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/lib/libzfs_core/common 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/lib/libzpool/common 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/common 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/uts/common 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/uts/common/zfs 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/uts/common/fs/zfs 
-I/build/netbsd-local/src_ro/external/cddl/osnet/dist/uts/common/sys -std=c99  
-c-fPIC   -g 
/build/netbsd-local/src_ro/external/cddl/osnet/lib/libzpool/../../dist/uts/common/fs/zfs/dmu_diff.c
 -o dmu_diff.pico
/build/netbsd-local/src_ro/external/cddl/osnet/lib/libzpool/../../dist/uts/common/fs/zfs/dmu_diff.c:
 In function 'write_bytes':
/build/netbsd-local/src_ro/external/cddl/osnet/lib/libzpool/../../dist/uts/common/fs/zfs/dmu_diff.c:70:6:
 error: 'struct uio' has no member named 'uio_vmspace'
  auio.uio_vmspace = vmspace_kernel();
  ^
/build/netbsd-local/src_ro/external/cddl/osnet/lib/libzpool/../../dist/uts/common/fs/zfs/dmu_diff.c:70:21:
 warning: implicit declaration of function 'vmspace_kernel' 
[-Wimplicit-function-declaration]
  auio.uio_vmspace = vmspace_kernel();
 ^~
/build/netbsd-local/src_ro/external/cddl/osnet/lib/libzpool/../../dist/uts/common/fs/zfs/dmu_diff.c:56:13:
 warning: variable 'auio' set but not used [-Wunused-but-set-variable]
  struct uio auio;
 ^~~~
*** [dmu_diff.pico] Error code 1





++--+---+
| Paul Goyette   | PGP Key fingerprint: | E-mail addresses: |
| (Retired)  | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org   |
++--+---+

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

2019-10-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 15 00:23:44 UTC 2019

Modified Files:
src/sys/arch/arm/acpi: acpipchb.c

Log Message:
Fix detection of root port resources for Graviton and remove no longer required 
bridge fixup


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/acpi/acpipchb.c

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



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

2019-10-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Oct 15 00:23:44 UTC 2019

Modified Files:
src/sys/arch/arm/acpi: acpipchb.c

Log Message:
Fix detection of root port resources for Graviton and remove no longer required 
bridge fixup


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/acpi/acpipchb.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/acpi/acpipchb.c
diff -u src/sys/arch/arm/acpi/acpipchb.c:1.11 src/sys/arch/arm/acpi/acpipchb.c:1.12
--- src/sys/arch/arm/acpi/acpipchb.c:1.11	Mon Oct 14 22:59:15 2019
+++ src/sys/arch/arm/acpi/acpipchb.c	Tue Oct 15 00:23:44 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: acpipchb.c,v 1.11 2019/10/14 22:59:15 jmcneill Exp $ */
+/* $NetBSD: acpipchb.c,v 1.12 2019/10/15 00:23:44 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpipchb.c,v 1.11 2019/10/14 22:59:15 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpipchb.c,v 1.12 2019/10/15 00:23:44 jmcneill Exp $");
 
 #include 
 #include 
@@ -146,9 +146,16 @@ acpipchb_amazon_graviton_map(ACPI_HANDLE
 	struct acpi_pci_context *ap = ctx;
 	struct acpi_resources res;
 	struct acpi_mem *mem;
+	ACPI_HANDLE parent;
 	ACPI_STATUS rv;
 	int error;
 
+	rv = AcpiGetParent(handle, );
+	if (ACPI_FAILURE(rv))
+		return rv;
+	if (ap->ap_handle != parent)
+		return AE_OK;
+
 	rv = acpi_resource_parse(ap->ap_dev, handle, "_CRS", , _resource_parse_ops_quiet);
 	if (ACPI_FAILURE(rv))
 		return rv;
@@ -163,18 +170,10 @@ acpipchb_amazon_graviton_map(ACPI_HANDLE
 	if (error != 0)
 		return AE_NO_MEMORY;
 
-	return AE_CTRL_TERMINATE;
-}
-
-static ACPI_STATUS
-acpipchb_amazon_graviton_busres(ACPI_RESOURCE *res, void *context)
-{
-	if (res->Type != ACPI_RESOURCE_TYPE_ADDRESS16)
-		return AE_OK;
-	if (res->Data.Address16.ResourceType != ACPI_BUS_NUMBER_RANGE)
-		return AE_OK;
+	ap->ap_conf_read = acpipchb_amazon_graviton_conf_read;
+	ap->ap_conf_write = acpipchb_amazon_graviton_conf_write;
+	ap->ap_bus_maxdevs = acpipchb_amazon_graviton_bus_maxdevs;
 
-	*(ACPI_RESOURCE *)context = *res;
 	return AE_CTRL_TERMINATE;
 }
 
@@ -182,51 +181,10 @@ static void
 acpipchb_amazon_graviton_init(struct acpi_pci_context *ap)
 {
 	ACPI_STATUS rv;
-	ACPI_RESOURCE res;
-	pcitag_t tag;
-	pcireg_t busdata;
 
 	rv = AcpiGetDevices(__UNCONST("AMZN0001"), acpipchb_amazon_graviton_map, ap, NULL);
 	if (ACPI_FAILURE(rv))
 		return;
-
-	ap->ap_conf_read = acpipchb_amazon_graviton_conf_read;
-	ap->ap_conf_write = acpipchb_amazon_graviton_conf_write;
-	ap->ap_bus_maxdevs = acpipchb_amazon_graviton_bus_maxdevs;
-
-	/*
-	 * The root port's may not have the correct bus information. Fix this up...
-	 */
-	/* Find bus number range */
-	memset(, 0, sizeof(res));
-	rv = AcpiWalkResources(ap->ap_handle, "_CRS", acpipchb_amazon_graviton_busres, );
-	if (ACPI_FAILURE(rv) || res.Type != ACPI_RESOURCE_TYPE_ADDRESS16)
-		return;
-
-	const int bus_primary = res.Data.Address16.Address.Minimum;
-	const int bus_secondary = bus_primary + 1;
-	const int bus_subordinate = res.Data.Address16.Address.Maximum;
-
-	tag = pci_make_tag(>ap_pc, ap->ap_bus, 0, 0);
-	busdata = pci_conf_read(>ap_pc, tag, PCI_BRIDGE_BUS_REG);
-	if (PCI_BRIDGE_BUS_NUM_PRIMARY(busdata) != bus_primary ||
-	PCI_BRIDGE_BUS_NUM_SECONDARY(busdata) != bus_secondary ||
-	PCI_BRIDGE_BUS_NUM_SUBORDINATE(busdata) != bus_subordinate) {
-
-		aprint_normal_dev(ap->ap_dev,
-		"fixup bridge bus numbers %#x/%#x/%#x -> %#x/%#x/%#x\n",
-		PCI_BRIDGE_BUS_NUM_PRIMARY(busdata),
-		PCI_BRIDGE_BUS_NUM_SECONDARY(busdata),
-		PCI_BRIDGE_BUS_NUM_SUBORDINATE(busdata),
-		bus_primary, bus_secondary, bus_subordinate);
-		busdata &= ~PCI_BRIDGE_BUS_PRIMARY;
-		busdata |= __SHIFTIN(bus_primary, PCI_BRIDGE_BUS_PRIMARY);
-		busdata &= ~PCI_BRIDGE_BUS_SECONDARY;
-		busdata |= __SHIFTIN(bus_secondary, PCI_BRIDGE_BUS_SECONDARY);
-		busdata &= ~PCI_BRIDGE_BUS_SUBORDINATE;
-		busdata |= __SHIFTIN(bus_subordinate, PCI_BRIDGE_BUS_SUBORDINATE);
-		pci_conf_write(>ap_pc, tag, PCI_BRIDGE_BUS_REG, busdata);
-	}
 }
 
 static const struct acpipchb_quirk {



CVS commit: src/sys/arch/aarch64/aarch64

2019-10-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 14 22:53:05 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: cpu.c

Log Message:
Remove the A72 errata #859971 detection, it causes an illegal instruction on 
AWS A1 (virtualized)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/aarch64/aarch64/cpu.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/cpu.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.21 src/sys/arch/aarch64/aarch64/cpu.c:1.22
--- src/sys/arch/aarch64/aarch64/cpu.c:1.21	Sun Sep 15 15:16:30 2019
+++ src/sys/arch/aarch64/aarch64/cpu.c	Mon Oct 14 22:53:05 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.21 2019/09/15 15:16:30 tnn Exp $ */
+/* $NetBSD: cpu.c,v 1.22 2019/10/14 22:53:05 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.21 2019/09/15 15:16:30 tnn Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.22 2019/10/14 22:53:05 jmcneill Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -432,14 +432,6 @@ cpu_identify2(device_t self, struct cpu_
 	}
 
 	aprint_normal("\n");
-
-	if ((id->ac_midr & CPU_PARTMASK) == (CPU_ID_CORTEXA72R0 & CPU_PARTMASK)
-	&& __SHIFTOUT(id->ac_midr, CPU_ID_REVISION_MASK) <= 3) {
-		aprint_normal_dev(self, "A72 errata #859971 present"
-		", workaround %s\n",
-		ISSET(reg_a72_cpuactlr_el1_read(), __BIT(32))
-		? "enabled" : "NOT enabled (U-Boot update needed)");
-	}
 }
 
 /*



CVS commit: src/sys/arch/aarch64/aarch64

2019-10-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 14 22:53:05 UTC 2019

Modified Files:
src/sys/arch/aarch64/aarch64: cpu.c

Log Message:
Remove the A72 errata #859971 detection, it causes an illegal instruction on 
AWS A1 (virtualized)


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

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



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

2019-10-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 14 22:59:15 UTC 2019

Modified Files:
src/sys/arch/arm/acpi: acpi_pci_machdep.c acpi_pci_machdep.h acpipchb.c

Log Message:
More Amazon Graviton quirks:
 - Ignore devno > 0 on the PCIe root port.
 - Fixup PCIe bridge bus number register on the root port.
 - Move quirk handling to acpipchb so it can be applied before the bus
   is configured.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/acpi/acpi_pci_machdep.c \
src/sys/arch/arm/acpi/acpipchb.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/acpi/acpi_pci_machdep.h

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



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

2019-10-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 14 22:59:15 UTC 2019

Modified Files:
src/sys/arch/arm/acpi: acpi_pci_machdep.c acpi_pci_machdep.h acpipchb.c

Log Message:
More Amazon Graviton quirks:
 - Ignore devno > 0 on the PCIe root port.
 - Fixup PCIe bridge bus number register on the root port.
 - Move quirk handling to acpipchb so it can be applied before the bus
   is configured.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/acpi/acpi_pci_machdep.c \
src/sys/arch/arm/acpi/acpipchb.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/acpi/acpi_pci_machdep.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/arm/acpi/acpi_pci_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.10 src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.11
--- src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.10	Mon Oct 14 00:16:29 2019
+++ src/sys/arch/arm/acpi/acpi_pci_machdep.c	Mon Oct 14 22:59:15 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci_machdep.c,v 1.10 2019/10/14 00:16:29 jmcneill Exp $ */
+/* $NetBSD: acpi_pci_machdep.c,v 1.11 2019/10/14 22:59:15 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.10 2019/10/14 00:16:29 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.11 2019/10/14 22:59:15 jmcneill Exp $");
 
 #include 
 #include 
@@ -60,120 +60,6 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_pci_mac
 
 #include 
 
-static int
-acpi_pci_amazon_graviton_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg, pcireg_t *data)
-{
-	struct acpi_pci_context *ap = pc->pc_conf_v;
-	bus_size_t off;
-	int b, d, f;
-
-	pci_decompose_tag(pc, tag, , , );
-
-	if (ap->ap_bus == b) {
-		if (d > 0) {
-			*data = -1;
-			return EINVAL;
-		}
-		off = f * PCI_EXTCONF_SIZE + reg;
-		*data = bus_space_read_4(ap->ap_bst, ap->ap_conf_bsh, off);
-		return 0;
-	}
-	
-	return acpimcfg_conf_read(pc, tag, reg, data);
-}
-
-static int
-acpi_pci_amazon_graviton_conf_write(pci_chipset_tag_t pc, pcitag_t tag, int reg, pcireg_t data)
-{
-	struct acpi_pci_context *ap = pc->pc_conf_v;
-	bus_size_t off;
-	int b, d, f;
-
-	pci_decompose_tag(pc, tag, , , );
-
-	if (ap->ap_bus == b) {
-		if (d > 0) {
-			return EINVAL;
-		}
-		off = f * PCI_EXTCONF_SIZE + reg;
-		bus_space_write_4(ap->ap_bst, ap->ap_conf_bsh, off, data);
-		return 0;
-	}
-	
-	return acpimcfg_conf_write(pc, tag, reg, data);
-}
-
-static ACPI_STATUS
-acpi_pci_amazon_graviton_map(ACPI_HANDLE handle, UINT32 level, void *ctx, void **retval)
-{
-	struct acpi_pci_context *ap = ctx;
-	struct acpi_resources res;
-	struct acpi_mem *mem;
-	ACPI_STATUS rv;
-	int error;
-
-	rv = acpi_resource_parse(ap->ap_dev, handle, "_CRS", , _resource_parse_ops_quiet);
-	if (ACPI_FAILURE(rv))
-		return rv;
-
-	mem = acpi_res_mem(, 0);
-	if (mem == NULL) {
-		acpi_resource_cleanup();
-		return AE_NOT_FOUND;
-	}
-
-	error = bus_space_map(ap->ap_bst, mem->ar_base, mem->ar_length, 0, >ap_conf_bsh);
-	if (error != 0)
-		return AE_NO_MEMORY;
-
-	return AE_CTRL_TERMINATE;
-}
-
-static void
-acpi_pci_amazon_graviton_init(struct pcibus_attach_args *pba)
-{
-	struct acpi_pci_context *ap = pba->pba_pc->pc_conf_v;
-	ACPI_STATUS rv;
-
-	rv = AcpiGetDevices(__UNCONST("AMZN0001"), acpi_pci_amazon_graviton_map, ap, NULL);
-	if (ACPI_FAILURE(rv))
-		return;
-
-	ap->ap_conf_read = acpi_pci_amazon_graviton_conf_read;
-	ap->ap_conf_write = acpi_pci_amazon_graviton_conf_write;
-}
-
-static const struct acpi_pci_quirk {
-	const char			q_oemid[ACPI_OEM_ID_SIZE+1];
-	const char			q_oemtableid[ACPI_OEM_TABLE_ID_SIZE+1];
-	uint32_t			q_oemrevision;
-	void(*q_init)(struct pcibus_attach_args *);
-} acpi_pci_quirks[] = {
-	{ "AMAZON",	"GRAVITON",	0,	acpi_pci_amazon_graviton_init },
-};
-
-static const struct acpi_pci_quirk *
-acpi_pci_find_quirk(void)
-{
-	ACPI_STATUS rv;
-	ACPI_TABLE_MCFG *mcfg;
-	u_int n;
-
-	rv = AcpiGetTable(ACPI_SIG_MCFG, 0, (ACPI_TABLE_HEADER **));
-	if (ACPI_FAILURE(rv))
-		return NULL;
-
-	for (n = 0; n < __arraycount(acpi_pci_quirks); n++) {
-		const struct acpi_pci_quirk *q = _pci_quirks[n];
-		if (memcmp(q->q_oemid, mcfg->Header.OemId, ACPI_OEM_ID_SIZE) == 0 &&
-		memcmp(q->q_oemtableid, mcfg->Header.OemTableId, ACPI_OEM_TABLE_ID_SIZE) == 0 &&
-		q->q_oemrevision == mcfg->Header.OemRevision)
-			return q;
-	}
-
-	return NULL;
-}
-
 struct acpi_pci_prt {
 	u_intprt_segment;
 	u_intprt_bus;
@@ -274,7 +160,6 @@ acpi_pci_md_attach_hook(device_t parent,
 {
 	struct acpi_pci_context *ap = pba->pba_pc->pc_conf_v;
 	struct acpi_pci_prt *prt, *prtp;
-	const struct acpi_pci_quirk *q;
 	struct acpi_devnode *ad;
 	ACPI_HANDLE handle;
 	int seg, bus, dev, func;
@@ -317,10 +202,6 @@ acpi_pci_md_attach_hook(device_t parent,
 		TAILQ_INSERT_TAIL(_pci_irq_routes, prt, prt_list);
 	}
 
-	q = acpi_pci_find_quirk();
-	if (q != NULL)
-		

CVS commit: src/sys

2019-10-14 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Tue Oct 15 00:13:53 UTC 2019

Modified Files:
src/sys/arch/ia64/ia64: sapic.c
src/sys/arch/sparc64/dev: ldc.c
src/sys/arch/x86/x86: cpu_ucode_amd.c
src/sys/dev/acpi: sdhc_acpi.c
src/sys/dev/ata: ata.c
src/sys/dev/dm: dm_target_linear.c dm_target_snapshot.c
dm_target_stripe.c
src/sys/dev/gpio: gpio.c
src/sys/dev/marvell: if_mvxpe.c mvxpsec.c

Log Message:
convert more KM_NOSLEEP to KM_SLEEP and remove code to handle failures.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/ia64/sapic.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/dev/ldc.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/x86/cpu_ucode_amd.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/acpi/sdhc_acpi.c
cvs rdiff -u -r1.150 -r1.151 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/dm/dm_target_linear.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/dm/dm_target_snapshot.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/dm/dm_target_stripe.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/gpio/gpio.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/marvell/if_mvxpe.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/marvell/mvxpsec.c

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



CVS commit: src/sys

2019-10-14 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Tue Oct 15 00:13:53 UTC 2019

Modified Files:
src/sys/arch/ia64/ia64: sapic.c
src/sys/arch/sparc64/dev: ldc.c
src/sys/arch/x86/x86: cpu_ucode_amd.c
src/sys/dev/acpi: sdhc_acpi.c
src/sys/dev/ata: ata.c
src/sys/dev/dm: dm_target_linear.c dm_target_snapshot.c
dm_target_stripe.c
src/sys/dev/gpio: gpio.c
src/sys/dev/marvell: if_mvxpe.c mvxpsec.c

Log Message:
convert more KM_NOSLEEP to KM_SLEEP and remove code to handle failures.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/ia64/sapic.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/dev/ldc.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/x86/cpu_ucode_amd.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/acpi/sdhc_acpi.c
cvs rdiff -u -r1.150 -r1.151 src/sys/dev/ata/ata.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/dm/dm_target_linear.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/dm/dm_target_snapshot.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/dm/dm_target_stripe.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/gpio/gpio.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/marvell/if_mvxpe.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/marvell/mvxpsec.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/ia64/ia64/sapic.c
diff -u src/sys/arch/ia64/ia64/sapic.c:1.2 src/sys/arch/ia64/ia64/sapic.c:1.3
--- src/sys/arch/ia64/ia64/sapic.c:1.2	Sat Oct 27 17:29:03 2012
+++ src/sys/arch/ia64/ia64/sapic.c	Tue Oct 15 00:13:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sapic.c,v 1.2 2012/10/27 17:29:03 chs Exp $	*/
+/*	$NetBSD: sapic.c,v 1.3 2019/10/15 00:13:52 chs Exp $	*/
 /*-
  * Copyright (c) 2001 Doug Rabson
  * All rights reserved.
@@ -144,10 +144,7 @@ sapic_create(u_int id, u_int base, uint6
 	struct sapic *sa;
 	u_int i;
 
-	sa = kmem_zalloc(sizeof(struct sapic), KM_NOSLEEP);
-	if (sa == NULL)
-		return NULL;
-
+	sa = kmem_zalloc(sizeof(struct sapic), KM_SLEEP);
 	sa->sa_id = id;
 	sa->sa_base = base;
 	sa->sa_registers = IA64_PHYS_TO_RR6(address);

Index: src/sys/arch/sparc64/dev/ldc.c
diff -u src/sys/arch/sparc64/dev/ldc.c:1.5 src/sys/arch/sparc64/dev/ldc.c:1.6
--- src/sys/arch/sparc64/dev/ldc.c:1.5	Tue Oct  1 18:00:07 2019
+++ src/sys/arch/sparc64/dev/ldc.c	Tue Oct 15 00:13:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ldc.c,v 1.5 2019/10/01 18:00:07 chs Exp $	*/
+/*	$NetBSD: ldc.c,v 1.6 2019/10/15 00:13:52 chs Exp $	*/
 /*	$OpenBSD: ldc.c,v 1.12 2015/03/21 18:02:58 kettenis Exp $	*/
 /*
  * Copyright (c) 2009 Mark Kettenis
@@ -604,10 +604,7 @@ ldc_map_alloc(int nentries)
 #if OPENBSD_BUSDMA
 	int nsegs;
 #endif
-	lm = kmem_zalloc(sizeof(struct ldc_map), KM_NOSLEEP);
-	if (lm == NULL)
-		return NULL;
-
+	lm = kmem_zalloc(sizeof(struct ldc_map), KM_SLEEP);
 	size = roundup(nentries * sizeof(struct ldc_map_slot), PAGE_SIZE);
 
 #if OPENBSD_BUSDMA
@@ -634,9 +631,7 @@ ldc_map_alloc(int nentries)
 		goto unmap;
 	}
 #else
-	va = (vaddr_t)kmem_zalloc(size, KM_NOSLEEP);
-	if (va == 0)
-		goto free;
+	va = (vaddr_t)kmem_zalloc(size, KM_SLEEP);
 #endif
 	lm->lm_slot = (struct ldc_map_slot *)va;
 	lm->lm_nentries = nentries;
@@ -650,9 +645,6 @@ free:
 	bus_dmamem_free(t, >lm_seg, 1);
 destroy:
 	bus_dmamap_destroy(t, lm->lm_map);
-#else
-free:
-	kmem_free(lm, sizeof(struct ldc_map));
 #endif
 	return (NULL);
 }

Index: src/sys/arch/x86/x86/cpu_ucode_amd.c
diff -u src/sys/arch/x86/x86/cpu_ucode_amd.c:1.9 src/sys/arch/x86/x86/cpu_ucode_amd.c:1.10
--- src/sys/arch/x86/x86/cpu_ucode_amd.c:1.9	Sun Jan 27 02:08:39 2019
+++ src/sys/arch/x86/x86/cpu_ucode_amd.c	Tue Oct 15 00:13:52 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode_amd.c,v 1.9 2019/01/27 02:08:39 pgoyette Exp $ */
+/* $NetBSD: cpu_ucode_amd.c,v 1.10 2019/10/15 00:13:52 chs Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_amd.c,v 1.9 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_amd.c,v 1.10 2019/10/15 00:13:52 chs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_xen.h"
@@ -263,16 +263,8 @@ cpu_ucode_amd_apply(struct cpu_ucode_sof
 		return EINVAL;
 	}
 
-	mc.mc_amd = kmem_zalloc(sizeof(*mc.mc_amd), KM_NOSLEEP);
-	if (mc.mc_amd == NULL)
-		return ENOMEM;
-
-	mc.mc_amd->ect = kmem_alloc(mc.mc_mpbuf->mpb_len, KM_NOSLEEP);
-	if (mc.mc_amd->ect == NULL) {
-		error = ENOMEM;
-		goto err0;
-	}
-
+	mc.mc_amd = kmem_zalloc(sizeof(*mc.mc_amd), KM_SLEEP);
+	mc.mc_amd->ect = kmem_alloc(mc.mc_mpbuf->mpb_len, KM_SLEEP);
 	memcpy(mc.mc_amd->ect, mc.mc_mpbuf->mpb_data, mc.mc_mpbuf->mpb_len);
 	mc.mc_amd->ect_size = mc.mc_mpbuf->mpb_len;
 
@@ -307,7 +299,6 @@ cpu_ucode_amd_apply(struct cpu_ucode_sof
 
 err1:
 	kmem_free(mc.mc_amd->ect, mc.mc_amd->ect_size);
-err0:
 	kmem_free(mc.mc_amd, sizeof(*mc.mc_amd));
 	return error;
 }

Index: src/sys/dev/acpi/sdhc_acpi.c
diff -u src/sys/dev/acpi/sdhc_acpi.c:1.7 

CVS commit: [netbsd-8] src/doc

2019-10-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Oct 15 04:24:16 UTC 2019

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

Log Message:
Ticket #1405


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.50 -r1.1.2.51 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-10-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Oct 15 04:24:16 UTC 2019

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

Log Message:
Ticket #1405


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.50 -r1.1.2.51 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.50 src/doc/CHANGES-8.2:1.1.2.51
--- src/doc/CHANGES-8.2:1.1.2.50	Fri Oct 11 18:16:45 2019
+++ src/doc/CHANGES-8.2	Tue Oct 15 04:24:16 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.50 2019/10/11 18:16:45 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.51 2019/10/15 04:24:16 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -1276,3 +1276,10 @@ external/bsd/ipf/dist/man/ipf.5			1.6
 	Fix typo.
 	[uwe, ticket #1404]
 
+sys/kern/vnode_if.sh1.67
+sys/kern/vnode_if.src1.78
+sys/kern/vnode_if.c(regen)
+
+	Add fstrans type LAZY and use it for VOP_STRATEGY().
+	[hannken, ticket #1405]
+



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

2019-10-14 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Tue Oct 15 04:25:44 UTC 2019

Modified Files:
src/distrib/sets/lists/xcomp: mi

Log Message:
Give syspkg's names to xcomp mi files until extensions.


To generate a diff of this commit:
cvs rdiff -u -r1.210 -r1.211 src/distrib/sets/lists/xcomp/mi

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



CVS commit: src

2019-10-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Oct 14 10:39:24 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm_x86.c
src/tests/lib/libnvmm: h_mem_assist.c h_mem_assist_asm.S

Log Message:
Implement XCHG, add associated tests, and add comments to explain. With
this in place the Windows 95 installer completes successfuly.

Part of PR/54611.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/lib/libnvmm/libnvmm_x86.c
cvs rdiff -u -r1.13 -r1.14 src/tests/lib/libnvmm/h_mem_assist.c
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libnvmm/h_mem_assist_asm.S

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



CVS commit: src/sys/arch/arm

2019-10-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 14 11:00:13 UTC 2019

Modified Files:
src/sys/arch/arm/acpi: files.acpi gic_acpi.c gicv3_acpi.c
src/sys/arch/arm/cortex: files.cortex gic_v2m.c gic_v2m.h
Added Files:
src/sys/arch/arm/acpi: gic_v2m_acpi.c gic_v2m_acpi.h

Log Message:
Add support for Amazon's Graviton MSI controller.

Graviton has a GICv3 with a modified GICv2m (!) for MSIs. Instead of
sending messages to a fixed address with the SPI as data, the Graviton's
GICv2m uses a different address for each vector with "don't care" as data.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/acpi/files.acpi
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/acpi/gic_acpi.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/acpi/gic_v2m_acpi.c \
src/sys/arch/arm/acpi/gic_v2m_acpi.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/acpi/gicv3_acpi.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/cortex/files.cortex
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/cortex/gic_v2m.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/cortex/gic_v2m.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/arm/acpi/files.acpi
diff -u src/sys/arch/arm/acpi/files.acpi:1.7 src/sys/arch/arm/acpi/files.acpi:1.8
--- src/sys/arch/arm/acpi/files.acpi:1.7	Sun Sep 22 18:31:59 2019
+++ src/sys/arch/arm/acpi/files.acpi	Mon Oct 14 11:00:13 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.acpi,v 1.7 2019/09/22 18:31:59 jmcneill Exp $
+#	$NetBSD: files.acpi,v 1.8 2019/10/14 11:00:13 jmcneill Exp $
 #
 # Configuration info for ACPI compliant ARM boards.
 #
@@ -26,6 +26,8 @@ file	arch/arm/acpi/gic_acpi.c		gic_acpi
 attach	gicvthree at acpimadtbus with gicv3_acpi
 file	arch/arm/acpi/gicv3_acpi.c		gicv3_acpi
 
+file	arch/arm/acpi/gic_v2m_acpi.c		(gic_acpi | gicv3_acpi) & pci
+
 attach	gtmr at acpisdtbus with gtmr_acpi
 file	arch/arm/acpi/gtmr_acpi.c		gtmr_acpi
 

Index: src/sys/arch/arm/acpi/gic_acpi.c
diff -u src/sys/arch/arm/acpi/gic_acpi.c:1.3 src/sys/arch/arm/acpi/gic_acpi.c:1.4
--- src/sys/arch/arm/acpi/gic_acpi.c:1.3	Mon Nov 12 12:56:05 2018
+++ src/sys/arch/arm/acpi/gic_acpi.c	Mon Oct 14 11:00:13 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_acpi.c,v 1.3 2018/11/12 12:56:05 jmcneill Exp $ */
+/* $NetBSD: gic_acpi.c,v 1.4 2019/10/14 11:00:13 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "pci.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gic_acpi.c,v 1.3 2018/11/12 12:56:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_acpi.c,v 1.4 2019/10/14 11:00:13 jmcneill Exp $");
 
 #include 
 #include 
@@ -43,16 +43,17 @@ __KERNEL_RCSID(0, "$NetBSD: gic_acpi.c,v
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
 #include 
 
-#include 
+#include 
 
 #define	GICD_SIZE		0x1000
 #define	GICC_SIZE		0x1000
-#define	GICMSIFRAME_SIZE	0x1000
 
 extern struct bus_space arm_generic_bs_tag;
 extern struct pic_softc *pic_list[];
@@ -61,9 +62,6 @@ static int	gic_acpi_match(device_t, cfda
 static void	gic_acpi_attach(device_t, device_t, void *);
 
 static ACPI_STATUS gic_acpi_find_gicc(ACPI_SUBTABLE_HEADER *, void *);
-#if NPCI > 0
-static ACPI_STATUS gic_acpi_find_msi_frame(ACPI_SUBTABLE_HEADER *, void *);
-#endif
 
 CFATTACH_DECL_NEW(gic_acpi, 0, gic_acpi_match, gic_acpi_attach, NULL, NULL);
 
@@ -130,7 +128,7 @@ gic_acpi_attach(device_t parent, device_
 		arm_fdt_irq_set_handler(armgic_irq_handler);
 
 #if NPCI > 0
-	acpi_madt_walk(gic_acpi_find_msi_frame, armgic);
+	acpi_madt_walk(gic_v2m_acpi_find_msi_frame, armgic);
 #endif
 }
 
@@ -146,46 +144,3 @@ gic_acpi_find_gicc(ACPI_SUBTABLE_HEADER 
 
 	return AE_LIMIT;
 }
-
-#if NPCI > 0
-static ACPI_STATUS
-gic_acpi_find_msi_frame(ACPI_SUBTABLE_HEADER *hdrp, void *aux)
-{
-	ACPI_MADT_GENERIC_MSI_FRAME *msi_frame = (ACPI_MADT_GENERIC_MSI_FRAME *)hdrp;
-	struct gic_v2m_frame *frame;
-	struct pic_softc *pic = pic_list[0];
-	device_t armgic = aux;
-
-	if (hdrp->Type != ACPI_MADT_TYPE_GENERIC_MSI_FRAME)
-		return AE_OK;
-
-	frame = kmem_zalloc(sizeof(*frame), KM_SLEEP);
-	frame->frame_reg = msi_frame->BaseAddress;
-	frame->frame_pic = pic;
-	if (msi_frame->Flags & ACPI_MADT_OVERRIDE_SPI_VALUES) {
-		frame->frame_base = msi_frame->SpiBase;
-		frame->frame_count = msi_frame->SpiCount;
-	} else {
-		bus_space_tag_t bst = _generic_bs_tag;
-		bus_space_handle_t bsh;
-		if (bus_space_map(bst, frame->frame_reg, GICMSIFRAME_SIZE, 0, ) != 0) {
-			printf("%s: failed to map frame\n", __func__);
-			return AE_OK;
-		}
-		const uint32_t typer = bus_space_read_4(bst, bsh, GIC_MSI_TYPER);
-		bus_space_unmap(bst, bsh, GICMSIFRAME_SIZE);
-
-		frame->frame_base = __SHIFTOUT(typer, GIC_MSI_TYPER_BASE);
-		frame->frame_count = __SHIFTOUT(typer, GIC_MSI_TYPER_NUMBER);
-	}
-
-	if (gic_v2m_init(frame, armgic, msi_frame->MsiFrameId) != 0)
-		aprint_error_dev(armgic, "failed to initialize GICv2m\n");
-	else
-		aprint_normal_dev(armgic, "GICv2m 

CVS commit: src/sys/arch/arm

2019-10-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Oct 14 11:00:13 UTC 2019

Modified Files:
src/sys/arch/arm/acpi: files.acpi gic_acpi.c gicv3_acpi.c
src/sys/arch/arm/cortex: files.cortex gic_v2m.c gic_v2m.h
Added Files:
src/sys/arch/arm/acpi: gic_v2m_acpi.c gic_v2m_acpi.h

Log Message:
Add support for Amazon's Graviton MSI controller.

Graviton has a GICv3 with a modified GICv2m (!) for MSIs. Instead of
sending messages to a fixed address with the SPI as data, the Graviton's
GICv2m uses a different address for each vector with "don't care" as data.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/acpi/files.acpi
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/acpi/gic_acpi.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/acpi/gic_v2m_acpi.c \
src/sys/arch/arm/acpi/gic_v2m_acpi.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/acpi/gicv3_acpi.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/cortex/files.cortex
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/cortex/gic_v2m.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/cortex/gic_v2m.h

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



CVS commit: src

2019-10-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Oct 14 10:39:24 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm_x86.c
src/tests/lib/libnvmm: h_mem_assist.c h_mem_assist_asm.S

Log Message:
Implement XCHG, add associated tests, and add comments to explain. With
this in place the Windows 95 installer completes successfuly.

Part of PR/54611.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/lib/libnvmm/libnvmm_x86.c
cvs rdiff -u -r1.13 -r1.14 src/tests/lib/libnvmm/h_mem_assist.c
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libnvmm/h_mem_assist_asm.S

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

Modified files:

Index: src/lib/libnvmm/libnvmm_x86.c
diff -u src/lib/libnvmm/libnvmm_x86.c:1.32 src/lib/libnvmm/libnvmm_x86.c:1.33
--- src/lib/libnvmm/libnvmm_x86.c:1.32	Sun Oct 13 17:32:15 2019
+++ src/lib/libnvmm/libnvmm_x86.c	Mon Oct 14 10:39:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: libnvmm_x86.c,v 1.32 2019/10/13 17:32:15 maxv Exp $	*/
+/*	$NetBSD: libnvmm_x86.c,v 1.33 2019/10/14 10:39:24 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -838,13 +838,15 @@ out:
 /* -- */
 
 struct x86_emul {
-	bool read;
+	bool readreg;
+	bool backprop;
 	bool notouch;
 	void (*func)(struct nvmm_machine *, struct nvmm_mem *, uint64_t *);
 };
 
 static void x86_func_or(struct nvmm_machine *, struct nvmm_mem *, uint64_t *);
 static void x86_func_and(struct nvmm_machine *, struct nvmm_mem *, uint64_t *);
+static void x86_func_xchg(struct nvmm_machine *, struct nvmm_mem *, uint64_t *);
 static void x86_func_sub(struct nvmm_machine *, struct nvmm_mem *, uint64_t *);
 static void x86_func_xor(struct nvmm_machine *, struct nvmm_mem *, uint64_t *);
 static void x86_func_cmp(struct nvmm_machine *, struct nvmm_mem *, uint64_t *);
@@ -855,22 +857,28 @@ static void x86_func_lods(struct nvmm_ma
 static void x86_func_movs(struct nvmm_machine *, struct nvmm_mem *, uint64_t *);
 
 static const struct x86_emul x86_emul_or = {
-	.read = true,
+	.readreg = true,
 	.func = x86_func_or
 };
 
 static const struct x86_emul x86_emul_and = {
-	.read = true,
+	.readreg = true,
 	.func = x86_func_and
 };
 
+static const struct x86_emul x86_emul_xchg = {
+	.readreg = true,
+	.backprop = true,
+	.func = x86_func_xchg
+};
+
 static const struct x86_emul x86_emul_sub = {
-	.read = true,
+	.readreg = true,
 	.func = x86_func_sub
 };
 
 static const struct x86_emul x86_emul_xor = {
-	.read = true,
+	.readreg = true,
 	.func = x86_func_xor
 };
 
@@ -1322,6 +1330,28 @@ static const struct x86_opcode primary_o
 	},
 
 	/*
+	 * XCHG
+	 */
+	[0x86] = {
+		/* Eb, Gb */
+		.valid = true,
+		.regmodrm = true,
+		.regtorm = true,
+		.szoverride = false,
+		.defsize = OPSIZE_BYTE,
+		.emul = _emul_xchg
+	},
+	[0x87] = {
+		/* Ev, Gv */
+		.valid = true,
+		.regmodrm = true,
+		.regtorm = true,
+		.szoverride = true,
+		.defsize = -1,
+		.emul = _emul_xchg
+	},
+
+	/*
 	 * MOV
 	 */
 	[0x88] = {
@@ -2616,10 +2646,10 @@ exec_##instr##sz(uint##sz##_t op1, uint#
 {	\
 	uint##sz##_t res;		\
 	__asm __volatile (		\
-		#instr " %2, %3;"	\
-		"mov %3, %1;"		\
+		#instr"	%2, %3;"	\
+		"mov	%3, %1;"	\
 		"pushfq;"		\
-		"popq %0"		\
+		"popq	%0"		\
 	: "=r" (*rflags), "=r" (res)\
 	: "r" (op1), "r" (op2));	\
 	return res;			\
@@ -2677,7 +2707,7 @@ EXEC_DISPATCHER(xor)
 
 /*
  * Emulation functions. We don't care about the order of the operands, except
- * for SUB, CMP and TEST. For these ones we look at mem->write todetermine who
+ * for SUB, CMP and TEST. For these ones we look at mem->write to determine who
  * is op1 and who is op2.
  */
 
@@ -2746,6 +2776,28 @@ x86_func_and(struct nvmm_machine *mach, 
 }
 
 static void
+x86_func_xchg(struct nvmm_machine *mach, struct nvmm_mem *mem, uint64_t *gprs)
+{
+	uint64_t *op1, op2;
+
+	op1 = (uint64_t *)mem->data;
+	op2 = 0;
+
+	/* Fetch op2. */
+	mem->data = (uint8_t *)
+	mem->write = false;
+	(*mach->cbs.mem)(mem);
+
+	/* Write op1 in op2. */
+	mem->data = (uint8_t *)op1;
+	mem->write = true;
+	(*mach->cbs.mem)(mem);
+
+	/* Write op2 in op1. */
+	*op1 = op2;
+}
+
+static void
 x86_func_sub(struct nvmm_machine *mach, struct nvmm_mem *mem, uint64_t *gprs)
 {
 	uint64_t *retval = (uint64_t *)mem->data;
@@ -3154,7 +3206,9 @@ assist_mem_single(struct nvmm_machine *m
 	if (mem.write) {
 		switch (instr->src.type) {
 		case STORE_REG:
-			if (instr->src.disp.type != DISP_NONE) {
+			/* The instruction was "reg -> mem". Fetch the register
+			 * in membuf. */
+			if (__predict_false(instr->src.disp.type != DISP_NONE)) {
 DISASSEMBLER_BUG();
 			}
 			val = state->gprs[instr->src.u.reg->num];
@@ -3162,16 +3216,20 @@ assist_mem_single(struct nvmm_machine *m
 			memcpy(mem.data, , mem.size);
 			break;
 		case STORE_IMM:
+			/* The instruction was "imm -> mem". Fetch the 

CVS commit: src/lib/libnvmm

2019-10-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Oct 14 10:43:40 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm_x86.c

Log Message:
Improve nvmm_vcpu_dump().


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libnvmm/libnvmm_x86.c

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

Modified files:

Index: src/lib/libnvmm/libnvmm_x86.c
diff -u src/lib/libnvmm/libnvmm_x86.c:1.33 src/lib/libnvmm/libnvmm_x86.c:1.34
--- src/lib/libnvmm/libnvmm_x86.c:1.33	Mon Oct 14 10:39:24 2019
+++ src/lib/libnvmm/libnvmm_x86.c	Mon Oct 14 10:43:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: libnvmm_x86.c,v 1.33 2019/10/14 10:39:24 maxv Exp $	*/
+/*	$NetBSD: libnvmm_x86.c,v 1.34 2019/10/14 10:43:40 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -70,20 +70,28 @@ nvmm_vcpu_dump(struct nvmm_machine *mach
 		return -1;
 
 	printf("+ VCPU id=%d\n", (int)vcpu->cpuid);
-	printf("| -> RIP=%"PRIx64"\n", state->gprs[NVMM_X64_GPR_RIP]);
-	printf("| -> RSP=%"PRIx64"\n", state->gprs[NVMM_X64_GPR_RSP]);
 	printf("| -> RAX=%"PRIx64"\n", state->gprs[NVMM_X64_GPR_RAX]);
-	printf("| -> RBX=%"PRIx64"\n", state->gprs[NVMM_X64_GPR_RBX]);
 	printf("| -> RCX=%"PRIx64"\n", state->gprs[NVMM_X64_GPR_RCX]);
+	printf("| -> RDX=%"PRIx64"\n", state->gprs[NVMM_X64_GPR_RDX]);
+	printf("| -> RBX=%"PRIx64"\n", state->gprs[NVMM_X64_GPR_RBX]);
+	printf("| -> RSP=%"PRIx64"\n", state->gprs[NVMM_X64_GPR_RSP]);
+	printf("| -> RBP=%"PRIx64"\n", state->gprs[NVMM_X64_GPR_RBP]);
+	printf("| -> RSI=%"PRIx64"\n", state->gprs[NVMM_X64_GPR_RSI]);
+	printf("| -> RDI=%"PRIx64"\n", state->gprs[NVMM_X64_GPR_RDI]);
+	printf("| -> RIP=%"PRIx64"\n", state->gprs[NVMM_X64_GPR_RIP]);
 	printf("| -> RFLAGS=%p\n", (void *)state->gprs[NVMM_X64_GPR_RFLAGS]);
 	for (i = 0; i < NVMM_X64_NSEG; i++) {
 		attr = (uint16_t *)>segs[i].attrib;
-		printf("| -> %s: sel=0x%x base=%"PRIx64", limit=%x, attrib=%x\n",
+		printf("| -> %s: sel=0x%x base=%"PRIx64", limit=%x, "
+		"attrib=%x [type=%d,l=%d,def=%d]\n",
 		segnames[i],
 		state->segs[i].selector,
 		state->segs[i].base,
 		state->segs[i].limit,
-		*attr);
+		*attr,
+		state->segs[i].attrib.type,
+		state->segs[i].attrib.l,
+		state->segs[i].attrib.def);
 	}
 	printf("| -> MSR_EFER=%"PRIx64"\n", state->msrs[NVMM_X64_MSR_EFER]);
 	printf("| -> CR0=%"PRIx64"\n", state->crs[NVMM_X64_CR_CR0]);



CVS commit: src/lib/libnvmm

2019-10-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Oct 14 10:43:40 UTC 2019

Modified Files:
src/lib/libnvmm: libnvmm_x86.c

Log Message:
Improve nvmm_vcpu_dump().


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libnvmm/libnvmm_x86.c

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



Re: CVS commit: src/tests/usr.bin

2019-10-14 Thread Kamil Rytarowski

On 14.10.2019 05:47, Jason High wrote:

Module Name:src
Committed By:   jhigh
Date:   Mon Oct 14 03:47:20 UTC 2019

Modified Files:
src/tests/usr.bin: Makefile
Added Files:
src/tests/usr.bin/argon2: Atffile Makefile t_argon2.sh

Log Message:
adding argon2 tests




diff -u /dev/null src/tests/usr.bin/argon2/Atffile:1.1
--- /dev/null   Mon Oct 14 03:47:20 2019
+++ src/tests/usr.bin/argon2/AtffileMon Oct 14 03:47:20 2019
@@ -0,0 +1,7 @@
+Content-Type: application/X-atf-atffile; version="1"
+
+# Automatically generated by bsd.test.mk.
+
+prop: test-suite = "NetBSD"
+
+tp: t_argon2


This file shall not be added, please delete it. On the other hand we
need to add entries in distrib sets.


CVS commit: src/tests/usr.bin/argon2

2019-10-14 Thread Jason High
Module Name:src
Committed By:   jhigh
Date:   Mon Oct 14 06:40:40 UTC 2019

Removed Files:
src/tests/usr.bin/argon2: Atffile

Log Message:
removed incorrectly added file


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/tests/usr.bin/argon2/Atffile

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



CVS commit: src/tests/usr.bin/argon2

2019-10-14 Thread Jason High
Module Name:src
Committed By:   jhigh
Date:   Mon Oct 14 06:40:40 UTC 2019

Removed Files:
src/tests/usr.bin/argon2: Atffile

Log Message:
removed incorrectly added file


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/tests/usr.bin/argon2/Atffile

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



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2019-10-14 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Oct 14 13:18:00 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: dmu_diff.c zfs_ioctl.c
src/external/cddl/osnet/dist/uts/common/fs/zfs/sys: dmu.h

Log Message:
Change dmu_diff() back to use a "file" instead of a "vnode".
Command "zfs diff" calls it with a pipe, not a plain file.

Fixes PR kern/54541: kernel panic using "zfs diff"


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu_diff.c
cvs rdiff -u -r1.20 -r1.21 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c
cvs rdiff -u -r1.3 -r1.4 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu.h

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



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2019-10-14 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Oct 14 13:18:00 UTC 2019

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: dmu_diff.c zfs_ioctl.c
src/external/cddl/osnet/dist/uts/common/fs/zfs/sys: dmu.h

Log Message:
Change dmu_diff() back to use a "file" instead of a "vnode".
Command "zfs diff" calls it with a pipe, not a plain file.

Fixes PR kern/54541: kernel panic using "zfs diff"


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu_diff.c
cvs rdiff -u -r1.20 -r1.21 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c
cvs rdiff -u -r1.3 -r1.4 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu.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/cddl/osnet/dist/uts/common/fs/zfs/dmu_diff.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu_diff.c:1.2 src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu_diff.c:1.3
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu_diff.c:1.2	Mon May 28 21:05:07 2018
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu_diff.c	Mon Oct 14 13:18:00 2019
@@ -43,16 +43,13 @@
 struct diffarg {
 #ifdef __FreeBSD__
 	kthread_t *da_td;
-	struct file *da_fp;		/* file to which we are reporting */
-#else
-	struct vnode *da_vp;		/* file to which we are reporting */
 #endif
+	struct file *da_fp;		/* file to which we are reporting */
 	offset_t *da_offp;
 	int da_err;			/* error that stopped diff search */
 	dmu_diff_record_t da_ddr;
 };
 
-#ifdef __FreeBSD__
 static int
 write_bytes(struct diffarg *da)
 {
@@ -66,18 +63,30 @@ write_bytes(struct diffarg *da)
 	auio.uio_resid = aiov.iov_len;
 	auio.uio_rw = UIO_WRITE;
 	auio.uio_offset = (off_t)-1;
+#ifdef __FreeBSD__
 	auio.uio_segflg = UIO_SYSSPACE;
 	auio.uio_td = da->da_td;
+#else
+	auio.uio_vmspace = vmspace_kernel();
+#endif /* __FreeBSD__ */
 #ifdef _KERNEL
+#ifdef __FreeBSD__
 	if (da->da_fp->f_type == DTYPE_VNODE)
 		bwillwrite();
 	return (fo_write(da->da_fp, , da->da_td->td_ucred, 0, da->da_td));
 #else
+	int flags = 0;
+
+	if (da->da_fp->f_type == DTYPE_VNODE)
+		flags |= FOF_UPDATE_OFFSET;
+	return (*da->da_fp->f_ops->fo_write)(da->da_fp, >da_fp->f_offset,
+	, da->da_fp->f_cred, flags);
+#endif /* __FreeBSD__ */
+#else
 	fprintf(stderr, "%s: returning EOPNOTSUPP\n", __func__);
 	return (EOPNOTSUPP);
 #endif
 }
-#endif /* __FreeBSD__ */
 
 static int
 write_record(struct diffarg *da)
@@ -89,13 +98,7 @@ write_record(struct diffarg *da)
 		return (0);
 	}
 
-#ifdef __FreeBSD__
 	da->da_err = write_bytes(da);
-#else
-	da->da_err = vn_rdwr(UIO_WRITE, da->da_vp, (caddr_t)>da_ddr,
-	sizeof (da->da_ddr), 0, UIO_SYSSPACE, FAPPEND,
-	RLIM64_INFINITY, CRED(), );
-#endif
 	*da->da_offp += sizeof (da->da_ddr);
 	return (da->da_err);
 }
@@ -193,11 +196,7 @@ diff_cb(spa_t *spa, zilog_t *zilog, cons
 
 int
 dmu_diff(const char *tosnap_name, const char *fromsnap_name,
-#ifdef __FreeBSD__
 struct file *fp, offset_t *offp)
-#else
-struct vnode *vp, offset_t *offp)
-#endif
 {
 	struct diffarg da;
 	dsl_dataset_t *fromsnap;
@@ -242,10 +241,8 @@ dmu_diff(const char *tosnap_name, const 
 
 #ifdef __FreeBSD__
 	da.da_td = curthread;
-	da.da_fp = fp;
-#else
-	da.da_vp = vp;
 #endif
+	da.da_fp = fp;
 	da.da_offp = offp;
 	da.da_ddr.ddr_type = DDR_NONE;
 	da.da_ddr.ddr_first = da.da_ddr.ddr_last = 0;

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.20 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.21
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.20	Wed May 22 08:46:27 2019
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c	Mon Oct 14 13:18:00 2019
@@ -5296,11 +5296,7 @@ zfs_ioc_diff(zfs_cmd_t *zc)
 
 	off = fp->f_offset;
 
-#ifdef __FreeBSD__
 	error = dmu_diff(zc->zc_name, zc->zc_value, fp, );
-#else
-	error = dmu_diff(zc->zc_name, zc->zc_value, fp->f_vnode, );
-#endif
 
 	if (off >= 0 && off <= MAXOFFSET_T)
 		fp->f_offset = off;

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu.h
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu.h:1.3 src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu.h:1.4
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu.h:1.3	Mon May 28 21:05:07 2018
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu.h	Mon Oct 14 13:18:00 2019
@@ -957,13 +957,8 @@ typedef void (*dmu_traverse_cb_t)(objset
 void dmu_traverse_objset(objset_t *os, uint64_t txg_start,
 dmu_traverse_cb_t cb, void *arg);
 
-#ifdef __FreeBSD__
 int dmu_diff(const char *tosnap_name, const char *fromsnap_name,
 struct file *fp, offset_t *offp);
-#else
-int dmu_diff(const char *tosnap_name, const char *fromsnap_name,
-struct vnode *vp, offset_t *offp);
-#endif
 
 /* CRC64 table */
 #define	ZFS_CRC64_POLY	

CVS commit: src/tests/usr.bin/argon2

2019-10-14 Thread Jason High
Module Name:src
Committed By:   jhigh
Date:   Mon Oct 14 14:37:31 UTC 2019

Modified Files:
src/tests/usr.bin/argon2: t_argon2.sh

Log Message:
added versioning tests for argon2


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/argon2/t_argon2.sh

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

Modified files:

Index: src/tests/usr.bin/argon2/t_argon2.sh
diff -u src/tests/usr.bin/argon2/t_argon2.sh:1.1 src/tests/usr.bin/argon2/t_argon2.sh:1.2
--- src/tests/usr.bin/argon2/t_argon2.sh:1.1	Mon Oct 14 03:47:20 2019
+++ src/tests/usr.bin/argon2/t_argon2.sh	Mon Oct 14 14:37:31 2019
@@ -58,6 +58,59 @@ argon2_argon2d_k2096_p2_t4_body() {
 		'echo -n 'password' | argon2 somesalt -e -d -k 2096 -p 2 -t 4'
 }
 
+atf_test_case argon2_argon2id_k2096_p1_v10
+argon2_argon2id_k2096_p1_v10_head() {
+	atf_set "descr" "ATF test for argon2 argon2id,k=2096,p=1,v=10"
+}
+argon2_argon2id_k2096_p1_v10_body() {
+	atf_check -s exit:0 -o match:"^\\\$argon2id\\\$v=16\\\$m=2096,t=3,p=1" -x \
+		'echo -n 'password' | argon2 somesalt -e -id -k 2096 -p 1 -v 10'
+}
+
+atf_test_case argon2_argon2id_k2096_p1_v13
+argon2_argon2id_k2096_p1_v13_head() {
+	atf_set "descr" "ATF test for argon2 argon2id,k=2096,p=1,v=13"
+}
+argon2_argon2id_k2096_p1_v13_body() {
+	atf_check -s exit:0 -o match:"^\\\$argon2id\\\$v=19\\\$m=2096,t=3,p=1" -x \
+		'echo -n 'password' | argon2 somesalt -e -id -k 2096 -p 1 -v 13'
+}
+
+atf_test_case argon2_argon2i_k2096_p1_v10
+argon2_argon2i_k2096_p1_v10_head() {
+	atf_set "descr" "ATF test for argon2 argon2i,k=2096,p=1,v=10"
+}
+argon2_argon2i_k2096_p1_v10_body() {
+	atf_check -s exit:0 -o match:"^\\\$argon2i\\\$v=16\\\$m=2096,t=3,p=1" -x \
+		'echo -n 'password' | argon2 somesalt -e -i -k 2096 -p 1 -v 10'
+}
+
+atf_test_case argon2_argon2i_k2096_p1_v13
+argon2_argon2i_k2096_p1_v13_head() {
+	atf_set "descr" "ATF test for argon2 argon2i,k=2096,p=1,v=13"
+}
+argon2_argon2i_k2096_p1_v13_body() {
+	atf_check -s exit:0 -o match:"^\\\$argon2i\\\$v=19\\\$m=2096,t=3,p=1" -x \
+		'echo -n 'password' | argon2 somesalt -e -i -k 2096 -p 1 -v 13'
+}
+
+atf_test_case argon2_argon2d_k2096_p1_v10
+argon2_argon2d_k2096_p1_v10_head() {
+	atf_set "descr" "ATF test for argon2 argon2d,k=2096,p=1,v=10"
+}
+argon2_argon2d_k2096_p1_v10_body() {
+	atf_check -s exit:0 -o match:"^\\\$argon2d\\\$v=16\\\$m=2096,t=3,p=1" -x \
+		'echo -n 'password' | argon2 somesalt -e -d -k 2096 -p 1 -v 10'
+}
+
+atf_test_case argon2_argon2d_k2096_p1_v13
+argon2_argon2d_k2096_p1_v13_head() {
+	atf_set "descr" "ATF test for argon2 argon2d,k=2096,p=1,v=13"
+}
+argon2_argon2d_k2096_p1_v13_body() {
+	atf_check -s exit:0 -o match:"^\\\$argon2d\\\$v=19\\\$m=2096,t=3,p=1" -x \
+		'echo -n 'password' | argon2 somesalt -e -d -k 2096 -p 1 -v 13'
+}
 
 atf_init_test_cases()
 {
@@ -67,4 +120,10 @@ atf_init_test_cases()
 	atf_add_test_case argon2_argon2id_k2096_p2_t3
 	atf_add_test_case argon2_argon2i_k2096_p1_t4
 	atf_add_test_case argon2_argon2d_k2096_p2_t4
+	atf_add_test_case argon2_argon2id_k2096_p1_v10
+	atf_add_test_case argon2_argon2id_k2096_p1_v13
+	atf_add_test_case argon2_argon2i_k2096_p1_v10
+	atf_add_test_case argon2_argon2i_k2096_p1_v13
+	atf_add_test_case argon2_argon2d_k2096_p1_v10
+	atf_add_test_case argon2_argon2d_k2096_p1_v13
 }



CVS commit: src/tests/usr.bin/argon2

2019-10-14 Thread Jason High
Module Name:src
Committed By:   jhigh
Date:   Mon Oct 14 14:37:31 UTC 2019

Modified Files:
src/tests/usr.bin/argon2: t_argon2.sh

Log Message:
added versioning tests for argon2


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/argon2/t_argon2.sh

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



CVS commit: src/tests/usr.bin/argon2

2019-10-14 Thread Jason High
Module Name:src
Committed By:   jhigh
Date:   Mon Oct 14 14:48:48 UTC 2019

Modified Files:
src/tests/usr.bin/argon2: t_argon2.sh

Log Message:
added test cases
invalid version specification
salt too short


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/argon2/t_argon2.sh

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

Modified files:

Index: src/tests/usr.bin/argon2/t_argon2.sh
diff -u src/tests/usr.bin/argon2/t_argon2.sh:1.2 src/tests/usr.bin/argon2/t_argon2.sh:1.3
--- src/tests/usr.bin/argon2/t_argon2.sh:1.2	Mon Oct 14 14:37:31 2019
+++ src/tests/usr.bin/argon2/t_argon2.sh	Mon Oct 14 14:48:48 2019
@@ -112,6 +112,24 @@ argon2_argon2d_k2096_p1_v13_body() {
 		'echo -n 'password' | argon2 somesalt -e -d -k 2096 -p 1 -v 13'
 }
 
+atf_test_case argon2_argon2id_k2096_p1_v19_inver
+argon2_argon2id_k2096_p1_v19_inver_head() {
+	atf_set "descr" "ATF test for argon2 argon2d,k=2096,p=1 invalid version specification"
+}
+argon2_argon2id_k2096_p1_v19_inver_body() {
+	atf_check -s exit:1 -e match:"Error: invalid Argon2 version" -x \
+		'echo -n 'password' | argon2 somesalt -e -d -k 2096 -p 1 -v 19'
+}
+
+atf_test_case argon2_argon2id_k2096_p1_sts
+argon2_argon2id_k2096_p1_sts_head() {
+	atf_set "descr" "ATF test for argon2 argon2d,k=2096,p=1 salt too short"
+}
+argon2_argon2id_k2096_p1_sts_body() {
+	atf_check -s exit:1 -e match:"Error: Salt is too short" -x \
+		'echo -n 'password' | argon2 tshort -e -d -k 2096 -p 1'
+}
+
 atf_init_test_cases()
 {
 	atf_add_test_case argon2_argon2id
@@ -126,4 +144,6 @@ atf_init_test_cases()
 	atf_add_test_case argon2_argon2i_k2096_p1_v13
 	atf_add_test_case argon2_argon2d_k2096_p1_v10
 	atf_add_test_case argon2_argon2d_k2096_p1_v13
+	atf_add_test_case argon2_argon2id_k2096_p1_v19_inver
+	atf_add_test_case argon2_argon2id_k2096_p1_sts
 }



CVS commit: src/tests/usr.bin/argon2

2019-10-14 Thread Jason High
Module Name:src
Committed By:   jhigh
Date:   Mon Oct 14 14:48:48 UTC 2019

Modified Files:
src/tests/usr.bin/argon2: t_argon2.sh

Log Message:
added test cases
invalid version specification
salt too short


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/argon2/t_argon2.sh

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



CVS commit: src/bin/sh

2019-10-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 14 13:34:14 UTC 2019

Modified Files:
src/bin/sh: expand.c

Log Message:
remove masking and cast (requested by kre@)


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/bin/sh/expand.c

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



CVS commit: src/bin/sh

2019-10-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 14 13:34:14 UTC 2019

Modified Files:
src/bin/sh: expand.c

Log Message:
remove masking and cast (requested by kre@)


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/bin/sh/expand.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/sh/expand.c
diff -u src/bin/sh/expand.c:1.135 src/bin/sh/expand.c:1.136
--- src/bin/sh/expand.c:1.135	Sun Oct 13 16:55:04 2019
+++ src/bin/sh/expand.c	Mon Oct 14 09:34:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: expand.c,v 1.135 2019/10/13 20:55:04 christos Exp $	*/
+/*	$NetBSD: expand.c,v 1.136 2019/10/14 13:34:14 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)expand.c	8.5 (Berkeley) 5/15/95";
 #else
-__RCSID("$NetBSD: expand.c,v 1.135 2019/10/13 20:55:04 christos Exp $");
+__RCSID("$NetBSD: expand.c,v 1.136 2019/10/14 13:34:14 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -268,8 +268,7 @@ argstr(const char *p, int flag)
 			return p - 1;
 		case CTLENDVAR: /* end of expanding yyy in ${xxx-yyy} */
 		case CTLENDARI: /* end of a $(( )) string */
-			if (had_dol_at &&
-			(*p & 0xff) == (unsigned char)CTLQUOTEEND)
+			if (had_dol_at && *p == CTLQUOTEEND)
 p++;
 			NULLTERM_4_TRACE(expdest);
 			VTRACE(DBG_EXPAND, ("argstr returning at \"%.6s\"..."



Re: CVS import: src/external/bsd/dhcpcd/dist

2019-10-14 Thread Herbert J. Skuhra
On Fri, 11 Oct 2019 13:01:23 +0200, "Roy Marples" wrote:
> 
> Module Name:  src
> Committed By: roy
> Date: Fri Oct 11 11:01:23 UTC 2019
> 
> Update of /cvsroot/src/external/bsd/dhcpcd/dist
> In directory ivanova.netbsd.org:/tmp/cvs-serv19794
> 
> Log Message:
> Import dhcpcd-8.1.0 with the following changes:
> 
>  * Fix carrier status after a route socket overflow
>  * Allow domain spaced options
>  * DHCP: Allow not sending Force Renew Nonce or Reconf Accept
>  * IPv4LL: Now passes Apple Bonjour test versions 1.4 and 1.5
>  * ARP: Fix a typo and remove pragma (thus working with old gcc)
>  * DHCP6: Fix a cosmetic issue with infinite leases
>  * DHCP6: SLA 0 and Prefix Len 0 will now add a delegatd /64 address
>  * Ignore some virtual interfaces such as Tap and Bridge by default
>  * BPF: Move validation logic out of BPF and back into dhcpcd 

Hi,

this obviously breaks DHCP on my Raspberry PI 2B (earmv7hf).
I've also checked daily snapshots:

201910102350Z OK
201910111300Z not OK usmsc0 169.254.x.x/16

--
Herbert


Re: CVS commit: src/sys/kern

2019-10-14 Thread Joerg Sonnenberger
On Mon, Oct 14, 2019 at 04:27:04PM +, Maxime Villard wrote:
> Module Name:  src
> Committed By: maxv
> Date: Mon Oct 14 16:27:04 UTC 2019
> 
> Modified Files:
>   src/sys/kern: uipc_socket.c
> 
> Log Message:
> Add a check before the memcpy. memcpy is defined to never take NULL as
> second argument, and the compiler is free to perform optimizations knowing
> that this argument is never NULL.
> 
> In this particular case, it was harmless. But still good to fix.

This is generally agreed to be a bug in the combination of GCC and glibc
and something we do not agree with. Compare the lack of attribute
nonnull on memcpy and friends.

Joerg


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

2019-10-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 14 17:43:58 UTC 2019

Modified Files:
src/sys/kern [netbsd-8]: vnode_if.sh vnode_if.src

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1405):

sys/kern/vnode_if.sh: revision 1.67
sys/kern/vnode_if.src: revision 1.78

As VOP_STRATEGY() usually calls itself on the file system holding "/dev"
it may deadlock on suspension of this file system.

Add fstrans type LAZY and use it for VOP_STRATEGY().

Adress PR kern/53624 (dom0 freeze on domU exit) is still there


To generate a diff of this commit:
cvs rdiff -u -r1.64.4.1 -r1.64.4.2 src/sys/kern/vnode_if.sh
cvs rdiff -u -r1.75.2.2 -r1.75.2.3 src/sys/kern/vnode_if.src

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



CVS commit: src/sys/kern

2019-10-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Oct 14 16:27:04 UTC 2019

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

Log Message:
Add a check before the memcpy. memcpy is defined to never take NULL as
second argument, and the compiler is free to perform optimizations knowing
that this argument is never NULL.

In this particular case, it was harmless. But still good to fix.

Reported-by: syzbot+6f504255accb795eb...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/sys/kern/uipc_socket.c

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



CVS commit: src/sys/net

2019-10-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Oct 14 16:43:04 UTC 2019

Modified Files:
src/sys/net: rtsock_shared.c

Log Message:
Error out if the type is beyond the storage size. No functional change,
since the shift would otherwise 'and' against zero, returning EEXIST.

Reported-by: syzbot+cb68ccdc1ef3aca2d...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/net/rtsock_shared.c

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



CVS commit: src/sys/net

2019-10-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Oct 14 16:43:04 UTC 2019

Modified Files:
src/sys/net: rtsock_shared.c

Log Message:
Error out if the type is beyond the storage size. No functional change,
since the shift would otherwise 'and' against zero, returning EEXIST.

Reported-by: syzbot+cb68ccdc1ef3aca2d...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/net/rtsock_shared.c

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

Modified files:

Index: src/sys/net/rtsock_shared.c
diff -u src/sys/net/rtsock_shared.c:1.10 src/sys/net/rtsock_shared.c:1.11
--- src/sys/net/rtsock_shared.c:1.10	Mon Aug 19 03:23:30 2019
+++ src/sys/net/rtsock_shared.c	Mon Oct 14 16:43:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock_shared.c,v 1.10 2019/08/19 03:23:30 ozaki-r Exp $	*/
+/*	$NetBSD: rtsock_shared.c,v 1.11 2019/10/14 16:43:04 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock_shared.c,v 1.10 2019/08/19 03:23:30 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock_shared.c,v 1.11 2019/10/14 16:43:04 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -227,6 +227,8 @@ COMPATNAME(route_filter)(struct mbuf *m,
 		return EINVAL;
 
 	rtm = mtod(m, struct rt_xmsghdr *);
+	if (rtm->rtm_type >= sizeof(rop->rocb_msgfilter) * CHAR_BIT)
+		return EINVAL;
 	/* If the rtm type is filtered out, return a positive. */
 	if (!(rop->rocb_msgfilter & RTMSGFILTER(rtm->rtm_type)))
 		return EEXIST;



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

2019-10-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 14 19:20:14 UTC 2019

Modified Files:
src/sys/kern [netbsd-8]: vnode_if.c

Log Message:
regen (for ticket #1405)


To generate a diff of this commit:
cvs rdiff -u -r1.104.2.2 -r1.104.2.3 src/sys/kern/vnode_if.c

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

Modified files:

Index: src/sys/kern/vnode_if.c
diff -u src/sys/kern/vnode_if.c:1.104.2.2 src/sys/kern/vnode_if.c:1.104.2.3
--- src/sys/kern/vnode_if.c:1.104.2.2	Tue Jul 25 01:29:56 2017
+++ src/sys/kern/vnode_if.c	Mon Oct 14 19:20:14 2019
@@ -1,13 +1,13 @@
-/*	$NetBSD: vnode_if.c,v 1.104.2.2 2017/07/25 01:29:56 snj Exp $	*/
+/*	$NetBSD: vnode_if.c,v 1.104.2.3 2019/10/14 19:20:14 martin Exp $	*/
 
 /*
  * Warning: DO NOT EDIT! This file is automatically generated!
  * (Modifications made here may easily be lost!)
  *
  * Created from the file:
- *	NetBSD: vnode_if.src,v 1.75.2.2 2017/07/25 01:29:23 snj Exp
+ *	NetBSD: vnode_if.src,v 1.75.2.3 2019/10/14 17:43:58 martin Exp
  * by the script:
- *	NetBSD: vnode_if.sh,v 1.64.4.1 2017/06/04 20:35:01 bouyer Exp
+ *	NetBSD: vnode_if.sh,v 1.64.4.2 2019/10/14 17:43:58 martin Exp
  */
 
 /*
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.104.2.2 2017/07/25 01:29:56 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v 1.104.2.3 2019/10/14 19:20:14 martin Exp $");
 
 #include 
 #include 
@@ -49,7 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: vnode_if.c,v
 #include 
 #include 
 
-enum fst_op { FST_NO, FST_YES, FST_TRY };
+enum fst_op { FST_NO, FST_YES, FST_LAZY, FST_TRY };
 
 static inline int
 vop_pre(vnode_t *vp, struct mount **mp, bool *mpsafe, enum fst_op op)
@@ -62,7 +62,7 @@ vop_pre(vnode_t *vp, struct mount **mp, 
 		KERNEL_LOCK(1, curlwp);
 	}
 
-	if (op == FST_YES || op == FST_TRY) {
+	if (op == FST_YES || op == FST_LAZY || op == FST_TRY) {
 		for (;;) {
 			*mp = vp->v_mount;
 			if (op == FST_TRY) {
@@ -73,6 +73,8 @@ vop_pre(vnode_t *vp, struct mount **mp, 
 	}
 	return error;
 }
+			} else if (op == FST_LAZY) {
+fstrans_start_lazy(*mp);
 			} else {
 fstrans_start(*mp);
 			}
@@ -91,7 +93,7 @@ static inline void
 vop_post(vnode_t *vp, struct mount *mp, bool mpsafe, enum fst_op op)
 {
 
-	if (op == FST_YES) {
+	if (op == FST_YES || op == FST_LAZY) {
 		fstrans_done(mp);
 	}
 
@@ -1378,11 +1380,11 @@ VOP_STRATEGY(struct vnode *vp,
 	a.a_desc = VDESC(vop_strategy);
 	a.a_vp = vp;
 	a.a_bp = bp;
-	error = vop_pre(vp, , , FST_YES);
+	error = vop_pre(vp, , , FST_LAZY);
 	if (error)
 		return error;
 	error = (VCALL(vp, VOFFSET(vop_strategy), ));
-	vop_post(vp, mp, mpsafe, FST_YES);
+	vop_post(vp, mp, mpsafe, FST_LAZY);
 	return error;
 }
 



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

2019-10-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Oct 14 19:20:14 UTC 2019

Modified Files:
src/sys/kern [netbsd-8]: vnode_if.c

Log Message:
regen (for ticket #1405)


To generate a diff of this commit:
cvs rdiff -u -r1.104.2.2 -r1.104.2.3 src/sys/kern/vnode_if.c

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



CVS commit: src/sys/kern

2019-10-14 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Oct 14 16:27:04 UTC 2019

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

Log Message:
Add a check before the memcpy. memcpy is defined to never take NULL as
second argument, and the compiler is free to perform optimizations knowing
that this argument is never NULL.

In this particular case, it was harmless. But still good to fix.

Reported-by: syzbot+6f504255accb795eb...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/sys/kern/uipc_socket.c

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

Modified files:

Index: src/sys/kern/uipc_socket.c
diff -u src/sys/kern/uipc_socket.c:1.284 src/sys/kern/uipc_socket.c:1.285
--- src/sys/kern/uipc_socket.c:1.284	Fri Sep 27 00:32:03 2019
+++ src/sys/kern/uipc_socket.c	Mon Oct 14 16:27:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.284 2019/09/27 00:32:03 pgoyette Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.285 2019/10/14 16:27:03 maxv Exp $	*/
 
 /*
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.284 2019/09/27 00:32:03 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.285 2019/10/14 16:27:03 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -2096,7 +2096,9 @@ sockopt_set(struct sockopt *sopt, const 
 	}
 
 	sopt->sopt_retsize = MIN(sopt->sopt_size, len);
-	memcpy(sopt->sopt_data, buf, sopt->sopt_retsize);
+	if (sopt->sopt_retsize > 0) {
+		memcpy(sopt->sopt_data, buf, sopt->sopt_retsize);
+	}
 
 	return 0;
 }



CVS commit: src/usr.bin/calendar/calendars

2019-10-14 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Oct 14 17:30:18 UTC 2019

Modified Files:
src/usr.bin/calendar/calendars: calendar.birthday

Log Message:
Add Ted Nelson's birthday


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/calendar/calendars/calendar.birthday

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

Modified files:

Index: src/usr.bin/calendar/calendars/calendar.birthday
diff -u src/usr.bin/calendar/calendars/calendar.birthday:1.31 src/usr.bin/calendar/calendars/calendar.birthday:1.32
--- src/usr.bin/calendar/calendars/calendar.birthday:1.31	Tue Oct  1 17:58:25 2019
+++ src/usr.bin/calendar/calendars/calendar.birthday	Mon Oct 14 17:30:17 2019
@@ -148,6 +148,7 @@
 06/11	Alexander the Great dies (323 BC)
 06/15	Edward (Edvard Hagerup) Grieg born in Bergen, Norway, 1843
 06/16	Hammurabi the Great dies, Babylon, 1686 BC
+06/17	Theodor Holm Nelson was born in Chicago, Illinois, 1937
 06/18	M.C. Escher born, 1898
 06/22	Carl Hubbell born, 1903
 06/22	Meryl Streep born in Summit, New Jersey, 1949



CVS commit: src/usr.bin/calendar/calendars

2019-10-14 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Mon Oct 14 17:30:18 UTC 2019

Modified Files:
src/usr.bin/calendar/calendars: calendar.birthday

Log Message:
Add Ted Nelson's birthday


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/calendar/calendars/calendar.birthday

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