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

2018-08-10 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Aug 11 04:46:17 UTC 2018

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

Log Message:
use DDB_EXPR_FMT. fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/aarch64/db_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/aarch64/aarch64/db_machdep.c
diff -u src/sys/arch/aarch64/aarch64/db_machdep.c:1.5 src/sys/arch/aarch64/aarch64/db_machdep.c:1.6
--- src/sys/arch/aarch64/aarch64/db_machdep.c:1.5	Tue Jul 17 00:31:03 2018
+++ src/sys/arch/aarch64/aarch64/db_machdep.c	Sat Aug 11 04:46:17 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.c,v 1.5 2018/07/17 00:31:03 christos Exp $ */
+/* $NetBSD: db_machdep.c,v 1.6 2018/08/11 04:46:17 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.5 2018/07/17 00:31:03 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.6 2018/08/11 04:46:17 ryo Exp $");
 
 #include "opt_kernhist.h"
 #include "opt_uvmhist.h"
@@ -435,7 +435,7 @@ db_md_sysreg_cmd(db_expr_t addr, bool ha
 const char *modif)
 {
 #define SHOW_ARMREG(x)	\
-	db_printf("%-16s = %016" PRIx64 "x\n", #x, reg_ ## x ## _read())
+	db_printf("%-16s = %016" PRIx64 "\n", #x, reg_ ## x ## _read())
 
 	SHOW_ARMREG(cbar_el1);
 	SHOW_ARMREG(ccsidr_el1);
@@ -822,7 +822,7 @@ db_md_watch_cmd(db_expr_t addr, bool hav
 	}
 
 	if (added >= 0)
-		db_printf("add watchpoint %d as %016llx\n", added, addr);
+		db_printf("add watchpoint %d as %016"DDB_EXPR_FMT"x\n", added, addr);
 	if (cleared >= 0)
 		db_printf("clear watchpoint %d\n", cleared);
 



CVS commit: src/sys/compat/netbsd32

2018-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Aug 11 03:41:06 UTC 2018

Modified Files:
src/sys/compat/netbsd32: netbsd32.h netbsd32_fs.c

Log Message:
support nullfs in netbsd32.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.80 -r1.81 src/sys/compat/netbsd32/netbsd32_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/sys/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.118 src/sys/compat/netbsd32/netbsd32.h:1.119
--- src/sys/compat/netbsd32/netbsd32.h:1.118	Thu May 10 02:36:07 2018
+++ src/sys/compat/netbsd32/netbsd32.h	Sat Aug 11 03:41:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.118 2018/05/10 02:36:07 christos Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.119 2018/08/11 03:41:06 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -965,7 +965,7 @@ struct netbsd32_tmpfs_args {
 /* from  */
 struct netbsd32_iso_args {
 	netbsd32_charp fspec;
-	struct export_args30 _pad1;
+	struct netbsd32_export_args30 _pad1;
 	int	flags;
 };
 
@@ -1021,8 +1021,6 @@ struct netbsd32_mountd_exports_list {
 	netbsd32_export_argsp	mel_exports;
 };
 
-/* no struct export_args30 yet */
-
 /* from  */
 struct netbsd32_nfs_args {
 	int32_t		version;	/* args structure version number */
@@ -1060,6 +1058,17 @@ struct netbsd32_msdosfs_args {
 	int	gmtoff;		/* v3: offset from UTC in seconds */
 };
 
+/* from  */
+struct netbsd32_layer_args {
+	netbsd32_charp target;		/* Target of loopback  */
+	struct netbsd32_export_args30 _pad1; /* compat with old userland tools */
+};
+
+/* from  */
+struct netbsd32_null_args {
+	struct	netbsd32_layer_args	la;	/* generic layerfs args */
+};
+
 struct netbsd32_posix_spawn_file_actions_entry {
 	enum { FAE32_OPEN, FAE32_DUP2, FAE32_CLOSE } fae_action;
 

Index: src/sys/compat/netbsd32/netbsd32_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.80 src/sys/compat/netbsd32/netbsd32_fs.c:1.81
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.80	Thu Jun  1 02:45:08 2017
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Sat Aug 11 03:41:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.80 2017/06/01 02:45:08 chs Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.81 2018/08/11 03:41:06 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.80 2017/06/01 02:45:08 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.81 2018/08/11 03:41:06 mrg Exp $");
 
 #include 
 #include 
@@ -54,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.
 #include 
 #include 
 #include 
+#include 
 
 #define NFS_ARGS_ONLY
 #include 
@@ -799,6 +800,7 @@ netbsd32___mount50(struct lwp *l, const 
 		struct netbsd32_nfs_args nfs_args;
 		struct netbsd32_msdosfs_args msdosfs_args;
 		struct netbsd32_tmpfs_args tmpfs_args;
+		struct netbsd32_null_args null_args;
 	} fs_args32;
 	union {
 		struct ufs_args ufs_args;
@@ -807,6 +809,7 @@ netbsd32___mount50(struct lwp *l, const 
 		struct nfs_args nfs_args;
 		struct msdosfs_args msdosfs_args;
 		struct tmpfs_args tmpfs_args;
+		struct null_args null_args;
 	} fs_args;
 	const char *type = SCARG_P32(uap, type);
 	const char *path = SCARG_P32(uap, path);
@@ -953,6 +956,20 @@ netbsd32___mount50(struct lwp *l, const 
 		data_seg = UIO_SYSSPACE;
 		data = _args.nfs_args;
 		data_len = sizeof(fs_args.nfs_args);
+	} else if (strcmp(mtype, MOUNT_NULL) == 0) {
+		if (data_len > sizeof(fs_args32.null_args))
+			return EINVAL;
+		if ((flags & MNT_GETARGS) == 0) {
+			error = copyin(data, _args32.null_args, 
+			sizeof(fs_args32.null_args));
+			if (error)
+return error;
+			fs_args.null_args.la.target =
+			NETBSD32PTR64(fs_args32.null_args.la.target);
+		}
+		data_seg = UIO_SYSSPACE;
+		data = _args.null_args;
+		data_len = sizeof(fs_args.null_args);
 	} else {
 		data_seg = UIO_USERSPACE;
 	}
@@ -1032,6 +1049,13 @@ netbsd32___mount50(struct lwp *l, const 
 			fs_args.nfs_args.hostname);
 			error = copyout(_args32.nfs_args, data,
 			sizeof(fs_args32.nfs_args));
+		} else if (strcmp(mtype, MOUNT_NULL) == 0) {
+			if (data_len != sizeof(fs_args.null_args))
+return EINVAL;
+			NETBSD32PTR32(fs_args32.null_args.la.target,
+			fs_args.null_args.la.target);
+			error = copyout(_args32.null_args, data, 
+			sizeof(fs_args32.null_args));
 		}
 	}
 	return error;



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

2018-08-10 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Aug 11 00:32:17 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: gicv3.c

Log Message:
IPI and priority fixes. My RK3399 board boots multiuser now.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/cortex/gicv3.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/cortex/gicv3.c
diff -u src/sys/arch/arm/cortex/gicv3.c:1.1 src/sys/arch/arm/cortex/gicv3.c:1.2
--- src/sys/arch/arm/cortex/gicv3.c:1.1	Wed Aug  8 19:02:28 2018
+++ src/sys/arch/arm/cortex/gicv3.c	Sat Aug 11 00:32:17 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3.c,v 1.1 2018/08/08 19:02:28 jmcneill Exp $ */
+/* $NetBSD: gicv3.c,v 1.2 2018/08/11 00:32:17 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -31,7 +31,7 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.1 2018/08/08 19:02:28 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.2 2018/08/11 00:32:17 jmcneill Exp $");
 
 #include 
 #include 
@@ -147,6 +147,7 @@ gicv3_establish_irq(struct pic_softc *pi
 	uint64_t irouter;
 	u_int n;
 
+	const u_int ipriority_val = 0x80 | IPL_TO_PRIORITY(is->is_ipl);
 	const u_int ipriority_shift = (is->is_irq & 0x3) * 8;
 	const u_int icfg_shift = (is->is_irq & 0xf) * 2;
 
@@ -165,7 +166,7 @@ gicv3_establish_irq(struct pic_softc *pi
 
 			ipriority = gicr_read_4(sc, n, GICR_IPRIORITYRn(is->is_irq / 4));
 			ipriority &= ~(0xff << ipriority_shift);
-			ipriority |= (IPL_TO_PRIORITY(is->is_ipl) << ipriority_shift);
+			ipriority |= (ipriority_val << ipriority_shift);
 			gicr_write_4(sc, n, GICR_IPRIORITYRn(is->is_irq / 4), ipriority);
 		}
 	} else {
@@ -189,7 +190,7 @@ gicv3_establish_irq(struct pic_softc *pi
 		/* Update interrupt priority */
 		ipriority = gicd_read_4(sc, GICD_IPRIORITYRn(is->is_irq / 4));
 		ipriority &= ~(0xff << ipriority_shift);
-		ipriority |= (IPL_TO_PRIORITY(is->is_ipl) << ipriority_shift);
+		ipriority |= (ipriority_val << ipriority_shift);
 		gicd_write_4(sc, GICD_IPRIORITYRn(is->is_irq / 4), ipriority);
 	}
 }
@@ -261,8 +262,10 @@ gicv3_redist_enable(struct gicv3_softc *
 			struct intrsource * const is = sc->sc_pic.pic_sources[n + o];
 			if (is == NULL)
 priority |= 0xff << byte_shift;
-			else
-priority |= IPL_TO_PRIORITY(is->is_ipl) << byte_shift;
+			else {
+const u_int ipriority_val = 0x80 | IPL_TO_PRIORITY(is->is_ipl);
+priority |= ipriority_val << byte_shift;
+			}
 		}
 		gicr_write_4(sc, ci->ci_gic_redist, GICR_IPRIORITYRn(n / 4), priority);
 	}
@@ -426,6 +429,8 @@ gicv3_ipi_send(struct pic_softc *pic, co
 		aff = 0;
 		targets = 0;
 		for (CPU_INFO_FOREACH(cii, ci)) {
+			if (!kcpuset_isset(kcp, cpu_index(ci)))
+continue;
 			if ((ci->ci_gic_sgir & ICC_SGIR_EL1_Aff) != aff) {
 if (targets != 0) {
 	icc_sgi1r_write(intid | aff | targets);
@@ -474,7 +479,7 @@ gicv3_irq_handler(void *frame)
 		KASSERT(is != NULL);
 
 		const int ipl = is->is_ipl;
-		if (ci->ci_cpl != ipl)
+		if (ci->ci_cpl < ipl)
 			pic_set_priority(ci, ipl);
 
 		cpsie(I32_bit);



CVS commit: src/sys/dev/ata

2018-08-10 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Aug 10 22:43:22 UTC 2018

Modified Files:
src/sys/dev/ata: ata_subr.c atavar.h wd.c

Log Message:
fix race in wd_lastclose() on systems with two ide disks on same
channel, which happened when one disk had pending I/O while the other
disk executed the final disk flush - need to restart bufq processing
once xfer is freed in this case

it could happen e.g. on boot when system executes fsck on different
partitions on the two drives in parallell and hence open and closes
the disk devices repeatedly

add KASSERT() for empty bufq on wd_lastclose(), and fix similar issue
also on suspend/standby path

this was introduced by the NCQ merge and not dksubr - before the merge
each drive had their own xfer, so they could not block each other

fixes PR kern/52783 by Onno van der Linden; many thanks for extensive
help with tracking this down


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ata/ata_subr.c
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/ata/atavar.h
cvs rdiff -u -r1.440 -r1.441 src/sys/dev/ata/wd.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/ata/ata_subr.c
diff -u src/sys/dev/ata/ata_subr.c:1.5 src/sys/dev/ata/ata_subr.c:1.6
--- src/sys/dev/ata/ata_subr.c:1.5	Mon Aug  6 20:07:05 2018
+++ src/sys/dev/ata/ata_subr.c	Fri Aug 10 22:43:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata_subr.c,v 1.5 2018/08/06 20:07:05 jdolecek Exp $	*/
+/*	$NetBSD: ata_subr.c,v 1.6 2018/08/10 22:43:22 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata_subr.c,v 1.5 2018/08/06 20:07:05 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_subr.c,v 1.6 2018/08/10 22:43:22 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -377,7 +377,7 @@ out:
  * released.
  */ 
 void
-ata_channel_start(struct ata_channel *chp, int drive)
+ata_channel_start(struct ata_channel *chp, int drive, bool start_self)
 {
 	int i, s;
 	struct ata_drive_datas *drvp;
@@ -413,7 +413,8 @@ ata_channel_start(struct ata_channel *ch
 	}
 
 	/* Now try to kick off xfers on the current drive */
-	ATA_DRIVE_START(chp, drive);
+	if (start_self)
+		ATA_DRIVE_START(chp, drive);
 
 	splx(s);
 #undef ATA_DRIVE_START

Index: src/sys/dev/ata/atavar.h
diff -u src/sys/dev/ata/atavar.h:1.98 src/sys/dev/ata/atavar.h:1.99
--- src/sys/dev/ata/atavar.h:1.98	Mon Aug  6 20:07:05 2018
+++ src/sys/dev/ata/atavar.h	Fri Aug 10 22:43:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: atavar.h,v 1.98 2018/08/06 20:07:05 jdolecek Exp $	*/
+/*	$NetBSD: atavar.h,v 1.99 2018/08/10 22:43:22 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -538,7 +538,7 @@ void	ata_kill_active(struct ata_channel 
 void	ata_reset_channel(struct ata_channel *, int);
 void	ata_channel_freeze(struct ata_channel *);
 void	ata_channel_thaw(struct ata_channel *);
-void	ata_channel_start(struct ata_channel *, int);
+void	ata_channel_start(struct ata_channel *, int, bool);
 void	ata_channel_lock(struct ata_channel *);
 void	ata_channel_unlock(struct ata_channel *);
 void	ata_channel_lock_owned(struct ata_channel *);

Index: src/sys/dev/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.440 src/sys/dev/ata/wd.c:1.441
--- src/sys/dev/ata/wd.c:1.440	Mon Aug  6 20:07:05 2018
+++ src/sys/dev/ata/wd.c	Fri Aug 10 22:43:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.440 2018/08/06 20:07:05 jdolecek Exp $ */
+/*	$NetBSD: wd.c,v 1.441 2018/08/10 22:43:22 jdolecek Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.440 2018/08/06 20:07:05 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.441 2018/08/10 22:43:22 jdolecek Exp $");
 
 #include "opt_ata.h"
 #include "opt_wd.h"
@@ -917,7 +917,7 @@ noerror:	if ((xfer->c_bio.flags & ATA_CO
 	ata_free_xfer(wd->drvp->chnl_softc, xfer);
 
 	dk_done(dksc, bp);
-	ata_channel_start(wd->drvp->chnl_softc, wd->drvp->drive);
+	ata_channel_start(wd->drvp->chnl_softc, wd->drvp->drive, true);
 }
 
 static void
@@ -1072,6 +1072,8 @@ wd_lastclose(device_t self)
 {
 	struct wd_softc *wd = device_private(self);
 
+	KASSERTMSG(bufq_peek(wd->sc_dksc.sc_bufq) == NULL, "bufq not empty");
+
 	wd_flushcache(wd, AT_WAIT, false);
 
 	wd->atabus->ata_delref(wd->drvp);
@@ -1667,7 +1669,7 @@ wd_setcache(struct wd_softc *wd, int bit
 
 out:
 	ata_free_xfer(wd->drvp->chnl_softc, xfer);
-	ata_channel_start(wd->drvp->chnl_softc, wd->drvp->drive);
+	ata_channel_start(wd->drvp->chnl_softc, wd->drvp->drive, true);
 	return error;
 }
 
@@ -1711,12 +1713,18 @@ wd_standby(struct wd_softc *wd, int flag
 
 out:
 	ata_free_xfer(wd->drvp->chnl_softc, xfer);
-	/* drive is supposed to go idle, do not call ata_channel_start() */
+
+	/*
+	 * Drive is supposed to go idle, start only other drives.
+	 * bufq might be actually already freed at this 

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

2018-08-10 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Aug 10 22:34:36 UTC 2018

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

Log Message:
Pass full mpidr (instead of just aff0) to psci_cpu_on


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/fdt/psci_fdt.c

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

Modified files:

Index: src/sys/arch/arm/fdt/psci_fdt.c
diff -u src/sys/arch/arm/fdt/psci_fdt.c:1.10 src/sys/arch/arm/fdt/psci_fdt.c:1.11
--- src/sys/arch/arm/fdt/psci_fdt.c:1.10	Mon Jul 16 23:11:47 2018
+++ src/sys/arch/arm/fdt/psci_fdt.c	Fri Aug 10 22:34:36 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: psci_fdt.c,v 1.10 2018/07/16 23:11:47 christos Exp $ */
+/* $NetBSD: psci_fdt.c,v 1.11 2018/08/10 22:34:36 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.10 2018/07/16 23:11:47 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.11 2018/08/10 22:34:36 jmcneill Exp $");
 
 #include 
 #include 
@@ -218,7 +218,7 @@ psci_fdt_bootstrap(void)
 			continue;
 
 		const u_int cpuid = __SHIFTOUT(mpidr, MPIDR_AFF0);
-		int ret = psci_cpu_on(cpuid, psci_fdt_mpstart_pa(), 0);
+		int ret = psci_cpu_on(mpidr, psci_fdt_mpstart_pa(), 0);
 		if (ret == PSCI_SUCCESS)
 			started |= __BIT(cpuid);
 	}



CVS commit: src/sys/sys

2018-08-10 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Aug 10 21:48:19 UTC 2018

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

Log Message:
Bump version for recent change to struct emul

Welcome to 8.99.24 !


To generate a diff of this commit:
cvs rdiff -u -r1.568 -r1.569 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.568 src/sys/sys/param.h:1.569
--- src/sys/sys/param.h:1.568	Tue Jul 31 13:06:32 2018
+++ src/sys/sys/param.h	Fri Aug 10 21:48:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.568 2018/07/31 13:06:32 rjs Exp $	*/
+/*	$NetBSD: param.h,v 1.569 2018/08/10 21:48:19 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	899002300	/* NetBSD 8.99.23 */
+#define	__NetBSD_Version__	899002400	/* NetBSD 8.99.24 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys

2018-08-10 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Aug 10 21:47:16 UTC 2018

Modified Files:
src/sys/compat/aoutm68k: aoutm68k_syscall.h aoutm68k_syscallargs.h
aoutm68k_syscalls.c aoutm68k_sysent.c
src/sys/compat/freebsd: freebsd_syscall.h freebsd_syscallargs.h
freebsd_syscalls.c freebsd_sysent.c
src/sys/compat/ibcs2: ibcs2_syscall.h ibcs2_syscallargs.h
ibcs2_syscalls.c ibcs2_sysent.c
src/sys/compat/linux/arch/alpha: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/arm: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/i386: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/m68k: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/mips: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/powerpc: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux32/arch/amd64: linux32_syscall.h
linux32_syscallargs.h linux32_syscalls.c linux32_sysent.c
linux32_systrace_args.c
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c
src/sys/compat/osf1: osf1_syscall.h osf1_syscallargs.h osf1_syscalls.c
osf1_sysent.c
src/sys/compat/sunos: sunos_syscall.h sunos_syscallargs.h
sunos_syscalls.c sunos_sysent.c
src/sys/compat/sunos32: sunos32_syscall.h sunos32_syscallargs.h
sunos32_syscalls.c sunos32_sysent.c
src/sys/compat/svr4: svr4_syscall.h svr4_syscallargs.h svr4_syscalls.c
svr4_sysent.c
src/sys/compat/svr4_32: svr4_32_syscall.h svr4_32_syscallargs.h
svr4_32_syscalls.c svr4_32_sysent.c
src/sys/compat/ultrix: ultrix_syscall.h ultrix_syscallargs.h
ultrix_syscalls.c ultrix_sysent.c
src/sys/kern: init_sysent.c syscalls.c syscalls_autoload.c
systrace_args.c
src/sys/rump: rump.sysmap
src/sys/rump/include/rump: rump_syscalls.h
src/sys/rump/librump/rumpkern: rump_syscalls.c
src/sys/sys: syscall.h syscallargs.h

Log Message:
Regen


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/compat/aoutm68k/aoutm68k_syscall.h
cvs rdiff -u -r1.50 -r1.51 src/sys/compat/aoutm68k/aoutm68k_syscallargs.h
cvs rdiff -u -r1.49 -r1.50 src/sys/compat/aoutm68k/aoutm68k_syscalls.c
cvs rdiff -u -r1.54 -r1.55 src/sys/compat/aoutm68k/aoutm68k_sysent.c
cvs rdiff -u -r1.88 -r1.89 src/sys/compat/freebsd/freebsd_syscall.h
cvs rdiff -u -r1.91 -r1.92 src/sys/compat/freebsd/freebsd_syscallargs.h \
src/sys/compat/freebsd/freebsd_sysent.c
cvs rdiff -u -r1.89 -r1.90 src/sys/compat/freebsd/freebsd_syscalls.c
cvs rdiff -u -r1.55 -r1.56 src/sys/compat/ibcs2/ibcs2_syscall.h
cvs rdiff -u -r1.56 -r1.57 src/sys/compat/ibcs2/ibcs2_syscallargs.h \
src/sys/compat/ibcs2/ibcs2_syscalls.c
cvs rdiff -u -r1.57 -r1.58 src/sys/compat/ibcs2/ibcs2_sysent.c
cvs rdiff -u -r1.106 -r1.107 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.105 -r1.106 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.107 -r1.108 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.68 -r1.69 src/sys/compat/linux/arch/amd64/linux_syscall.h \
src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
src/sys/compat/linux/arch/amd64/linux_syscalls.c \
src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.12 -r1.13 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.79 -r1.80 src/sys/compat/linux/arch/arm/linux_syscall.h \
src/sys/compat/linux/arch/arm/linux_syscallargs.h \
src/sys/compat/linux/arch/arm/linux_syscalls.c \
src/sys/compat/linux/arch/arm/linux_sysent.c
cvs rdiff -u -r1.12 -r1.13 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.113 -r1.114 src/sys/compat/linux/arch/i386/linux_syscall.h \
src/sys/compat/linux/arch/i386/linux_syscallargs.h \
src/sys/compat/linux/arch/i386/linux_sysent.c
cvs rdiff -u -r1.114 -r1.115 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.105 -r1.106 src/sys/compat/linux/arch/m68k/linux_syscall.h \
src/sys/compat/linux/arch/m68k/linux_syscalls.c \
src/sys/compat/linux/arch/m68k/linux_sysent.c
cvs rdiff -u 

CVS commit: src/sys

2018-08-10 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Aug 10 21:45:00 UTC 2018

Modified Files:
src/sys/arch/i386/i386: linux_syscall.c
src/sys/compat/aoutm68k: aoutm68k_exec.c
src/sys/compat/freebsd: freebsd_exec.c
src/sys/compat/ibcs2: ibcs2_exec.c
src/sys/compat/linux/common: linux_exec.c
src/sys/compat/linux32/common: linux32_exec.c
src/sys/compat/netbsd32: netbsd32_netbsd.c
src/sys/compat/osf1: osf1_exec.c
src/sys/compat/sunos: sunos_exec.c
src/sys/compat/sunos32: sunos32_exec.c
src/sys/compat/svr4: svr4_exec.c
src/sys/compat/svr4_32: svr4_32_exec.c
src/sys/compat/ultrix: ultrix_misc.c
src/sys/kern: kern_exec.c kern_syscall.c makesyscalls.sh
src/sys/rump/include/rump-sys: kern.h
src/sys/rump/kern/lib/libsys_cygwin: sys_cygwin_component.c
src/sys/rump/kern/lib/libsys_linux: sys_linux_component.c
src/sys/rump/kern/lib/libsys_sunos: sys_sunos_component.c
src/sys/rump/librump/rumpkern: emul.c
src/sys/sys: proc.h systm.h

Log Message:
/home/paul/X_nomodbits.commit


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/i386/i386/linux_syscall.c
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/aoutm68k/aoutm68k_exec.c
cvs rdiff -u -r1.41 -r1.42 src/sys/compat/freebsd/freebsd_exec.c
cvs rdiff -u -r1.78 -r1.79 src/sys/compat/ibcs2/ibcs2_exec.c
cvs rdiff -u -r1.119 -r1.120 src/sys/compat/linux/common/linux_exec.c
cvs rdiff -u -r1.23 -r1.24 src/sys/compat/linux32/common/linux32_exec.c
cvs rdiff -u -r1.217 -r1.218 src/sys/compat/netbsd32/netbsd32_netbsd.c
cvs rdiff -u -r1.46 -r1.47 src/sys/compat/osf1/osf1_exec.c
cvs rdiff -u -r1.56 -r1.57 src/sys/compat/sunos/sunos_exec.c
cvs rdiff -u -r1.35 -r1.36 src/sys/compat/sunos32/sunos32_exec.c
cvs rdiff -u -r1.68 -r1.69 src/sys/compat/svr4/svr4_exec.c
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/svr4_32/svr4_32_exec.c
cvs rdiff -u -r1.124 -r1.125 src/sys/compat/ultrix/ultrix_misc.c
cvs rdiff -u -r1.459 -r1.460 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.16 -r1.17 src/sys/kern/kern_syscall.c
cvs rdiff -u -r1.169 -r1.170 src/sys/kern/makesyscalls.sh
cvs rdiff -u -r1.3 -r1.4 src/sys/rump/include/rump-sys/kern.h
cvs rdiff -u -r1.2 -r1.3 \
src/sys/rump/kern/lib/libsys_cygwin/sys_cygwin_component.c
cvs rdiff -u -r1.3 -r1.4 \
src/sys/rump/kern/lib/libsys_linux/sys_linux_component.c
cvs rdiff -u -r1.2 -r1.3 \
src/sys/rump/kern/lib/libsys_sunos/sys_sunos_component.c
cvs rdiff -u -r1.185 -r1.186 src/sys/rump/librump/rumpkern/emul.c
cvs rdiff -u -r1.348 -r1.349 src/sys/sys/proc.h
cvs rdiff -u -r1.276 -r1.277 src/sys/sys/systm.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/i386/i386/linux_syscall.c
diff -u src/sys/arch/i386/i386/linux_syscall.c:1.53 src/sys/arch/i386/i386/linux_syscall.c:1.54
--- src/sys/arch/i386/i386/linux_syscall.c:1.53	Sat Aug 12 07:21:57 2017
+++ src/sys/arch/i386/i386/linux_syscall.c	Fri Aug 10 21:44:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_syscall.c,v 1.53 2017/08/12 07:21:57 maxv Exp $	*/
+/*	$NetBSD: linux_syscall.c,v 1.54 2018/08/10 21:44:58 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.53 2017/08/12 07:21:57 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscall.c,v 1.54 2018/08/10 21:44:58 pgoyette Exp $");
 
 #include 
 #include 
@@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_syscal
 
 static void linux_syscall(struct trapframe *);
 extern struct sysent linux_sysent[];
+extern const uint32_t linux_sysent_nomodbits[];
 
 void
 linux_syscall_intern(struct proc *p)

Index: src/sys/compat/aoutm68k/aoutm68k_exec.c
diff -u src/sys/compat/aoutm68k/aoutm68k_exec.c:1.29 src/sys/compat/aoutm68k/aoutm68k_exec.c:1.30
--- src/sys/compat/aoutm68k/aoutm68k_exec.c:1.29	Sun May  6 13:40:50 2018
+++ src/sys/compat/aoutm68k/aoutm68k_exec.c	Fri Aug 10 21:44:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: aoutm68k_exec.c,v 1.29 2018/05/06 13:40:50 kamil Exp $	*/
+/*	$NetBSD: aoutm68k_exec.c,v 1.30 2018/08/10 21:44:58 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: aoutm68k_exec.c,v 1.29 2018/05/06 13:40:50 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aoutm68k_exec.c,v 1.30 2018/08/10 21:44:58 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_syscall_debug.h"
@@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: aoutm68k_exe
 #include 
 
 extern struct sysent aoutm68k_sysent[];
+extern const uint32_t aoutm68k_sysent_nomodbits[];
 extern char sigcode[], esigcode[];
 void aoutm68k_syscall_intern(struct proc *);
 
@@ -64,6 +65,7 @@ struct emul emul_netbsd_aoutm68k = {
 	.e_nsysent =		AOUTM68K_SYS_NSYSENT,
 #endif
 	.e_sysent =		aoutm68k_sysent,
+	.e_nomodbits =		

CVS commit: src/sys/arch/aarch64

2018-08-10 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Aug 10 21:06:42 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: locore.S pmap.c
src/sys/arch/aarch64/include: pmap.h

Log Message:
treat kernel-exec attr and user-exec attr separately.
kernel cannot execute userland exec page, and user cannot execute kernel page.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/aarch64/aarch64/locore.S \
src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/aarch64/include/pmap.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/aarch64/aarch64/locore.S
diff -u src/sys/arch/aarch64/aarch64/locore.S:1.17 src/sys/arch/aarch64/aarch64/locore.S:1.18
--- src/sys/arch/aarch64/aarch64/locore.S:1.17	Fri Aug 10 17:46:06 2018
+++ src/sys/arch/aarch64/aarch64/locore.S	Fri Aug 10 21:06:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.17 2018/08/10 17:46:06 maxv Exp $	*/
+/*	$NetBSD: locore.S,v 1.18 2018/08/10 21:06:42 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -35,7 +35,7 @@
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: locore.S,v 1.17 2018/08/10 17:46:06 maxv Exp $")
+RCSID("$NetBSD: locore.S,v 1.18 2018/08/10 21:06:42 ryo Exp $")
 
 /* #define DEBUG_LOCORE */
 /* #define DEBUG_MMU */
@@ -640,7 +640,7 @@ arm_boot_l0pt_init:
 	adr	x2, start		/* physical addr. before MMU */
 	and	x2, x2, #L2_BLK_OA	/* L2 block size aligned (2MB) */
 	mov	x1, #VM_MIN_KERNEL_ADDRESS
-	mov	x3, #L2_BLKPAG_ATTR_NORMAL_WB
+	mov	x3, #(L2_BLKPAG_ATTR_NORMAL_WB|LX_BLKPAG_UXN)
 
 	/* kernelsize = _end - start */
 	ldr	x1, =start
Index: src/sys/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.17 src/sys/arch/aarch64/aarch64/pmap.c:1.18
--- src/sys/arch/aarch64/aarch64/pmap.c:1.17	Mon Aug  6 12:50:56 2018
+++ src/sys/arch/aarch64/aarch64/pmap.c	Fri Aug 10 21:06:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.17 2018/08/06 12:50:56 ryo Exp $	*/
+/*	$NetBSD: pmap.c,v 1.18 2018/08/10 21:06:42 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.17 2018/08/06 12:50:56 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.18 2018/08/10 21:06:42 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -163,7 +163,7 @@ struct pv_entry {
 };
 
 static pt_entry_t *_pmap_pte_lookup(struct pmap *, vaddr_t);
-static pt_entry_t _pmap_pte_adjust_prot(pt_entry_t, vm_prot_t, vm_prot_t);
+static pt_entry_t _pmap_pte_adjust_prot(pt_entry_t, vm_prot_t, vm_prot_t, bool);
 static pt_entry_t _pmap_pte_adjust_cacheflags(pt_entry_t, u_int);
 static void _pmap_remove(struct pmap *, vaddr_t, bool);
 static int _pmap_enter(struct pmap *, vaddr_t, paddr_t, vm_prot_t, u_int, bool);
@@ -249,11 +249,15 @@ _pmap_map_chunk(pd_entry_t *l2, vaddr_t 
 	oldpte = l2[l2pde_index(va)];
 	KDASSERT(!l2pde_valid(oldpte));
 
-	attr = _pmap_pte_adjust_prot(L2_BLOCK, prot, VM_PROT_ALL);
+	attr = _pmap_pte_adjust_prot(L2_BLOCK, prot, VM_PROT_ALL, false);
 	attr = _pmap_pte_adjust_cacheflags(attr, flags | PMAP_DEV);
 #ifdef MULTIPROCESSOR
 	attr |= LX_BLKPAG_SH_IS;
 #endif
+	/* user cannot execute, and kernel follows the prot */
+	attr |= (LX_BLKPAG_UXN|LX_BLKPAG_PXN);
+	if (prot & VM_PROT_EXECUTE)
+		attr &= ~LX_BLKPAG_PXN;
 
 	resid = (size + (L2_SIZE - 1)) & ~(L2_SIZE - 1);
 	size = resid;
@@ -780,9 +784,11 @@ _pmap_pte_lookup(struct pmap *pm, vaddr_
 }
 
 static pt_entry_t
-_pmap_pte_adjust_prot(pt_entry_t pte, vm_prot_t prot, vm_prot_t protmask)
+_pmap_pte_adjust_prot(pt_entry_t pte, vm_prot_t prot, vm_prot_t protmask,
+bool user)
 {
 	vm_prot_t masked;
+	pt_entry_t xn;
 
 	masked = prot & protmask;
 	pte &= ~(LX_BLKPAG_OS_RWMASK|LX_BLKPAG_AF|LX_BLKPAG_AP);
@@ -820,10 +826,12 @@ _pmap_pte_adjust_prot(pt_entry_t pte, vm
 		break;
 	}
 
-	if ((prot & VM_PROT_EXECUTE) == 0)
-		pte |= (LX_BLKPAG_UXN|LX_BLKPAG_PXN);
-	else
-		pte &= ~(LX_BLKPAG_UXN|LX_BLKPAG_PXN);
+	/* executable for kernel or user? first set never exec both */
+	pte |= (LX_BLKPAG_UXN|LX_BLKPAG_PXN);
+	/* and either to executable */
+	xn = user ? LX_BLKPAG_UXN : LX_BLKPAG_PXN;
+	if (prot & VM_PROT_EXECUTE)
+		pte &= ~xn;			
 
 	return pte;
 }
@@ -1052,6 +1060,7 @@ _pmap_protect_pv(struct vm_page *pg, str
 	pt_entry_t *ptep, pte;
 	vm_prot_t pteprot;
 	uint32_t mdattr;
+	const bool user = (pv->pv_pmap != pmap_kernel());
 
 	UVMHIST_FUNC(__func__);
 	UVMHIST_CALLED(pmaphist);
@@ -1073,11 +1082,11 @@ _pmap_protect_pv(struct vm_page *pg, str
 		pteprot |= VM_PROT_READ;
 	if ((pte & LX_BLKPAG_AP) == LX_BLKPAG_AP_RW)
 		pteprot |= VM_PROT_WRITE;
-	if ((pte & (LX_BLKPAG_UXN|LX_BLKPAG_PXN)) == 0)
+	if (l3pte_executable(pte, user))
 		pteprot |= VM_PROT_EXECUTE;
 
 	/* new prot = prot & pteprot & mdattr */
-	pte = _pmap_pte_adjust_prot(pte, prot & pteprot, mdattr);
+	pte = _pmap_pte_adjust_prot(pte, prot & pteprot, mdattr, user);
 	

CVS commit: src/lib/libc/gen

2018-08-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Aug 10 20:35:52 UTC 2018

Modified Files:
src/lib/libc/gen: timespec_get.3

Log Message:
Merge FreeBSD improvements to the man-page of timespec_get(3)

Keep NetBSD references instead of FreeBSD ones included in the FreeBSD
version.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/gen/timespec_get.3

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/timespec_get.3
diff -u src/lib/libc/gen/timespec_get.3:1.2 src/lib/libc/gen/timespec_get.3:1.3
--- src/lib/libc/gen/timespec_get.3:1.2	Tue Oct  4 10:46:40 2016
+++ src/lib/libc/gen/timespec_get.3	Fri Aug 10 20:35:52 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: timespec_get.3,v 1.2 2016/10/04 10:46:40 wiz Exp $
+.\"	$NetBSD: timespec_get.3,v 1.3 2018/08/10 20:35:52 kamil Exp $
 .\"
 .\" Copyright (c) 2016 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd October 4, 2016
+.Dd August 10, 2018
 .Dt TIMESPEC_GET 3
 .Os
 .Sh NAME
@@ -37,7 +37,6 @@
 .Lb libc
 .Sh SYNOPSIS
 .In time.h
-.Vt #define TIME_UTC 1
 .Ft int
 .Fn timespec_get "struct timespec *ts" "int base"
 .Sh DESCRIPTION
@@ -48,9 +47,14 @@ function sets the interval pointed to by
 to hold the current calendar time based on the specified time base in
 .Fa base .
 .Pp
-Currently the only supported valid base is
-.Dv TIME_UTC .
-It returns time elapsed since epoch.
+The base
+.Dv TIME_UTC
+returns the time since the epoch.
+This time is expressed in seconds and nanoseconds since midnight (0 hour), January 1, 1970.
+In
+.Nx ,
+this corresponds to
+.Dv CLOCK_REALTIME .
 .Sh RETURN VALUES
 The
 .Nm
@@ -59,16 +63,22 @@ function returns the passed value of
 if successful, otherwise
 .Dv 0
 on failure.
-.\" .Sh ERRORS
 .Sh SEE ALSO
-.Xr clock_gettime 2
+.Xr gettimeofday 2 ,
+.Xr clock_gettime 2 ,
+.Xr time 3
 .Sh STANDARDS
 The
 .Nm
-function conforms to
+function with a
+.Fa base
+of
+.Dv TIME_UTC
+conforms to
 .St -isoC-2011 .
 .Sh HISTORY
 This interface first appeared in
 .Nx 8 .
 .Sh AUTHORS
 .An Kamil Rytarowski Aq Mt ka...@netbsd.org
+.An Warner Losh Aq Mt i...@freebsd.org



CVS commit: src/doc

2018-08-10 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Fri Aug 10 20:11:29 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
lua: Import version 5.3.5.


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2418 src/doc/CHANGES:1.2419
--- src/doc/CHANGES:1.2418	Wed Aug  8 19:05:19 2018
+++ src/doc/CHANGES	Fri Aug 10 20:11:29 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2418 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2419 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -192,4 +192,5 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 		[kamil 20180803]
 	kUBSan: Added support for micro-UBSan (kernel-UBSan) as KUBSAN.
 		[kamil 20180803]
+	lua: Import version 5.3.5. [alnsn 20180804]
 	arm: Add driver for ARM GICv3 interrupt controllers. [jmcneill 20180808]



CVS commit: src/sys/arch

2018-08-10 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri Aug 10 17:54:46 UTC 2018

Modified Files:
src/sys/arch/amd64/conf: GENERIC
src/sys/arch/i386/conf: GENERIC

Log Message:
Add snippet for bpfjit(4) as both i386 and amd64 are listed as supported.
Ideally BPFJIT should be enabled by default for use with NPF but I haven't
raised the question (no access to email at the moment) hence both are disabled.


To generate a diff of this commit:
cvs rdiff -u -r1.499 -r1.500 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.1185 -r1.1186 src/sys/arch/i386/conf/GENERIC

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

Modified files:

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.499 src/sys/arch/amd64/conf/GENERIC:1.500
--- src/sys/arch/amd64/conf/GENERIC:1.499	Fri Aug  3 04:35:20 2018
+++ src/sys/arch/amd64/conf/GENERIC	Fri Aug 10 17:54:46 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.499 2018/08/03 04:35:20 kamil Exp $
+# $NetBSD: GENERIC,v 1.500 2018/08/10 17:54:46 sevan Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.499 $"
+#ident		"GENERIC-$Revision: 1.500 $"
 
 maxusers	64		# estimated number of users
 
@@ -205,6 +205,10 @@ options 	PPP_FILTER	# Active filter supp
 #options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG
 #options 	TCP_SIGNATURE	# Enable RFC-2385 TCP md5 signatures
 
+# JIT compiler for bpfilter
+#options 	SLJIT
+#options 	BPFJIT
+
 #options 	ALTQ		# Manipulate network interfaces' output queues
 #options 	ALTQ_BLUE	# Stochastic Fair Blue
 #options 	ALTQ_CBQ	# Class-Based Queueing

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1185 src/sys/arch/i386/conf/GENERIC:1.1186
--- src/sys/arch/i386/conf/GENERIC:1.1185	Wed Aug  1 16:59:09 2018
+++ src/sys/arch/i386/conf/GENERIC	Fri Aug 10 17:54:46 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1185 2018/08/01 16:59:09 maxv Exp $
+# $NetBSD: GENERIC,v 1.1186 2018/08/10 17:54:46 sevan Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.1185 $"
+#ident		"GENERIC-$Revision: 1.1186 $"
 
 maxusers	64		# estimated number of users
 
@@ -196,6 +196,10 @@ options 	NETATALK	# AppleTalk networking
 options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
 #options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG
 
+# JIT compiler for bpfilter
+#options 	SLJIT
+#options 	BPFJIT
+
 #options 	ALTQ		# Manipulate network interfaces' output queues
 #options 	ALTQ_BLUE	# Stochastic Fair Blue
 #options 	ALTQ_CBQ	# Class-Based Queueing



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

2018-08-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Aug 10 17:47:14 UTC 2018

Modified Files:
src/sys/arch/arm/conf: files.arm

Log Message:
remove reference to CPU_ARMV2, suggested by jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/sys/arch/arm/conf/files.arm

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/conf/files.arm
diff -u src/sys/arch/arm/conf/files.arm:1.140 src/sys/arch/arm/conf/files.arm:1.141
--- src/sys/arch/arm/conf/files.arm:1.140	Fri Aug 10 16:17:30 2018
+++ src/sys/arch/arm/conf/files.arm	Fri Aug 10 17:47:14 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.arm,v 1.140 2018/08/10 16:17:30 maxv Exp $
+#	$NetBSD: files.arm,v 1.141 2018/08/10 17:47:14 maxv Exp $
 
 # temporary define to allow easy moving to ../arch/arm/arm32
 defflagARM32
@@ -8,8 +8,7 @@ defflag	opt_cpuoptions.h	ARM32_DISABLE_A
 
 # CPU types.  Make sure to update  if you change this list.
 defflag	opt_cputypes.h		CPU_PRE_ARMV6
-defflag	opt_cputypes.h		CPU_ARMV2: CPU_PRE_ARMV6
-defflag	opt_cputypes.h		CPU_ARMV3: CPU_ARMV2
+defflag	opt_cputypes.h		CPU_ARMV3: CPU_PRE_ARMV6
 defflag	opt_cputypes.h		CPU_ARMV4: CPU_ARMV3
 defflag	opt_cputypes.h		CPU_ARMV4T: CPU_ARMV4
 defflag	opt_cputypes.h		CPU_ARMV5T: CPU_ARMV4T



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

2018-08-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Aug 10 17:46:06 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: locore.S

Log Message:
Enlighten a little.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/aarch64/aarch64/locore.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/aarch64/aarch64/locore.S
diff -u src/sys/arch/aarch64/aarch64/locore.S:1.16 src/sys/arch/aarch64/aarch64/locore.S:1.17
--- src/sys/arch/aarch64/aarch64/locore.S:1.16	Mon Aug  6 20:05:26 2018
+++ src/sys/arch/aarch64/aarch64/locore.S	Fri Aug 10 17:46:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.16 2018/08/06 20:05:26 ryo Exp $	*/
+/*	$NetBSD: locore.S,v 1.17 2018/08/10 17:46:06 maxv Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -35,7 +35,7 @@
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: locore.S,v 1.16 2018/08/06 20:05:26 ryo Exp $")
+RCSID("$NetBSD: locore.S,v 1.17 2018/08/10 17:46:06 maxv Exp $")
 
 /* #define DEBUG_LOCORE */
 /* #define DEBUG_MMU */
@@ -589,28 +589,30 @@ arm_boot_l0pt_init:
 	b.lo	1b
 
 	VERBOSE("Creating VA=PA tables\r\n")
-	/* VA=PA table for L0 */
+
+	/* VA=PA table, link L0->L1 */
 	ADDR	x0, ttbr0_l0table
 	mov	x1, #0
 	ADDR	x2, ttbr0_l1table
 	bl	l0_settable
 
-	/* VA=PA blocks */
+	/* VA=PA L1 blocks */
 	ADDR	x0, ttbr0_l1table
-	mov	x1, #0			/* PA */
-	mov	x2, #0			/* VA */
+	mov	x1, #0			/* VA */
+	mov	x2, #0			/* PA */
 	mov	x3, #L2_BLKPAG_ATTR_DEVICE_MEM
 	mov	x4, #4			/* 4GB = whole 32bit */
 	bl	l1_setblocks
 
 	VERBOSE("Creating KSEG tables\r\n")
-	/* KSEG table for L0 */
+
+	/* KSEG table, link L0->L1 */
 	ADDR	x0, ttbr1_l0table
 	mov	x1, #AARCH64_KSEG_START
 	ADDR	x2, ttbr1_l1table_kseg
 	bl	l0_settable
 
-	/* KSEG blocks */
+	/* KSEG L1 blocks */
 	ADDR	x0, ttbr1_l1table_kseg
 	mov	x1, #AARCH64_KSEG_START
 	mov	x2, #0
@@ -620,19 +622,20 @@ arm_boot_l0pt_init:
 	bl	l1_setblocks
 
 	VERBOSE("Creating KVA=PA tables\r\n")
-	/* KVA=PA table for L0 */
+
+	/* KVA=PA table, link L0->L1 */
 	ADDR	x0, ttbr1_l0table
 	mov	x1, #VM_MIN_KERNEL_ADDRESS
 	ADDR	x2, ttbr1_l1table_kva
 	bl	l0_settable
 
-	/* KVA=PA table for L1 */
+	/* KVA=PA table, link L1->L2 */
 	ADDR	x0, ttbr1_l1table_kva
 	mov	x1, #VM_MIN_KERNEL_ADDRESS
 	ADDR	x2, ttbr1_l2table_kva
 	bl	l1_settable
 
-	/* KVA=PA blocks */
+	/* KVA=PA L2 blocks */
 	ADDR	x0, ttbr1_l2table_kva
 	adr	x2, start		/* physical addr. before MMU */
 	and	x2, x2, #L2_BLK_OA	/* L2 block size aligned (2MB) */
@@ -717,7 +720,7 @@ arm_boot_l0pt_init:
 
 
 	VERBOSE("Creating devmap tables\r\n")
-	/* devmap=PA table for L1 */
+	/* devmap=PA table, link L1->L2 */
 	ADDR	x0, ttbr1_l1table_kva
 	ldr	x1, .L_devmap_addr
 	ADDR	x2, ttbr1_l2table_devmap



CVS commit: src/sys/dev/acpi

2018-08-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 10 17:11:56 UTC 2018

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

Log Message:
Don't hold up boot: defer acpibat(4) inquiry until threads are running.

ok jmcneill@


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/dev/acpi/acpi_bat.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/acpi_bat.c
diff -u src/sys/dev/acpi/acpi_bat.c:1.115 src/sys/dev/acpi/acpi_bat.c:1.116
--- src/sys/dev/acpi/acpi_bat.c:1.115	Thu Apr 23 23:23:00 2015
+++ src/sys/dev/acpi/acpi_bat.c	Fri Aug 10 17:11:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_bat.c,v 1.115 2015/04/23 23:23:00 pgoyette Exp $	*/
+/*	$NetBSD: acpi_bat.c,v 1.116 2018/08/10 17:11:56 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.115 2015/04/23 23:23:00 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.116 2018/08/10 17:11:56 riastradh Exp $");
 
 #include 
 #include 
@@ -252,7 +252,7 @@ acpibat_attach(device_t parent, device_t
 	if (sc->sc_sensor == NULL)
 		return;
 
-	acpibat_init_envsys(self);
+	config_interrupts(self, acpibat_init_envsys);
 
 	/*
 	 * If this is ever seen, the driver should be extended.



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

2018-08-10 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Aug 10 17:05:22 UTC 2018

Modified Files:
src/sys/arch/arm/include: int_const.h

Log Message:
fix arm int_const.h for aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/include/int_const.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/include/int_const.h
diff -u src/sys/arch/arm/include/int_const.h:1.4 src/sys/arch/arm/include/int_const.h:1.5
--- src/sys/arch/arm/include/int_const.h:1.4	Fri Jul 25 21:43:13 2014
+++ src/sys/arch/arm/include/int_const.h	Fri Aug 10 17:05:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: int_const.h,v 1.4 2014/07/25 21:43:13 joerg Exp $	*/
+/*	$NetBSD: int_const.h,v 1.5 2018/08/10 17:05:22 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -44,17 +44,31 @@
 #define	INT8_C(c)	c
 #define	INT16_C(c)	c
 #define	INT32_C(c)	c
+#ifdef _LP64
+#define	INT64_C(c)	c ## L
+#else
 #define	INT64_C(c)	c ## LL
+#endif
 
 #define	UINT8_C(c)	c
 #define	UINT16_C(c)	c
 #define	UINT32_C(c)	c ## U
+#ifdef _LP64
+#define	UINT64_C(c)	c ## UL
+#else
 #define	UINT64_C(c)	c ## ULL
+#endif
 
 /* 7.18.4.2 Macros for greatest-width integer constants */
 
+#ifdef _LP64
+#define	INTMAX_C(c)	c ## L
+#define	UINTMAX_C(c)	c ## UL
+#else
 #define	INTMAX_C(c)	c ## LL
 #define	UINTMAX_C(c)	c ## ULL
 #endif
 
+#endif /* !__INTMAX_C_SUFFIX__ */
+
 #endif /* !_ARM_INT_CONST_H_ */



CVS commit: src/sys/arch/arm

2018-08-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Aug 10 16:17:30 UTC 2018

Modified Files:
src/sys/arch/arm/arm: cpufunc.c fiq_subr.S
src/sys/arch/arm/arm32: cpu.c fault.c
src/sys/arch/arm/conf: files.arm
src/sys/arch/arm/include: cpuconf.h cpufunc_proto.h
Removed Files:
src/sys/arch/arm/arm: cpufunc_asm_arm3.S

Log Message:
Retire CPU_ARM2, CPU_ARM250 and CPU_ARM3, they are all leftovers of
acorn26.

ok jmcneill@ skrll@


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/arch/arm/arm/cpufunc.c
cvs rdiff -u -r1.4 -r0 src/sys/arch/arm/arm/cpufunc_asm_arm3.S
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/arm/fiq_subr.S
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/arm/arm32/cpu.c
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/arm/arm32/fault.c
cvs rdiff -u -r1.139 -r1.140 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/include/cpuconf.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/include/cpufunc_proto.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/arm/cpufunc.c
diff -u src/sys/arch/arm/arm/cpufunc.c:1.170 src/sys/arch/arm/arm/cpufunc.c:1.171
--- src/sys/arch/arm/arm/cpufunc.c:1.170	Thu Jul 12 12:48:50 2018
+++ src/sys/arch/arm/arm/cpufunc.c	Fri Aug 10 16:17:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.170 2018/07/12 12:48:50 jakllsch Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.171 2018/08/10 16:17:29 maxv Exp $	*/
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.170 2018/07/12 12:48:50 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.171 2018/08/10 16:17:29 maxv Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_cpuoptions.h"
@@ -118,174 +118,6 @@ u_int	arm_dcache_align_mask;
 /* 1 == use cpu_sleep(), 0 == don't */
 int cpu_do_powersave;
 
-#ifdef CPU_ARM2
-struct cpu_functions arm2_cpufuncs = {
-	/* CPU functions */
-
-	.cf_id			= arm2_id,
-	.cf_cpwait		= cpufunc_nullop,
-
-	/* MMU functions */
-
-	.cf_control		= (void *)cpufunc_nullop,
-
-	/* TLB functions */
-
-	.cf_tlb_flushID		= cpufunc_nullop,
-	.cf_tlb_flushID_SE	= (void *)cpufunc_nullop,
-	.cf_tlb_flushI		= cpufunc_nullop,
-	.cf_tlb_flushI_SE	= (void *)cpufunc_nullop,
-	.cf_tlb_flushD		= cpufunc_nullop,
-	.cf_tlb_flushD_SE	= (void *)cpufunc_nullop,
-
-	/* Cache operations */
-
-	.cf_icache_sync_all	= cpufunc_nullop,
-	.cf_icache_sync_range	= (void *) cpufunc_nullop,
-
-	.cf_dcache_wbinv_all	= arm3_cache_flush,
-	.cf_dcache_wbinv_range	= (void *)cpufunc_nullop,
-	.cf_dcache_inv_range	= (void *)cpufunc_nullop,
-	.cf_dcache_wb_range	= (void *)cpufunc_nullop,
-
-	.cf_sdcache_wbinv_range	= (void *)cpufunc_nullop,
-	.cf_sdcache_inv_range	= (void *)cpufunc_nullop,
-	.cf_sdcache_wb_range	= (void *)cpufunc_nullop,
-
-	.cf_idcache_wbinv_all	= cpufunc_nullop,
-	.cf_idcache_wbinv_range	= (void *)cpufunc_nullop,
-
-	/* Other functions */
-
-	.cf_flush_prefetchbuf	= cpufunc_nullop,
-	.cf_drain_writebuf	= cpufunc_nullop,
-	.cf_flush_brnchtgt_C	= cpufunc_nullop,
-	.cf_flush_brnchtgt_E	= (void *)cpufunc_nullop,
-
-	.cf_sleep		= (void *)cpufunc_nullop,
-
-	/* Soft functions */
-
-	.cf_dataabt_fixup	= early_abort_fixup,
-	.cf_prefetchabt_fixup	= cpufunc_null_fixup,
-
-	.cf_setup		= (void *)cpufunc_nullop
-
-};
-#endif	/* CPU_ARM2 */
-
-#ifdef CPU_ARM250
-struct cpu_functions arm250_cpufuncs = {
-	/* CPU functions */
-
-	.cf_id			= arm250_id,
-	.cf_cpwait		= cpufunc_nullop,
-
-	/* MMU functions */
-
-	.cf_control		= (void *)cpufunc_nullop,
-
-	/* TLB functions */
-
-	.cf_tlb_flushID		= cpufunc_nullop,
-	.cf_tlb_flushID_SE	= (void *)cpufunc_nullop,
-	.cf_tlb_flushI		= cpufunc_nullop,
-	.cf_tlb_flushI_SE	= (void *)cpufunc_nullop,
-	.cf_tlb_flushD		= cpufunc_nullop,
-	.cf_tlb_flushD_SE	= (void *)cpufunc_nullop,
-
-	/* Cache operations */
-
-	.cf_icache_sync_all	= cpufunc_nullop,
-	.cf_icache_sync_range	= (void *) cpufunc_nullop,
-
-	.cf_dcache_wbinv_all	= arm3_cache_flush,
-	.cf_dcache_wbinv_range	= (void *)cpufunc_nullop,
-	.cf_dcache_inv_range	= (void *)cpufunc_nullop,
-	.cf_dcache_wb_range	= (void *)cpufunc_nullop,
-
-	.cf_sdcache_wbinv_range	= (void *)cpufunc_nullop,
-	.cf_sdcache_inv_range	= (void *)cpufunc_nullop,
-	.cf_sdcache_wb_range	= (void *)cpufunc_nullop,
-
-	.cf_idcache_wbinv_all	= cpufunc_nullop,
-	.cf_idcache_wbinv_range	= (void *)cpufunc_nullop,
-
-	/* Other functions */
-
-	.cf_flush_prefetchbuf	= cpufunc_nullop,
-	.cf_drain_writebuf	= cpufunc_nullop,
-	.cf_flush_brnchtgt_C	= cpufunc_nullop,
-	.cf_flush_brnchtgt_E	= (void *)cpufunc_nullop,
-
-	.cf_sleep		= (void *)cpufunc_nullop,
-
-	/* Soft functions */
-
-	.cf_dataabt_fixup	= early_abort_fixup,
-	.cf_prefetchabt_fixup	= cpufunc_null_fixup,
-
-	.cf_setup		= (void *)cpufunc_nullop
-
-};
-#endif	/* CPU_ARM250 */
-
-#ifdef CPU_ARM3
-struct cpu_functions arm3_cpufuncs = {
-	/* CPU functions */
-
-	.cf_id			

CVS commit: src/sys/net

2018-08-10 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Aug 10 10:31:01 UTC 2018

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

Log Message:
fix if_snd_is_used(), ifp->if_snd is also used by if.c::if_transmit().


To generate a diff of this commit:
cvs rdiff -u -r1.432 -r1.433 src/sys/net/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/net/if.c
diff -u src/sys/net/if.c:1.432 src/sys/net/if.c:1.433
--- src/sys/net/if.c:1.432	Fri Aug 10 07:24:09 2018
+++ src/sys/net/if.c	Fri Aug 10 10:31:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.432 2018/08/10 07:24:09 msaitoh Exp $	*/
+/*	$NetBSD: if.c,v 1.433 2018/08/10 10:31:01 knakahara Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.432 2018/08/10 07:24:09 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.433 2018/08/10 10:31:01 knakahara Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1042,6 +1042,7 @@ if_snd_is_used(struct ifnet *ifp)
 {
 
 	return ifp->if_transmit == NULL || ifp->if_transmit == if_nulltransmit ||
+	ifp->if_transmit == if_transmit ||
 	ALTQ_IS_ENABLED(>if_snd);
 }
 



CVS commit: src/sys/net

2018-08-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 10 07:24:09 UTC 2018

Modified Files:
src/sys/net: if.c pktqueue.c

Log Message:
- Fix a bug that drop counter shows incorrect vaule like
  "net.inet.ip.ifq.drops = 72059810241052672"
- Change pktq's length sysctl to uint64_t.


To generate a diff of this commit:
cvs rdiff -u -r1.431 -r1.432 src/sys/net/if.c
cvs rdiff -u -r1.9 -r1.10 src/sys/net/pktqueue.c

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

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.431 src/sys/net/if.c:1.432
--- src/sys/net/if.c:1.431	Mon Aug  6 06:54:40 2018
+++ src/sys/net/if.c	Fri Aug 10 07:24:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.431 2018/08/06 06:54:40 msaitoh Exp $	*/
+/*	$NetBSD: if.c,v 1.432 2018/08/10 07:24:09 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.431 2018/08/06 06:54:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.432 2018/08/10 07:24:09 msaitoh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -3767,7 +3767,7 @@ sysctl_net_pktq_setup(struct sysctllog *
 
 	sysctl_createv(clog, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT,
-		   CTLTYPE_INT, "len",
+		   CTLTYPE_QUAD, "len",
 		   SYSCTL_DESCR("Current input queue length"),
 		   len_func, 0, NULL, 0,
 		   CTL_NET, pf, ipn, qid, IFQCTL_LEN, CTL_EOL);

Index: src/sys/net/pktqueue.c
diff -u src/sys/net/pktqueue.c:1.9 src/sys/net/pktqueue.c:1.10
--- src/sys/net/pktqueue.c:1.9	Thu Jun  1 02:45:14 2017
+++ src/sys/net/pktqueue.c	Fri Aug 10 07:24:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pktqueue.c,v 1.9 2017/06/01 02:45:14 chs Exp $	*/
+/*	$NetBSD: pktqueue.c,v 1.10 2018/08/10 07:24:09 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pktqueue.c,v 1.9 2017/06/01 02:45:14 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pktqueue.c,v 1.10 2018/08/10 07:24:09 msaitoh Exp $");
 
 #include 
 #include 
@@ -381,8 +381,9 @@ sysctl_pktq_maxlen(SYSCTLFN_ARGS, pktque
 int
 sysctl_pktq_count(SYSCTLFN_ARGS, pktqueue_t *pq, u_int count_id)
 {
-	int count = pktq_get_count(pq, count_id);
+	uint64_t count = pktq_get_count(pq, count_id);
 	struct sysctlnode node = *rnode;
+
 	node.sysctl_data = 
 	return sysctl_lookup(SYSCTLFN_CALL());
 }



CVS commit: src/sys/netinet

2018-08-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 10 07:20:59 UTC 2018

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

Log Message:
 Change the type of wqinput's drop counter to uint64_t. OK'd by ozaki-r@.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/netinet/wqinput.c

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

Modified files:

Index: src/sys/netinet/wqinput.c
diff -u src/sys/netinet/wqinput.c:1.4 src/sys/netinet/wqinput.c:1.5
--- src/sys/netinet/wqinput.c:1.4	Sat Feb 24 07:37:09 2018
+++ src/sys/netinet/wqinput.c	Fri Aug 10 07:20:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: wqinput.c,v 1.4 2018/02/24 07:37:09 ozaki-r Exp $	*/
+/*	$NetBSD: wqinput.c,v 1.5 2018/08/10 07:20:59 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -62,7 +62,7 @@ struct wqinput_worklist {
 	struct wqinput_work *wwl_head;
 	struct wqinput_work *wwl_tail;
 	unsigned int	wwl_len;
-	unsigned long	wwl_dropped;
+	uint64_t	wwl_dropped;
 	struct work	wwl_work;
 	bool		wwl_wq_is_active;
 };
@@ -81,7 +81,7 @@ static void
 wqinput_drops(void *p, void *arg, struct cpu_info *ci __unused)
 {
 	struct wqinput_worklist *const wwl = p;
-	int *sum = arg;
+	uint64_t *sum = arg;
 
 	*sum += wwl->wwl_dropped;
 }
@@ -91,7 +91,7 @@ wqinput_sysctl_drops_handler(SYSCTLFN_AR
 {
 	struct sysctlnode node;
 	struct wqinput *wqi;
-	int sum = 0;
+	uint64_t sum = 0;
 	int error;
 
 	node = *rnode;
@@ -135,7 +135,7 @@ wqinput_sysctl_setup(const char *name, s
 		goto bad;
 
 	error = sysctl_createv(NULL, 0, , ,
-	CTLFLAG_PERMANENT, CTLTYPE_INT, "drops",
+	CTLFLAG_PERMANENT, CTLTYPE_QUAD, "drops",
 	SYSCTL_DESCR("Total packets dropped due to full input queue"),
 	wqinput_sysctl_drops_handler, 0, (void *)wqi, 0, CTL_CREATE, CTL_EOL);
 	if (error != 0)



CVS commit: src/sys

2018-08-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Aug 10 07:16:13 UTC 2018

Modified Files:
src/sys/dist/pf/net: pf_ioctl.c
src/sys/external/bsd/ipf/netinet: ip_fil_netbsd.c

Log Message:
Fix compilation of PF/IPF...


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dist/pf/net/pf_ioctl.c
cvs rdiff -u -r1.30 -r1.31 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.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/dist/pf/net/pf_ioctl.c
diff -u src/sys/dist/pf/net/pf_ioctl.c:1.55 src/sys/dist/pf/net/pf_ioctl.c:1.56
--- src/sys/dist/pf/net/pf_ioctl.c:1.55	Fri Aug 10 06:46:08 2018
+++ src/sys/dist/pf/net/pf_ioctl.c	Fri Aug 10 07:16:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pf_ioctl.c,v 1.55 2018/08/10 06:46:08 maxv Exp $	*/
+/*	$NetBSD: pf_ioctl.c,v 1.56 2018/08/10 07:16:13 maxv Exp $	*/
 /*	$OpenBSD: pf_ioctl.c,v 1.182 2007/06/24 11:17:13 mcbride Exp $ */
 
 /*
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pf_ioctl.c,v 1.55 2018/08/10 06:46:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf_ioctl.c,v 1.56 2018/08/10 07:16:13 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -100,6 +100,7 @@ __KERNEL_RCSID(0, "$NetBSD: pf_ioctl.c,v
 #ifdef INET6
 #include 
 #include 
+#include 
 #endif /* INET6 */
 
 #ifdef ALTQ

Index: src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
diff -u src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.30 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.31
--- src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.30	Fri Aug 10 06:46:08 2018
+++ src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c	Fri Aug 10 07:16:13 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_fil_netbsd.c,v 1.30 2018/08/10 06:46:08 maxv Exp $	*/
+/*	$NetBSD: ip_fil_netbsd.c,v 1.31 2018/08/10 07:16:13 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -8,7 +8,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.30 2018/08/10 06:46:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.31 2018/08/10 07:16:13 maxv Exp $");
 #else
 static const char sccsid[] = "@(#)ip_fil.c	2.41 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -83,6 +83,7 @@ static const char rcsid[] = "@(#)Id: ip_
 # endif
 # if __NetBSD_Version__ >= 499001100
 #  include 
+#  include 
 # endif
 #endif
 #include "netinet/ip_fil.h"



CVS commit: src/sys/netinet6

2018-08-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Aug 10 06:55:04 UTC 2018

Modified Files:
src/sys/netinet6: in6_offload.c in6_offload.h

Log Message:
Remove the callback and localify. Same as IPv4.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/netinet6/in6_offload.c
cvs rdiff -u -r1.8 -r1.9 src/sys/netinet6/in6_offload.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/netinet6/in6_offload.c
diff -u src/sys/netinet6/in6_offload.c:1.9 src/sys/netinet6/in6_offload.c:1.10
--- src/sys/netinet6/in6_offload.c:1.9	Fri Aug 10 06:46:09 2018
+++ src/sys/netinet6/in6_offload.c	Fri Aug 10 06:55:04 2018
@@ -1,6 +1,6 @@
-/*	$NetBSD: in6_offload.c,v 1.9 2018/08/10 06:46:09 maxv Exp $	*/
+/*	$NetBSD: in6_offload.c,v 1.10 2018/08/10 06:55:04 maxv Exp $	*/
 
-/*-
+/*
  * Copyright (c)2006 YAMAMOTO Takashi,
  * All rights reserved.
  *
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_offload.c,v 1.9 2018/08/10 06:46:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_offload.c,v 1.10 2018/08/10 06:55:04 maxv Exp $");
 
 #include 
 #include 
@@ -43,47 +43,13 @@ __KERNEL_RCSID(0, "$NetBSD: in6_offload.
 #include 
 #include 
 
-struct ip6_tso_output_args {
-	struct ifnet *ifp;
-	struct ifnet *origifp;
-	const struct sockaddr_in6 *dst;
-	struct rtentry *rt;
-};
-
-static int ip6_tso_output_callback(void *, struct mbuf *);
-
-static int
-ip6_tso_output_callback(void *vp, struct mbuf *m)
-{
-	struct ip6_tso_output_args *args = vp;
-
-	return ip6_if_output(args->ifp, args->origifp, m, args->dst, args->rt);
-}
-
-int
-ip6_tso_output(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m,
-const struct sockaddr_in6 *dst, struct rtentry *rt)
-{
-	struct ip6_tso_output_args args;
-
-	args.ifp = ifp;
-	args.origifp = origifp;
-	args.dst = dst;
-	args.rt = rt;
-
-	return tcp6_segment(m, ip6_tso_output_callback, );
-}
-
 /*
- * tcp6_segment: handle M_CSUM_TSOv6 by software.
- *
- * => always consume m.
- * => call output_func with output_arg for each segments.
+ * Handle M_CSUM_TSOv6 in software. Split the TCP payload in chunks of
+ * size MSS, and send them.
  */
-
-int
-tcp6_segment(struct mbuf *m, int (*output_func)(void *, struct mbuf *),
-void *output_arg)
+static int
+tcp6_segment(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m,
+const struct sockaddr_in6 *dst, struct rtentry *rt)
 {
 	int mss;
 	int iphlen;
@@ -173,7 +139,7 @@ tcp6_segment(struct mbuf *m, int (*outpu
 		th->th_sum = 0;
 		th->th_sum = in6_cksum(n, IPPROTO_TCP, iphlen, thlen + mss);
 
-		error = (*output_func)(output_arg, n);
+		error = ip6_if_output(ifp, origifp, n, dst, rt);
 		if (error) {
 			goto quit;
 		}
@@ -193,6 +159,13 @@ quit:
 	return error;
 }
 
+int
+ip6_tso_output(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m,
+const struct sockaddr_in6 *dst, struct rtentry *rt)
+{
+	return tcp6_segment(ifp, origifp, m, dst, rt);
+}
+
 /*
  * Compute now in software the IP and TCP/UDP checksums. Cancel the
  * hardware offloading.

Index: src/sys/netinet6/in6_offload.h
diff -u src/sys/netinet6/in6_offload.h:1.8 src/sys/netinet6/in6_offload.h:1.9
--- src/sys/netinet6/in6_offload.h:1.8	Fri Aug 10 06:46:09 2018
+++ src/sys/netinet6/in6_offload.h	Fri Aug 10 06:55:04 2018
@@ -1,6 +1,6 @@
-/*	$NetBSD: in6_offload.h,v 1.8 2018/08/10 06:46:09 maxv Exp $	*/
+/*	$NetBSD: in6_offload.h,v 1.9 2018/08/10 06:55:04 maxv Exp $	*/
 
-/*-
+/*
  * Copyright (c)2005, 2006 YAMAMOTO Takashi,
  * All rights reserved.
  *
@@ -26,14 +26,12 @@
  * SUCH DAMAGE.
  */
 
-/*
- * subroutines to do software-only equivalent of h/w offloading.
- */
-
 #if !defined(_NETINET6_IN6_OFFLOAD_H_)
 #define	_NETINET6_IN6_OFFLOAD_H_
 
-int tcp6_segment(struct mbuf *, int (*)(void *, struct mbuf *), void *);
+/*
+ * Subroutines to do software-only equivalent of h/w offloading.
+ */
 int ip6_tso_output(struct ifnet *, struct ifnet *, struct mbuf *,
 const struct sockaddr_in6 *, struct rtentry *);
 void in6_undefer_cksum(struct mbuf *, size_t, int);



CVS commit: src/sys

2018-08-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Aug 10 06:46:09 UTC 2018

Modified Files:
src/sys/arch/powerpc/booke/dev: pq3etsec.c
src/sys/dist/pf/net: pf_ioctl.c
src/sys/external/bsd/ipf/netinet: ip_fil_netbsd.c
src/sys/net: if_loop.c
src/sys/net/npf: npf_mbuf.c
src/sys/netinet6: in6.h in6_offload.c in6_offload.h ip6_output.c

Log Message:
Rename

ip6_undefer_csum  -> in6_undefer_cksum
in6_delayed_cksum -> in6_undefer_cksum_tcpudp

The two previous names were inconsistent and misleading.

Put the two functions into in6_offload.c. Add comments to explain what
we're doing.

Same as IPv4.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/powerpc/booke/dev/pq3etsec.c
cvs rdiff -u -r1.54 -r1.55 src/sys/dist/pf/net/pf_ioctl.c
cvs rdiff -u -r1.29 -r1.30 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
cvs rdiff -u -r1.104 -r1.105 src/sys/net/if_loop.c
cvs rdiff -u -r1.19 -r1.20 src/sys/net/npf/npf_mbuf.c
cvs rdiff -u -r1.91 -r1.92 src/sys/netinet6/in6.h
cvs rdiff -u -r1.8 -r1.9 src/sys/netinet6/in6_offload.c
cvs rdiff -u -r1.7 -r1.8 src/sys/netinet6/in6_offload.h
cvs rdiff -u -r1.211 -r1.212 src/sys/netinet6/ip6_output.c

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

Modified files:

Index: src/sys/arch/powerpc/booke/dev/pq3etsec.c
diff -u src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.35 src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.36
--- src/sys/arch/powerpc/booke/dev/pq3etsec.c:1.35	Wed Jul 11 05:25:45 2018
+++ src/sys/arch/powerpc/booke/dev/pq3etsec.c	Fri Aug 10 06:46:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pq3etsec.c,v 1.35 2018/07/11 05:25:45 maxv Exp $	*/
+/*	$NetBSD: pq3etsec.c,v 1.36 2018/08/10 06:46:08 maxv Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,7 +41,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.35 2018/07/11 05:25:45 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.36 2018/08/10 06:46:08 maxv Exp $");
 
 #include 
 #include 
@@ -2095,7 +2095,7 @@ pq3etsec_tx_offload(
 #endif
 			} else if (csum_flags & M_CSUM_IP6) {
 #ifdef INET6
-ip6_undefer_csum(m, ETHER_HDR_LEN,
+in6_undefer_cksum(m, ETHER_HDR_LEN,
 csum_flags & M_CSUM_IP6);
 #else
 panic("%s: impossible M_CSUM flags %#x",

Index: src/sys/dist/pf/net/pf_ioctl.c
diff -u src/sys/dist/pf/net/pf_ioctl.c:1.54 src/sys/dist/pf/net/pf_ioctl.c:1.55
--- src/sys/dist/pf/net/pf_ioctl.c:1.54	Wed Jul 11 11:13:16 2018
+++ src/sys/dist/pf/net/pf_ioctl.c	Fri Aug 10 06:46:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pf_ioctl.c,v 1.54 2018/07/11 11:13:16 kre Exp $	*/
+/*	$NetBSD: pf_ioctl.c,v 1.55 2018/08/10 06:46:08 maxv Exp $	*/
 /*	$OpenBSD: pf_ioctl.c,v 1.182 2007/06/24 11:17:13 mcbride Exp $ */
 
 /*
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pf_ioctl.c,v 1.54 2018/07/11 11:13:16 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf_ioctl.c,v 1.55 2018/08/10 06:46:08 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -3344,7 +3344,7 @@ pfil6_wrapper(void *arg, struct mbuf **m
 	 */
 	if (dir == PFIL_OUT) {
 		if ((*mp)->m_pkthdr.csum_flags & (M_CSUM_TCPv6|M_CSUM_UDPv6)) {
-			in6_delayed_cksum(*mp);
+			in6_undefer_cksum_tcpudp(*mp);
 			(*mp)->m_pkthdr.csum_flags &=
 			~(M_CSUM_TCPv6|M_CSUM_UDPv6);
 		}

Index: src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
diff -u src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.29 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.30
--- src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.29	Wed Jul 11 05:25:46 2018
+++ src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c	Fri Aug 10 06:46:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_fil_netbsd.c,v 1.29 2018/07/11 05:25:46 maxv Exp $	*/
+/*	$NetBSD: ip_fil_netbsd.c,v 1.30 2018/08/10 06:46:08 maxv Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -8,7 +8,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.29 2018/07/11 05:25:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.30 2018/08/10 06:46:08 maxv Exp $");
 #else
 static const char sccsid[] = "@(#)ip_fil.c	2.41 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -257,7 +257,7 @@ ipf_check_wrapper6(void *arg, struct mbu
 	if (dir == PFIL_OUT) {
 		if ((*mp)->m_pkthdr.csum_flags & (M_CSUM_TCPv6|M_CSUM_UDPv6)) {
 #   if (__NetBSD_Version__ > 399000600)
-			in6_delayed_cksum(*mp);
+			in6_undefer_cksum_tcpudp(*mp);
 #   endif
 			(*mp)->m_pkthdr.csum_flags &= ~(M_CSUM_TCPv6|
 			M_CSUM_UDPv6);

Index: src/sys/net/if_loop.c
diff -u src/sys/net/if_loop.c:1.104 src/sys/net/if_loop.c:1.105
--- src/sys/net/if_loop.c:1.104	Wed Jul 11 05:25:45 2018
+++ src/sys/net/if_loop.c	Fri Aug 10 06:46:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_loop.c,v 1.104 2018/07/11 05:25:45 maxv Exp $	*/
+/*	

CVS commit: src/sys/arch/xen/xen

2018-08-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Aug 10 06:23:12 UTC 2018

Modified Files:
src/sys/arch/xen/xen: if_xennet_xenbus.c

Log Message:
Don't unconditionally call pmap_extract_ma, it is part of XENNET_DEBUG.
This call costs us.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/xen/xen/if_xennet_xenbus.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/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.77 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.78
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.77	Tue Jun 26 06:48:00 2018
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c	Fri Aug 10 06:23:12 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_xennet_xenbus.c,v 1.77 2018/06/26 06:48:00 msaitoh Exp $  */
+/*  $NetBSD: if_xennet_xenbus.c,v 1.78 2018/08/10 06:23:12 maxv Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.77 2018/06/26 06:48:00 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.78 2018/08/10 06:23:12 maxv Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -131,6 +131,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_xennet_xe
 
 #undef XENNET_DEBUG_DUMP
 #undef XENNET_DEBUG
+
 #ifdef XENNET_DEBUG
 #define XEDB_FOLLOW 0x01
 #define XEDB_INIT   0x02
@@ -1171,7 +1172,7 @@ xennet_softstart(void *arg)
 	struct mbuf *m, *new_m;
 	netif_tx_request_t *txreq;
 	RING_IDX req_prod;
-	paddr_t pa, pa2;
+	paddr_t pa;
 	struct xennet_txreq *req;
 	int notify;
 	int do_notify = 0;
@@ -1290,9 +1291,13 @@ xennet_softstart(void *arg)
 		"mbuf %p, buf %p/%p/%p, size %d\n",
 		req->txreq_id, m, mtod(m, void *), (void *)pa,
 		(void *)xpmap_ptom_masked(pa), m->m_pkthdr.len));
+#ifdef XENNET_DEBUG
+		paddr_t pa2;
 		pmap_extract_ma(pmap_kernel(), mtod(m, vaddr_t), );
 		DPRINTFN(XEDB_MBUF, ("xennet_start pa %p ma %p/%p\n",
 		(void *)pa, (void *)xpmap_ptom_masked(pa), (void *)pa2));
+#endif
+
 #ifdef XENNET_DEBUG_DUMP
 		xennet_hex_dump(mtod(m, u_char *), m->m_pkthdr.len, "s",
 			   	req->txreq_id);