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

2021-03-25 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Mar 25 18:41:29 UTC 2021

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

Log Message:
zfs_ioctl.c: Drop WARNING that ZFS is under development

Following discussions on current-users@, it seems many rely on ZFS to
store data, and there are not particularly large issues with ZFS.  ATF
tests with /tmp as tmpfs, ffs2, and zfs are similar, with only a
slight increase in failures under zfs.

(This commit should probably NOT be pulled up to 9.)


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c

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

Modified files:

Index: src/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.22 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.23
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c:1.22	Fri Feb 28 03:52:26 2020
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c	Thu Mar 25 18:41:29 2021
@@ -7194,7 +7194,6 @@ zfs_modcmd(modcmd_t cmd, void *arg)
 		/* XXXNETBSD trim is not supported yet */
 		zfs_trim_enabled = B_FALSE;
 
-		printf("WARNING: ZFS on NetBSD is under development\n");
 		availrmem = (uint64_t)physmem * PAGE_SIZE / 1048576;
 		if (availrmem < ZFS_MIN_MEGS * 80 / 100) {
 			printf("ERROR: at least %dMB of memory required to "



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

2021-03-05 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Fri Mar  5 20:30:56 UTC 2021

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0

Log Message:
XEN3_DOM0: Approach GENERIC

When processed to remove comments, blank lines, normalize whitespace,
and sort/uniq (one line was previously duplicated), this file is
identical to the previous version.  It has been reorganized to reduce
diffs to GENERIC, and many missing lines from GENERIC have been added
but commented out.


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/sys/arch/amd64/conf/XEN3_DOM0

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/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.191 src/sys/arch/amd64/conf/XEN3_DOM0:1.192
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.191	Thu Mar  4 16:02:10 2021
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Fri Mar  5 20:30:56 2021
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.191 2021/03/04 16:02:10 gdt Exp $
+# $NetBSD: XEN3_DOM0,v 1.192 2021/03/05 20:30:56 gdt Exp $
 
 # XEN3_DOM0 machine description file
 #
@@ -14,7 +14,7 @@ include 	"arch/amd64/conf/std.xen"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"XEN3_DOM0-$Revision: 1.191 $"
+#ident		"XEN3_DOM0-$Revision: 1.192 $"
 
 maxusers	32		# estimated number of users
 
@@ -43,9 +43,20 @@ maxusers	32		# estimated number of users
 #options 	PHYSMEM_MAX_SIZE=64	# max size of physical memory (in MB)
 #options 	PHYSMEM_MAX_ADDR=2048	# don't use memory above this (in MB)
 
+## Replace std.amd64 content
+
+mainbus0 at root
+cpu* at mainbus?
+ioapic* at mainbus? apid ?
+
+# Atheros HAL options
+include "external/isc/atheros_hal/conf/std.ath_hal"
+
+## end std.amd64
+
 ## Xen-specific options
 
-options		XENPV		# PV dom0 support
+options 	XENPV		# PV dom0 support
 options 	DOM0OPS
 options 	MULTIPROCESSOR
 #options 	NO_PREEMPTION	# needed if MULTIPROCESSOR is disabled
@@ -58,10 +69,6 @@ options 	MULTIPROCESSOR
 # boot messages with MPBIOS, acpi and ioapic can be quite large
 options 	MSGBUFSIZE=24576
 
-# CPU features
-est0		at cpu0		# Intel Enhanced SpeedStep (non-ACPI)
-powernow0	at cpu0		# AMD PowerNow! and Cool'n'Quiet (non-ACPI)
-
 # Standard system options
 
 options 	INSECURE	# disable kernel security levels - X needs this
@@ -79,10 +86,20 @@ options 	SYSVSEM		# System V-like semaph
 options 	SYSVSHM		# System V-like memory sharing
 
 options 	MODULAR		# new style module(7) framework
+#options 	MODULAR_DEFAULT_AUTOLOAD
 options 	USERCONF	# userconf(4) support
 #options 	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
 options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
 
+# CPU features
+#acpicpu*	at cpu?		# ACPI CPU (including frequency scaling)
+#coretemp*	at cpu?		# Intel on-die thermal sensor
+est0		at cpu0		# Intel Enhanced SpeedStep (non-ACPI)
+#hyperv0 	at cpu0		# Microsoft Hyper-V
+#odcm0		at cpu0		# On-demand clock modulation
+powernow0	at cpu0		# AMD PowerNow! and Cool'n'Quiet (non-ACPI)
+#vmt0		at cpu0		# VMware Tools
+
 # Alternate buffer queue strategies for better responsiveness under high
 # disk I/O load.
 #options 	BUFQ_READPRIO
@@ -286,10 +303,6 @@ config		netbsd	root on ? type ?
 #
 
 ## Xen-specific options
-mainbus0 at root
-
-cpu* at mainbus?
-
 hypervisor*	at mainbus?		# Xen hypervisor
 
 vcpu*		at hypervisor?		# Xen virtual CPUs
@@ -306,8 +319,8 @@ ipmi_acpi*	at acpi?
 ipmi0		at ipmi_acpi?
 
 # ACPI will be used if present. If not it will fall back to MPBIOS
-acpi0		at hypervisor?		# ACPI access in PV mode
 acpi0		at mainbus?		# ACPI access in PVH(VM) mode
+acpi0		at hypervisor?		# ACPI access in PV mode
 
 options 	ACPI_SCANPCI		# find PCI roots using ACPI
 options 	MPBIOS			# configure CPUs and APICs using MPBIOS
@@ -322,8 +335,6 @@ options 	MPBIOS_SCANPCI		# MPBIOS config
 #options 	MPDEBUG			# MPBIOS configures PCI roots
 #options 	MPVERBOSE		# verbose MPBIOS autoconfig messages
 
-ioapic* 	at mainbus? apid ?
-
 # ACPI devices
 acpiacad*	at acpi?		# ACPI AC Adapter
 acpibat*	at acpi?		# ACPI Battery
@@ -343,30 +354,44 @@ acpitz* 	at acpi?		# ACPI Thermal Zone
 
 # Mainboard devices
 aibs*		at acpi?		# ASUSTeK AI Booster hardware monitor
+#asus*		at acpi?		# ASUS hotkeys
+#attimer*	at acpi?		# AT Timer
 #com*		at acpi?		# Serial communications interface
 #fdc*		at acpi?		# Floppy disk controller
+#fujbp*		at acpi?		# Fujitsu Brightness & Pointer
+#fujhk*		at acpi?		# Fujitsu Hotkeys
 #hpacel* 	at acpi?		# HP 3D DriveGuard accelerometer
-#hpqlb*		at acpi?		# HP Quick Launch Buttons
 hpqlb*		at acpi?		# HP Quick Launch Buttons
+#hpet*		at acpihpetbus?		# High Precision Event Timer (table)
+#hpet*		at acpinodebus?		# High Precision Event Timer (device)
+#joy*		at acpi?		# Joystick/Game port
+#lpt*		at acpi?		# Parallel port
+#mpu*		at acpi?		# Roland MPU-401 MIDI UART
 #lpt*		at acpi?		# Parallel port
 pckbc*		at acpi?		# PC keyboard controller
 pcppi*		at 

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

2021-03-05 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Fri Mar  5 20:18:39 UTC 2021

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

Log Message:
GENERIC: comment typo fix (spacing)


To generate a diff of this commit:
cvs rdiff -u -r1.585 -r1.586 src/sys/arch/amd64/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.585 src/sys/arch/amd64/conf/GENERIC:1.586
--- src/sys/arch/amd64/conf/GENERIC:1.585	Thu Mar  4 15:58:50 2021
+++ src/sys/arch/amd64/conf/GENERIC	Fri Mar  5 20:18:39 2021
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.585 2021/03/04 15:58:50 gdt Exp $
+# $NetBSD: GENERIC,v 1.586 2021/03/05 20:18:39 gdt 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.585 $"
+#ident		"GENERIC-$Revision: 1.586 $"
 
 maxusers	64		# estimated number of users
 
@@ -1133,7 +1133,7 @@ pseudo-device	ccd			# concatenated/strip
 pseudo-device	cgd			# cryptographic disk devices
 pseudo-device	raid			# RAIDframe disk driver
 options 	RAID_AUTOCONFIG		# auto-configuration of RAID components
-#Options to enable various other RAIDframe RAID types.
+# Options to enable various other RAIDframe RAID types.
 #options 	RF_INCLUDE_EVENODD=1
 #options 	RF_INCLUDE_RAID5_RS=1
 #options 	RF_INCLUDE_PARITYLOGGING=1



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

2021-03-04 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Mar  4 19:01:41 UTC 2021

Modified Files:
src/sys/arch/amd64/conf: std.xen

Log Message:
std.xen: Move towards std.amd64

(No functional change.)


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/amd64/conf/std.xen

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

Modified files:

Index: src/sys/arch/amd64/conf/std.xen
diff -u src/sys/arch/amd64/conf/std.xen:1.13 src/sys/arch/amd64/conf/std.xen:1.14
--- src/sys/arch/amd64/conf/std.xen:1.13	Sat Apr 25 15:26:16 2020
+++ src/sys/arch/amd64/conf/std.xen	Thu Mar  4 19:01:41 2021
@@ -1,20 +1,20 @@
-# $NetBSD: std.xen,v 1.13 2020/04/25 15:26:16 bouyer Exp $
-# NetBSD: std.i386,v 1.24 2003/02/26 21:33:36 fvdl Exp 
+# $NetBSD: std.xen,v 1.14 2021/03/04 19:01:41 gdt Exp $
 #
-# standard, required NetBSD/i386 'options'
+# standard, required NetBSD/xen 'options'
+# Note that this file is used by both DOM0 and DOMU.
 
 machine xen amd64 x86
 include 	"conf/std"	# MI standard options
-include		"arch/xen/conf/files.xen.pv"
-
-options 	XEN	#Xen support
-
-include		"arch/xen/conf/std.xenversion"
+include 	"arch/xen/conf/std.xenversion"
 
 options 	CPU_IN_CKSUM
 options 	EXEC_ELF64	# exec ELF binaries
 options 	EXEC_SCRIPT	# exec #! scripts
 options 	MTRR
+#options 	MULTIPROCESSOR
 
 options 	CHILD_MAX=1024	# 160 is too few
 options 	OPEN_MAX=1024	# 128 is too few
+
+options 	XEN		# Xen support
+include 	"arch/xen/conf/files.xen.pv"



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

2021-03-04 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Mar  4 16:02:11 UTC 2021

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0

Log Message:
XEN3_DOM0: Move closer to GENERIC (NFC)

This is another step in making XEN3_DOM0 closer to GENERIC.  It is
just reordering lines, adding commented out lines, and adding a few
comments.  (Test-booted with no dmesg change.)

This pass is showing cases where there are substantive and likely
undesired changes (e.g., UFS_ACL is not defined in XEN3_DOM0).  Often
I added them but commented them out to preserve the NFC property of
this commit.  My plan is to finish the easy NFC stuff first before
addressing functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 src/sys/arch/amd64/conf/XEN3_DOM0

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/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.190 src/sys/arch/amd64/conf/XEN3_DOM0:1.191
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.190	Wed Mar  3 12:31:19 2021
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Thu Mar  4 16:02:10 2021
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.190 2021/03/03 12:31:19 gdt Exp $
+# $NetBSD: XEN3_DOM0,v 1.191 2021/03/04 16:02:10 gdt Exp $
 
 # XEN3_DOM0 machine description file
 #
@@ -14,7 +14,7 @@ include 	"arch/amd64/conf/std.xen"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"XEN3_DOM0-$Revision: 1.190 $"
+#ident		"XEN3_DOM0-$Revision: 1.191 $"
 
 maxusers	32		# estimated number of users
 
@@ -80,6 +80,7 @@ options 	SYSVSHM		# System V-like memory
 
 options 	MODULAR		# new style module(7) framework
 options 	USERCONF	# userconf(4) support
+#options 	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
 options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
 
 # Alternate buffer queue strategies for better responsiveness under high
@@ -108,9 +109,55 @@ options 	DDB_HISTORY_SIZE=512	# enable h
 #options 	SYSCALL_STATS	# per syscall counts
 #options 	SYSCALL_TIMES	# per syscall times
 #options 	SYSCALL_TIMES_HASCOUNTER	# use 'broken' rdtsc (soekris)
+#options 	KDTRACE_HOOKS	# kernel DTrace hooks
+
+# Kernel Undefined Behavior Sanitizer (kUBSan).
+#options 	KUBSAN			# mandatory
+#options 	UBSAN_ALWAYS_FATAL	# optional: panic on all kUBSan reports
+
+# Kernel Address Sanitizer (kASan). You need to disable SVS to use it.
+# The quarantine is optional and can help KASAN find more use-after-frees.
+# Use KASAN_PANIC if you want panics instead of warnings.
+#makeoptions 	KASAN=1		# mandatory
+#options 	KASAN		# mandatory
+#no options	SVS		# mandatory
+#options 	POOL_QUARANTINE	# optional
+#options 	KASAN_PANIC	# optional
+
+# Kernel Concurrency Sanitizer (kCSan).
+#makeoptions 	KCSAN=1		# mandatory
+#options 	KCSAN		# mandatory
+#options 	KCSAN_PANIC	# optional
+
+# Kernel Memory Sanitizer (kMSan). You need to disable SVS and kernel modules
+# to use it. POOL_NOCACHE is optional and can help KMSAN find uninitialized
+# memory in pool caches. Note that KMSAN requires at least 4GB of RAM.
+#makeoptions 	KMSAN=1		# mandatory
+#options 	KMSAN		# mandatory
+#no options	SVS		# mandatory
+#no options 	MODULAR		# mandatory
+#no options 	MODULAR_DEFAULT_AUTOLOAD	# mandatory
+#options 	POOL_NOCACHE	# optional
+#options 	KMSAN_PANIC	# optional
+
+# Kernel Code Coverage Driver.
+#makeoptions	KCOV=1
+#options 	KCOV
+
+# Fault Injection Driver.
+#options 	FAULT
 
 # Compatibility options
+# x86_64 never shipped with a.out binaries; the two options below are
+# only relevant to 32-bit i386 binaries
+#options 	EXEC_AOUT	# required by binaries from before 1.5
+#options 	COMPAT_NOMID	# NetBSD 0.8, 386BSD, and BSDI
+
+# NetBSD backward compatibility. Support goes from COMPAT_15 up until
+# the latest release. Note that really old compat (< COMPAT_16) is only
+# useful for 32-bit i386 binaries.
 include 	"conf/compat_netbsd15.config"
+
 #options 	COMPAT_386BSD_MBRPART # recognize old partition ID
 
 options 	COMPAT_NETBSD32
@@ -128,17 +175,23 @@ options 	DKWEDGE_METHOD_APPLE	# Support 
 include "conf/filesystems.config"
 
 # File system options
+# ffs
 options 	QUOTA		# legacy UFS quotas
 options 	QUOTA2		# new, in-filesystem UFS quotas
-#options 	DISKLABEL_EI	# disklabel Endian Independent support
 #options 	FFS_EI		# FFS Endian Independent support
 options 	WAPBL		# File system journaling support
+# Note that UFS_DIRHASH is suspected of causing kernel memory corruption.
+# It is not recommended for general use.
 #options 	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
-options 	NFSSERVER	# Network File System server
+#options		UFS_ACL		# UFS Access Control Lists
 #options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 options 	UFS_EXTATTR	# Extended attribute support for UFS1
+# ext2fs
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
 # immutable) behave as system flags.
+# other
+#options 	DISKLABEL_EI	

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

2021-03-04 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Mar  4 15:58:50 UTC 2021

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

Log Message:
GENERIC: Tiny comment adjustment (NFC)

While making XEN3_DOM0 more like GENERIC, I noticed a few differences
where GENERIC was off -- trivial things like missing spaces in
comments, inconsistent comment workding.  This fixes those, both
because they are valid fixes in their own right once noticed, and to
make the diff to XEN smaller.


To generate a diff of this commit:
cvs rdiff -u -r1.584 -r1.585 src/sys/arch/amd64/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.584 src/sys/arch/amd64/conf/GENERIC:1.585
--- src/sys/arch/amd64/conf/GENERIC:1.584	Mon Mar  1 18:12:58 2021
+++ src/sys/arch/amd64/conf/GENERIC	Thu Mar  4 15:58:50 2021
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.584 2021/03/01 18:12:58 jakllsch Exp $
+# $NetBSD: GENERIC,v 1.585 2021/03/04 15:58:50 gdt 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.584 $"
+#ident		"GENERIC-$Revision: 1.585 $"
 
 maxusers	64		# estimated number of users
 
@@ -297,7 +297,7 @@ config		netbsd	root on ? type ?
 # Device configuration
 #
 
-#IPMI support
+# IPMI support
 ipmi0		at mainbus?
 ipmi_acpi*	at acpi?
 ipmi0		at ipmi_acpi?
@@ -307,7 +307,7 @@ acpi0		at mainbus0
 options 	ACPI_SCANPCI		# find PCI roots using ACPI
 options 	MPBIOS			# configure CPUs and APICs using MPBIOS
 options 	MPBIOS_SCANPCI		# MPBIOS configures PCI roots
-#options 	PCI_INTR_FIXUP		# PCI interrupt routing via ACPI
+#options 	PCI_INTR_FIXUP		# fixup PCI interrupt routing via ACPI
 #options 	PCI_BUS_FIXUP		# fixup PCI bus numbering
 #options 	PCI_ADDR_FIXUP		# fixup PCI I/O addresses
 #options 	ACPI_ACTIVATE_DEV	# If set, activate inactive devices
@@ -317,7 +317,7 @@ options 	VGA_POST		# in-kernel support f
 acpiacad*	at acpi?		# ACPI AC Adapter
 acpibat*	at acpi?		# ACPI Battery
 acpibut*	at acpi?		# ACPI Button
-acpidalb*	at acpi?		# Direct Application Launch Button
+acpidalb*	at acpi?		# ACPI Direct Application Launch Button
 acpiec* 	at acpi?		# ACPI Embedded Controller (late)
 acpiecdt*	at acpi?		# ACPI Embedded Controller (early)
 acpifan*	at acpi?		# ACPI Fan



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

2021-03-03 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Wed Mar  3 12:31:19 UTC 2021

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0

Log Message:
XEN3_DOM0: Move closer to GENERIC (NFC)

This commit reorders some lines, and brings in commented lines from
GENERIC to reduce the diff.  It also brings in two agp lines,
commented out, and with a warning that they are intentionally omitted.


To generate a diff of this commit:
cvs rdiff -u -r1.189 -r1.190 src/sys/arch/amd64/conf/XEN3_DOM0

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/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.189 src/sys/arch/amd64/conf/XEN3_DOM0:1.190
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.189	Tue Mar  2 18:10:31 2021
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Wed Mar  3 12:31:19 2021
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.189 2021/03/02 18:10:31 gdt Exp $
+# $NetBSD: XEN3_DOM0,v 1.190 2021/03/03 12:31:19 gdt Exp $
 
 # XEN3_DOM0 machine description file
 #
@@ -12,22 +12,48 @@
 
 include 	"arch/amd64/conf/std.xen"
 
-options		XENPV		# PV dom0 support
-options 	MULTIPROCESSOR
-#options 	NO_PREEMPTION	# needed if MULTIPROCESSOR is disabled
-
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#options 	UVMHIST
-#options 	UVMHIST_PRINT
-#options 	SYSCALL_DEBUG
-
-#ident		"XEN3_DOM0-$Revision: 1.189 $"
+#ident		"XEN3_DOM0-$Revision: 1.190 $"
 
 maxusers	32		# estimated number of users
 
-#
+# delay between "rebooting ..." message and hardware reset, in milliseconds
+#options 	CPURESET_DELAY=2000
+
+# This option allows you to force a serial console at the specified
+# I/O address.   see console(4) for details.
+#options 	CONSDEVNAME="\"com\"",CONADDR=0x2f8,CONSPEED=57600
+#	you don't want the option below ON iff you are using the
+#	serial console option of the new boot strap code.
+#options 	CONS_OVERRIDE	# Always use above! independent of boot info
+
+# The following options override the memory sizes passed in from the boot
+# block.  Use them *only* if the boot block is unable to determine the correct
+# values.  Note that the BIOS may *correctly* report less than 640k of base
+# memory if the extended BIOS data area is located at the top of base memory
+# (as is the case on most recent systems).
+#options 	REALBASEMEM=639		# size of base memory (in KB)
+#options 	REALEXTMEM=15360	# size of extended memory (in KB)
+
+# The following options limit the overall size of physical memory
+# and/or the maximum address used by the system.
+# Contrary to REALBASEMEM and REALEXTMEM, they still use the BIOS memory map
+# and can deal with holes in the memory layout.
+#options 	PHYSMEM_MAX_SIZE=64	# max size of physical memory (in MB)
+#options 	PHYSMEM_MAX_ADDR=2048	# don't use memory above this (in MB)
+
+## Xen-specific options
+
+options		XENPV		# PV dom0 support
 options 	DOM0OPS
+options 	MULTIPROCESSOR
+#options 	NO_PREEMPTION	# needed if MULTIPROCESSOR is disabled
+
+#options 	CONSDEVNAME="\"xencons\""
+#options 	CONS_OVERRIDE
+
+## end Xen-specific options
 
 # boot messages with MPBIOS, acpi and ioapic can be quite large
 options 	MSGBUFSIZE=24576
@@ -36,10 +62,7 @@ options 	MSGBUFSIZE=24576
 est0		at cpu0		# Intel Enhanced SpeedStep (non-ACPI)
 powernow0	at cpu0		# AMD PowerNow! and Cool'n'Quiet (non-ACPI)
 
-#options 	MTRR		# memory-type range register syscall support
-
-#options 	CONSDEVNAME="\"xencons\""
-#options 	CONS_OVERRIDE
+# Standard system options
 
 options 	INSECURE	# disable kernel security levels - X needs this
 
@@ -50,6 +73,7 @@ options 	KTRACE		# system call tracing v
 
 options 	CPU_UCODE	# cpu ucode loading support
 
+# Note: SysV IPC parameters could be changed dynamically, see sysctl(8).
 options 	SYSVMSG		# System V-like message queues
 options 	SYSVSEM		# System V-like semaphores
 options 	SYSVSHM		# System V-like memory sharing
@@ -65,15 +89,25 @@ options 	BUFQ_PRIOCSCAN
 
 # Diagnostic/debugging support options
 options 	DIAGNOSTIC	# inexpensive kernel consistency checks
+# XXX to be commented out on release branch
 #options 	DEBUG		# expensive debugging checks/support
+#options 	LOCKDEBUG	# expensive locking checks/support
+
+#
+# Because gcc omits the frame pointer for any -O level, the line below
+# is needed to make backtraces in DDB work.
+#
+makeoptions	COPTS="-O2 -fno-omit-frame-pointer"
 options 	DDB		# in-kernel debugger
+options		DDB_COMMANDONENTER="show registers"
 options 	DDB_ONPANIC=1	# see also sysctl(7): `ddb.onpanic'
 options 	DDB_HISTORY_SIZE=512	# enable history editing in DDB
 #options 	KGDB		# remote debugger
 #options 	KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x2f8,KGDB_DEVRATE=57600
 #makeoptions	DEBUG="-g"	# compile full symbol table
-makeoptions	COPTS="-O2 -fno-omit-frame-pointer"
-options DDB_COMMANDONENTER="show registers"
+#options 	SYSCALL_STATS	# per syscall counts
+#options 	SYSCALL_TIMES	# per syscall times
+#options 	

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

2021-03-02 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Tue Mar  2 18:10:31 UTC 2021

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0

Log Message:
XEN3_DOM0: Fix pckbc console attachment logic

Copy PCKBD_CNATTACH_MAY_FAIL lines from GENERIC to XEN3_DOM0.

GENERIC defines PCKBD_CNATTACH_MAY_FAIL, which means that an attempt
to activate console input on pckbc will fail if there is no keyboard
present.  This is a problem on semi-modern machines that have pckbc
silicon but not ports, and thus almost always have a USB keyboard
also.  What I suspect are bugs in console attachment logic lead to
attempting to attach a ukbd while there already is a console keyboard,
and with DIAGNOSTIC this is (properly) fatal, so XEN3_DOM0 blows up
with a USB keyboard in current, and probably not in 9.

Live tested on a machine that previously paniced on boot.


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/sys/arch/amd64/conf/XEN3_DOM0

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/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.188 src/sys/arch/amd64/conf/XEN3_DOM0:1.189
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.188	Tue Mar  2 18:06:12 2021
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Tue Mar  2 18:10:31 2021
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.188 2021/03/02 18:06:12 gdt Exp $
+# $NetBSD: XEN3_DOM0,v 1.189 2021/03/02 18:10:31 gdt Exp $
 
 # XEN3_DOM0 machine description file
 #
@@ -22,7 +22,7 @@ options 	INCLUDE_CONFIG_FILE	# embed con
 #options 	UVMHIST_PRINT
 #options 	SYSCALL_DEBUG
 
-#ident		"XEN3_DOM0-$Revision: 1.188 $"
+#ident		"XEN3_DOM0-$Revision: 1.189 $"
 
 maxusers	32		# estimated number of users
 
@@ -166,6 +166,8 @@ options 	WSDISPLAY_COMPAT_PCVT		# emulat
 options 	WSDISPLAY_COMPAT_SYSCONS	# emulate some ioctls
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
 options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
+# don't attach pckbd as the console if no PS/2 keyboard is found
+options 	PCKBD_CNATTACH_MAY_FAIL
 # see dev/pckbport/wskbdmap_mfii.c for implemented layouts
 #options 	PCKBD_LAYOUT="(KB_DE | KB_NODEAD)"
 # allocate a number of virtual screens at autoconfiguration time



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

2021-03-02 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Tue Mar  2 18:06:12 UTC 2021

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0

Log Message:
XEN3_DOM0: Sync VERBOSE with GENERIC

Copy the *VERBOSE option block from GENERIC, and prune the scattered
verbose options in XEN3_DOM0, surely dating from a time they were
copied from an earlier GENERIC.  This amounts to adding PCIVERBOSE and
SCSIVERBOSE, and the diff from GENERIC to DOM0 boots is markedly
reduced.


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/sys/arch/amd64/conf/XEN3_DOM0

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/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.187 src/sys/arch/amd64/conf/XEN3_DOM0:1.188
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.187	Mon Mar  1 13:52:50 2021
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Tue Mar  2 18:06:12 2021
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.187 2021/03/01 13:52:50 gdt Exp $
+# $NetBSD: XEN3_DOM0,v 1.188 2021/03/02 18:06:12 gdt Exp $
 
 # XEN3_DOM0 machine description file
 #
@@ -22,7 +22,7 @@ options 	INCLUDE_CONFIG_FILE	# embed con
 #options 	UVMHIST_PRINT
 #options 	SYSCALL_DEBUG
 
-#ident		"XEN3_DOM0-$Revision: 1.187 $"
+#ident		"XEN3_DOM0-$Revision: 1.188 $"
 
 maxusers	32		# estimated number of users
 
@@ -133,6 +133,17 @@ options 	PPP_FILTER	# Active filter supp
 #options 	ALTQ_RIO	# RED with IN/OUT
 #options 	ALTQ_WFQ	# Weighted Fair Queueing
 
+# These options enable verbose messages for several subsystems.
+# Warning, these may compile large string tables into the kernel!
+#options 	ACPIVERBOSE	# verbose ACPI configuration messages
+#options 	MIIVERBOSE	# verbose PHY autoconfig messages
+options 	PCIVERBOSE	# verbose PCI device autoconfig messages
+#options 	PCI_CONFIG_DUMP	# verbosely dump PCI config space
+#options 	PCMCIAVERBOSE	# verbose PCMCIA configuration messages
+options 	SCSIVERBOSE	# human readable SCSI error messages
+#options 	USBVERBOSE	# verbose USB device autoconfig messages
+#options 	HDAUDIOVERBOSE	# verbose HDAUDIO driver messages
+
 options 	NFS_BOOT_DHCP,NFS_BOOT_BOOTPARAM
 #options 	NFS_BOOT_BOOTSTATIC
 #options 	NFS_BOOTSTATIC_MYIP="\"169.254.1.2\""
@@ -197,8 +208,6 @@ acpi0		at mainbus?		# ACPI access in PVH
 #options 	ACPI_ACTIVATE_DEV	# If set, activate inactive devices
 options 	ACPI_SCANPCI		# find PCI roots using ACPI
 #options 	ACPICA_PEDANTIC		# force strict conformance to the Spec.
-#options 	ACPIVERBOSE		# verbose ACPI configuration messages
-#options 	MIIVERBOSE		# verbose PHY autoconfig messages
 options 	MPBIOS			# configure CPUs and APICs using MPBIOS
 #options 	MPDEBUG			# MPBIOS configures PCI roots
 #options 	MPVERBOSE		# verbose MPBIOS autoconfig messages
@@ -206,9 +215,6 @@ options 	MPBIOS_SCANPCI		# MPBIOS config
 #options 	PCI_ADDR_FIXUP		# fixup PCI I/O addresses
 #options 	PCI_BUS_FIXUP		# fixup PCI bus numbering
 #options 	PCI_INTR_FIXUP		# fixup PCI interrupt routing
-#options 	PCIVERBOSE		# verbose PCI device autoconfig messages
-#options 	USBVERBOSE		# verbose USB device autoconfig messages
-#options 	HDAUDIOVERBOSE		# verbose HDAUDIO driver messages
 
 ioapic* 	at mainbus? apid ?
 



CVS commit: src/sys/dev/usb

2021-03-01 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Tue Mar  2 00:18:22 UTC 2021

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

Log Message:
ukbd: GC some 20 year old code (NFC)

Long ago, code was improved to allow detaching keyboards that were the
console, but the old commen and panic() were #if 0'd instead of
removed.


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/dev/usb/ukbd.c

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

Modified files:

Index: src/sys/dev/usb/ukbd.c
diff -u src/sys/dev/usb/ukbd.c:1.148 src/sys/dev/usb/ukbd.c:1.149
--- src/sys/dev/usb/ukbd.c:1.148	Tue Mar  2 00:01:27 2021
+++ src/sys/dev/usb/ukbd.c	Tue Mar  2 00:18:22 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: ukbd.c,v 1.148 2021/03/02 00:01:27 gdt Exp $*/
+/*  $NetBSD: ukbd.c,v 1.149 2021/03/02 00:18:22 gdt Exp $*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.148 2021/03/02 00:01:27 gdt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.149 2021/03/02 00:18:22 gdt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -555,17 +555,6 @@ ukbd_detach(device_t self, int flags)
 	pmf_device_deregister(self);
 
 	if (sc->sc_console_keyboard) {
-#if 0
-		/*
-		 * XXX Should probably disconnect our consops,
-		 * XXX and either notify some other keyboard that
-		 * XXX it can now be the console, or if there aren't
-		 * XXX any more USB keyboards, set ukbd_is_console
-		 * XXX back to 1 so that the next USB keyboard attached
-		 * XXX to the system will get it.
-		 */
-		panic("ukbd_detach: console keyboard");
-#else
 		/*
 		 * Disconnect our consops and set ukbd_is_console
 		 * back to 1 so that the next USB keyboard attached
@@ -577,7 +566,6 @@ ukbd_detach(device_t self, int flags)
 		   device_xname(sc->sc_hdev.sc_dev));
 		wskbd_cndetach();
 		ukbd_is_console = 1;
-#endif
 	}
 	/* No need to do reference counting of ukbd, wskbd has all the goo. */
 	if (sc->sc_wskbddev != NULL)



CVS commit: src/sys/dev/usb

2021-03-01 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Tue Mar  2 00:01:27 UTC 2021

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

Log Message:
ukbd: Condition probe-time verbosity on USBVERBOSE

Previously, this driver switched on more verbose messages based on
DIAGNOSTIC.  But, the messages weren't about an impossible-to-reach
condition, just extra keys.  Change the condition to USBVERBOSE,
documented as serving this purpose.


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/dev/usb/ukbd.c

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

Modified files:

Index: src/sys/dev/usb/ukbd.c
diff -u src/sys/dev/usb/ukbd.c:1.147 src/sys/dev/usb/ukbd.c:1.148
--- src/sys/dev/usb/ukbd.c:1.147	Sat Sep 12 18:10:37 2020
+++ src/sys/dev/usb/ukbd.c	Tue Mar  2 00:01:27 2021
@@ -1,4 +1,4 @@
-/*  $NetBSD: ukbd.c,v 1.147 2020/09/12 18:10:37 macallan Exp $*/
+/*  $NetBSD: ukbd.c,v 1.148 2021/03/02 00:01:27 gdt Exp $*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.147 2020/09/12 18:10:37 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukbd.c,v 1.148 2021/03/02 00:01:27 gdt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -435,7 +435,7 @@ ukbd_attach(device_t parent, device_t se
 		sc->sc_flags = FLAG_GDIUM_FN;
 #endif
 
-#ifdef DIAGNOSTIC
+#ifdef USBVERBOSE
 	aprint_normal(": %d Variable keys, %d Array codes", sc->sc_nkeyloc,
 	   sc->sc_nkeycode);
 	if (sc->sc_flags & FLAG_APPLE_FN)



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

2021-03-01 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Mon Mar  1 13:52:50 UTC 2021

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0

Log Message:
amd64/conf/XEN3_DOM0: Add comment

This commit merely adds a comment explaining how XEN3_DOM0 ought to
relate to GENERIC.


To generate a diff of this commit:
cvs rdiff -u -r1.186 -r1.187 src/sys/arch/amd64/conf/XEN3_DOM0

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/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.186 src/sys/arch/amd64/conf/XEN3_DOM0:1.187
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.186	Wed Jan 20 13:22:08 2021
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Mon Mar  1 13:52:50 2021
@@ -1,4 +1,14 @@
-# $NetBSD: XEN3_DOM0,v 1.186 2021/01/20 13:22:08 nia Exp $
+# $NetBSD: XEN3_DOM0,v 1.187 2021/03/01 13:52:50 gdt Exp $
+
+# XEN3_DOM0 machine description file
+#
+# This machine description file is used to generate a kernel to be
+# used as a PV dom0 under Xen.  It is similar to GENERIC in that it is
+# intended to be useful for most applications.  Generally, besides
+# changes that are specifically required for Xen (e.g., XENPV), it
+# should be similar to GENERIC.  Some differences are currently
+# necessary, such as drivers that fail under Xen but work in GENERIC,
+# for reasons that do not follow from Xen architecture.
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -12,7 +22,7 @@ options 	INCLUDE_CONFIG_FILE	# embed con
 #options 	UVMHIST_PRINT
 #options 	SYSCALL_DEBUG
 
-#ident		"XEN3_DOM0-$Revision: 1.186 $"
+#ident		"XEN3_DOM0-$Revision: 1.187 $"
 
 maxusers	32		# estimated number of users
 



CVS commit: src

2020-03-25 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Wed Mar 25 18:08:34 UTC 2020

Modified Files:
src/lib/libc/sys: fdatasync.2
src/sys/kern: vfs_syscalls.c

Log Message:
Relax fdatasync restriction that fd be writable

The restriction that a fd passed to fdatasync(2) must be writable was
added in 2003 in order to comply with POSIX.  Since then, POSIX has
removed that requirement, and POSIX-valid programs have been therefore
encountering errors on NetBSD.

Patch by Paul Ripke after discussion on netbsd-users.  Issue
discovered with pkgsrc/databases/mongodb3 as used by pkgsrc/net/unifi.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libc/sys/fdatasync.2
cvs rdiff -u -r1.543 -r1.544 src/sys/kern/vfs_syscalls.c

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

Modified files:

Index: src/lib/libc/sys/fdatasync.2
diff -u src/lib/libc/sys/fdatasync.2:1.16 src/lib/libc/sys/fdatasync.2:1.17
--- src/lib/libc/sys/fdatasync.2:1.16	Wed Apr 30 13:10:51 2008
+++ src/lib/libc/sys/fdatasync.2	Wed Mar 25 18:08:34 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fdatasync.2,v 1.16 2008/04/30 13:10:51 martin Exp $
+.\"	$NetBSD: fdatasync.2,v 1.17 2020/03/25 18:08:34 gdt Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -68,7 +68,7 @@ function will fail if:
 .It Bq Er EBADF
 The
 .Fa fd
-argument is not a valid file descriptor open for writing.
+argument is not a valid file descriptor.
 .It Bq Er EINVAL
 This implementation does not support synchronized I/O for this file.
 .It Bq Er ENOSYS
@@ -93,4 +93,4 @@ and outstanding I/O operations are not g
 The
 .Fn fdatasync
 function conforms to
-.St -p1003.1b-93 .
+.St -p1003.1-2008 .

Index: src/sys/kern/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.543 src/sys/kern/vfs_syscalls.c:1.544
--- src/sys/kern/vfs_syscalls.c:1.543	Tue Mar  3 19:55:16 2020
+++ src/sys/kern/vfs_syscalls.c	Wed Mar 25 18:08:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls.c,v 1.543 2020/03/03 19:55:16 christos Exp $	*/
+/*	$NetBSD: vfs_syscalls.c,v 1.544 2020/03/25 18:08:34 gdt Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009, 2019, 2020 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.543 2020/03/03 19:55:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.544 2020/03/25 18:08:34 gdt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -4059,8 +4059,7 @@ sys_fsync(struct lwp *l, const struct sy
  * Sync a range of file data.  API modeled after that found in AIX.
  *
  * FDATASYNC indicates that we need only save enough metadata to be able
- * to re-read the written data.  Note we duplicate AIX's requirement that
- * the file be open for writing.
+ * to re-read the written data.
  */
 /* ARGSUSED */
 int
@@ -4141,10 +4140,6 @@ sys_fdatasync(struct lwp *l, const struc
 	/* fd_getvnode() will use the descriptor for us */
 	if ((error = fd_getvnode(SCARG(uap, fd), )) != 0)
 		return (error);
-	if ((fp->f_flag & FWRITE) == 0) {
-		fd_putfile(SCARG(uap, fd));
-		return (EBADF);
-	}
 	vp = fp->f_vnode;
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 	error = VOP_FSYNC(vp, fp->f_cred, FSYNC_WAIT|FSYNC_DATAONLY, 0, 0);



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

2018-07-04 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Wed Jul  4 13:32:01 UTC 2018

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

Log Message:
RPI: remove commented-out pseudodevices

Remove a number of commented out pseudodevice lines that are
duplicative with GENERIC.common.  Othewise, someone might think it
reasonable to uncomment or add them.

For now, a number of pseudodevices that are not in GENERIC.common
remain, pending comments on the larger-scale rototill.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/evbarm/conf/RPI

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

Modified files:

Index: src/sys/arch/evbarm/conf/RPI
diff -u src/sys/arch/evbarm/conf/RPI:1.82 src/sys/arch/evbarm/conf/RPI:1.83
--- src/sys/arch/evbarm/conf/RPI:1.82	Sun Jul  1 15:33:29 2018
+++ src/sys/arch/evbarm/conf/RPI	Wed Jul  4 13:32:01 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: RPI,v 1.82 2018/07/01 15:33:29 skrll Exp $
+#	$NetBSD: RPI,v 1.83 2018/07/04 13:32:01 gdt Exp $
 #
 #	RPi -- Raspberry Pi
 #
@@ -217,21 +217,11 @@ options 	WSDISPLAY_DEFAULTSCREENS=4
 #pseudo-device	carp			# Common Address Redundancy Protocol
 #pseudo-device	ipfilter		# IP filter (firewall) and NAT
 #pseudo-device	kttcp			# network loopback
-#pseudo-device	ppp			# Point-to-Point Protocol
-#pseudo-device	pppoe			# PPP over Ethernet (RFC 2516)
-#options 	PPPOE_SERVER		# Enable PPPoE server via link0
 #pseudo-device	sl			# Serial Line IP
 #pseudo-device	strip			# Starmode Radio IP (Metricom)
 #pseudo-device	irframetty		# IrDA frame line discipline
-#pseudo-device	tap			# virtual Ethernet
-#pseudo-device	tun			# network tunneling over tty
-#pseudo-device	gre			# generic L3 over IP tunnel
-#pseudo-device	gif			# IPv[46] over IPv[46] tunnel (RFC 1933)
 #pseudo-device	faith			# IPv[46] TCP relay translation i/f
 #pseudo-device	stf			# 6to4 IPv6 over IPv4 encapsulation
-#pseudo-device	vlan			# IEEE 802.1q encapsulation
-#pseudo-device	bridge			# simple inter-network bridging
-#options	BRIDGE_IPF		# bridge uses IP/IPv6 pfil hooks too
 #pseudo-device	agr			# IEEE 802.3ad link aggregation
 #pseudo-device	pf			# PF packet filter
 #pseudo-device	pflog			# PF log if



CVS commit: src/external/gpl3

2015-11-01 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Mon Nov  2 00:51:18 UTC 2015

Modified Files:
src/external/gpl3/gcc.old/dist/gcc: Makefile.in
src/external/gpl3/gcc/dist/gcc: Makefile.in

Log Message:
Use -f with cp.

When the source tree is 444 (as should be unremarkable), cp results in
object files that are 444, which when cp'd again without -f result in
an error.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc.old/dist/gcc/Makefile.in
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc/dist/gcc/Makefile.in

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

Modified files:

Index: src/external/gpl3/gcc.old/dist/gcc/Makefile.in
diff -u src/external/gpl3/gcc.old/dist/gcc/Makefile.in:1.3 src/external/gpl3/gcc.old/dist/gcc/Makefile.in:1.4
--- src/external/gpl3/gcc.old/dist/gcc/Makefile.in:1.3	Wed Sep 23 03:39:09 2015
+++ src/external/gpl3/gcc.old/dist/gcc/Makefile.in	Mon Nov  2 00:51:18 2015
@@ -1902,10 +1902,10 @@ gcc-nm.o: gcc-nm.c $(CONFIG_H) $(SYSTEM_
 # ??? the implicit rules dont trigger if the source file has a different name
 # so copy instead
 gcc-ranlib.c: gcc-ar.c
-	cp $^ $@
+	cp -f $^ $@
 
 gcc-nm.c: gcc-ar.c
-	cp $^ $@
+	cp -f $^ $@
 
 COLLECT2_OBJS = collect2.o collect2-aix.o tlink.o vec.o ggc-none.o file-find.o
 COLLECT2_LIBS = @COLLECT2_LIBS@

Index: src/external/gpl3/gcc/dist/gcc/Makefile.in
diff -u src/external/gpl3/gcc/dist/gcc/Makefile.in:1.10 src/external/gpl3/gcc/dist/gcc/Makefile.in:1.11
--- src/external/gpl3/gcc/dist/gcc/Makefile.in:1.10	Sun Jul 13 00:16:31 2014
+++ src/external/gpl3/gcc/dist/gcc/Makefile.in	Mon Nov  2 00:51:18 2015
@@ -1902,10 +1902,10 @@ gcc-nm.o: gcc-nm.c $(CONFIG_H) $(SYSTEM_
 # ??? the implicit rules dont trigger if the source file has a different name
 # so copy instead
 gcc-ranlib.c: gcc-ar.c
-	cp $^ $@
+	cp -f $^ $@
 
 gcc-nm.c: gcc-ar.c
-	cp $^ $@
+	cp -f $^ $@
 
 COLLECT2_OBJS = collect2.o collect2-aix.o tlink.o vec.o ggc-none.o file-find.o
 COLLECT2_LIBS = @COLLECT2_LIBS@



CVS commit: src/usr.sbin/mrouted

2015-02-05 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Feb  5 16:50:19 UTC 2015

Modified Files:
src/usr.sbin/mrouted: vif.c

Log Message:
Fix bug in mrouted about aging neighbors.

mrouted will periodically age its neighbors and will remove a neighbor
if it hasn't heard from it for NEIGHBOR_EXPIRE_TIME. Unfortunately, the
neighbor pointers 'a' and 'prev_a' were never advanced when timer was
not expired. Therefore it would get stuck in a tight loop, advancing
'al_timer' until it would be greater than NEIGHBOR_EXPIRE_TIME. This
caused the neighbor to allways get timed out and dropped. Furthermore,
there was a second bug in this loop when deleting an item that was not
at the head of the list (i.e., prev_a should stay the same instead of
advancing).

This bug fix is the work of Konrad Lorincz.  Bug found and fix made on
netbsd-6.

This material is based upon work supported by the Defense Advanced
Research Projects Agency and Space and Naval Warfare Systems Center,
Pacific, under Contract No. N66001-09-C-2073.  Any opinions, findings
and conclusions or recommendations expressed in this material are
those of the author(s) and do not necessarily reflect the views of the
Defense Advanced Research Project Agency and Space and Naval Warfare
Systems Center, Pacific.
Approved for Public Release, Distribution Unlimited


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/mrouted/vif.c

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

Modified files:

Index: src/usr.sbin/mrouted/vif.c
diff -u src/usr.sbin/mrouted/vif.c:1.18 src/usr.sbin/mrouted/vif.c:1.19
--- src/usr.sbin/mrouted/vif.c:1.18	Thu May 25 01:43:58 2006
+++ src/usr.sbin/mrouted/vif.c	Thu Feb  5 16:50:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vif.c,v 1.18 2006/05/25 01:43:58 christos Exp $	*/
+/*	$NetBSD: vif.c,v 1.19 2015/02/05 16:50:19 gdt Exp $	*/
 
 /*
  * The mrouted program is covered by the license in the accompanying file
@@ -1201,10 +1201,13 @@ age_vifs(void)
 		v-uv_flags |= VIFF_LEAF;
 	}
 
-	for (prev_a = a = v-uv_neighbors; a != NULL;) {
+	for (prev_a = NULL, a = v-uv_neighbors; a != NULL;) {
 
-	if ((a-al_timer += TIMER_INTERVAL)  NEIGHBOR_EXPIRE_TIME)
+	if ((a-al_timer += TIMER_INTERVAL)  NEIGHBOR_EXPIRE_TIME) {
+		prev_a = a;
+		a = a-al_next;
 		continue;
+	}
 
 	/*
 	 * Neighbor has expired; delete it from the neighbor list,
@@ -1213,14 +1216,14 @@ age_vifs(void)
 	 * another neighbor with a lower IP address than mine.
 	 */
 	addr = a-al_addr;
-	if (a == v-uv_neighbors) {
+	if (a == v-uv_neighbors) {	/* implies prev_a == NULL */
 		v-uv_neighbors = a-al_next;
 		free((char *)a);
-		prev_a = a = v-uv_neighbors;
+		a = v-uv_neighbors;	/* prev_a stays NULL */
 	} else {
 		prev_a-al_next = a-al_next;
 		free((char *)a);
-		prev_a = a = prev_a-al_next;
+		a = prev_a-al_next;	/* prev_a stays the same */
 	}
 
 	delete_neighbor_from_routes(addr, vifi);



CVS commit: src/share/man/man4

2014-12-31 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Wed Dec 31 18:14:55 UTC 2014

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

Log Message:
Explain RBUS_IO_BASE/SIZE.

See also kern/32327.

Adapted from a patch by Bj�rn Johannesson.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/share/man/man4/cardbus.4

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

Modified files:

Index: src/share/man/man4/cardbus.4
diff -u src/share/man/man4/cardbus.4:1.35 src/share/man/man4/cardbus.4:1.36
--- src/share/man/man4/cardbus.4:1.35	Wed Apr 25 04:14:03 2012
+++ src/share/man/man4/cardbus.4	Wed Dec 31 18:14:55 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: cardbus.4,v 1.35 2012/04/25 04:14:03 nakayama Exp $
+.\	$NetBSD: cardbus.4,v 1.36 2014/12/31 18:14:55 gdt Exp $
 .\
 .\ Copyright (c) 1999-2006 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 April 25, 2012
+.Dd December 31, 2014
 .Dt CARDBUS 4
 .Os
 .Sh NAME
@@ -183,9 +183,9 @@ driver appeared in
 .Sh BUGS
 .Ss Memory space conflicts
 .Nx
-maps memory on Cardbus and PCMCIA cards in order to access the cards
-(including reading CIS tuples on PCMCIA cards)
-and access the devices using the
+maps memory on Cardbus (and therefore PCMCIA cards behind Cardbus) in
+order to access the cards (including reading CIS tuples on PCMCIA
+cards) and access the devices using the
 .Tn RBUS
 abstraction.
 When the mapping does not work, PCMCIA cards are typically ignored on
@@ -204,3 +204,12 @@ models, including the IBM Thinkpad 600E 
 ARMADA M700:
 .Pp
 .Cd options RBUS_MIN_START=0x2000
+.Ss PCMCIA addressing choice
+By default, on i386, the kernel uses RBUS_IO_BASE as 0x4000 and
+RBUS_IO_SIZE as 0x2000.  On some machines, this fails, due to a
+requirement that these addresses fit within 12 bits.  The following
+kernel options have been reported as helpful:
+.Pp
+.Cd options RBUS_IO_BASE=0xa00
+.Pp
+.Cd options RBUS_IO_SIZE=0x00ff



CVS commit: src/share/man/man4

2014-12-31 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Wed Dec 31 18:16:32 UTC 2014

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

Log Message:
note that RBUS_IO_BASE issues are common to i386 and amd64


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/share/man/man4/cardbus.4

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

Modified files:

Index: src/share/man/man4/cardbus.4
diff -u src/share/man/man4/cardbus.4:1.36 src/share/man/man4/cardbus.4:1.37
--- src/share/man/man4/cardbus.4:1.36	Wed Dec 31 18:14:55 2014
+++ src/share/man/man4/cardbus.4	Wed Dec 31 18:16:32 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: cardbus.4,v 1.36 2014/12/31 18:14:55 gdt Exp $
+.\	$NetBSD: cardbus.4,v 1.37 2014/12/31 18:16:32 gdt Exp $
 .\
 .\ Copyright (c) 1999-2006 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -205,8 +205,8 @@ ARMADA M700:
 .Pp
 .Cd options RBUS_MIN_START=0x2000
 .Ss PCMCIA addressing choice
-By default, on i386, the kernel uses RBUS_IO_BASE as 0x4000 and
-RBUS_IO_SIZE as 0x2000.  On some machines, this fails, due to a
+By default, on i386 and amd64, the kernel uses RBUS_IO_BASE as 0x4000
+and RBUS_IO_SIZE as 0x2000.  On some machines, this fails, due to a
 requirement that these addresses fit within 12 bits.  The following
 kernel options have been reported as helpful:
 .Pp



CVS commit: src/distrib/macppc/floppies/ramdisk

2014-08-07 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Aug  7 15:48:19 UTC 2014

Modified Files:
src/distrib/macppc/floppies/ramdisk: Makefile

Log Message:
I need 2244k for src/distrib/macppc/floppies/ramdisk, rather than
2240k.  My build is normal, with a few uncommitted changes that really
shouldn't change the install situation.  Because 2240k isn't near a
magic boundary, just increase it a hair.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/distrib/macppc/floppies/ramdisk/Makefile

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

Modified files:

Index: src/distrib/macppc/floppies/ramdisk/Makefile
diff -u src/distrib/macppc/floppies/ramdisk/Makefile:1.43 src/distrib/macppc/floppies/ramdisk/Makefile:1.44
--- src/distrib/macppc/floppies/ramdisk/Makefile:1.43	Wed Aug  6 13:57:15 2014
+++ src/distrib/macppc/floppies/ramdisk/Makefile	Thu Aug  7 15:48:19 2014
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.43 2014/08/06 13:57:15 martin Exp $
+#	$NetBSD: Makefile,v 1.44 2014/08/07 15:48:19 gdt Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
 
 IMAGE=		ramdisk.fs
-IMAGESIZE=	2240k
+IMAGESIZE=	2244k
 MAKEFS_FLAGS=	-f 15
 
 WARNS=		1



CVS commit: src

2014-08-07 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Aug  7 16:51:57 UTC 2014

Modified Files:
src/distrib/macppc/floppies/ramdisk: Makefile
src/sys/arch/macppc/conf: GENERIC_MD INSTALL

Log Message:
Get macppc to build again by adjusting sizes.

In addition to the ramdisk size, it is necessary to have matching MD
sizes.  Increase the MD sizes, and leave a comment near the ramdisk
size to ease future changes.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/distrib/macppc/floppies/ramdisk/Makefile
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/macppc/conf/GENERIC_MD
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/macppc/conf/INSTALL

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

Modified files:

Index: src/distrib/macppc/floppies/ramdisk/Makefile
diff -u src/distrib/macppc/floppies/ramdisk/Makefile:1.44 src/distrib/macppc/floppies/ramdisk/Makefile:1.45
--- src/distrib/macppc/floppies/ramdisk/Makefile:1.44	Thu Aug  7 15:48:19 2014
+++ src/distrib/macppc/floppies/ramdisk/Makefile	Thu Aug  7 16:51:57 2014
@@ -1,10 +1,14 @@
-#	$NetBSD: Makefile,v 1.44 2014/08/07 15:48:19 gdt Exp $
+#	$NetBSD: Makefile,v 1.45 2014/08/07 16:51:57 gdt Exp $
 
 .include bsd.own.mk
 .include ${NETBSDSRCDIR}/distrib/common/Makefile.distrib
 
 IMAGE=		ramdisk.fs
-IMAGESIZE=	2244k
+# This must be kept in sync with config option MEMORY_DISK_ROOT_SIZE
+# in both
+#   src/sys/arch/macppc/conf/INSTALL
+#   src/sys/arch/macppc/conf/GENERIC_MD
+IMAGESIZE=	2248k
 MAKEFS_FLAGS=	-f 15
 
 WARNS=		1

Index: src/sys/arch/macppc/conf/GENERIC_MD
diff -u src/sys/arch/macppc/conf/GENERIC_MD:1.14 src/sys/arch/macppc/conf/GENERIC_MD:1.15
--- src/sys/arch/macppc/conf/GENERIC_MD:1.14	Wed Aug  6 14:23:53 2014
+++ src/sys/arch/macppc/conf/GENERIC_MD	Thu Aug  7 16:51:56 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: GENERIC_MD,v 1.14 2014/08/06 14:23:53 martin Exp $
+#	$NetBSD: GENERIC_MD,v 1.15 2014/08/07 16:51:56 gdt Exp $
 #
 # GENERIC_MD config file
 #
@@ -8,5 +8,5 @@ include arch/macppc/conf/GENERIC
 # Enable the hooks used for initializing the ram-disk.
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT	# Force root on ram-disk
-options 	MEMORY_DISK_ROOT_SIZE=4480	# 2240 KiB
+options 	MEMORY_DISK_ROOT_SIZE=4496	# 2248 KiB
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode

Index: src/sys/arch/macppc/conf/INSTALL
diff -u src/sys/arch/macppc/conf/INSTALL:1.121 src/sys/arch/macppc/conf/INSTALL:1.122
--- src/sys/arch/macppc/conf/INSTALL:1.121	Wed Aug  6 14:23:53 2014
+++ src/sys/arch/macppc/conf/INSTALL	Thu Aug  7 16:51:56 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL,v 1.121 2014/08/06 14:23:53 martin Exp $
+#	$NetBSD: INSTALL,v 1.122 2014/08/07 16:51:56 gdt Exp $
 #
 # config file for INSTALL FLOPPY
 #
@@ -17,7 +17,7 @@ options 	RTC_OFFSET=0	# hardware clock i
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT	# Force root on ram-disk
 options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support
-options 	MEMORY_DISK_ROOT_SIZE=4480	# 2240 KiB
+options 	MEMORY_DISK_ROOT_SIZE=4496	# 2248 KiB
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
 
 options 	USERCONF	# userconf(4) support



CVS commit: src/share/man/man4

2014-07-25 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Fri Jul 25 16:14:01 UTC 2014

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

Log Message:
Bump date for previous to avoid wizd(1) invocation.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/share/man/man4/ucom.4

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

Modified files:

Index: src/share/man/man4/ucom.4
diff -u src/share/man/man4/ucom.4:1.24 src/share/man/man4/ucom.4:1.25
--- src/share/man/man4/ucom.4:1.24	Fri Jul 25 16:13:21 2014
+++ src/share/man/man4/ucom.4	Fri Jul 25 16:14:01 2014
@@ -1,4 +1,4 @@
-.\ $NetBSD: ucom.4,v 1.24 2014/07/25 16:13:21 gdt Exp $
+.\ $NetBSD: ucom.4,v 1.25 2014/07/25 16:14:01 gdt Exp $
 .\
 .\ Copyright (c) 1999 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 April 17, 2014
+.Dd July 25, 2014
 .Dt UCOM 4
 .Os
 .Sh NAME



CVS commit: src

2014-07-25 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Fri Jul 25 16:13:21 UTC 2014

Modified Files:
src/share/man/man4: ucom.4
src/sys/dev/usb: ucom.c

Log Message:
Add PPS support to ucom(4).

This is basically cribbed from regular serial ports, and just adds
hooks to call the pps support routines.

Also, note in the ucom(4) man page that there is about 1 ms of
latency.  Discussed on tech-kern in October of 2013, with the only
concern being that someone who didn't know what they were doing might
set up a stratum 1 server, and that somehow might have worse
timekeeping than whatever else that person might have done; the man
page comment is a mitigation for this.

This patch has been live-tested in netbsd-5/i386 and netbsd-6/i386,
and has been running on machines without a USB-serial GPS device for
most of a year with no adverse consequences (very little happens if
the PPS ioctls are not invoked).


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/share/man/man4/ucom.4
cvs rdiff -u -r1.105 -r1.106 src/sys/dev/usb/ucom.c

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

Modified files:

Index: src/share/man/man4/ucom.4
diff -u src/share/man/man4/ucom.4:1.23 src/share/man/man4/ucom.4:1.24
--- src/share/man/man4/ucom.4:1.23	Thu Apr 17 17:50:21 2014
+++ src/share/man/man4/ucom.4	Fri Jul 25 16:13:21 2014
@@ -1,4 +1,4 @@
-.\ $NetBSD: ucom.4,v 1.23 2014/04/17 17:50:21 martin Exp $
+.\ $NetBSD: ucom.4,v 1.24 2014/07/25 16:13:21 gdt Exp $
 .\
 .\ Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -69,6 +69,12 @@ The
 .Va portno
 locator can be used to decide which port to use for device that have
 multiple external ports.
+.Pp
+Note that while
+.Nm
+supports the (undocumented) pulse-per-second API normally used on
+conventional serial ports, USB serial devices typically have a varying
+latency around 1 ms due to the USB frame structure.
 .Sh FILES
 .Bl -tag -width Pa
 .It Pa /dev/dtyU?

Index: src/sys/dev/usb/ucom.c
diff -u src/sys/dev/usb/ucom.c:1.105 src/sys/dev/usb/ucom.c:1.106
--- src/sys/dev/usb/ucom.c:1.105	Fri Jul 25 08:10:39 2014
+++ src/sys/dev/usb/ucom.c	Fri Jul 25 16:13:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucom.c,v 1.105 2014/07/25 08:10:39 dholland Exp $	*/
+/*	$NetBSD: ucom.c,v 1.106 2014/07/25 16:13:21 gdt Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ucom.c,v 1.105 2014/07/25 08:10:39 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: ucom.c,v 1.106 2014/07/25 16:13:21 gdt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -50,6 +50,7 @@ __KERNEL_RCSID(0, $NetBSD: ucom.c,v 1.1
 #include sys/poll.h
 #include sys/queue.h
 #include sys/kauth.h
+#include sys/timepps.h
 #include sys/rnd.h
 
 #include dev/usb/usb.h
@@ -141,6 +142,8 @@ struct ucom_softc {
 	int			sc_refcnt;
 	u_char			sc_dying;	/* disconnecting */
 
+	struct pps_state	sc_pps_state;	/* pps state */
+
 	krndsource_t	sc_rndsource;	/* random source */
 };
 
@@ -418,6 +421,13 @@ ucomopen(dev_t dev, int flag, int mode, 
 
 		ucom_status_change(sc);
 
+		/* Clear PPS capture state on first open. */
+		mutex_spin_enter(timecounter_lock);
+		memset(sc-sc_pps_state, 0, sizeof(sc-sc_pps_state));
+		sc-sc_pps_state.ppscap = PPS_CAPTUREASSERT | PPS_CAPTURECLEAR;
+		pps_init(sc-sc_pps_state);
+		mutex_spin_exit(timecounter_lock);
+
 		/*
 		 * Initialize the termios status to the defaults.  Add in the
 		 * sticky bits from TIOCSFLAGS.
@@ -775,6 +785,20 @@ ucom_do_ioctl(struct ucom_softc *sc, u_l
 		*(int *)data = ucom_to_tiocm(sc);
 		break;
 
+	case PPS_IOC_CREATE:
+	case PPS_IOC_DESTROY:
+	case PPS_IOC_GETPARAMS:
+	case PPS_IOC_SETPARAMS:
+	case PPS_IOC_GETCAP:
+	case PPS_IOC_FETCH:
+#ifdef PPS_SYNC
+	case PPS_IOC_KCBIND:
+#endif
+		mutex_spin_enter(timecounter_lock);
+		error = pps_ioctl(cmd, data, sc-sc_pps_state);
+		mutex_spin_exit(timecounter_lock);
+		break;
+
 	default:
 		error = EPASSTHROUGH;
 		break;
@@ -888,9 +912,18 @@ ucom_status_change(struct ucom_softc *sc
 		old_msr = sc-sc_msr;
 		sc-sc_methods-ucom_get_status(sc-sc_parent, sc-sc_portno,
 		sc-sc_lsr, sc-sc_msr);
-		if (ISSET((sc-sc_msr ^ old_msr), UMSR_DCD))
+		if (ISSET((sc-sc_msr ^ old_msr), UMSR_DCD)) {
+			mutex_spin_enter(timecounter_lock);
+			pps_capture(sc-sc_pps_state);
+			pps_event(sc-sc_pps_state,
+			(sc-sc_msr  UMSR_DCD) ?
+			PPS_CAPTUREASSERT :
+			PPS_CAPTURECLEAR);
+			mutex_spin_exit(timecounter_lock);
+
 			(*tp-t_linesw-l_modem)(tp,
 			ISSET(sc-sc_msr, UMSR_DCD));
+		}
 	} else {
 		sc-sc_lsr = 0;
 		/* Assume DCD is present, if we have no chance to check it. */



CVS commit: src/share/man/man4

2014-07-23 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Wed Jul 23 20:13:13 UTC 2014

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

Log Message:
Sync DIAGNOSTIC performance comments with historical reality.

Somehow, options(4) ended up with a bizarre claim that DIAGNOSTIC can
reduce performance by 15%.  While that might have been true at some
isolated point due to a bug, it's an outlier.  Since at least 2BSD,
DIAGNOSTIC has added asserts, resulting in at most
difficult-to-perceived performance degredation, and many people have
been running production systems (meaning systems they intend to use,
rather than debugging targets) with this option.(The decision a
while ago to enable DIAGNOSTIC in -current's GENERIC reflects this; if
it really were a 15% hit such enabling by default would be unreasonable.)


To generate a diff of this commit:
cvs rdiff -u -r1.437 -r1.438 src/share/man/man4/options.4

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

Modified files:

Index: src/share/man/man4/options.4
diff -u src/share/man/man4/options.4:1.437 src/share/man/man4/options.4:1.438
--- src/share/man/man4/options.4:1.437	Sun Mar 23 00:50:20 2014
+++ src/share/man/man4/options.4	Wed Jul 23 20:13:13 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: options.4,v 1.437 2014/03/23 00:50:20 dholland Exp $
+.\	$NetBSD: options.4,v 1.438 2014/07/23 20:13:13 gdt Exp $
 .\
 .\ Copyright (c) 1996
 .\ 	Perry E. Metzger.  All rights reserved.
@@ -604,11 +604,18 @@ Note that many parts of the kernel (typi
 conditionals instead.
 This option also turns on certain other options,
 which may decrease system performance.
+Systems with this option are not suitable for regular use, and are
+intended only for debugging or looking for bugs.
 .It Cd options DIAGNOSTIC
 Adds code to the kernel that does internal consistency checks.
 This code will cause the kernel to panic if corruption of internal data
 structures is detected.
-These checks can decrease performance up to 15%.
+Historically, the performance degredation is sufficiently small that
+it is reasonable for systems with
+.Em options DIAGNOSTIC
+to be in production use, with the real consideration not being
+performance but instead a preference for more panics versus continued
+operation with undetected problems.
 .It Cd options LOCKDEBUG
 Adds code to the kernel to detect incorrect use of locking primitives
 (mutex, rwlock).



CVS commit: src/share/man/man7

2014-06-02 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Mon Jun  2 19:17:08 UTC 2014

Modified Files:
src/share/man/man7: tests.kyua.7

Log Message:
Add test environment considerations from tests.atf.7.

Bump date in an attempt to avoid provoking wizd(1).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man7/tests.kyua.7

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

Modified files:

Index: src/share/man/man7/tests.kyua.7
diff -u src/share/man/man7/tests.kyua.7:1.3 src/share/man/man7/tests.kyua.7:1.4
--- src/share/man/man7/tests.kyua.7:1.3	Tue Mar 18 18:20:40 2014
+++ src/share/man/man7/tests.kyua.7	Mon Jun  2 19:17:08 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: tests.kyua.7,v 1.3 2014/03/18 18:20:40 riastradh Exp $
+.\	$NetBSD: tests.kyua.7,v 1.4 2014/06/02 19:17:08 gdt Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -25,7 +25,7 @@
 .\ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd February 24, 2013
+.Dd June 2, 2014
 .Dt TESTS 7
 .Os
 .Sh NAME
@@ -138,6 +138,21 @@ $ kyua report-html --output ~/public_htm
 For further details on the command-line interface of Kyua, please refer
 to its manual page
 .Xr kyua 1 .
+.Ss Test environment considerations
+Tests can be invoked as an unprivileged user, in which case tests that
+require privileges will be skipped.
+If run as root, an unprivileged user will be used for tests that
+require privileges.
+For maximal coverage, the standard approach is to invoke tests as root.
+.Pp
+Ideally, tests are self-contained and do not either depend on or
+perturb the host environment, aside from skipping tests when optional
+facilities are not available.
+In reality, tests load and unload modules, and do other things that
+might cause problems.
+While it is not entirely safe to run tests on a multi-user system,
+permanent problems or crashes from doing so are viewed as bugs and
+should be reported.
 .Ss Configuring the tests
 Some test cases in the
 .Nx



CVS commit: src/share/man/man7

2014-05-20 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Tue May 20 14:23:43 UTC 2014

Modified Files:
src/share/man/man7: tests.atf.7

Log Message:
Explain that tests should be run as root, and that in theory it's ok
to run them multiuser.

Discussed on current-users with in put from martin@ and gson@.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man7/tests.atf.7

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

Modified files:

Index: src/share/man/man7/tests.atf.7
diff -u src/share/man/man7/tests.atf.7:1.3 src/share/man/man7/tests.atf.7:1.4
--- src/share/man/man7/tests.atf.7:1.3	Tue Mar 18 18:20:40 2014
+++ src/share/man/man7/tests.atf.7	Tue May 20 14:23:43 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: tests.atf.7,v 1.3 2014/03/18 18:20:40 riastradh Exp $
+.\	$NetBSD: tests.atf.7,v 1.4 2014/05/20 14:23:43 gdt Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -143,6 +143,21 @@ see
 .Xr atf-test-program 1
 for more details, but be aware that you should only be doing this if you are
 debugging failing tests.
+.Ss Test environment considerations
+Tests can be invoked as an unprivileged user, in which case tests that
+require privileges will be skipped.
+If run as root, an unprivileged user will be used for tests that
+require privileges.
+For maximal coverage, the standard approach is to invoke tests as root.
+.Pp
+Ideally, tests are self-contained and do not either depend on or
+perturb the host environment, aside from skipping tests when optional
+facilities are not available.
+In reality, tests load and unload modules, and do other things that
+might cause problems.
+While it is not entirely safe to run tests on a multi-user system,
+permanent problems or crashes from doing so are viewed as bugs and
+should be reported.
 .Ss Configuring the tests
 Some test cases in the
 .Nx



CVS commit: src/external/gpl3/gcc/lib/libstdc++-v3/include/bits

2014-03-13 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Mar 13 16:14:27 UTC 2014

Modified Files:
src/external/gpl3/gcc/lib/libstdc++-v3/include/bits: Makefile

Log Message:
Use cp -pf rather than cp -p.

Otherwise, those with sources that are 444 encounter failures.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gcc/lib/libstdc++-v3/include/bits/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/lib/libstdc++-v3/include/bits/Makefile
diff -u src/external/gpl3/gcc/lib/libstdc++-v3/include/bits/Makefile:1.13 src/external/gpl3/gcc/lib/libstdc++-v3/include/bits/Makefile:1.14
--- src/external/gpl3/gcc/lib/libstdc++-v3/include/bits/Makefile:1.13	Sun Mar  2 04:31:55 2014
+++ src/external/gpl3/gcc/lib/libstdc++-v3/include/bits/Makefile	Thu Mar 13 16:14:27 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2014/03/02 04:31:55 mrg Exp $
+#	$NetBSD: Makefile,v 1.14 2014/03/13 16:14:27 gdt Exp $
 
 .include bsd.own.mk
 .include bsd.init.mk
@@ -52,7 +52,7 @@ COPYHEADERS+=	${_dst} ${_src}
 
 .for _h _s in ${COPYHEADERS}
 ${_h}: ${_s}
-	cp -p ${.ALLSRC} ${.TARGET}
+	cp -pf ${.ALLSRC} ${.TARGET}
 .endfor
 
 .PATH: ${.CURDIR}/../../arch/${GCC_MACHINE_ARCH} \



CVS commit: src/external/gpl3/gcc/usr.bin/include

2014-03-13 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Mar 13 16:19:24 UTC 2014

Modified Files:
src/external/gpl3/gcc/usr.bin/include: Makefile

Log Message:
Use -f with cp, for 444 sources.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/usr.bin/include/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/usr.bin/include/Makefile
diff -u src/external/gpl3/gcc/usr.bin/include/Makefile:1.6 src/external/gpl3/gcc/usr.bin/include/Makefile:1.7
--- src/external/gpl3/gcc/usr.bin/include/Makefile:1.6	Sat Mar  1 10:00:52 2014
+++ src/external/gpl3/gcc/usr.bin/include/Makefile	Thu Mar 13 16:19:24 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6 2014/03/01 10:00:52 mrg Exp $
+#	$NetBSD: Makefile,v 1.7 2014/03/13 16:19:24 gdt Exp $
 
 .include ../Makefile.inc
 
@@ -15,7 +15,7 @@ INCS+=	mm_malloc.h
 # XXX we should put this in gcc/config.gcc and regenerate the i386/x86
 # mknative files
 mm_malloc.h: ${DIST}/gcc/config/i386/pmm_malloc.h
-	cp $ ${.TARGET}
+	cp -f $ ${.TARGET}
 
 CLEANFILES+=	mm_malloc.h
 .endif



CVS commit: src/external/lgpl3/gmp/lib/libgmp

2013-12-18 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Dec 19 01:07:03 UTC 2013

Modified Files:
src/external/lgpl3/gmp/lib/libgmp: Makefile

Log Message:
When copying an .OBJDIR file, rm -f first.

Arguably there should be some general mechanism, but there isn't yet,
and I hit a build failure at

cp ${.CURDIR}/arch/${GMP_MACHINE_ARCH}/config.m4 ${.OBJDIR}/config.m4

because my source tree is mode 444, and hence my previously-copied
config.m4 was too.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/lgpl3/gmp/lib/libgmp/Makefile

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

Modified files:

Index: src/external/lgpl3/gmp/lib/libgmp/Makefile
diff -u src/external/lgpl3/gmp/lib/libgmp/Makefile:1.23 src/external/lgpl3/gmp/lib/libgmp/Makefile:1.24
--- src/external/lgpl3/gmp/lib/libgmp/Makefile:1.23	Wed Dec  4 00:57:21 2013
+++ src/external/lgpl3/gmp/lib/libgmp/Makefile	Thu Dec 19 01:07:03 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.23 2013/12/04 00:57:21 mrg Exp $
+#	$NetBSD: Makefile,v 1.24 2013/12/19 01:07:03 gdt Exp $
 
 .include bsd.init.mk
 
@@ -212,7 +212,7 @@ CLEANFILES+=	${DPSRCS} gen-fac gen-fib g
 dummy:
 	mkdir dummy
 ${.OBJDIR}/config.m4: ${.CURDIR}/arch/${GMP_MACHINE_ARCH}/config.m4
-	cp ${.CURDIR}/arch/${GMP_MACHINE_ARCH}/config.m4 ${.OBJDIR}/config.m4
+	rm -f ${.OBJDIR}/config.m4  cp ${.CURDIR}/arch/${GMP_MACHINE_ARCH}/config.m4 ${.OBJDIR}/config.m4
 
 CLEANFILES+=	config.m4
 clean: cleandummy



CVS commit: src/external/lgpl3/mpfr/lib/libmpfr

2013-12-18 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Dec 19 01:10:19 UTC 2013

Modified Files:
src/external/lgpl3/mpfr/lib/libmpfr: Makefile

Log Message:
rm -f an .objdir file before copying to it.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/lgpl3/mpfr/lib/libmpfr/Makefile

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

Modified files:

Index: src/external/lgpl3/mpfr/lib/libmpfr/Makefile
diff -u src/external/lgpl3/mpfr/lib/libmpfr/Makefile:1.15 src/external/lgpl3/mpfr/lib/libmpfr/Makefile:1.16
--- src/external/lgpl3/mpfr/lib/libmpfr/Makefile:1.15	Thu Nov 28 12:36:55 2013
+++ src/external/lgpl3/mpfr/lib/libmpfr/Makefile	Thu Dec 19 01:10:19 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.15 2013/11/28 12:36:55 mrg Exp $
+#	$NetBSD: Makefile,v 1.16 2013/12/19 01:10:19 gdt Exp $
 
 .include bsd.init.mk
 
@@ -511,7 +511,7 @@ WITHOUT_MAN=	yes
 .include bsd.lib.mk
 
 mparam.h: mparam_h.in
-	cp ${.ALLSRC} ${.TARGET}
+	rm -f ${.TARGET}  cp ${.ALLSRC} ${.TARGET}
 
 ${SRCS}: mparam.h
 CLEANFILES+= mparam.h



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

2013-11-04 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Tue Nov  5 02:32:12 UTC 2013

Modified Files:
src/external/gpl3/gdb/lib/libsim: Makefile

Log Message:
Use -f with cp to cope with nonwritable files in .


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/lib/libsim/Makefile

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

Modified files:

Index: src/external/gpl3/gdb/lib/libsim/Makefile
diff -u src/external/gpl3/gdb/lib/libsim/Makefile:1.2 src/external/gpl3/gdb/lib/libsim/Makefile:1.3
--- src/external/gpl3/gdb/lib/libsim/Makefile:1.2	Sun Aug  4 23:41:43 2013
+++ src/external/gpl3/gdb/lib/libsim/Makefile	Tue Nov  5 02:32:12 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2013/08/04 23:41:43 matt Exp $
+#	$NetBSD: Makefile,v 1.3 2013/11/05 02:32:12 gdt Exp $
 
 LIBISPRIVATE=	yes
 NOGCCERROR=
@@ -202,11 +202,11 @@ DPSRCS+= ${DEFINES_H}
 
 # misc. dependancies.
 filter_host.c: ${DIST}/sim/ppc/filter_filename.c
-	cp ${.ALLSRC} ${.TARGET}
+	cp -f ${.ALLSRC} ${.TARGET}
 filter_host.lo: ppc-config.h
 
 ppc-config.h: ${DIST}/sim/ppc/std-config.h
-	cp ${.ALLSRC} ${.TARGET}
+	cp -f ${.ALLSRC} ${.TARGET}
 DPSRCS+= ppc-config.h
 
 CLEANFILES+=	igen dgen gentmap *.lo \



CVS commit: src/share/man/man7

2013-07-31 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Wed Jul 31 11:57:24 UTC 2013

Modified Files:
src/share/man/man7: Makefile

Log Message:
Remove tests.7 in objdir before copying to it.

If one's source tree has non-writable files (because of CVSREAD=t, or
someone else owns it, or it's on some read-only filesystems, some
other reason), recently-added makefile code would cp tests.foo.7 in
the sources to tests.7 in objdir, preserving permissions, but not
forcing the copy.  A subsequent copy would result in an error, failing
the build.  Therefore, rm -f the target file before doing the copy.

(Arguably there should some standard support for this, but copying
files from the source directory to objdir is quite unusual.)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/share/man/man7/Makefile

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

Modified files:

Index: src/share/man/man7/Makefile
diff -u src/share/man/man7/Makefile:1.29 src/share/man/man7/Makefile:1.30
--- src/share/man/man7/Makefile:1.29	Mon Feb 25 02:02:41 2013
+++ src/share/man/man7/Makefile	Wed Jul 31 11:57:24 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.29 2013/02/25 02:02:41 jmmv Exp $
+#	$NetBSD: Makefile,v 1.30 2013/07/31 11:57:24 gdt Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/5/93
 
 .include bsd.init.mk
@@ -13,10 +13,10 @@ MAN=	ascii.7 c.7 environ.7 glob.7 hier.7
 CLEANFILES=	tests.7
 .if ${MKKYUA} != no
 tests.7: tests.kyua.7
-	cp ${.ALLSRC} ${.TARGET}
+	rm -f ${.TARGET}  cp ${.ALLSRC} ${.TARGET}
 .else
 tests.7: tests.atf.7
-	cp ${.ALLSRC} ${.TARGET}
+	rm -f ${.TARGET}  cp ${.ALLSRC} ${.TARGET}
 .endif
 
 MLINKS+=c.7 c78.7 \



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

2013-07-06 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Sat Jul  6 12:03:11 UTC 2013

Modified Files:
src/sys/arch/x86/x86: cpu_ucode.c cpu_ucode_amd.c

Log Message:
Add #endif comments (only).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x86/x86/cpu_ucode.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/x86/cpu_ucode_amd.c

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

Modified files:

Index: src/sys/arch/x86/x86/cpu_ucode.c
diff -u src/sys/arch/x86/x86/cpu_ucode.c:1.3 src/sys/arch/x86/x86/cpu_ucode.c:1.4
--- src/sys/arch/x86/x86/cpu_ucode.c:1.3	Wed Oct 17 20:19:55 2012
+++ src/sys/arch/x86/x86/cpu_ucode.c	Sat Jul  6 12:03:11 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode.c,v 1.3 2012/10/17 20:19:55 drochner Exp $ */
+/* $NetBSD: cpu_ucode.c,v 1.4 2013/07/06 12:03:11 gdt Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu_ucode.c,v 1.3 2012/10/17 20:19:55 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_ucode.c,v 1.4 2013/07/06 12:03:11 gdt Exp $);
 
 #include opt_cpu_ucode.h
 #include opt_compat_netbsd.h
@@ -77,7 +77,7 @@ compat6_cpu_ucode_get_version(struct com
 
 	return 0;
 }
-#endif
+#endif /* COMPAT60 */
 
 int
 cpu_ucode_md_open(firmware_handle_t *fwh, int loader_version, const char *fwname)
@@ -145,4 +145,4 @@ compat6_cpu_ucode_apply(const struct com
 	sc-sc_blobsize = 0;
 	return error;
 }
-#endif
+#endif /* COMPAT60 */

Index: src/sys/arch/x86/x86/cpu_ucode_amd.c
diff -u src/sys/arch/x86/x86/cpu_ucode_amd.c:1.5 src/sys/arch/x86/x86/cpu_ucode_amd.c:1.6
--- src/sys/arch/x86/x86/cpu_ucode_amd.c:1.5	Wed Oct 17 20:19:55 2012
+++ src/sys/arch/x86/x86/cpu_ucode_amd.c	Sat Jul  6 12:03:11 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode_amd.c,v 1.5 2012/10/17 20:19:55 drochner Exp $ */
+/* $NetBSD: cpu_ucode_amd.c,v 1.6 2013/07/06 12:03:11 gdt Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu_ucode_amd.c,v 1.5 2012/10/17 20:19:55 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_ucode_amd.c,v 1.6 2013/07/06 12:03:11 gdt Exp $);
 
 #include opt_xen.h
 #include opt_cpu_ucode.h
@@ -129,7 +129,7 @@ compat6_cpu_ucode_amd_get_version(struct
 	ucode-version = uclevel;
 	return 0;
 }
-#endif
+#endif /* COMPAT60 */
 
 int
 cpu_ucode_amd_firmware_open(firmware_handle_t *fwh, const char *fwname)
@@ -324,4 +324,4 @@ err0:
 	kmem_free(mc.mc_amd, sizeof(*mc.mc_amd));
 	return error;
 }
-#endif
+#endif /* ! XEN */



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

2013-07-06 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Sat Jul  6 12:06:24 UTC 2013

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

Log Message:
Add #endif comments.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/xen/xen/xen_ucode.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/xen_ucode.c
diff -u src/sys/arch/xen/xen/xen_ucode.c:1.3 src/sys/arch/xen/xen/xen_ucode.c:1.4
--- src/sys/arch/xen/xen/xen_ucode.c:1.3	Wed Oct 17 20:19:55 2012
+++ src/sys/arch/xen/xen/xen_ucode.c	Sat Jul  6 12:06:24 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ucode.c,v 1.3 2012/10/17 20:19:55 drochner Exp $ */
+/* $NetBSD: xen_ucode.c,v 1.4 2013/07/06 12:06:24 gdt Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xen_ucode.c,v 1.3 2012/10/17 20:19:55 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: xen_ucode.c,v 1.4 2013/07/06 12:06:24 gdt Exp $);
 
 #include opt_cpu_ucode.h
 #include opt_compat_netbsd.h
@@ -77,7 +77,7 @@ compat6_cpu_ucode_get_version(struct com
 
 	return 0;
 }
-#endif
+#endif /* COMPAT_60 */
 
 int
 cpu_ucode_md_open(firmware_handle_t *fwh, int loader_version, const char *fwname)
@@ -146,4 +146,4 @@ compat6_cpu_ucode_apply(const struct com
 	sc-sc_blobsize = 0;
 	return error;
 }
-#endif
+#endif /* COMPAT_60 */



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

2013-07-06 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Sat Jul  6 12:11:54 UTC 2013

Modified Files:
src/sys/arch/x86/x86: cpu_ucode_intel.c

Log Message:
#endif comments


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/x86/cpu_ucode_intel.c

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

Modified files:

Index: src/sys/arch/x86/x86/cpu_ucode_intel.c
diff -u src/sys/arch/x86/x86/cpu_ucode_intel.c:1.2 src/sys/arch/x86/x86/cpu_ucode_intel.c:1.3
--- src/sys/arch/x86/x86/cpu_ucode_intel.c:1.2	Wed Oct 17 20:19:55 2012
+++ src/sys/arch/x86/x86/cpu_ucode_intel.c	Sat Jul  6 12:11:54 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode_intel.c,v 1.2 2012/10/17 20:19:55 drochner Exp $ */
+/* $NetBSD: cpu_ucode_intel.c,v 1.3 2013/07/06 12:11:54 gdt Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu_ucode_intel.c,v 1.2 2012/10/17 20:19:55 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_ucode_intel.c,v 1.3 2013/07/06 12:11:54 gdt Exp $);
 
 #include opt_xen.h
 #include opt_cpu_ucode.h
@@ -150,4 +150,4 @@ cpu_ucode_intel_apply(struct cpu_ucode_s
 
 	return 0;
 }
-#endif
+#endif /* ! XEN */



CVS commit: src/sys/conf

2013-06-10 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Mon Jun 10 20:08:35 UTC 2013

Modified Files:
src/sys/conf: files

Log Message:
Drop references to kame_ipsec, which has been gone for a while.


To generate a diff of this commit:
cvs rdiff -u -r1.1071 -r1.1072 src/sys/conf/files

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1071 src/sys/conf/files:1.1072
--- src/sys/conf/files:1.1071	Sun May 26 18:07:42 2013
+++ src/sys/conf/files	Mon Jun 10 20:08:35 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1071 2013/05/26 18:07:42 kardel Exp $
+#	$NetBSD: files,v 1.1072 2013/06/10 20:08:35 gdt Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20100430
@@ -1702,7 +1702,7 @@ file	net/route.c
 file	net/rtbl.c
 file	net/rtsock.c
 file	net/slcompress.c		sl | ppp | strip | (irip  irip_vj)
-file	net/zlib.c			(ppp  ppp_deflate) | kame_ipsec | opencrypto | vnd_compression
+file	net/zlib.c			(ppp  ppp_deflate) | opencrypto | vnd_compression
 file	netinet/accf_data.c		accf_data
 file	netinet/accf_http.c		accf_http
 file	netinet/cpu_in_cksum.c		(inet | inet6)  !cpu_in_cksum
@@ -1712,7 +1712,7 @@ file	netinet/in4_cksum.c		inet
 file	netinet/in_cksum.c		inet
 file	netinet/in_gif.c		gif  inet
 file	netinet/ip_carp.c		carp  (inet | inet6)	needs-flag
-file	netinet/ip_ecn.c		kame_ipsec | fast_ipsec | gif | stf
+file	netinet/ip_ecn.c		fast_ipsec | gif | stf
 file	netinet/ip_encap.c		inet | inet6
 file	netinet/ip_etherip.c		etherip  inet
 file	netinet6/ip6_etherip.c		etherip  inet6



CVS commit: src/sys/netipsec

2013-05-09 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu May  9 19:21:50 UTC 2013

Modified Files:
src/sys/netipsec: ipsec_osdep.h

Log Message:
Fix FAST_IPSEC locking violation.

Without this change, using ESP tunnels with FAST_IPSEC on a 2-cpu i386
machine results in an mbuf leak.  This change was tested in netbsd-6.

When FAST_IPSEC is enabled and a tunnel is set up, after the
outer packet is stripped off, FAST_IPSEC queues the inner
packet on the appropriate queue (ipinstrq or ip6instrq).
These queues require the KERNEL_LOCK to be held before
using the queue, and the FAST_IPSEC code did not take the
KERNEL_LOCK as required.
KERNEL_LOCK and KERNEL_UNLOCK_ONE calls have been added.

If a struct ifnet instance is passed to the if_handoff
function which does this queuing, the interface's
if_start function may be called.  Some hardware devices
require KERNEL_LOCK to be held; others do not.  Looking
at the body of NetBSD code, other places where an if_start
function is called, KERNEL_LOCK is held.  Thus, the lock is
not released in if_handoff until after the if_start function
is called.  In practice, having the kernel lock when
if_start is called makes no difference - there is not
a single instance in all of the NetBSD code where
if_handoff is passed an instance of struct ifnet.

This commit is the work of Bev Schwartz of BBN.

Approved for Public Release, Distribution Unlimited
This material is based upon work supported by the Defense Advanced Research
Projects Agency and Space and Naval Warfare Systems Center, Pacific, under
Contract No. N66001-09-C-2073.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/netipsec/ipsec_osdep.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/netipsec/ipsec_osdep.h
diff -u src/sys/netipsec/ipsec_osdep.h:1.23 src/sys/netipsec/ipsec_osdep.h:1.24
--- src/sys/netipsec/ipsec_osdep.h:1.23	Tue Nov 29 13:15:27 2011
+++ src/sys/netipsec/ipsec_osdep.h	Thu May  9 19:21:50 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_osdep.h,v 1.23 2011/11/29 13:15:27 drochner Exp $	*/
+/*	$NetBSD: ipsec_osdep.h,v 1.24 2013/05/09 19:21:50 gdt Exp $	*/
 /*	$FreeBSD: /repoman/r/ncvs/src/sys/netipsec/ipsec_osdep.h,v 1.1 2003/09/29 22:47:45 sam Exp $	*/
 
 /*
@@ -144,8 +144,10 @@ if_handoff(struct ifqueue *ifq, struct m
 	int need_if_start = 0;
 	int s = splnet();
 
+	KERNEL_LOCK(1, NULL);
 	if (IF_QFULL(ifq)) {
 		IF_DROP(ifq);
+		KERNEL_UNLOCK_ONE(NULL);
 		splx(s);
 		m_freem(m);
 		return (0);
@@ -159,6 +161,7 @@ if_handoff(struct ifqueue *ifq, struct m
 	IF_ENQUEUE(ifq, m);
 	if (need_if_start)
 		(*ifp-if_start)(ifp);
+	KERNEL_UNLOCK_ONE(NULL);
 	splx(s);
 	return (1);
 }



CVS commit: src/sys/netinet6

2013-03-18 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Mon Mar 18 19:31:39 UTC 2013

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

Log Message:
Initialize variable used as (conditional) result parameter.

ip6_insertfraghdr either sets a result parameter or returns an error.
While the caller only uses the result parameter in the non-error case,
knowing that requires cross-module static analysis, and that's not
robust against distant code changes.  Therfore, set ip6f to NULL
before the function call that maybe sets it, avoiding a spuruious
warning and changing the future possible bug from an unitialized
dereference to a NULL deferrence.


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 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/netinet6/ip6_output.c
diff -u src/sys/netinet6/ip6_output.c:1.151 src/sys/netinet6/ip6_output.c:1.152
--- src/sys/netinet6/ip6_output.c:1.151	Fri Jan 25 10:33:53 2013
+++ src/sys/netinet6/ip6_output.c	Mon Mar 18 19:31:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_output.c,v 1.151 2013/01/25 10:33:53 kefren Exp $	*/
+/*	$NetBSD: ip6_output.c,v 1.152 2013/03/18 19:31:39 gdt Exp $	*/
 /*	$KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ip6_output.c,v 1.151 2013/01/25 10:33:53 kefren Exp $);
+__KERNEL_RCSID(0, $NetBSD: ip6_output.c,v 1.152 2013/03/18 19:31:39 gdt Exp $);
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -905,6 +905,11 @@ ip6_output(
 			mhip6 = mtod(m, struct ip6_hdr *);
 			*mhip6 = *ip6;
 			m-m_len = sizeof(*mhip6);
+			/*
+			 * ip6f must be valid if error is 0.  But how
+			 * can a compiler be expected to infer this?
+			 */
+			ip6f = NULL;
 			error = ip6_insertfraghdr(m0, m, hlen, ip6f);
 			if (error) {
 IP6_STATINC(IP6_STAT_ODROPPED);



CVS commit: src/sys/kern

2013-03-14 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Mar 14 19:13:17 UTC 2013

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

Log Message:
Add comment questioning lock asymmetry.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 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.213 src/sys/kern/uipc_socket.c:1.214
--- src/sys/kern/uipc_socket.c:1.213	Thu Feb 14 21:57:58 2013
+++ src/sys/kern/uipc_socket.c	Thu Mar 14 19:13:17 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.213 2013/02/14 21:57:58 christos Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.214 2013/03/14 19:13:17 gdt Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.213 2013/02/14 21:57:58 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_socket.c,v 1.214 2013/03/14 19:13:17 gdt Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_sock_counters.h
@@ -538,6 +538,7 @@ socreate(int dom, struct socket **aso, i
 		lock = lockso-so_lock;
 		so-so_lock = lock;
 		mutex_obj_hold(lock);
+		/* XXX Why is this not solock, to match sounlock? */
 		mutex_enter(lock);
 	} else {
 		/* Lock assigned and taken during PRU_ATTACH. */



CVS commit: src/external/gpl3/binutils/usr.sbin/dbsym

2013-02-18 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Mon Feb 18 15:29:37 UTC 2013

Modified Files:
src/external/gpl3/binutils/usr.sbin/dbsym: Makefile

Log Message:
Adjust blank lines, add comment about DPADD


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/binutils/usr.sbin/dbsym/Makefile

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

Modified files:

Index: src/external/gpl3/binutils/usr.sbin/dbsym/Makefile
diff -u src/external/gpl3/binutils/usr.sbin/dbsym/Makefile:1.8 src/external/gpl3/binutils/usr.sbin/dbsym/Makefile:1.9
--- src/external/gpl3/binutils/usr.sbin/dbsym/Makefile:1.8	Sun Feb 17 20:36:01 2013
+++ src/external/gpl3/binutils/usr.sbin/dbsym/Makefile	Mon Feb 18 15:29:36 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2013/02/17 20:36:01 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2013/02/18 15:29:36 gdt Exp $
 
 .include bsd.own.mk
 
@@ -33,7 +33,8 @@ CPPFLAGS+=	-I${TOP}/${BFDSUBDIR}/libbfd/
 LDADD+=		-lintl
 DPADD+=		${LIBINTL}
 .endif # HOSTPROG
-LDADD+=		-lz
-.endif # MKBINUTILS != no
 
+LDADD+=		-lz
+# No DPADD because we don't know the format and we didn't build it.
 
+.endif # MKBINUTILS != no



CVS commit: src/external/gpl3/binutils/usr.sbin/mdsetimage

2013-02-18 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Mon Feb 18 15:32:02 UTC 2013

Modified Files:
src/external/gpl3/binutils/usr.sbin/mdsetimage: Makefile

Log Message:
Adjust blank lines.  Add comment about missing DPADD for -lz.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/binutils/usr.sbin/mdsetimage/Makefile

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

Modified files:

Index: src/external/gpl3/binutils/usr.sbin/mdsetimage/Makefile
diff -u src/external/gpl3/binutils/usr.sbin/mdsetimage/Makefile:1.8 src/external/gpl3/binutils/usr.sbin/mdsetimage/Makefile:1.9
--- src/external/gpl3/binutils/usr.sbin/mdsetimage/Makefile:1.8	Sun Feb 17 20:36:02 2013
+++ src/external/gpl3/binutils/usr.sbin/mdsetimage/Makefile	Mon Feb 18 15:32:02 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2013/02/17 20:36:02 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2013/02/18 15:32:02 gdt Exp $
 
 .include bsd.own.mk
 
@@ -35,6 +35,8 @@ LDADD+=		-lintl
 DPADD+=		${LIBINTL}
 DPADD+=		${LIBZ}
 .endif # HOSTPROG
+
 LDADD+=		-lz
-.endif # MKBINUTILS != no
+# No DPADD because we don't know the format and we didn't build it.
 
+.endif # MKBINUTILS != no



CVS commit: src/sys/sys

2013-02-07 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Feb  7 18:53:35 UTC 2013

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

Log Message:
Remove spurious \ from last line of __link_set_decl macro.

The next line is blank, so this was not actually causing a problem.
But, removing that blank line would lead to odd lossage.

(From Richard Hansen of BBN.)


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/sys/cdefs_elf.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/cdefs_elf.h
diff -u src/sys/sys/cdefs_elf.h:1.42 src/sys/sys/cdefs_elf.h:1.43
--- src/sys/sys/cdefs_elf.h:1.42	Sat Feb  2 17:58:11 2013
+++ src/sys/sys/cdefs_elf.h	Thu Feb  7 18:53:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs_elf.h,v 1.42 2013/02/02 17:58:11 matt Exp $	*/
+/*	$NetBSD: cdefs_elf.h,v 1.43 2013/02/07 18:53:34 gdt Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -154,7 +154,7 @@
 
 #define	__link_set_decl(set, ptype)	\
 	extern ptype * const __start_link_set_##set[] __dso_hidden;	\
-	extern ptype * const __stop_link_set_##set[] __dso_hidden	\
+	extern ptype * const __stop_link_set_##set[] __dso_hidden
 
 #define	__link_set_start(set)	(__start_link_set_##set)
 #define	__link_set_end(set)	(__stop_link_set_##set)



CVS commit: src/sys/sys

2013-01-28 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Tue Jan 29 01:23:13 UTC 2013

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

Log Message:
Fix comment documenting __link_set_decl() macro.

The `__link_set_decl()` macro's replacement text includes a `*` after
`ptype`, so `ptype` is the pointed-at type (the type of a dereferenced
array entry), not the pointer type.

(This is a comment-only change.)

(From Richard Hansen of BBN.)


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/sys/cdefs.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/cdefs.h
diff -u src/sys/sys/cdefs.h:1.104 src/sys/sys/cdefs.h:1.105
--- src/sys/sys/cdefs.h:1.104	Wed Jan  2 17:02:13 2013
+++ src/sys/sys/cdefs.h	Tue Jan 29 01:23:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.104 2013/01/02 17:02:13 matt Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.105 2013/01/29 01:23:12 gdt Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -468,7 +468,7 @@
  *
  *	__link_set_decl(set, ptype)
  *		Provide an extern declaration of the set `set', which
- *		contains an array of the pointer type `ptype'.  This
+ *		contains an array of pointers to type `ptype'.  This
  *		macro must be used by any code which wishes to reference
  *		the elements of a link set.
  *



CVS commit: src/sys/netipsec

2012-09-20 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Sep 20 23:50:06 UTC 2012

Modified Files:
src/sys/netipsec: key.c

Log Message:
Fix whitespace (mostly removing trailing).

This commit changes only whitespace (trailing, tabs vs spaces,
removing spurious newlines).  From Bev Schwartz of BBN.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/netipsec/key.c

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

Modified files:

Index: src/sys/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.78 src/sys/netipsec/key.c:1.79
--- src/sys/netipsec/key.c:1.78	Thu Aug 30 12:16:49 2012
+++ src/sys/netipsec/key.c	Thu Sep 20 23:50:05 2012
@@ -1,7 +1,7 @@
-/*	$NetBSD: key.c,v 1.78 2012/08/30 12:16:49 drochner Exp $	*/
+/*	$NetBSD: key.c,v 1.79 2012/09/20 23:50:05 gdt Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
-	
+
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: key.c,v 1.78 2012/08/30 12:16:49 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: key.c,v 1.79 2012/09/20 23:50:05 gdt Exp $);
 
 /*
  * This code is referd to RFC 2367
@@ -360,10 +360,10 @@ do { \
  * set parameters into secasindex buffer.
  * Must allocate secasindex buffer before calling this function.
  */
-static int 
-key_setsecasidx (int, int, int, const struct sadb_address *, 
+static int
+key_setsecasidx (int, int, int, const struct sadb_address *,
 		 const struct sadb_address *, struct secasindex *);
-	
+
 /* key statistics */
 struct _keystat {
 	u_long getspi_count; /* the avarage of count to try to get new SPI */
@@ -466,7 +466,7 @@ static int key_getspi (struct socket *, 
 static u_int32_t key_do_getnewspi (const struct sadb_spirange *,
 	const struct secasindex *);
 #ifdef IPSEC_NAT_T
-static int key_handle_natt_info (struct secasvar *, 
+static int key_handle_natt_info (struct secasvar *,
  const struct sadb_msghdr *);
 static int key_set_natt_ports (union sockaddr_union *,
 			 	union sockaddr_union *,
@@ -997,7 +997,7 @@ key_do_allocsa_policy(struct secashead *
 (key_do_allocsa_policy: bogus ref count));
 
 			satype = key_proto2satype(d-sah-saidx.proto);
-			if (satype == 0) 
+			if (satype == 0)
 goto msgfail;
 
 			m = key_setsadbmsg(SADB_DELETE, 0,
@@ -1113,13 +1113,13 @@ key_allocsa(
 		printf(DP key_allocsa from %s:%u\n, where, tag));
 
 	/*
-	 * XXX IPCOMP case 
+	 * XXX IPCOMP case
 	 * We use cpi to define spi here. In the case where cpi =
 	 * IPCOMP_CPI_NEGOTIATE_MIN, cpi just define the algorithm used, not
 	 * the real spi. In this case, don't check the spi but check the
 	 * algorithm
 	 */
-
+
 	if (proto == IPPROTO_IPCOMP) {
 		u_int32_t tmp;
 		tmp = ntohl(spi);
@@ -1166,7 +1166,7 @@ key_allocsa(
 
 #if 0	/* don't check src */
 	/* Fix port in src-sa */
-
+
 /* check src address */
 if (key_sockaddrcmp(src-sa, sav-sah-saidx.src.sa, 0) != 0)
 	continue;
@@ -1810,7 +1810,7 @@ fail:
  * m will always be freed.
  */
 static int
-key_spdadd(struct socket *so, struct mbuf *m, 
+key_spdadd(struct socket *so, struct mbuf *m,
 	   const struct sadb_msghdr *mhp)
 {
 	const struct sadb_address *src0, *dst0;
@@ -2439,8 +2439,8 @@ key_spdflush(struct socket *so, struct m
 	return key_sendup_mbuf(so, m, KEY_SENDUP_ALL);
 }
 
-static struct sockaddr key_src = { 
-	.sa_len = 2, 
+static struct sockaddr key_src = {
+	.sa_len = 2,
 	.sa_family = PF_KEY,
 };
 
@@ -3602,7 +3602,7 @@ key_setdumpsa(struct secasvar *sav, u_in
 		case SADB_X_EXT_NAT_T_TYPE:
 			m = key_setsadbxtype(sav-natt_type);
 			break;
-		
+
 		case SADB_X_EXT_NAT_T_DPORT:
 			if (sav-natt_type == 0)
 continue;
@@ -3774,10 +3774,10 @@ key_setsadbxfrag(u_int16_t flen)
 	return m;
 }
 
-/* 
+/*
  * Get port from sockaddr, port is in network order
  */
-u_int16_t 
+u_int16_t
 key_portfromsaddr(const union sockaddr_union *saddr)
 {
 	u_int16_t port;
@@ -3822,7 +3822,7 @@ key_porttosaddr(union sockaddr_union *sa
 	}
 #endif
 	default:
-		printf(key_porttosaddr: unexpected address family %d\n, 
+		printf(key_porttosaddr: unexpected address family %d\n,
 			saddr-sa.sa_family);
 		break;
 	}
@@ -3831,7 +3831,7 @@ key_porttosaddr(union sockaddr_union *sa
 }
 
 /*
- * Safety check sa_len 
+ * Safety check sa_len
  */
 static int
 key_checksalen(const union sockaddr_union *saddr)
@@ -4822,23 +4822,23 @@ key_proto2satype(u_int16_t proto)
 	/* NOTREACHED */
 }
 
-static int 
+static int
 key_setsecasidx(int proto, int mode, int reqid,
 	const struct sadb_address * src,
 	 	const struct sadb_address * dst,
 		struct secasindex * saidx)
 {
-	const union sockaddr_union * src_u = 
+	const union sockaddr_union * src_u =
 		(const union sockaddr_union *) src;
 	const union sockaddr_union * dst_u =
-		(const union sockaddr_union *) 

CVS commit: src/sys/netinet6

2012-07-21 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Sat Jul 21 14:52:40 UTC 2012

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

Log Message:
Add comments describing parameter handling for ip6_insertfraghdr.

Depending on compiler options, this code can be involved in an
(apparently) spurious compiler warning.  However, it was not
immediately obvious the the compiler was wrong.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 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/netinet6/ip6_output.c
diff -u src/sys/netinet6/ip6_output.c:1.149 src/sys/netinet6/ip6_output.c:1.150
--- src/sys/netinet6/ip6_output.c:1.149	Mon Jun 25 15:28:40 2012
+++ src/sys/netinet6/ip6_output.c	Sat Jul 21 14:52:40 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_output.c,v 1.149 2012/06/25 15:28:40 christos Exp $	*/
+/*	$NetBSD: ip6_output.c,v 1.150 2012/07/21 14:52:40 gdt Exp $	*/
 /*	$KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ip6_output.c,v 1.149 2012/06/25 15:28:40 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: ip6_output.c,v 1.150 2012/07/21 14:52:40 gdt Exp $);
 
 #include opt_inet.h
 #include opt_inet6.h
@@ -1147,6 +1147,10 @@ ip6_insert_jumboopt(struct ip6_exthdrs *
 
 /*
  * Insert fragment header and copy unfragmentable header portions.
+ * 
+ * *frghdrp will not be read, and it is guaranteed that either an
+ * error is returned or that *frghdrp will point to space allocated
+ * for the fragment header.
  */
 static int
 ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen, 



CVS commit: src/sys/netinet

2012-06-08 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Fri Jun  8 15:01:51 UTC 2012

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

Log Message:
Simply use the ifa_addr pointer, rather than taking its address.
Resolves failure to match addresses in SIOC[GD]LIFADDR calls.
Diagnosis and fix is due to Mark Keaton of BBN.


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/sys/netinet/in.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/in.c
diff -u src/sys/netinet/in.c:1.142 src/sys/netinet/in.c:1.143
--- src/sys/netinet/in.c:1.142	Mon Dec 12 00:06:39 2011
+++ src/sys/netinet/in.c	Fri Jun  8 15:01:51 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.142 2011/12/12 00:06:39 roy Exp $	*/
+/*	$NetBSD: in.c,v 1.143 2012/06/08 15:01:51 gdt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: in.c,v 1.142 2011/12/12 00:06:39 roy Exp $);
+__KERNEL_RCSID(0, $NetBSD: in.c,v 1.143 2012/06/08 15:01:51 gdt Exp $);
 
 #include opt_inet.h
 #include opt_inet_conf.h
@@ -729,7 +729,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo
 continue;
 			if (cmp == 0)
 break;
-			candidate.s_addr = ((struct sockaddr_in *)ifa-ifa_addr)-sin_addr.s_addr;
+			candidate.s_addr = ((struct sockaddr_in *)ifa-ifa_addr)-sin_addr.s_addr;
 			candidate.s_addr = mask.s_addr;
 			if (candidate.s_addr == match.s_addr)
 break;



CVS commit: src/sys/dev/pci

2012-04-26 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Apr 26 17:43:03 UTC 2012

Modified Files:
src/sys/dev/pci: if_bnxvar.h

Log Message:
Use RX_PAGES for rx_bd_chain_{,r}seq.

Before, TX_PAGES was used, but no harm was done because TX_PAGES ==
RX_PAGES == 2.  Found by Frank Kastenholz of BBN.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/if_bnxvar.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/dev/pci/if_bnxvar.h
diff -u src/sys/dev/pci/if_bnxvar.h:1.2 src/sys/dev/pci/if_bnxvar.h:1.3
--- src/sys/dev/pci/if_bnxvar.h:1.2	Fri Jul 15 11:29:31 2011
+++ src/sys/dev/pci/if_bnxvar.h	Thu Apr 26 17:43:02 2012
@@ -220,8 +220,8 @@ struct bnx_softc
 	bus_addr_t		tx_bd_chain_paddr[TX_PAGES];
 
 	/* H/W maintained RX buffer descriptor chain structure. */
-	bus_dma_segment_t	rx_bd_chain_seg[TX_PAGES];
-	int			rx_bd_chain_rseg[TX_PAGES];
+	bus_dma_segment_t	rx_bd_chain_seg[RX_PAGES];
+	int			rx_bd_chain_rseg[RX_PAGES];
 	bus_dmamap_t		rx_bd_chain_map[RX_PAGES];
 	struct rx_bd		*rx_bd_chain[RX_PAGES];
 	bus_addr_t		rx_bd_chain_paddr[RX_PAGES];



CVS commit: src

2011-11-11 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Fri Nov 11 15:09:33 UTC 2011

Modified Files:
src/sbin/route: keywords.c keywords.h keywords.sh route.8 route.c
show.c
src/sys/net: route.h
src/sys/netinet: icmp6.h if_inarp.h
src/sys/netinet6: nd6.h
src/usr.bin/netstat: netstat.1 show.c

Log Message:
Move RTF_ANNOUNCE flag so that it no longer conflicts with RTF_PROTO2.

RTF_ANNOUNCE was defined as RTF_PROTO2.  The flag is used to indicated
that host should act as a proxy for a link level arp or ndp request.
(If RTF_PROTO2 is used as an experimental flag (as advertised),
various problems can occur.)

This commit provides a first-class definition with its own bit for
RTF_ANNOUNCE, removes the old aliasing definitions, and adds support
for the new RTF_ANNOUNCE flag to netstat(8) and route(8).,

Also, remove unused RTF_ flags that collide with RTF_PROTO1:
  netinet/icmp6.h defined RTF_PROBEMTU as RTF_PROTO1
  netinet/if_inarp.h defined RTF_USETRAILERS as RTF_PROTO1
  (Neither of these flags are used anywhere.  Both have been removed
  to reduce chances of collision with RTF_PROTO1.)

Figuring this out and the diff are the work of Beverly Schwartz of
BBN.

(Passed release build, boot in VM, with no apparently related atf
failures.)

Approved for Public Release, Distribution Unlimited
This material is based upon work supported by the Defense Advanced
Research Projects Agency and Space and Naval Warfare Systems Center,
Pacific, under Contract No. N66001-09-C-2073.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/route/keywords.c
cvs rdiff -u -r1.11 -r1.12 src/sbin/route/keywords.h
cvs rdiff -u -r1.9 -r1.10 src/sbin/route/keywords.sh
cvs rdiff -u -r1.45 -r1.46 src/sbin/route/route.8
cvs rdiff -u -r1.133 -r1.134 src/sbin/route/route.c
cvs rdiff -u -r1.43 -r1.44 src/sbin/route/show.c
cvs rdiff -u -r1.79 -r1.80 src/sys/net/route.h
cvs rdiff -u -r1.42 -r1.43 src/sys/netinet/icmp6.h src/sys/netinet/if_inarp.h
cvs rdiff -u -r1.54 -r1.55 src/sys/netinet6/nd6.h
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/netstat/netstat.1
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/netstat/show.c

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

Modified files:

Index: src/sbin/route/keywords.c
diff -u src/sbin/route/keywords.c:1.8 src/sbin/route/keywords.c:1.9
--- src/sbin/route/keywords.c:1.8	Sat Jun 26 14:29:36 2010
+++ src/sbin/route/keywords.c	Fri Nov 11 15:09:32 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: keywords.c,v 1.8 2010/06/26 14:29:36 kefren Exp $ */
+/* $NetBSD: keywords.c,v 1.9 2011/11/11 15:09:32 gdt Exp $ */
 
 /* WARNING!  This file was generated by keywords.sh  */
 
@@ -61,6 +61,7 @@ struct keytab keywords[] = {
 	{noreject, K_NOREJECT},
 	{mpls, K_MPLS},
 	{tag, K_TAG},
+	{proxy, K_PROXY},
 	{0, 0}
 };
 

Index: src/sbin/route/keywords.h
diff -u src/sbin/route/keywords.h:1.11 src/sbin/route/keywords.h:1.12
--- src/sbin/route/keywords.h:1.11	Sat Jun 26 14:29:36 2010
+++ src/sbin/route/keywords.h	Fri Nov 11 15:09:32 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: keywords.h,v 1.11 2010/06/26 14:29:36 kefren Exp $ */
+/* $NetBSD: keywords.h,v 1.12 2011/11/11 15:09:32 gdt Exp $ */
 
 /* WARNING!  This file was generated by keywords.sh  */
 
@@ -63,3 +63,4 @@ extern struct keytab {
 #define	K_NOREJECT	53
 #define	K_MPLS	54
 #define	K_TAG	55
+#define	K_PROXY	56

Index: src/sbin/route/keywords.sh
diff -u src/sbin/route/keywords.sh:1.9 src/sbin/route/keywords.sh:1.10
--- src/sbin/route/keywords.sh:1.9	Sat Jun 26 14:29:36 2010
+++ src/sbin/route/keywords.sh	Fri Nov 11 15:09:32 2011
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: keywords.sh,v 1.9 2010/06/26 14:29:36 kefren Exp $
+# $NetBSD: keywords.sh,v 1.10 2011/11/11 15:09:32 gdt Exp $
 # @(#)keywords	8.2 (Berkeley) 3/19/94
 #
 # WARNING!  If you change this file, re-run it!
@@ -63,6 +63,7 @@ noblackhole
 noreject
 mpls
 tag
+proxy
 _EOF_
 
 

Index: src/sbin/route/route.8
diff -u src/sbin/route/route.8:1.45 src/sbin/route/route.8:1.46
--- src/sbin/route/route.8:1.45	Sun Jul 17 23:46:53 2011
+++ src/sbin/route/route.8	Fri Nov 11 15:09:32 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: route.8,v 1.45 2011/07/17 23:46:53 dholland Exp $
+.\	$NetBSD: route.8,v 1.46 2011/11/11 15:09:32 gdt Exp $
 .\
 .\ Copyright (c) 1983, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -295,6 +295,7 @@ by indicating the following correspondin
 -proto1   RTF_PROTO1 - set protocol specific routing flag #1
 -proto2   RTF_PROTO2 - set protocol specific routing flag #2
 -llinfo   RTF_LLINFO - validly translates proto addr to link addr
+-proxyRTF_ANNOUNCE   - make entry a link level proxy
 .Ed
 .Pp
 The optional modifiers

Index: src/sbin/route/route.c
diff -u src/sbin/route/route.c:1.133 src/sbin/route/route.c:1.134
--- src/sbin/route/route.c:1.133	Fri Oct  7 09:56:15 2011
+++ src/sbin/route/route.c	Fri Nov 11 15:09:32 2011
@@ -1,4 +1,4 @@
-/*	

CVS commit: src/sys/ufs/ufs

2011-09-19 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Mon Sep 19 11:18:02 UTC 2011

Modified Files:
src/sys/ufs/ufs: ufs_wapbl.h

Log Message:
Remove prototype for the departed wapbl_ufs_rename.

ok dholland@


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/ufs/ufs/ufs_wapbl.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/ufs/ufs/ufs_wapbl.h
diff -u src/sys/ufs/ufs/ufs_wapbl.h:1.6 src/sys/ufs/ufs/ufs_wapbl.h:1.7
--- src/sys/ufs/ufs/ufs_wapbl.h:1.6	Wed Nov 18 12:22:48 2009
+++ src/sys/ufs/ufs/ufs_wapbl.h	Mon Sep 19 11:18:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_wapbl.h,v 1.6 2009/11/18 12:22:48 yamt Exp $	*/
+/*	$NetBSD: ufs_wapbl.h,v 1.7 2011/09/19 11:18:01 gdt Exp $	*/
 
 /*-
  * Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@@ -90,8 +90,6 @@
 #error Undefine WAPBL_DEBUG_INODES or update the code.  Have a nice day.
 #endif
 
-int	wapbl_ufs_rename(void *v);
-
 #ifdef WAPBL_DEBUG_INODES
 void	ufs_wapbl_verify_inodes(struct mount *, const char *);
 #endif



CVS commit: src/sys/coda

2011-09-13 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Tue Sep 13 19:34:27 UTC 2011

Modified Files:
src/sys/coda: coda_vnops.c

Log Message:
Reduce verbosity of semi-debug coda_inactive printf.

Rather than print if the usecount is  0, only print if it is greater
than 1.  It seems 1 is normal.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/coda/coda_vnops.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/coda/coda_vnops.c
diff -u src/sys/coda/coda_vnops.c:1.80 src/sys/coda/coda_vnops.c:1.81
--- src/sys/coda/coda_vnops.c:1.80	Sun Jun 12 03:35:51 2011
+++ src/sys/coda/coda_vnops.c	Tue Sep 13 19:34:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: coda_vnops.c,v 1.80 2011/06/12 03:35:51 rmind Exp $	*/
+/*	$NetBSD: coda_vnops.c,v 1.81 2011/09/13 19:34:27 gdt Exp $	*/
 
 /*
  *
@@ -46,7 +46,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: coda_vnops.c,v 1.80 2011/06/12 03:35:51 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: coda_vnops.c,v 1.81 2011/09/13 19:34:27 gdt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -854,7 +854,7 @@
 
 if (IS_UNMOUNTING(cp)) {
 	/* XXX Do we need to VOP_CLOSE container vnodes? */
-	if (vp-v_usecount  0)
+	if (vp-v_usecount  1)
 	printf(coda_inactive: IS_UNMOUNTING %p usecount %d\n,
 		   vp, vp-v_usecount);
 	if (cp-c_ovp != NULL)
@@ -862,7 +862,7 @@
 	VOP_UNLOCK(vp);
 } else {
 /* Sanity checks that perhaps should be panic. */
-	if (vp-v_usecount) {
+	if (vp-v_usecount  1) {
 	printf(coda_inactive: %p usecount %d\n, vp, vp-v_usecount);
 	}
 	if (cp-c_ovp != NULL) {



CVS commit: src/etc/rc.d

2011-08-17 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Wed Aug 17 16:39:30 UTC 2011

Modified Files:
src/etc/rc.d: route6d

Log Message:
Make route6d REQUIRE: mountcritremote.

route6d is in /usr/sbin, and thus on systems with separate / and /usr,
/etc/rc.d/route6d can be run before /usr is mounted, resulting in
route6d mysteriously failing to start.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/etc/rc.d/route6d

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

Modified files:

Index: src/etc/rc.d/route6d
diff -u src/etc/rc.d/route6d:1.7 src/etc/rc.d/route6d:1.8
--- src/etc/rc.d/route6d:1.7	Sat Apr 21 15:20:07 2007
+++ src/etc/rc.d/route6d	Wed Aug 17 16:39:29 2011
@@ -1,10 +1,10 @@
 #!/bin/sh
 #
-# $NetBSD: route6d,v 1.7 2007/04/21 15:20:07 tron Exp $
+# $NetBSD: route6d,v 1.8 2011/08/17 16:39:29 gdt Exp $
 #
 
 # PROVIDE: route6d
-# REQUIRE: network mountcritlocal
+# REQUIRE: network mountcritlocal mountcritremote
 # BEFORE:  NETWORKING
 
 $_rc_subr_loaded . /etc/rc.subr



CVS commit: src/usr.sbin/installboot

2011-08-03 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Wed Aug  3 14:47:28 UTC 2011

Modified Files:
src/usr.sbin/installboot: installboot.8

Log Message:
Explain how to use -e -v without -o to see the current options.
Caution that installing a new primary bootstrap will reset options to
default values.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/usr.sbin/installboot/installboot.8

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

Modified files:

Index: src/usr.sbin/installboot/installboot.8
diff -u src/usr.sbin/installboot/installboot.8:1.76 src/usr.sbin/installboot/installboot.8:1.77
--- src/usr.sbin/installboot/installboot.8:1.76	Mon Apr 25 07:04:50 2011
+++ src/usr.sbin/installboot/installboot.8	Wed Aug  3 14:47:28 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: installboot.8,v 1.76 2011/04/25 07:04:50 martin Exp $
+.\	$NetBSD: installboot.8,v 1.77 2011/08/03 14:47:28 gdt Exp $
 .\
 .\ Copyright (c) 2002-2009 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 January 11, 2010
+.Dd August 3, 2011
 .Dt INSTALLBOOT 8
 .Os
 .Sh NAME
@@ -75,6 +75,8 @@
 .Pp
 One some architectures the options of an existing installed bootstrap,
 or those of a bootstrap file can be changed.
+Installing a new primary bootstrap will reset those options to default
+values.
 .Pp
 Generally,
 .Nx
@@ -175,6 +177,11 @@
 raw disk partitions, and the
 .Pa pxeboot_ia32.bin
 file.
+With
+.Fl v
+and without
+.Fl o ,
+show the current options.
 .Sy [ amd64 , i386 ]
 .
 .It Fl f



CVS commit: src/sys/netinet

2011-05-25 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Wed May 25 23:17:44 UTC 2011

Modified Files:
src/sys/netinet: tcp_var.h

Log Message:
Add comment urging a separation of TCP_RTT_SHIFT into separate defines
describing the EWMA calculation and the storage representation.
(No code change.)


To generate a diff of this commit:
cvs rdiff -u -r1.166 -r1.167 src/sys/netinet/tcp_var.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/netinet/tcp_var.h
diff -u src/sys/netinet/tcp_var.h:1.166 src/sys/netinet/tcp_var.h:1.167
--- src/sys/netinet/tcp_var.h:1.166	Tue May  3 18:28:45 2011
+++ src/sys/netinet/tcp_var.h	Wed May 25 23:17:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_var.h,v 1.166 2011/05/03 18:28:45 dyoung Exp $	*/
+/*	$NetBSD: tcp_var.h,v 1.167 2011/05/25 23:17:44 gdt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -571,6 +571,9 @@
  * average (smoothed = (1/scale)sample + ((scale-1)/scale)smoothed).
  * This results in alpha of 0.125 and beta of 0.25, following RFC2988
  * section 2.3
+ *
+ * XXX Change SHIFT values to LGWEIGHT and REP_SHIFT, and adjust
+ * the code to use the correct ones.
  */
 #define	TCP_RTT_SHIFT		3	/* shift for srtt; 3 bits frac. */
 #define	TCP_RTTVAR_SHIFT	2	/* multiplier for rttvar; 2 bits */



CVS commit: src/sys/netinet

2011-05-25 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Wed May 25 23:20:57 UTC 2011

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

Log Message:
Remove erroneous additional tick in RTO estimation.  The variable
ts_rtt is 1 plus the RTT, so that 0 can mean invalid measurement.
However, the code failed to subtract the 1 back out before use.  With
this change, TCP from Massachusetts to France now typically has 1s RTO
values, rather than 1.5s.

This bug was found and fixed by Bev Schwartz of BBN.  This material is
based upon work supported by the Defense Advanced Research Projects
Agency and Space and Naval Warfare Systems Center, Pacific, under
Contract No. N66001-09-C-2073.  Approved for Public Release,
Distribution Unlimited


To generate a diff of this commit:
cvs rdiff -u -r1.313 -r1.314 src/sys/netinet/tcp_input.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/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.313 src/sys/netinet/tcp_input.c:1.314
--- src/sys/netinet/tcp_input.c:1.313	Tue May 17 05:40:24 2011
+++ src/sys/netinet/tcp_input.c	Wed May 25 23:20:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.313 2011/05/17 05:40:24 dholland Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.314 2011/05/25 23:20:57 gdt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.313 2011/05/17 05:40:24 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.314 2011/05/25 23:20:57 gdt Exp $);
 
 #include opt_inet.h
 #include opt_ipsec.h
@@ -2001,7 +2001,7 @@
  * this is a pure ack for outstanding data.
  */
 if (ts_rtt)
-	tcp_xmit_timer(tp, ts_rtt);
+	tcp_xmit_timer(tp, ts_rtt - 1);
 else if (tp-t_rtttime 
 SEQ_GT(th-th_ack, tp-t_rtseq))
 	tcp_xmit_timer(tp,
@@ -2689,7 +2689,7 @@
 		 * Recompute the initial retransmit timer.
 		 */
 		if (ts_rtt)
-			tcp_xmit_timer(tp, ts_rtt);
+			tcp_xmit_timer(tp, ts_rtt - 1);
 		else if (tp-t_rtttime  SEQ_GT(th-th_ack, tp-t_rtseq))
 			tcp_xmit_timer(tp, tcp_now - tp-t_rtttime);
 



CVS commit: src/sys/netinet

2011-05-24 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Tue May 24 18:37:53 UTC 2011

Modified Files:
src/sys/netinet: tcp_timer.h

Log Message:
Note units and current value for TCP_DELACK_TICKS.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/netinet/tcp_timer.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/netinet/tcp_timer.h
diff -u src/sys/netinet/tcp_timer.h:1.27 src/sys/netinet/tcp_timer.h:1.28
--- src/sys/netinet/tcp_timer.h:1.27	Wed Apr 20 13:35:52 2011
+++ src/sys/netinet/tcp_timer.h	Tue May 24 18:37:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_timer.h,v 1.27 2011/04/20 13:35:52 gdt Exp $	*/
+/*	$NetBSD: tcp_timer.h,v 1.28 2011/05/24 18:37:52 gdt Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2005 The NetBSD Foundation, Inc.
@@ -136,6 +136,7 @@
 
 #define	TCP_MAXRXTSHIFT	12			/* maximum retransmits */
 
+/* Acks are delayed for 1 second; constant is in fast ticks. */
 #define	TCP_DELACK_TICKS (hz / PR_FASTHZ)	/* time to delay ACK */
 
 #ifdef	TCPTIMERS



CVS commit: src/sys/netinet

2011-04-20 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Wed Apr 20 13:35:52 UTC 2011

Modified Files:
src/sys/netinet: tcp_input.c tcp_subr.c tcp_timer.c tcp_timer.h
tcp_var.h

Log Message:
Rewrite comments about TCP RTO calculations.

Long ago, the storage representations of srtt and rttvar were changed
from the 4.4BSD scheme, and the comments are out of sync with the
code.  This commit rewrites most of the comments that explain the RTO
calculations, and points out some issues in the code.

Joint work with Bev Schwartz of BBN (original analysis and comments),
but I have rewritten and extended them, so errors are mine.

This material is based upon work supported by the Defense Advanced
Research Projects Agency and Space and Naval Warfare Systems Center,
Pacific, under Contract No. N66001-09-C-2073.  Approved for Public
Release, Distribution Unlimited


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.238 -r1.239 src/sys/netinet/tcp_subr.c
cvs rdiff -u -r1.84 -r1.85 src/sys/netinet/tcp_timer.c
cvs rdiff -u -r1.26 -r1.27 src/sys/netinet/tcp_timer.h
cvs rdiff -u -r1.163 -r1.164 src/sys/netinet/tcp_var.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/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.308 src/sys/netinet/tcp_input.c:1.309
--- src/sys/netinet/tcp_input.c:1.308	Thu Apr 14 15:48:48 2011
+++ src/sys/netinet/tcp_input.c	Wed Apr 20 13:35:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.308 2011/04/14 15:48:48 yamt Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.309 2011/04/20 13:35:51 gdt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -145,7 +145,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.308 2011/04/14 15:48:48 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: tcp_input.c,v 1.309 2011/04/20 13:35:51 gdt Exp $);
 
 #include opt_inet.h
 #include opt_ipsec.h
@@ -1687,6 +1687,18 @@
 		 * the current time, or is extremely old, fall back to non-1323
 		 * RTT calculation.  Since ts_rtt is unsigned, we can test both
 		 * at the same time.
+		 *
+		 * Note that ts_rtt is in units of slow ticks (500
+		 * ms).  Since most earthbound RTTs are  500 ms,
+		 * observed values will have large quantization noise.
+		 * Our smoothed RTT is then the fraction of observed
+		 * samples that are 1 tick instead of 0 (times 500
+		 * ms).
+		 *
+		 * ts_rtt is increased by 1 to denote a valid sample,
+		 * with 0 indicating an invalid measurement.  This
+		 * extra 1 must be removed when ts_rtt is used, or
+		 * else an an erroneous extra 500 ms will result.
 		 */
 		ts_rtt = TCP_TIMESTAMP(tp) - opti.ts_ecr + 1;
 		if (ts_rtt  TCP_PAWS_IDLE)
@@ -3223,6 +3235,9 @@
 /*
  * Collect new round-trip time estimate
  * and update averages and current timeout.
+ *
+ * rtt is in units of slow ticks (typically 500 ms) -- essentially the
+ * difference of two timestamps.
  */
 void
 tcp_xmit_timer(struct tcpcb *tp, uint32_t rtt)
@@ -3232,35 +3247,55 @@
 	TCP_STATINC(TCP_STAT_RTTUPDATED);
 	if (tp-t_srtt != 0) {
 		/*
-		 * srtt is stored as fixed point with 3 bits after the
-		 * binary point (i.e., scaled by 8).  The following magic
-		 * is equivalent to the smoothing algorithm in rfc793 with
-		 * an alpha of .875 (srtt = rtt/8 + srtt*7/8 in fixed
-		 * point).  Adjust rtt to origin 0.
+		 * Compute the amount to add to srtt for smoothing,
+		 * *alpha, or 2^(-TCP_RTT_SHIFT).  Because
+		 * srtt is stored in 1/32 slow ticks, we conceptually
+		 * shift left 5 bits, subtract srtt to get the
+		 * diference, and then shift right by TCP_RTT_SHIFT
+		 * (3) to obtain 1/8 of the difference.
 		 */
 		delta = (rtt  2) - (tp-t_srtt  TCP_RTT_SHIFT);
+		/* 
+		 * This can never happen, because delta's lowest
+		 * possible value is 1/8 of t_srtt.  But if it does,
+		 * set srtt to some reasonable value, here chosen
+		 * as 1/8 tick.
+		 */
 		if ((tp-t_srtt += delta) = 0)
 			tp-t_srtt = 1  2;
 		/*
-		 * We accumulate a smoothed rtt variance (actually, a
-		 * smoothed mean difference), then set the retransmit
-		 * timer to smoothed rtt + 4 times the smoothed variance.
-		 * rttvar is stored as fixed point with 2 bits after the
-		 * binary point (scaled by 4).  The following is
-		 * equivalent to rfc793 smoothing with an alpha of .75
-		 * (rttvar = rttvar*3/4 + |delta| / 4).  This replaces
-		 * rfc793's wired-in beta.
+		 * RFC2988 requires that rttvar be updated first.
+		 * This code is compliant because delta is the old
+		 * srtt minus the new observation (scaled).
+		 *
+		 * RFC2988 says:
+		 *   rttvar = (1-beta) * rttvar + beta * |srtt-observed|
+		 *
+		 * delta is in units of 1/32 ticks, and has then been
+		 * divided by 8.  This is equivalent to being in 1/16s
+		 * units and divided by 4.  Subtract from it 1/4 of
+		 * the existing rttvar to form the (signed) amount to
+		 * adjust.
 		

CVS commit: src/external/bsd/ntp/bin/ntpq

2011-02-27 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Sun Feb 27 12:42:44 UTC 2011

Modified Files:
src/external/bsd/ntp/bin/ntpq: Makefile

Log Message:
Don't copy ntpq.1 to ntpq.8 before overwriting it.

foo  bar fails when bar is mode 444, and files copied from the
source tree should be expected to perhaps be read only.  However, the
copy should have been removed when the sed was added.  And, it never
should have been @; suppressing it made debugging this harder than
it should have been.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/bin/ntpq/Makefile

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

Modified files:

Index: src/external/bsd/ntp/bin/ntpq/Makefile
diff -u src/external/bsd/ntp/bin/ntpq/Makefile:1.4 src/external/bsd/ntp/bin/ntpq/Makefile:1.5
--- src/external/bsd/ntp/bin/ntpq/Makefile:1.4	Sat Feb 26 19:17:38 2011
+++ src/external/bsd/ntp/bin/ntpq/Makefile	Sun Feb 27 12:42:44 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2011/02/26 19:17:38 plunky Exp $
+#	$NetBSD: Makefile,v 1.5 2011/02/27 12:42:44 gdt Exp $
 
 # NOGCCERROR=yes
 
@@ -24,7 +24,6 @@
 .PATH: ${DIST}
 
 ntpq.8:	ntpq.1
-	@cp $? $@
 	${_MKTARGET_BUILD}
 	${TOOL_SED} -e s,NTPQ 1,NTPQ 8, $?  $@
 



CVS commit: src/distrib/i386/cdroms

2011-01-27 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Jan 27 15:34:38 UTC 2011

Modified Files:
src/distrib/i386/cdroms: Makefile.cdrom

Log Message:
Use ${INSTALL} ${COPY} instead of ${CP}.

This avoids a problem where files with mode 0400 (CVSREAD=t) are
copied to OBJDIR and then can't be re-copied on a subsequent build.
ok joerg@


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/distrib/i386/cdroms/Makefile.cdrom

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

Modified files:

Index: src/distrib/i386/cdroms/Makefile.cdrom
diff -u src/distrib/i386/cdroms/Makefile.cdrom:1.22 src/distrib/i386/cdroms/Makefile.cdrom:1.23
--- src/distrib/i386/cdroms/Makefile.cdrom:1.22	Fri Jan 14 10:26:33 2011
+++ src/distrib/i386/cdroms/Makefile.cdrom	Thu Jan 27 15:34:38 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.cdrom,v 1.22 2011/01/14 10:26:33 tsutsui Exp $
+# $NetBSD: Makefile.cdrom,v 1.23 2011/01/27 15:34:38 gdt Exp $
 
 .include bsd.own.mk
 
@@ -55,15 +55,15 @@
 
 image_md_pre:
 	${MKDIR} cdrom/libexec/dhcpcd-hooks
-	${CP} ${.CURDIR}/../../../common/10-resolv.conf cdrom/libexec/dhcpcd-hooks
-	${CP} ${.CURDIR}/../../../common/99-print-sysinst cdrom/libexec/dhcpcd-hooks
+	${INSTALL} ${COPY} ${.CURDIR}/../../../common/10-resolv.conf cdrom/libexec/dhcpcd-hooks
+	${INSTALL} ${COPY} ${.CURDIR}/../../../common/99-print-sysinst cdrom/libexec/dhcpcd-hooks
 	${MKDIR} cdrom/etc
 	${HOST_LN} -fs /tmp/gettytab cdrom/etc/gettytab
 	${INSTALL} ${COPY} ${.CURDIR}/../etc.ttys cdrom/etc/ttys
 	${INSTALL} ${COPY} ${.CURDIR}/../etc.rc cdrom/etc/rc
 	${INSTALL} ${COPY} -m 0555 ${.CURDIR}/../install.sh cdrom/install.sh
 	${MKDIR} cdrom/mnt2 cdrom/targetroot
-	${CP} ${SYSINSTDIR}/sysinst cdrom
+	${INSTALL} ${COPY} ${SYSINSTDIR}/sysinst cdrom
 	${CHMOD} ugo+rx cdrom/sysinst
-	${CP} ${SYSINSTDIR}/sysinstmsgs.?? cdrom
+	${INSTALL} ${COPY} ${SYSINSTDIR}/sysinstmsgs.?? cdrom
 	${MKDIR} cdrom/var



CVS commit: src/crypto/dist/ipsec-tools/src/racoon

2010-12-16 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Thu Dec 16 16:59:05 UTC 2010

Modified Files:
src/crypto/dist/ipsec-tools/src/racoon: oakley.c

Log Message:
When encountering a certificate where ID mismatched with ASN1
SubjectName, and verify_identifier is off, don't raise an error.
This makes the behavior match the man page.

Patch sent for review long ago:
  http://mail-index.netbsd.org/tech-security/2006/03/24/.html
with no negative feedback received to date.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/crypto/dist/ipsec-tools/src/racoon/oakley.c

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

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/oakley.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/oakley.c:1.17 src/crypto/dist/ipsec-tools/src/racoon/oakley.c:1.18
--- src/crypto/dist/ipsec-tools/src/racoon/oakley.c:1.17	Mon Aug 24 09:33:03 2009
+++ src/crypto/dist/ipsec-tools/src/racoon/oakley.c	Thu Dec 16 16:59:05 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: oakley.c,v 1.17 2009/08/24 09:33:03 vanhu Exp $	*/
+/*	$NetBSD: oakley.c,v 1.18 2010/12/16 16:59:05 gdt Exp $	*/
 
 /* Id: oakley.c,v 1.32 2006/05/26 12:19:46 manubsd Exp */
 
@@ -1817,7 +1817,8 @@
 ID mismatched with ASN1 SubjectName.\n);
 			plogdump(LLV_DEBUG, id_b + 1, idlen);
 			plogdump(LLV_DEBUG, name-v, idlen);
-			return ISAKMP_NTYPE_INVALID_ID_INFORMATION;
+			if (iph1-rmconf-verify_identifier)
+return ISAKMP_NTYPE_INVALID_ID_INFORMATION;
 		}
 		return 0;
 	case IPSECDOI_ID_IPV4_ADDR:
@@ -1889,7 +1890,8 @@
 ID mismatched with subjectAltName.\n);
 			plogdump(LLV_DEBUG, id_b + 1, idlen);
 			plogdump(LLV_DEBUG, a, idlen);
-			return ISAKMP_NTYPE_INVALID_ID_INFORMATION;
+			if (iph1-rmconf-verify_identifier)
+return ISAKMP_NTYPE_INVALID_ID_INFORMATION;
 		}
 		return 0;
 	}



CVS commit: src/share/man/man4

2009-12-21 Thread Greg Troxel
Module Name:src
Committed By:   gdt
Date:   Mon Dec 21 19:04:36 UTC 2009

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

Log Message:
In the introduction, point out that RA_WB is intended for recurring
fixed-sized transfers.  Clarification requested by po...@.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/share/man/man4/ugen.4

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

Modified files:

Index: src/share/man/man4/ugen.4
diff -u src/share/man/man4/ugen.4:1.27 src/share/man/man4/ugen.4:1.28
--- src/share/man/man4/ugen.4:1.27	Fri Apr 10 15:07:08 2009
+++ src/share/man/man4/ugen.4	Mon Dec 21 19:04:36 2009
@@ -1,4 +1,4 @@
-.\ $NetBSD: ugen.4,v 1.27 2009/04/10 15:07:08 joerg Exp $
+.\ $NetBSD: ugen.4,v 1.28 2009/12/21 19:04:36 gdt Exp $
 .\
 .\ Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -118,6 +118,8 @@
 .Xr ioctl 2
 calls are available, and enable read-ahead and write-behind buffering
 respectively.
+This buffering supports fixed-sized USB transfers and is intended for
+devices with regular and continuing data transfers.
 When read-ahead or write-behind are enabled, the file descriptor
 may be set to use non-blocking IO.
 .Pp