CVS commit: src/sys/arch/xen

2019-02-11 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Tue Feb 12 07:58:26 UTC 2019

Modified Files:
src/sys/arch/xen/include: pci_machdep.h
src/sys/arch/xen/x86: hypervisor_machdep.c

Log Message:
conditionally include XENPV specific code.

This explicitly excludes PV only functionality that would be wrong to
attempt to use in other modes, for eg: p2m table management.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/xen/include/pci_machdep.h
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/xen/x86/hypervisor_machdep.c

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

Modified files:

Index: src/sys/arch/xen/include/pci_machdep.h
diff -u src/sys/arch/xen/include/pci_machdep.h:1.19 src/sys/arch/xen/include/pci_machdep.h:1.20
--- src/sys/arch/xen/include/pci_machdep.h:1.19	Sun Jul 16 06:14:24 2017
+++ src/sys/arch/xen/include/pci_machdep.h	Tue Feb 12 07:58:26 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.h,v 1.19 2017/07/16 06:14:24 cherry Exp $ */
+/* $NetBSD: pci_machdep.h,v 1.20 2019/02/12 07:58:26 cherry Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -66,7 +66,7 @@ typedef intr_handle_t pci_intr_handle_t;
 
 #include "opt_xen.h"
 
-#ifndef DOM0OPS
+#if !defined(DOM0OPS) && defined(XENPV)
 int		xpci_enumerate_bus(struct pci_softc *, const int *,
 		   int (*)(const struct pci_attach_args *),
 		   struct pci_attach_args *);

Index: src/sys/arch/xen/x86/hypervisor_machdep.c
diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.34 src/sys/arch/xen/x86/hypervisor_machdep.c:1.35
--- src/sys/arch/xen/x86/hypervisor_machdep.c:1.34	Tue Dec 25 06:50:12 2018
+++ src/sys/arch/xen/x86/hypervisor_machdep.c	Tue Feb 12 07:58:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor_machdep.c,v 1.34 2018/12/25 06:50:12 cherry Exp $	*/
+/*	$NetBSD: hypervisor_machdep.c,v 1.35 2019/02/12 07:58:26 cherry Exp $	*/
 
 /*
  *
@@ -54,7 +54,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.34 2018/12/25 06:50:12 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.35 2019/02/12 07:58:26 cherry Exp $");
 
 #include 
 #include 
@@ -74,6 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: hypervisor_m
 #include "isa.h"
 #include "pci.h"
 
+#ifdef XENPV
 /*
  * arch-dependent p2m frame lists list (L3 and L2)
  * used by Xen for save/restore mappings
@@ -85,6 +86,8 @@ static int l2_p2m_page_size; /* size of 
 static void build_p2m_frame_list_list(void);
 static void update_p2m_frame_list_list(void);
 
+#endif
+
 // #define PORT_DEBUG 4
 // #define EARLY_DEBUG_EVENT
 
@@ -434,21 +437,26 @@ hypervisor_set_ipending(uint32_t iplmask
 void
 hypervisor_machdep_attach(void)
 {
+#ifdef XENPV
  	/* dom0 does not require the arch-dependent P2M translation table */
 	if (!xendomain_is_dom0()) {
 		build_p2m_frame_list_list();
 		sysctl_xen_suspend_setup();
 	}
+#endif
 }
 
 void
 hypervisor_machdep_resume(void)
 {
+#ifdef XENPV
 	/* dom0 does not require the arch-dependent P2M translation table */
 	if (!xendomain_is_dom0())
 		update_p2m_frame_list_list();
+#endif
 }
 
+#ifdef XENPV
 /*
  * Generate the p2m_frame_list_list table,
  * needed for guest save/restore
@@ -532,3 +540,4 @@ update_p2m_frame_list_list(void)
 HYPERVISOR_shared_info->arch.max_pfn = max_pfn;
 
 }
+#endif /* XENPV */



CVS commit: src/sys

2019-02-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Feb 12 07:16:56 UTC 2019

Modified Files:
src/sys/compat/sunos: files.sunos
src/sys/conf: files

Log Message:
compat_sunos depends upon compat_09.  fixes:

[   1.8785495] WARNING: module error: built-in module compat_sunos can't find 
builtin dependency `compat_09'
[   1.8785495] WARNING: module error: built-in module compat_sunos prerequisite 
compat_09 failed, error 2


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/compat/sunos/files.sunos
cvs rdiff -u -r1.1228 -r1.1229 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/compat/sunos/files.sunos
diff -u src/sys/compat/sunos/files.sunos:1.10 src/sys/compat/sunos/files.sunos:1.11
--- src/sys/compat/sunos/files.sunos:1.10	Sun Jan 27 02:08:40 2019
+++ src/sys/compat/sunos/files.sunos	Tue Feb 12 07:16:55 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sunos,v 1.10 2019/01/27 02:08:40 pgoyette Exp $
+#	$NetBSD: files.sunos,v 1.11 2019/02/12 07:16:55 mrg Exp $
 #
 # Config file description for machine-independent SunOS compat code.
 # Included by ports that need it.
@@ -6,7 +6,7 @@
 # ports should define any machine-specific files they need in their
 # own file lists.
 
-define	compat_sunos		: compat_netbsd,exec_aout
+define	compat_sunos		: compat_netbsd,compat_09,exec_aout
 file	compat/sunos/sunos_exec.c	compat_sunos & !compat_netbsd32
 file	compat/sunos/sunos_exec_aout.c	compat_sunos & exec_aout & !compat_netbsd32
 file	compat/sunos/sunos_sysent.c	compat_sunos & !compat_netbsd32

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1228 src/sys/conf/files:1.1229
--- src/sys/conf/files:1.1228	Wed Jan 30 01:19:49 2019
+++ src/sys/conf/files	Tue Feb 12 07:16:56 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1228 2019/01/30 01:19:49 jmcneill Exp $
+#	$NetBSD: files,v 1.1229 2019/02/12 07:16:56 mrg Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20171118
@@ -155,7 +155,7 @@ defflagCOMPAT_43
 defflagCOMPAT_FREEBSD: COMPAT_09, COMPAT_43
 defflagCOMPAT_LINUX: COMPAT_NETBSD, COMPAT_43
 defflagCOMPAT_OSF1
-defflagCOMPAT_SUNOS: COMPAT_30
+defflagCOMPAT_SUNOS: COMPAT_09, COMPAT_43
 defflagCOMPAT_ULTRIX: COMPAT_50
 defflagCOMPAT_NETBSD32
 defflagCOMPAT_SYSV



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

2019-02-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Feb 12 07:15:58 UTC 2019

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

Log Message:
add commented QUOTA2 line.


To generate a diff of this commit:
cvs rdiff -u -r1.263 -r1.264 src/sys/arch/sparc/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/sparc/conf/GENERIC
diff -u src/sys/arch/sparc/conf/GENERIC:1.263 src/sys/arch/sparc/conf/GENERIC:1.264
--- src/sys/arch/sparc/conf/GENERIC:1.263	Mon Jan 14 00:13:18 2019
+++ src/sys/arch/sparc/conf/GENERIC	Tue Feb 12 07:15:58 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.263 2019/01/14 00:13:18 mrg Exp $
+# $NetBSD: GENERIC,v 1.264 2019/02/12 07:15:58 mrg Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/sparc/conf/std.sparc"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.263 $"
+#ident 		"GENERIC-$Revision: 1.264 $"
 
 maxusers	32
 
@@ -182,6 +182,7 @@ file-system	TMPFS		# Efficient memory fi
 ## File system options.
 options 	NFSSERVER	# Sun NFS-compatible filesystem server
 options 	QUOTA		# FFS quotas
+#options 	QUOTA2		# new, in-filesystem UFS quotas
 #options 	FFS_EI		# FFS Endian Independent support
 options 	WAPBL		# File system journaling support
 #options 	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental



CVS commit: src/tests/lib/libc/sys

2019-02-11 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Feb 12 06:00:05 UTC 2019

Modified Files:
src/tests/lib/libc/sys: t_ptrace_wait.c

Log Message:
Refactor lwp_create1 and lwp_exit1 into trace_thread* in ptrace(2) tests

New tests:
 - trace_thread1
 - trace_thread2
 - trace_thread3
 - trace_thread4

These tests verify _lwp_create(2) and _lwp_exit(2) events. They are
currently skipped as not reliable.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/tests/lib/libc/sys/t_ptrace_wait.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_ptrace_wait.c
diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.82 src/tests/lib/libc/sys/t_ptrace_wait.c:1.83
--- src/tests/lib/libc/sys/t_ptrace_wait.c:1.82	Mon Feb 11 05:59:00 2019
+++ src/tests/lib/libc/sys/t_ptrace_wait.c	Tue Feb 12 06:00:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_wait.c,v 1.82 2019/02/11 05:59:00 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_wait.c,v 1.83 2019/02/12 06:00:05 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.82 2019/02/11 05:59:00 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.83 2019/02/12 06:00:05 kamil Exp $");
 
 #include 
 #include 
@@ -3492,26 +3492,23 @@ ATF_TC_BODY(traceme_exec, tc)
 
 /// 
 
-volatile lwpid_t the_lwp_id = 0;
+static volatile int done;
 
-static void
-lwp_main_func(void *arg)
+static void *
+trace_threads_cb(void *arg __unused)
 {
-	the_lwp_id = _lwp_self();
-	_lwp_exit();
-}
 
-ATF_TC(lwp_create1);
-ATF_TC_HEAD(lwp_create1, tc)
-{
-	atf_tc_set_md_var(tc, "descr",
-	"Verify that 1 LWP creation is intercepted by ptrace(2) with "
-	"EVENT_MASK set to PTRACE_LWP_CREATE");
+	done++;
+
+	while (done < 3)
+		continue;
+
+	return NULL;
 }
 
-ATF_TC_BODY(lwp_create1, tc)
+static void
+trace_threads(bool trace_create, bool trace_exit)
 {
-	const int exitval = 5;
 	const int sigval = SIGSTOP;
 	pid_t child, wpid;
 #if defined(TWAIT_HAVE_STATUS)
@@ -3521,10 +3518,17 @@ ATF_TC_BODY(lwp_create1, tc)
 	const int slen = sizeof(state);
 	ptrace_event_t event;
 	const int elen = sizeof(event);
-	ucontext_t uc;
+	struct ptrace_siginfo info;
+
+	pthread_t t[3];
+	int rv;
+	size_t n;
 	lwpid_t lid;
-	static const size_t ssize = 16*1024;
-	void *stack;
+
+	/* Track created and exited threads */
+	bool traced_lwps[__arraycount(t)];
+
+	atf_tc_skip("PR kern/51995");
 
 	DPRINTF("Before forking process PID=%d\n", getpid());
 	SYSCALL_REQUIRE((child = fork()) != -1);
@@ -3535,24 +3539,26 @@ ATF_TC_BODY(lwp_create1, tc)
 		DPRINTF("Before raising %s from child\n", strsignal(sigval));
 		FORKEE_ASSERT(raise(sigval) == 0);
 
-		DPRINTF("Before allocating memory for stack in child\n");
-		FORKEE_ASSERT((stack = malloc(ssize)) != NULL);
-
-		DPRINTF("Before making context for new lwp in child\n");
-		_lwp_makecontext(, lwp_main_func, NULL, NULL, stack, ssize);
-
-		DPRINTF("Before creating new in child\n");
-		FORKEE_ASSERT(_lwp_create(, 0, ) == 0);
+		for (n = 0; n < __arraycount(t); n++) {
+			rv = pthread_create([n], NULL, trace_threads_cb,
+			NULL);
+			FORKEE_ASSERT(rv == 0);
+		}
 
-		DPRINTF("Before waiting for lwp %d to exit\n", lid);
-		FORKEE_ASSERT(_lwp_wait(lid, NULL) == 0);
+		for (n = 0; n < __arraycount(t); n++) {
+			rv = pthread_join(t[n], NULL);
+			FORKEE_ASSERT(rv == 0);
+		}
 
-		DPRINTF("Before verifying that reported %d and running lid %d "
-		"are the same\n", lid, the_lwp_id);
-		FORKEE_ASSERT_EQ(lid, the_lwp_id);
+		/*
+		 * There is race between _exit() and pthread_join() detaching
+		 * a thread. For simplicity kill the process after detecting
+		 * LWP events.
+		 */
+		while (true)
+			continue;
 
-		DPRINTF("Before exiting of the child process\n");
-		_exit(exitval);
+		FORKEE_ASSERT(0 && "Not reached");
 	}
 	DPRINTF("Parent process PID=%d, child's PID=%d\n", getpid(), child);
 
@@ -3561,140 +3567,147 @@ ATF_TC_BODY(lwp_create1, tc)
 
 	validate_status_stopped(status, sigval);
 
-	DPRINTF("Set empty EVENT_MASK for the child %d\n", child);
-	event.pe_set_event = PTRACE_LWP_CREATE;
-	SYSCALL_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, , elen) != -1);
-
-	DPRINTF("Before resuming the child process where it left off and "
-	"without signal to be sent\n");
-	SYSCALL_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1);
-
-	DPRINTF("Before calling %s() for the child - expected stopped "
-	"SIGTRAP\n", TWAIT_FNAME);
-	TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, , 0), child);
-
-	validate_status_stopped(status, SIGTRAP);
-
+	DPRINTF("Before calling ptrace(2) with PT_GET_SIGINFO for child\n");
 	SYSCALL_REQUIRE(
-	ptrace(PT_GET_PROCESS_STATE, child, , slen) != -1);
+	ptrace(PT_GET_SIGINFO, child, , sizeof(info)) != -1);
 
-	

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

2019-02-11 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Tue Feb 12 03:13:50 UTC 2019

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

Log Message:
Fix typo: Parameters are seperated by ','.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/arch/x86/x86/intr.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/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.141 src/sys/arch/x86/x86/intr.c:1.142
--- src/sys/arch/x86/x86/intr.c:1.141	Tue Dec 25 06:50:12 2018
+++ src/sys/arch/x86/x86/intr.c	Tue Feb 12 03:13:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.141 2018/12/25 06:50:12 cherry Exp $	*/
+/*	$NetBSD: intr.c,v 1.142 2019/02/12 03:13:50 cherry Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.141 2018/12/25 06:50:12 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.142 2019/02/12 03:13:50 cherry Exp $");
 
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
@@ -1131,7 +1131,7 @@ intr_string(intr_handle_t ih, char *buf,
 		snprintf(buf, len, "irq %d", APIC_IRQ_LEGACY_IRQ(ih));
 
 #elif NLAPIC > 0
-	snprintf(buf, len, "irq %d" APIC_IRQ_LEGACY_IRQ(ih));
+	snprintf(buf, len, "irq %d", APIC_IRQ_LEGACY_IRQ(ih));
 #else
 	snprintf(buf, len, "irq %d", (int) ih);
 #endif



CVS commit: src/external/mpl/bind/dist/lib/isc/unix

2019-02-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Feb 12 02:38:56 UTC 2019

Modified Files:
src/external/mpl/bind/dist/lib/isc/unix: socket.c

Log Message:
Instead of queuing to a separate task, handle the fdwatch events inline.
Fixes locking. We could simplify the code a lot more now.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/mpl/bind/dist/lib/isc/unix/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/external/mpl/bind/dist/lib/isc/unix/socket.c
diff -u src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.5 src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.6
--- src/external/mpl/bind/dist/lib/isc/unix/socket.c:1.5	Sat Jan 26 20:51:00 2019
+++ src/external/mpl/bind/dist/lib/isc/unix/socket.c	Mon Feb 11 21:38:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.c,v 1.5 2019/01/27 01:51:00 christos Exp $	*/
+/*	$NetBSD: socket.c,v 1.6 2019/02/12 02:38:55 christos Exp $	*/
 
 /*
  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
@@ -2866,24 +2866,20 @@ dispatch_recv(isc__socket_t *sock) {
 		internal_recv(sock);
 		return;
 	}
-#if 0
+
+	LOCK(>lock);
 	INSIST(!sock->pending_recv);
-#else
-	// XXX: locking
-	if (sock->pending_recv)
-		return;
-#endif
 
 	sender = sock->fdwatchtask;
 	sock->pending_recv = 1;
 	iev = >readable_ev;
 
-	sock->references++;
+	isc_refcount_increment(>references);
 	iev->ev_sender = sock;
 	iev->ev_action = internal_fdwatch_read;
 	iev->ev_arg = sock;
-
-	isc_task_send(sender, (isc_event_t **));
+	UNLOCK(>lock);
+	internal_fdwatch_read(sender, iev);
 }
 
 static void
@@ -2896,18 +2892,21 @@ dispatch_send(isc__socket_t *sock) {
 		return;
 	}
 
+	LOCK(>lock);
+
 	INSIST(!sock->pending_send);
 
 	sender = sock->fdwatchtask;
 	sock->pending_send = 1;
 	iev = >writable_ev;
 
-	sock->references++;
+	isc_refcount_increment(>references);
 	iev->ev_sender = sock;
 	iev->ev_action = internal_fdwatch_write;
 	iev->ev_arg = sock;
 
-	isc_task_send(sender, (isc_event_t **));
+	UNLOCK(>lock);
+	internal_fdwatch_write(sender, iev);
 }
 
 /*
@@ -3374,9 +3373,7 @@ internal_fdwatch_write(isc_task_t *me, i
 
 	sock->pending_send = 0;
 
-	INSIST(sock->references > 0);
-	sock->references--;  /* the internal event is done with this socket */
-	if (sock->references == 0) {
+	if (isc_refcount_decrement(>references) == 0) {
 		UNLOCK(>lock);
 		destroy();
 		return;
@@ -3408,16 +3405,14 @@ internal_fdwatch_read(isc_task_t *me, is
 		   "internal_fdwatch_read: task %p got event %p", me, ev);
 
 	INSIST(sock->pending_recv == 1);
-	sock->pending_recv = 0;
 
 	UNLOCK(>lock);
 	more_data = (sock->fdwatchcb)(me, (isc_socket_t *)sock,
   sock->fdwatcharg, ISC_SOCKFDWATCH_READ);
 	LOCK(>lock);
 
-	INSIST(sock->references > 0);
-	sock->references--;  /* the internal event is done with this socket */
-	if (sock->references == 0) {
+	sock->pending_recv = 0;
+	if (isc_refcount_decrement(>references) == 0) {
 		UNLOCK(>lock);
 		destroy();
 		return;



CVS commit: src/external/gpl2/xcvs/dist/doc

2019-02-11 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Tue Feb 12 01:32:08 UTC 2019

Modified Files:
src/external/gpl2/xcvs/dist/doc: cvs.1 cvs.texinfo

Log Message:
cvs.1 & cvs.texinfo: add information about the "update" command's "-t"
flag to cvs.texinfo, so the installed man and info documentation match
here. This makes cvs.1 auto-generable from cvs.texinfo again, which I
plan to leverage with further additions later.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/xcvs/dist/doc/cvs.1
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/xcvs/dist/doc/cvs.texinfo

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

Modified files:

Index: src/external/gpl2/xcvs/dist/doc/cvs.1
diff -u src/external/gpl2/xcvs/dist/doc/cvs.1:1.5 src/external/gpl2/xcvs/dist/doc/cvs.1:1.6
--- src/external/gpl2/xcvs/dist/doc/cvs.1:1.5	Sun Feb 10 22:36:27 2019
+++ src/external/gpl2/xcvs/dist/doc/cvs.1	Tue Feb 12 01:32:08 2019
@@ -3900,7 +3900,7 @@ Requires: repository, working directory.
 .IP "\(bu" 2
 Changes: working directory.
 .SP
-After you\(aqve run checkout to create your private copy
+After you\(aqve run \fBcheckout\fR to create your private copy
 of source from the common repository, other developers
 will continue changing the central source.  From time
 to time, when it is convenient in your development
@@ -3954,19 +3954,6 @@ Local; run only in current working direc
 Prune empty directories.  See see node `Moving directories\(aq in the CVS manual.
 .SP
 .IP "" 0
-\fB-t\fR
-.IP "" 2
-Preserve source timestamps.  Unlike \fBcheckout\fR where files are created
-using the original timestamp of the file in the repository, \fBupdate\fR
-updates files using the current time of the machine.  This is convenient
-because updated files appear newer than any other files on the system so
-.BR make ( 1 )
-knows that are their corresponding built artifacts are out of date and
-they will get rebuilt.  The \fB-t\fR flag instead preserves the timestamps
-of the original repository files, behaving exactly like \fBcheckout\fR.
-This is useful for maintaining a tree in the original checked-out state.
-.SP
-.IP "" 0
 \fB-p\fR
 .IP "" 2
 Pipe files to the standard output.
@@ -3986,6 +3973,18 @@ existed on \fIdate\fR.  This option is s
 See see node `Sticky tags\(aq in the CVS manual, for more information on sticky tags/dates. Also
 see see node `Common options\(aq in the CVS manual.
 .SP
+.IP "" 0
+\fB-t\fR
+.IP "" 2
+Preserve source timestamps.  Unlike \fBcheckout\fR, where files are created
+using the original timestamp of the file in the repository, \fBupdate\fR
+updates files using the current time of the machine.  This is convenient
+because updated files appear newer than any other files on the system so
+\fBmake(1)\fR knows that their corresponding built artifacts are out of date
+and they will get rebuilt.  The \fB-t\fR flag instead preserves the timestamps
+of the original repository files, behaving exactly like \fBcheckout\fR.
+This is useful for maintaining a tree in the original checked-out state.
+.SP
 These special options are also available with
 \fBupdate\fR.
 .SP

Index: src/external/gpl2/xcvs/dist/doc/cvs.texinfo
diff -u src/external/gpl2/xcvs/dist/doc/cvs.texinfo:1.4 src/external/gpl2/xcvs/dist/doc/cvs.texinfo:1.5
--- src/external/gpl2/xcvs/dist/doc/cvs.texinfo:1.4	Sun Feb 10 22:36:27 2019
+++ src/external/gpl2/xcvs/dist/doc/cvs.texinfo	Tue Feb 12 01:32:08 2019
@@ -11595,14 +11595,14 @@ supported beginning with @sc{cvs} releas
 
 @itemize @bullet
 @item
-update [-ACdflPpR] [-I name] [-j rev [-j rev]] [-k kflag] [-r tag[:date] | -D date] [-W spec] files@dots{}
+update [-ACdflPpRt] [-I name] [-j rev [-j rev]] [-k kflag] [-r tag[:date] | -D date] [-W spec] files@dots{}
 @item
 Requires: repository, working directory.
 @item
 Changes: working directory.
 @end itemize
 
-After you've run checkout to create your private copy
+After you've run @code{checkout} to create your private copy
 of source from the common repository, other developers
 will continue changing the central source.  From time
 to time, when it is convenient in your development
@@ -11666,6 +11666,16 @@ and @var{tag} is a branch tag, the versi
 existed on @var{date}.  This option is sticky, and implies @samp{-P}.
 See @ref{Sticky tags}, for more information on sticky tags/dates. Also
 see @ref{Common options}.
+
+@item -t
+Preserve source timestamps.  Unlike @code{checkout}, where files are created
+using the original timestamp of the file in the repository, @code{update}
+updates files using the current time of the machine.  This is convenient
+because updated files appear newer than any other files on the system so
+@code{make(1)} knows that their corresponding built artifacts are out of date
+and they will get rebuilt.  The @samp{-t} flag instead preserves the timestamps
+of the original repository files, behaving exactly like @code{checkout}.
+This is useful 

CVS commit: src/usr.sbin/sysinst

2019-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 11 20:40:18 UTC 2019

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c defs.h partman.c util.c

Log Message:
Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/sysinst/partman.c
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/sysinst/util.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/sysinst/bsddisklabel.c
diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.6 src/usr.sbin/sysinst/bsddisklabel.c:1.7
--- src/usr.sbin/sysinst/bsddisklabel.c:1.6	Tue Nov 20 19:02:07 2018
+++ src/usr.sbin/sysinst/bsddisklabel.c	Mon Feb 11 20:40:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.6 2018/11/20 19:02:07 martin Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.7 2019/02/11 20:40:18 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -224,7 +224,7 @@ set_ptn_size(menudesc *m, void *arg)
 	if (size == 0)
 		size = p->dflt_size;
 	size /= sizemult;
-	snprintf(dflt, sizeof dflt, "%" PRIi64 "%s",
+	trunc_snprintf(dflt, sizeof dflt, "%" PRIi64 "%s",
 	size, p == pi->pool_part ? "+" : "");
 
 	for (;;) {

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.31 src/usr.sbin/sysinst/defs.h:1.32
--- src/usr.sbin/sysinst/defs.h:1.31	Sun Jan 27 04:15:11 2019
+++ src/usr.sbin/sysinst/defs.h	Mon Feb 11 20:40:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.31 2019/01/27 04:15:11 oster Exp $	*/
+/*	$NetBSD: defs.h,v 1.32 2019/02/11 20:40:18 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -561,6 +561,9 @@ void	do_reinstall_sets(void);
 void	restore_etc(void);
 
 /* from util.c */
+/* like snprintf, but always terminates the output */
+void trunc_snprintf(char * restrict str, size_t size,
+const char * restrict format, ...) __printflike(3, 4);
 char*	str_arg_subst(const char *, size_t, const char **);
 void	msg_display_subst(const char *, size_t, ...);
 int	ask_yesno(const char *);

Index: src/usr.sbin/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.28 src/usr.sbin/sysinst/partman.c:1.29
--- src/usr.sbin/sysinst/partman.c:1.28	Mon Feb 11 20:03:28 2019
+++ src/usr.sbin/sysinst/partman.c	Mon Feb 11 20:40:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.28 2019/02/11 20:03:28 martin Exp $ */
+/*	$NetBSD: partman.c,v 1.29 2019/02/11 20:40:18 martin Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -255,23 +255,19 @@ pm_edit(int menu_entries_count, void (*m
 static void
 pm_getdevstring(char *buf, int len, pm_devs_t *pm_cur, int num)
 {
-	int i, r;
+	int i;
 
 	if (pm_cur->isspecial)
 		snprintf(buf, len, "%s", pm_cur->diskdev);
 	else if (num + 'a' < 'a' || num + 'a' > 'a' + MAXPARTITIONS) {
-		r = snprintf(buf, len-1, "%sd", pm_cur->diskdev);
-		if (r >= len)
-			buf[len] = 0;
+		trunc_snprintf(buf, len, "%sd", pm_cur->diskdev);
 	} else if (pm_cur->gpt) {
 		for (i = 0; i < MAX_WEDGES; i++)
 			if (wedges[i].pm == pm_cur &&
 wedges[i].ptn == num)
 snprintf(buf, len, "dk%d", i); // XXX: xxx
 	} else {
-		r = snprintf(buf, len-1, "%s%c", pm_cur->diskdev, num + 'a');
-		if (r >= len)
-			buf[len] = 0;
+		trunc_snprintf(buf, len, "%s%c", pm_cur->diskdev, num + 'a');
 	}
 
 	return;
@@ -1898,7 +1894,7 @@ pm_gpt_commit(void)
 int
 pm_getrefdev(pm_devs_t *pm_cur)
 {
-	int i, ii, dev_num, num_devs, num_devs_s, r;
+	int i, ii, dev_num, num_devs, num_devs_s;
 	char dev[SSTRSIZE]; dev[0] = '\0';
 
 	pm_cur->refdev = NULL;
@@ -1907,15 +1903,11 @@ pm_getrefdev(pm_devs_t *pm_cur)
 		for (i = 0; i < MAX_CGD; i++)
 			if (cgds[i].blocked && cgds[i].node == dev_num) {
 pm_cur->refdev = [i];
-r = snprintf(pm_cur->diskdev_descr,
-sizeof(pm_cur->diskdev_descr)-1,
+trunc_snprintf(pm_cur->diskdev_descr,
+sizeof(pm_cur->diskdev_descr),
 "%s (%s, %s-%d)",
 pm_cur->diskdev_descr, cgds[i].pm_name,
 cgds[i].enc_type, cgds[i].key_size);
-if (r >= (int)sizeof(pm_cur->diskdev_descr))
-	pm_cur->diskdev_descr[
-	sizeof(pm_cur->diskdev_descr)-1]
-	= 0;
 break;
 			}
  	} else if (! strncmp(pm_cur->diskdev, "vnd", 3)) {
@@ -1925,15 +1917,11 @@ pm_getrefdev(pm_devs_t *pm_cur)
 pm_cur->refdev = [i];
 pm_getdevstring(dev, SSTRSIZE, vnds[i].pm,
 vnds[i].pm_part);
-r = snprintf(pm_cur->diskdev_descr,
-sizeof(pm_cur->diskdev_descr)-1,
+trunc_snprintf(pm_cur->diskdev_descr,
+sizeof(pm_cur->diskdev_descr),
 "%s (%s, %s)",
 pm_cur->diskdev_descr, dev,
 vnds[i].filepath);
-if (r >= 

CVS commit: src/usr.sbin/sysinst

2019-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 11 20:03:28 UTC 2019

Modified Files:
src/usr.sbin/sysinst: partman.c

Log Message:
Remove unconditional truncation - it confuses gcc


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/sysinst/partman.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/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.27 src/usr.sbin/sysinst/partman.c:1.28
--- src/usr.sbin/sysinst/partman.c:1.27	Mon Feb 11 19:58:22 2019
+++ src/usr.sbin/sysinst/partman.c	Mon Feb 11 20:03:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.27 2019/02/11 19:58:22 martin Exp $ */
+/*	$NetBSD: partman.c,v 1.28 2019/02/11 20:03:28 martin Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -1934,8 +1934,6 @@ pm_getrefdev(pm_devs_t *pm_cur)
 	pm_cur->diskdev_descr[
 	sizeof(pm_cur->diskdev_descr)-1]
 	= 0;
-pm_cur->diskdev_descr[
-sizeof(pm_cur->diskdev_descr)-1] = 0;
 break;
 			}
 	} else if (! strncmp(pm_cur->diskdev, "raid", 4)) {



CVS commit: src/usr.sbin/sysinst

2019-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 11 19:58:23 UTC 2019

Modified Files:
src/usr.sbin/sysinst: partman.c

Log Message:
Two more gcc 7 warnings when compiling wiht optimization on, one to go.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/sysinst/partman.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/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.26 src/usr.sbin/sysinst/partman.c:1.27
--- src/usr.sbin/sysinst/partman.c:1.26	Mon Feb 11 19:15:38 2019
+++ src/usr.sbin/sysinst/partman.c	Mon Feb 11 19:58:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.26 2019/02/11 19:15:38 martin Exp $ */
+/*	$NetBSD: partman.c,v 1.27 2019/02/11 19:58:22 martin Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -255,19 +255,24 @@ pm_edit(int menu_entries_count, void (*m
 static void
 pm_getdevstring(char *buf, int len, pm_devs_t *pm_cur, int num)
 {
-	int i;
+	int i, r;
 
 	if (pm_cur->isspecial)
 		snprintf(buf, len, "%s", pm_cur->diskdev);
-	else if (num + 'a' < 'a' || num + 'a' > 'a' + MAXPARTITIONS)
-		snprintf(buf, len, "%sd", pm_cur->diskdev);
-	else if (pm_cur->gpt) {
+	else if (num + 'a' < 'a' || num + 'a' > 'a' + MAXPARTITIONS) {
+		r = snprintf(buf, len-1, "%sd", pm_cur->diskdev);
+		if (r >= len)
+			buf[len] = 0;
+	} else if (pm_cur->gpt) {
 		for (i = 0; i < MAX_WEDGES; i++)
 			if (wedges[i].pm == pm_cur &&
 wedges[i].ptn == num)
 snprintf(buf, len, "dk%d", i); // XXX: xxx
-	} else
-		snprintf(buf, len, "%s%c", pm_cur->diskdev, num + 'a');
+	} else {
+		r = snprintf(buf, len-1, "%s%c", pm_cur->diskdev, num + 'a');
+		if (r >= len)
+			buf[len] = 0;
+	}
 
 	return;
 }
@@ -1918,7 +1923,8 @@ pm_getrefdev(pm_devs_t *pm_cur)
  		for (i = 0; i < MAX_VND; i++)
 			if (vnds[i].blocked && vnds[i].node == dev_num) {
 pm_cur->refdev = [i];
-pm_getdevstring(dev, SSTRSIZE, vnds[i].pm, vnds[i].pm_part);
+pm_getdevstring(dev, SSTRSIZE, vnds[i].pm,
+vnds[i].pm_part);
 r = snprintf(pm_cur->diskdev_descr,
 sizeof(pm_cur->diskdev_descr)-1,
 "%s (%s, %s)",



CVS commit: src/usr.sbin/syslogd

2019-02-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Feb 11 19:45:54 UTC 2019

Modified Files:
src/usr.sbin/syslogd: syslogd.h

Log Message:
add parens around defines with expressions that could expand poorly
depending on the usage.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/syslogd/syslogd.h

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/syslogd/syslogd.h
diff -u src/usr.sbin/syslogd/syslogd.h:1.7 src/usr.sbin/syslogd/syslogd.h:1.8
--- src/usr.sbin/syslogd/syslogd.h:1.7	Tue Sep  8 18:33:12 2015
+++ src/usr.sbin/syslogd/syslogd.h	Mon Feb 11 19:45:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: syslogd.h,v 1.7 2015/09/08 18:33:12 plunky Exp $	*/
+/*	$NetBSD: syslogd.h,v 1.8 2019/02/11 19:45:54 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -243,8 +243,8 @@ void dbprintf(const char *, const char *
 } while (/*CONSTCOND*/0)
 
 #define MAXUNAMES		20	/* maximum number of user names */
-#define BSD_TIMESTAMPLEN	14+1
-#define MAX_TIMESTAMPLEN	31+1
+#define BSD_TIMESTAMPLEN	(14+1)
+#define MAX_TIMESTAMPLEN	(31+1)
 
 /* maximum field lengths in syslog-protocol */
 #define PRI_MAX	  5



CVS commit: src/usr.sbin/sysinst

2019-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 11 19:15:38 UTC 2019

Modified Files:
src/usr.sbin/sysinst: Makefile.inc partman.c

Log Message:
Make sure we properly truncate snprintf() results when the target buffer
is too small, in a way that appeases gcc 7 warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/sysinst/Makefile.inc
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sysinst/partman.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/sysinst/Makefile.inc
diff -u src/usr.sbin/sysinst/Makefile.inc:1.17 src/usr.sbin/sysinst/Makefile.inc:1.18
--- src/usr.sbin/sysinst/Makefile.inc:1.17	Mon Feb  4 10:22:15 2019
+++ src/usr.sbin/sysinst/Makefile.inc	Mon Feb 11 19:15:38 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.17 2019/02/04 10:22:15 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.18 2019/02/11 19:15:38 martin Exp $
 #
 # Makefile for sysinst
 
@@ -118,11 +118,6 @@ COPTS.bsddisklabel.c += -Wno-format-nonl
 COPTS.md.c += -Wno-format-nonliteral
 COPTS.partman.c += -Wno-format-nonliteral -Wno-stack-protector
 
-# Lots of warnings
-.if defined(HAVE_GCC) && ${HAVE_GCC} == 7 && ${ACTIVE_CC} == "gcc"
-COPTS.partman.c+=	-Wno-error=format-truncation
-.endif
-
 # Host to ftp from.  Default:
 #	"ftp.NetBSD.org"
 #

Index: src/usr.sbin/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.25 src/usr.sbin/sysinst/partman.c:1.26
--- src/usr.sbin/sysinst/partman.c:1.25	Thu Dec 13 12:28:25 2018
+++ src/usr.sbin/sysinst/partman.c	Mon Feb 11 19:15:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.25 2018/12/13 12:28:25 martin Exp $ */
+/*	$NetBSD: partman.c,v 1.26 2019/02/11 19:15:38 martin Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -1893,7 +1893,7 @@ pm_gpt_commit(void)
 int
 pm_getrefdev(pm_devs_t *pm_cur)
 {
-	int i, ii, dev_num, num_devs, num_devs_s;
+	int i, ii, dev_num, num_devs, num_devs_s, r;
 	char dev[SSTRSIZE]; dev[0] = '\0';
 
 	pm_cur->refdev = NULL;
@@ -1902,10 +1902,15 @@ pm_getrefdev(pm_devs_t *pm_cur)
 		for (i = 0; i < MAX_CGD; i++)
 			if (cgds[i].blocked && cgds[i].node == dev_num) {
 pm_cur->refdev = [i];
-
-snprintf(pm_cur->diskdev_descr, STRSIZE, "%s (%s, %s-%d)",
-	pm_cur->diskdev_descr, cgds[i].pm_name,
-	cgds[i].enc_type, cgds[i].key_size);
+r = snprintf(pm_cur->diskdev_descr,
+sizeof(pm_cur->diskdev_descr)-1,
+"%s (%s, %s-%d)",
+pm_cur->diskdev_descr, cgds[i].pm_name,
+cgds[i].enc_type, cgds[i].key_size);
+if (r >= (int)sizeof(pm_cur->diskdev_descr))
+	pm_cur->diskdev_descr[
+	sizeof(pm_cur->diskdev_descr)-1]
+	= 0;
 break;
 			}
  	} else if (! strncmp(pm_cur->diskdev, "vnd", 3)) {
@@ -1914,8 +1919,17 @@ pm_getrefdev(pm_devs_t *pm_cur)
 			if (vnds[i].blocked && vnds[i].node == dev_num) {
 pm_cur->refdev = [i];
 pm_getdevstring(dev, SSTRSIZE, vnds[i].pm, vnds[i].pm_part);
-snprintf(pm_cur->diskdev_descr, STRSIZE, "%s (%s, %s)",
-	pm_cur->diskdev_descr, dev, vnds[i].filepath);
+r = snprintf(pm_cur->diskdev_descr,
+sizeof(pm_cur->diskdev_descr)-1,
+"%s (%s, %s)",
+pm_cur->diskdev_descr, dev,
+vnds[i].filepath);
+if (r >= (int)sizeof(pm_cur->diskdev_descr))
+	pm_cur->diskdev_descr[
+	sizeof(pm_cur->diskdev_descr)-1]
+	= 0;
+pm_cur->diskdev_descr[
+sizeof(pm_cur->diskdev_descr)-1] = 0;
 break;
 			}
 	} else if (! strncmp(pm_cur->diskdev, "raid", 4)) {
@@ -1931,9 +1945,14 @@ pm_getrefdev(pm_devs_t *pm_cur)
 		else
 			num_devs++;
 	}
-snprintf(pm_cur->diskdev_descr, STRSIZE,
+r = snprintf(pm_cur->diskdev_descr,
+	sizeof(pm_cur->diskdev_descr)-1,
 	"%s (lvl %d, %d disks, %d spare)", pm_cur->diskdev_descr,
 	raids[i].raid_level, num_devs, num_devs_s);
+if (r >= (int)sizeof(pm_cur->diskdev_descr))
+	pm_cur->diskdev_descr[
+	sizeof(pm_cur->diskdev_descr)-1]
+	= 0;
 break;
 			}
 	} else
@@ -2178,13 +2197,16 @@ pm_mountall(void)
 static int
 pm_mount(pm_devs_t *pm_cur, int part_num)
 {
-	int error = 0;
+	int error = 0, r;
 	char buf[MOUNTLEN];
 
 	if (strlen(pm_cur->bsdlabel[part_num].mounted) > 0)
 		return 0;
 
-	snprintf(buf, MOUNTLEN, "/tmp/%s%c", pm_cur->diskdev, part_num + 'a');
+	r = snprintf(buf, sizeof(buf)-1, "/tmp/%s%c", pm_cur->diskdev,
+	part_num + 'a');
+	if (r >= (int)sizeof(buf))
+		buf[sizeof(buf)-1] = 0;
 	if (! dir_exists_p(buf))
 		run_program(RUN_DISPLAY | RUN_PROGRESS, "/bin/mkdir -p %s", buf);
 	if (pm_cur->bsdlabel[part_num].pi_flags & PIF_MOUNT &&
@@ -2479,7 +2501,7 @@ pm_menufmt(menudesc *m, int opt, void *a
 {
 	const char *dev_status = "";
 	char buf[STRSIZE];
-	int part_num = ((part_entry_t *)arg)[opt].dev_num;
+	int r, part_num = ((part_entry_t *)arg)[opt].dev_num;
 	pm_devs_t *pm_cur = ((part_entry_t *)arg)[opt].dev_ptr;
 
 	switch (((part_entry_t *)arg)[opt].type) {
@@ 

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

2019-02-11 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Feb 11 18:50:15 UTC 2019

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

Log Message:
Detect and report running in a XEN hvm container.

This allows the lapic code to apply its x2apic probe logic while
running in a XEN hvm container.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/x86/x86/identcpu.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/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.87 src/sys/arch/x86/x86/identcpu.c:1.88
--- src/sys/arch/x86/x86/identcpu.c:1.87	Mon Feb 11 14:59:33 2019
+++ src/sys/arch/x86/x86/identcpu.c	Mon Feb 11 18:50:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.87 2019/02/11 14:59:33 cherry Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.88 2019/02/11 18:50:15 cherry Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.87 2019/02/11 14:59:33 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.88 2019/02/11 18:50:15 cherry Exp $");
 
 #include "opt_xen.h"
 
@@ -1125,6 +1125,8 @@ identify_hypervisor(void)
 vm_guest = VM_GUEST_HV;
 			else if (memcmp(hv_vendor, "KVMKVMKVM\0\0\0", 12) == 0)
 vm_guest = VM_GUEST_KVM;
+			else if (memcmp(hv_vendor, "XenVMMXenVMM", 12) == 0)
+vm_guest = VM_GUEST_XEN;
 			/* FreeBSD bhyve: "bhyve bhyve " */
 			/* OpenBSD vmm:   "OpenBSDVMM58" */
 			/* NetBSD nvmm:   "___ NVMM ___" */



CVS commit: src/external/cddl/osnet/lib/libdtrace

2019-02-11 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Mon Feb 11 17:49:37 UTC 2019

Modified Files:
src/external/cddl/osnet/lib/libdtrace: Makefile

Log Message:
-Wno-format-truncation is only needed when using GCC


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/cddl/osnet/lib/libdtrace/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/cddl/osnet/lib/libdtrace/Makefile
diff -u src/external/cddl/osnet/lib/libdtrace/Makefile:1.20 src/external/cddl/osnet/lib/libdtrace/Makefile:1.21
--- src/external/cddl/osnet/lib/libdtrace/Makefile:1.20	Wed Feb  6 04:23:16 2019
+++ src/external/cddl/osnet/lib/libdtrace/Makefile	Mon Feb 11 17:49:37 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.20 2019/02/06 04:23:16 christos Exp $
+#	$NetBSD: Makefile,v 1.21 2019/02/11 17:49:37 tnn Exp $
 
 # $FreeBSD: head/cddl/lib/libdtrace/Makefile 314654 2017-03-04 11:30:04Z ngie $
 
@@ -105,7 +105,7 @@ CPPFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/
 CPPFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/uts/arm
 .PATH:		${.CURDIR}/../../dist/lib/libdtrace/arm
 .endif
-COPTS.dt_link.c	+= -Wno-format-truncation
+COPTS.dt_link.c	+= ${${ACTIVE_CC} == "gcc" :? -Wno-format-truncation :}
 
 LFLAGS+=-l
 



CVS commit: src/sys/arch/i386/i386

2019-02-11 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Feb 11 17:28:52 UTC 2019

Modified Files:
src/sys/arch/i386/i386: i386_trap.S

Log Message:
Remove redundant conditional IDT_VEC() entries.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/i386/i386/i386_trap.S

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

Modified files:

Index: src/sys/arch/i386/i386/i386_trap.S
diff -u src/sys/arch/i386/i386/i386_trap.S:1.17 src/sys/arch/i386/i386/i386_trap.S:1.18
--- src/sys/arch/i386/i386/i386_trap.S:1.17	Mon Feb 11 14:59:32 2019
+++ src/sys/arch/i386/i386/i386_trap.S	Mon Feb 11 17:28:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386_trap.S,v 1.17 2019/02/11 14:59:32 cherry Exp $	*/
+/*	$NetBSD: i386_trap.S,v 1.18 2019/02/11 17:28:52 cherry Exp $	*/
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -66,7 +66,7 @@
 
 #if 0
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.17 2019/02/11 14:59:32 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.18 2019/02/11 17:28:52 cherry Exp $");
 #endif
 
 /*
@@ -345,13 +345,8 @@ IDTVEC_END(trap17)
 IDTVEC_END(trap16)
 IDTVEC_END(trap15)
 IDTVEC_END(trap14)
-#ifndef XENPV
 IDTVEC_END(trap13)
 IDTVEC_END(trap12)
-#else
-IDTVEC_END(trap13)
-IDTVEC_END(trap12)
-#endif
 IDTVEC_END(trap11)
 
 IDTVEC(exceptions)



CVS commit: src/sys/arch

2019-02-11 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Mon Feb 11 14:59:33 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: amd64_trap.S cpufunc.S db_interface.c gdt.c
genassym.cf lock_stubs.S locore.S machdep.c process_machdep.c spl.S
trap.c vector.S
src/sys/arch/amd64/conf: XEN3_DOM0 XEN3_DOMU
src/sys/arch/amd64/include: cpu.h frame.h frameasm.h param.h pmap.h
profile.h segments.h types.h vmparam.h
src/sys/arch/i386/conf: XEN3PAE_DOM0 XEN3PAE_DOMU
src/sys/arch/i386/i386: cpufunc.S db_interface.c gdt.c genassym.cf
i386_trap.S lock_stubs.S locore.S machdep.c spl.S trap.c vector.S
src/sys/arch/i386/include: cpu.h frame.h frameasm.h pmap.h segments.h
vmparam.h
src/sys/arch/x86/acpi: acpi_machdep.c
src/sys/arch/x86/include: cpu.h cpuvar.h intr.h intrdefs.h pmap.h
specialreg.h
src/sys/arch/x86/isa: isa_machdep.c
src/sys/arch/x86/pci: pci_intr_machdep.c pci_machdep.c pcib.c
src/sys/arch/x86/x86: bios32.c bus_space.c cpu_ucode.c fpu.c i8259.c
identcpu.c idt.c pmap.c sys_machdep.c vm_machdep.c x86_machdep.c
x86_tlb.c

Log Message:
We reorganise definitions for XEN source support as follows:

XEN - common sources required for baseline XEN support.
XENPV - sources required for support of XEN in PV mode.
XENPVHVM - sources required for support for XEN in HVM mode.
XENPVH - sources required for support for XEN in PVH mode.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/amd64/amd64/amd64_trap.S \
src/sys/arch/amd64/amd64/gdt.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/amd64/amd64/cpufunc.S
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/amd64/amd64/db_interface.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/amd64/amd64/genassym.cf
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/amd64/amd64/lock_stubs.S
cvs rdiff -u -r1.175 -r1.176 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.324 -r1.325 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/amd64/amd64/process_machdep.c \
src/sys/arch/amd64/amd64/spl.S
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/amd64/amd64/trap.c
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/amd64/conf/XEN3_DOMU
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/amd64/include/cpu.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/amd64/include/frame.h
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/amd64/include/frameasm.h
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/amd64/include/param.h
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/amd64/include/pmap.h \
src/sys/arch/amd64/include/types.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/amd64/include/profile.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/amd64/include/segments.h
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/amd64/include/vmparam.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/conf/XEN3PAE_DOM0
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/conf/XEN3PAE_DOMU
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/i386/i386/cpufunc.S
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/i386/i386/db_interface.c
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/i386/i386/gdt.c
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/i386/i386/genassym.cf
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/i386/i386/i386_trap.S
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/i386/i386/lock_stubs.S
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.814 -r1.815 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/i386/i386/spl.S
cvs rdiff -u -r1.297 -r1.298 src/sys/arch/i386/i386/trap.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/i386/i386/vector.S
cvs rdiff -u -r1.180 -r1.181 src/sys/arch/i386/include/cpu.h
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/i386/include/frame.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/i386/include/frameasm.h
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/i386/include/pmap.h
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/i386/include/segments.h
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/i386/include/vmparam.h
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/x86/acpi/acpi_machdep.c
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/x86/include/cpuvar.h
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/x86/include/intr.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/include/intrdefs.h
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/x86/include/pmap.h
cvs rdiff -u -r1.139 -r1.140 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/x86/isa/isa_machdep.c
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/x86/pci/pci_intr_machdep.c
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/x86/pci/pci_machdep.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/x86/pci/pcib.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/x86/bios32.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/x86/x86/bus_space.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/x86/cpu_ucode.c
cvs rdiff -u -r1.49 -r1.50 

CVS commit: [netbsd-8] src/doc

2019-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 11 13:45:33 UTC 2019

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

Log Message:
Tickets #1187, #1188 and #1189


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.105 -r1.1.2.106 src/doc/CHANGES-8.1

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.105 src/doc/CHANGES-8.1:1.1.2.106
--- src/doc/CHANGES-8.1:1.1.2.105	Sun Feb 10 13:41:35 2019
+++ src/doc/CHANGES-8.1	Mon Feb 11 13:45:33 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.105 2019/02/10 13:41:35 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.106 2019/02/11 13:45:33 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -2447,3 +2447,32 @@ lib/libperfuse/perfuse_priv.h			1.37
 	Fix directory filehandle usage with libufse. Fix lookup count.
 	[manu, ticket #1186]
 
+sys/arch/x86/include/specialreg.h		1.138
+usr.sbin/cpuctl/arch/i386.c			1.92
+
+	- Add new CPUID flags WAITPKG, CLDEMOTE, MOVDIRI, MOVDIR64B and
+	   IA32_CORE_CAPABILITIES.
+	- Add Ice Lake and Tremont.
+	- Fix performance monitoring bitstring format.
+	[msaitoh, ticket #1187]
+
+sys/dev/pci/pcidevs1.1357,1.1359-1.1362
+sys/dev/pci/pcidevs.h(regen)
+sys/dev/pci/pcidevs_data.h			(regen)
+
+	- Add yet another Intel Core QuickPath Generic Non-Core Register.
+	- Add some RADEON devices.
+	- Add AMD Family 17h devices.
+	- Add NetXen's vendor ID and devices.
+	- Add Sun Neptune.
+	- Add Some Freescale MPC834x devices.
+	- Add Intel I210 SGMII Flash-less device.
+	[msaitoh, ticket #1188]
+
+sys/dev/pci/if_wm.c1.622,1.624,1.625
+
+	We now have IFM_2500_KX and IFM_1000_KX, so use them.
+	I21[01]'s RAL size is not 15 but 16.
+	Fix a bug that WOL didn't work on some chips.
+	[msaitoh, ticket #1189]
+



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

2019-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 11 13:44:34 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1189):

sys/dev/pci/if_wm.c: revision 1.622
sys/dev/pci/if_wm.c: revision 1.624
sys/dev/pci/if_wm.c: revision 1.625

 We now have IFM_2500_KX and IFM_1000_KX, so use them.

 -

 I21[01]'s RAL size is not 15 but 16(== 82575's value). Same as other OSes.

 -

 Fix a bug that WOL didn't work on some chips since if_wm.c rev. 1.610.

Set WUC_APME bit older than PCH. Will fixes PR kern/53945 reported by kardel@.
Tested with my own 82574 card.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.29 -r1.508.4.30 src/sys/dev/pci/if_wm.c

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.29 src/sys/dev/pci/if_wm.c:1.508.4.30
--- src/sys/dev/pci/if_wm.c:1.508.4.29	Thu Jan 31 06:43:48 2019
+++ src/sys/dev/pci/if_wm.c	Mon Feb 11 13:44:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.29 2019/01/31 06:43:48 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.30 2019/02/11 13:44:34 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.29 2019/01/31 06:43:48 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.30 2019/02/11 13:44:34 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -3597,6 +3597,8 @@ wm_rar_count(struct wm_softc *sc)
 		size = WM_RAL_TABSIZE_PCH_LPT;
 		break;
 	case WM_T_82575:
+	case WM_T_I210:
+	case WM_T_I211:
 		size = WM_RAL_TABSIZE_82575;
 		break;
 	case WM_T_82576:
@@ -11895,9 +11897,9 @@ wm_serdes_mediastatus(struct ifnet *ifp,
 		status = CSR_READ(sc, WMREG_STATUS);
 		if (((status & STATUS_2P5_SKU) != 0)
 		&& ((status & STATUS_2P5_SKU_OVER) == 0)) {
-			ifmr->ifm_active |= IFM_2500_SX; /* XXX KX */
+			ifmr->ifm_active |= IFM_2500_KX;
 		} else
-			ifmr->ifm_active |= IFM_1000_SX; /* XXX KX */
+			ifmr->ifm_active |= IFM_1000_KX;
 	} else {
 		switch (__SHIFTOUT(reg, PCS_LSTS_SPEED)) {
 		case PCS_LSTS_SPEED_10:
@@ -14700,7 +14702,7 @@ wm_enable_wakeup(struct wm_softc *sc)
 			goto pme;
 	} else {
 		/* Enable wakeup by the MAC */
-		CSR_WRITE(sc, WMREG_WUC, WUC_PME_EN);
+		CSR_WRITE(sc, WMREG_WUC, WUC_APME | WUC_PME_EN);
 		CSR_WRITE(sc, WMREG_WUFC, WUFC_MAG);
 	}
 



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

2019-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 11 13:38:19 UTC 2019

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

Log Message:
Regen for ticket #1188


To generate a diff of this commit:
cvs rdiff -u -r1.1281.2.12 -r1.1281.2.13 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1280.2.12 -r1.1280.2.13 src/sys/dev/pci/pcidevs_data.h

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

diffs are larger than 1MB and have been omitted


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

2019-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 11 13:34:09 UTC 2019

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

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1188):

sys/dev/pci/pcidevs: revision 1.1360
sys/dev/pci/pcidevs: revision 1.1361
sys/dev/pci/pcidevs: revision 1.1362
sys/dev/pci/pcidevs: revision 1.1357
sys/dev/pci/pcidevs: revision 1.1359

 Add yet another Intel Core QuickPath Generic Non-Core Register.

 Add some RADEON devices. Mainly taken from OpenBSD.

 Add AMD Family 17h devices from OpenBSD.

>From OpenBSD:
- Add NetXen's vendor ID and devices.
- Add Sun Neptune.

- Add Some Freescale MPC834x devices from OpenBSD.

- Add Intel I210 SGMII Flash-less device from the spec update document.


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

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1289.2.12 src/sys/dev/pci/pcidevs:1.1289.2.13
--- src/sys/dev/pci/pcidevs:1.1289.2.12	Tue Dec  4 12:02:12 2018
+++ src/sys/dev/pci/pcidevs	Mon Feb 11 13:34:09 2019
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1289.2.12 2018/12/04 12:02:12 martin Exp $
+$NetBSD: pcidevs,v 1.1289.2.13 2019/02/11 13:34:09 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -657,6 +657,7 @@ vendor HINT		0x3388	HiNT
 vendor 3DLABS		0x3d3d	3D Labs
 vendor AVANCE2		0x4005	Avance Logic (2nd PCI Vendor ID)
 vendor ADDTRON		0x4033	Addtron Technology
+vendor NETXEN		0x4040	NetXen
 vendor QINHENG		0x4348	Nanjing QinHeng Electronics
 vendor ICOMPRESSION	0x	Conexant (iCompression)
 vendor INDCOMPSRC	0x494f	Industrial Computer Source
@@ -1002,6 +1003,24 @@ product AMD F15_30_HB	0x1424	Family15h H
 product AMD F15_30_RP_5	0x1425	Family15h Root Port
 product AMD F15_30_RP_6	0x1426	Family15h Root Port
 product AMD F16_GPPB	0x1439	Family16h GPP Bridge
+product AMD F17_RC	0x1450	Family17h Root Complex
+product AMD F17_IOMMU	0x1451	Family17h IOMMU
+product AMD F17_PCIE_1	0x1452	Family17h PCIE
+product AMD F17_PCIE_2	0x1453	Family17h PCIE
+product AMD F17_PCIE_3	0x1454	Family17h PCIE
+product AMD F17_HDA	0x1457	Family17h HD Audio
+product AMD F17_XHCI	0x145c	Family17h xHCI
+product AMD F17_XHCI_2	0x145f	Family17h xHCI
+product AMD F17_DF_1	0x1460	Family17h Data Fabric
+product AMD F17_DF_2	0x1461	Family17h Data Fabric
+product AMD F17_DF_3	0x1462	Family17h Data Fabric
+product AMD F17_DF_4	0x1463	Family17h Data Fabric
+product AMD F17_DF_5	0x1464	Family17h Data Fabric
+product AMD F17_DF_6	0x1465	Family17h Data Fabric
+product AMD F17_DF_7	0x1466	Family17h Data Fabric
+product AMD F17_DF_8	0x1467	Family17h Data Fabric
+product AMD F17_PCIE_4	0x1470	Family17h PCIE
+product AMD F17_PCIE_5	0x1471	Family17h PCIE
 product AMD F14_RC	0x1510	Family14h Root Complex
 product AMD F16_HT	0x1530	Family16h HyperTransport Configuration
 product AMD F16_ADDR	0x1531	Family16h Address Map Configuration
@@ -1033,6 +1052,21 @@ product AMD F16_30_DRAM	0x1582	Family16h
 product AMD F16_30_NB	0x1583	Family16h North Bridge Configuration
 product AMD F16_30_CSTATE	0x1584	Family16h CPU C-state Configuration
 product AMD F16_30_MISC	0x1585	Family16h Miscellaneous Configuration
+product AMD F17_1X_RC	0x15d0	Family17h/1xh Root Complex
+product AMD F17_1X_IOMMU 0x15d1	Family17h/1xh IOMMU
+product AMD F17_1X_PCIE_1 0x15d3 Family17h/1xh PCIE
+product AMD F17_1X_PCIE_2 0x15db Family17h/1xh PCIE
+product AMD F17_1X_PCIE_3 0x15dc Family17h/1xh PCIE
+product AMD F17_1X_XHCI_1 0x15e0 Family17h/1xh xHCI
+product AMD F17_1X_XHCI_2 0x15e1 Family17h/1xh xHCI
+product AMD F17_1X_DF_0	0x15e8	Family17h/1xh Data Fabric
+product AMD F17_1X_DF_1	0x15e9	Family17h/1xh Data Fabric
+product AMD F17_1X_DF_2	0x15ea	Family17h/1xh Data Fabric
+product AMD F17_1X_DF_3	0x15eb	Family17h/1xh Data Fabric
+product AMD F17_1X_DF_4	0x15ec	Family17h/1xh Data Fabric
+product AMD F17_1X_DF_5	0x15ed	Family17h/1xh Data Fabric
+product AMD F17_1X_DF_6	0x15ee	Family17h/1xh Data Fabric
+product AMD F17_1X_DF_7	0x15ef	Family17h/1xh Data Fabric
 product AMD F15_HT	0x1600	Family15h HyperTransport Configuration
 product AMD F15_ADDR	0x1601	Family15h Address Map Configuration
 product AMD F15_DRAM	0x1602	Family15h DRAM Configuration
@@ -1576,7 +1610,44 @@ product ATI RADEON_HD8530M	0x6607	Radeon
 product ATI RADEON_HD8600	0x6610	Radeon HD 8600
 product ATI RADEON_HD8570	0x6611	Radeon HD 8570
 product ATI RADEON_HD8500	0x6613	Radeon HD 8500
+product ATI RADEON_HD6970	0x6718	Radeon HD 6970
+product ATI RADEON_HD6950	0x6719	Radeon HD 6950
+product ATI RADEON_HD6990_1	0x671c	Radeon HD 6990
+product ATI RADEON_HD6990_2	0x671d	Radeon HD 6990
+product ATI RADEON_HD6930	0x671f	Radeon HD 6930
+product ATI RADEON_HD6970M	0x6720	Radeon HD 6970M
+product ATI RADEON_HD6900M	0x6725	Radeon HD 6900M
+product ATI 

CVS commit: [netbsd-8] src

2019-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Feb 11 13:23:03 UTC 2019

Modified Files:
src/sys/arch/x86/include [netbsd-8]: specialreg.h
src/usr.sbin/cpuctl/arch [netbsd-8]: i386.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1187):

usr.sbin/cpuctl/arch/i386.c: revision 1.92
sys/arch/x86/include/specialreg.h: revision 1.138

 Add new CPUID flags WAITPKG, CLDEMOTE, MOVDIRI, MOVDIR64B and
IA32_CORE_CAPABILITIES from the latest Intel SDM.

 Add Ice Lake and Tremont from the latest Intel SDM.

 Fix bitstring format of Intel CPUID Architectural Performance Monitoring
Fn000a %ebx.


To generate a diff of this commit:
cvs rdiff -u -r1.98.2.9 -r1.98.2.10 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.74.6.4 -r1.74.6.5 src/usr.sbin/cpuctl/arch/i386.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/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.98.2.9 src/sys/arch/x86/include/specialreg.h:1.98.2.10
--- src/sys/arch/x86/include/specialreg.h:1.98.2.9	Thu Dec 27 12:17:19 2018
+++ src/sys/arch/x86/include/specialreg.h	Mon Feb 11 13:23:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.98.2.9 2018/12/27 12:17:19 martin Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.98.2.10 2019/02/11 13:23:03 martin Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -398,6 +398,7 @@
 #define CPUID_SEF_UMIP		__BIT(2)  /* User-Mode Instruction prevention */
 #define CPUID_SEF_PKU		__BIT(3)  /* Protection Keys for User-mode pages */
 #define CPUID_SEF_OSPKE		__BIT(4)  /* OS has set CR4.PKE to ena. protec. keys */
+#define CPUID_SEF_WAITPKG	__BIT(5)  /* TPAUSE,UMONITOR,UMWAIT */
 #define CPUID_SEF_AVX512_VBMI2	__BIT(6)  /* AVX-512 Vector Byte Manipulation 2 */
 #define CPUID_SEF_GFNI		__BIT(8)
 #define CPUID_SEF_VAES		__BIT(9)
@@ -407,16 +408,20 @@
 #define CPUID_SEF_AVX512_VPOPCNTDQ __BIT(14)
 #define CPUID_SEF_MAWAU		__BITS(21, 17) /* MAWAU for BND{LD,ST}X */
 #define CPUID_SEF_RDPID		__BIT(22) /* RDPID and IA32_TSC_AUX */
+#define CPUID_SEF_CLDEMOTE	__BIT(25) /* Cache line demote */
+#define CPUID_SEF_MOVDIRI	__BIT(27) /* MOVDIRI instruction */
+#define CPUID_SEF_MOVDIR64B	__BIT(28) /* MOVDIR64B instruction */
 #define CPUID_SEF_SGXLC		__BIT(30) /* SGX Launch Configuration */
 
 #define CPUID_SEF_FLAGS1	"\177\20" \
 	"b\0PREFETCHWT1\0" "b\1AVX512_VBMI\0" "b\2UMIP\0" "b\3PKU\0"	\
-	"b\4OSPKE\0"			"b\6AVX512_VBMI2\0"		\
+	"b\4OSPKE\0"	"b\5WAITPKG\0"	"b\6AVX512_VBMI2\0"		  \
 	"b\10GFNI\0"	"b\11VAES\0"	"b\12VPCLMULQDQ\0" "b\13AVX512_VNNI\0"\
 	"b\14AVX512_BITALG\0"		"b\16AVX512_VPOPCNTDQ\0"	\
 	"f\21\5MAWAU\0"			\
 	"b\26RDPID\0"			\
-	"b\36SGXLC\0"
+			"b\31CLDEMOTE\0"		"b\33MOVDIRI\0"	\
+	"b\34MOVDIR64B\0"		"b\36SGXLC\0"
 
 /* %edx */
 #define CPUID_SEF_AVX512_4VNNIW	__BIT(2)
@@ -425,12 +430,13 @@
 #define CPUID_SEF_STIBP		__BIT(27) /* STIBP Speculation Control */
 #define CPUID_SEF_L1D_FLUSH	__BIT(28) /* IA32_FLUSH_CMD MSR */
 #define CPUID_SEF_ARCH_CAP	__BIT(29) /* IA32_ARCH_CAPABILITIES */
+#define CPUID_SEF_CORE_CAP	__BIT(30) /* IA32_CORE_CAPABILITIES */
 #define CPUID_SEF_SSBD		__BIT(31) /* Speculative Store Bypass Disable */
 
 #define CPUID_SEF_FLAGS2	"\20" \
 "\3" "AVX512_4VNNIW" "\4" "AVX512_4FMAPS" \
 	"\33" "IBRS"	"\34" "STIBP"	\
-	"\35" "L1D_FLUSH" "\36" "ARCH_CAP"		"\40" "SSBD"
+	"\35" "L1D_FLUSH" "\36" "ARCH_CAP" "\37CORE_CAP"	"\40" "SSBD"
 
 /*
  * Intel CPUID Architectural Performance Monitoring Fn000a

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.74.6.4 src/usr.sbin/cpuctl/arch/i386.c:1.74.6.5
--- src/usr.sbin/cpuctl/arch/i386.c:1.74.6.4	Tue Dec  4 11:52:57 2018
+++ src/usr.sbin/cpuctl/arch/i386.c	Mon Feb 11 13:23:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.74.6.4 2018/12/04 11:52:57 martin Exp $	*/
+/*	$NetBSD: i386.c,v 1.74.6.5 2019/02/11 13:23:03 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.74.6.4 2018/12/04 11:52:57 martin Exp $");
+__RCSID("$NetBSD: i386.c,v 1.74.6.5 2019/02/11 13:23:03 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -382,7 +382,9 @@ const struct cpu_cpuid_nameclass i386_cp
 [0x5f] = "Atom (Goldmont, Denverton)",
 [0x66] = "Future Core (Cannon Lake)",
 [0x7a] = "Atom (Goldmont Plus)",
+[0x7e] = "Future Core (Ice Lake)",
 [0x85] = "Xeon Phi 7215, 7285, 7295 (Knights Mill)",
+[0x86] = "Atom (Tremont)",
 [0x8e] = "7th or 8th gen Core (Kaby Lake, Coffee Lake)",
 [0x9e] = "7th or 8th gen Core (Kaby Lake, Coffee Lake)",
 			},



CVS commit: src/sys/kern

2019-02-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Feb 11 11:12:58 UTC 2019

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

Log Message:
Fix previous, pr_size includes the KASAN redzone. Repurpose pr_reqsize and
use it for PR_ZERO, it holds the size requested by the user with no padding
or redzone added, and only these bytes should be zeroed.


To generate a diff of this commit:
cvs rdiff -u -r1.232 -r1.233 src/sys/kern/subr_pool.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/subr_pool.c
diff -u src/sys/kern/subr_pool.c:1.232 src/sys/kern/subr_pool.c:1.233
--- src/sys/kern/subr_pool.c:1.232	Sun Feb 10 17:13:33 2019
+++ src/sys/kern/subr_pool.c	Mon Feb 11 11:12:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pool.c,v 1.232 2019/02/10 17:13:33 christos Exp $	*/
+/*	$NetBSD: subr_pool.c,v 1.233 2019/02/11 11:12:58 maxv Exp $	*/
 
 /*
  * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014, 2015, 2018
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.232 2019/02/10 17:13:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.233 2019/02/11 11:12:58 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -575,6 +575,7 @@ pool_init(struct pool *pp, size_t size, 
 	pp->pr_roflags = flags;
 	pp->pr_flags = 0;
 	pp->pr_size = prsize;
+	pp->pr_reqsize = size;
 	pp->pr_align = align;
 	pp->pr_wchan = wchan;
 	pp->pr_alloc = palloc;
@@ -960,7 +961,7 @@ pool_get(struct pool *pp, int flags)
 	FREECHECK_OUT(>pr_freecheck, v);
 	pool_redzone_fill(pp, v);
 	if (flags & PR_ZERO)
-		memset(v, 0, pp->pr_size);
+		memset(v, 0, pp->pr_reqsize);
 	else
 		pool_kleak_fill(pp, v);
 	return v;
@@ -2820,7 +2821,6 @@ pool_redzone_init(struct pool *pp, size_
 #endif
 
 	if (pp->pr_roflags & PR_NOTOUCH) {
-		pp->pr_reqsize = 0;
 		pp->pr_redzone = false;
 		return;
 	}
@@ -2830,7 +2830,6 @@ pool_redzone_init(struct pool *pp, size_
 	 * there's naturally space in the padding for a red zone.
 	 */
 	if (pp->pr_size - requested_size >= redzsz) {
-		pp->pr_reqsize = requested_size;
 		pp->pr_reqsize_with_redzone = requested_size + redzsz;
 		pp->pr_redzone = true;
 		return;
@@ -2844,12 +2843,10 @@ pool_redzone_init(struct pool *pp, size_
 	if (nsz <= pp->pr_alloc->pa_pagesz) {
 		/* Ok, we can */
 		pp->pr_size = nsz;
-		pp->pr_reqsize = requested_size;
 		pp->pr_reqsize_with_redzone = requested_size + redzsz;
 		pp->pr_redzone = true;
 	} else {
 		/* No space for a red zone... snif :'( */
-		pp->pr_reqsize = 0;
 		pp->pr_redzone = false;
 		printf("pool redzone disabled for '%s'\n", pp->pr_wchan);
 	}