CVS commit: src/sys/dev/hdaudio

2020-04-18 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sun Apr 19 04:13:10 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Make round_blocksize satisfy all of
- restrictions that existed before merging isaki-audio2 branch.
- better support for 6 channels hardware.
- audio layer's requirement.
This may help PR kern/54474.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/hdaudio/hdafg.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/hdaudio/hdafg.c
diff -u src/sys/dev/hdaudio/hdafg.c:1.21 src/sys/dev/hdaudio/hdafg.c:1.22
--- src/sys/dev/hdaudio/hdafg.c:1.21	Sat Feb 15 03:04:45 2020
+++ src/sys/dev/hdaudio/hdafg.c	Sun Apr 19 04:13:09 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.21 2020/02/15 03:04:45 isaki Exp $ */
+/* $NetBSD: hdafg.c,v 1.22 2020/04/19 04:13:09 isaki Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.21 2020/02/15 03:04:45 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.22 2020/04/19 04:13:09 isaki Exp $");
 
 #include 
 #include 
@@ -3942,12 +3942,28 @@ hdafg_set_format(void *opaque, int setmo
 	return 0;
 }
 
+/* LCM for round_blocksize */
+static u_int gcd(u_int, u_int);
+static u_int lcm(u_int, u_int);
+
+static u_int gcd(u_int a, u_int b)
+{
+
+	return (b == 0) ? a : gcd(b, a % b);
+}
+static u_int lcm(u_int a, u_int b)
+{
+
+	return a * b / gcd(a, b);
+}
+
 static int
 hdafg_round_blocksize(void *opaque, int blksize, int mode,
 const audio_params_t *param)
 {
 	struct hdaudio_audiodev *ad = opaque;
 	struct hdaudio_stream *st;
+	u_int minblksize;
 	int bufsize;
 
 	st = (mode == AUMODE_PLAY) ? ad->ad_playback : ad->ad_capture;
@@ -3957,6 +3973,15 @@ hdafg_round_blocksize(void *opaque, int 
 		return 128;
 	}
 
+	if (blksize > 8192)
+		blksize = 8192;
+
+	/* Make sure there are enough BDL descriptors */
+	bufsize = st->st_data.dma_size;
+	if (bufsize > HDAUDIO_BDL_MAX * blksize) {
+		blksize = bufsize / HDAUDIO_BDL_MAX;
+	}
+
 	/*
 	 * HD audio's buffer constraint looks like following:
 	 * - The buffer MUST start on a 128bytes boundary.
@@ -3964,13 +3989,15 @@ hdafg_round_blocksize(void *opaque, int 
 	 * - The buffer size is preferred multiple of 128bytes for efficiency.
 	 *
 	 * https://www.intel.co.jp/content/www/jp/ja/standards/high-definition-audio-specification.html , p70.
+	 *
+	 * Also, the audio layer requires that the blocksize must be a
+	 * multiple of the number of channels.
 	 */
+	minblksize = lcm(128, param->channels);
+	blksize = rounddown(blksize, minblksize);
+	if (blksize < minblksize)
+		blksize = minblksize;
 
-	/* Make sure there are enough BDL descriptors */
-	bufsize = st->st_data.dma_size;
-	if (bufsize > HDAUDIO_BDL_MAX * blksize) {
-		blksize = bufsize / HDAUDIO_BDL_MAX;
-	}
 	return blksize;
 }
 



CVS commit: src/sys/dev/hdaudio

2020-04-18 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sun Apr 19 04:13:10 UTC 2020

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Make round_blocksize satisfy all of
- restrictions that existed before merging isaki-audio2 branch.
- better support for 6 channels hardware.
- audio layer's requirement.
This may help PR kern/54474.


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

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



CVS commit: src/sys/dev/audio

2020-04-18 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sun Apr 19 03:52:22 UTC 2020

Modified Files:
src/sys/dev/audio: audio.c

Log Message:
Improve the blocksize notation.
The blocksize is expressed in bytes, and the millisecond notation
is supplementary information to make it easier to understand.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/audio/audio.c

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



CVS commit: src/sys/dev/audio

2020-04-18 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sun Apr 19 03:52:22 UTC 2020

Modified Files:
src/sys/dev/audio: audio.c

Log Message:
Improve the blocksize notation.
The blocksize is expressed in bytes, and the millisecond notation
is supplementary information to make it easier to understand.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/audio/audio.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/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.66 src/sys/dev/audio/audio.c:1.67
--- src/sys/dev/audio/audio.c:1.66	Fri Apr 17 07:48:35 2020
+++ src/sys/dev/audio/audio.c	Sun Apr 19 03:52:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.66 2020/04/17 07:48:35 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.67 2020/04/19 03:52:22 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -138,7 +138,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.66 2020/04/17 07:48:35 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.67 2020/04/19 03:52:22 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -4788,6 +4788,7 @@ audio_mixer_init(struct audio_softc *sc,
 	const audio_format2_t *hwfmt, const audio_filter_reg_t *reg)
 {
 	char codecbuf[64];
+	char blkdmsbuf[8];
 	audio_trackmixer_t *mixer;
 	void (*softint_handler)(void *);
 	int len;
@@ -4796,6 +4797,7 @@ audio_mixer_init(struct audio_softc *sc,
 	size_t bufsize;
 	int hwblks;
 	int blkms;
+	int blkdms;
 	int error;
 
 	KASSERT(hwfmt != NULL);
@@ -4975,13 +4977,20 @@ audio_mixer_init(struct audio_softc *sc,
 		mixer->hwbuf.fmt.precision);
 	}
 	blkms = mixer->blktime_n * 1000 / mixer->blktime_d;
-	aprint_normal_dev(sc->sc_dev, "%s:%d%s %dch %dHz, blk %dms for %s\n",
+	blkdms = (mixer->blktime_n * 1 / mixer->blktime_d) % 10;
+	blkdmsbuf[0] = '\0';
+	if (blkdms != 0) {
+		snprintf(blkdmsbuf, sizeof(blkdmsbuf), ".%1d", blkdms);
+	}
+	aprint_normal_dev(sc->sc_dev,
+	"%s:%d%s %dch %dHz, blk %d bytes (%d%sms) for %s\n",
 	audio_encoding_name(mixer->track_fmt.encoding),
 	mixer->track_fmt.precision,
 	codecbuf,
 	mixer->track_fmt.channels,
 	mixer->track_fmt.sample_rate,
-	blkms,
+	blksize,
+	blkms, blkdmsbuf,
 	(mode == AUMODE_PLAY) ? "playback" : "recording");
 
 	return 0;



CVS commit: src/sys/sys

2020-04-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 19 03:12:26 UTC 2020

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

Log Message:
do {...} while (0) to make DTRACE_PROBE macros proper statements.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/sys/sdt.h

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



CVS commit: src/sys/sys

2020-04-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 19 03:12:35 UTC 2020

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

Log Message:
Need  for uint32_t and uintptr_t.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/sys/sdt.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/sdt.h
diff -u src/sys/sys/sdt.h:1.13 src/sys/sys/sdt.h:1.14
--- src/sys/sys/sdt.h:1.13	Sun Apr 19 03:12:26 2020
+++ src/sys/sys/sdt.h	Sun Apr 19 03:12:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdt.h,v 1.13 2020/04/19 03:12:26 riastradh Exp $	*/
+/*	$NetBSD: sdt.h,v 1.14 2020/04/19 03:12:35 riastradh Exp $	*/
 
 /*-
  * Copyright 2006-2008 John Birrell 
@@ -79,6 +79,7 @@
 
 #else /* _KERNEL */
 
+#include 
 #include 
 #include 
 



CVS commit: src/sys/sys

2020-04-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 19 03:12:26 UTC 2020

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

Log Message:
do {...} while (0) to make DTRACE_PROBE macros proper statements.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/sys/sdt.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/sdt.h
diff -u src/sys/sys/sdt.h:1.12 src/sys/sys/sdt.h:1.13
--- src/sys/sys/sdt.h:1.12	Wed Oct 16 18:29:49 2019
+++ src/sys/sys/sdt.h	Sun Apr 19 03:12:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdt.h,v 1.12 2019/10/16 18:29:49 christos Exp $	*/
+/*	$NetBSD: sdt.h,v 1.13 2020/04/19 03:12:26 riastradh Exp $	*/
 
 /*-
  * Copyright 2006-2008 John Birrell 
@@ -37,45 +37,45 @@
 
 #define	_DTRACE_VERSION	1
 
-#define	DTRACE_PROBE(prov, name) {\
+#define	DTRACE_PROBE(prov, name) do {\
 	extern void __dtrace_##prov##___##name(void);		\
 	__dtrace_##prov##___##name();\
-}
+} while (0)
 
-#define	DTRACE_PROBE1(prov, name, arg1) {			\
+#define	DTRACE_PROBE1(prov, name, arg1) do {			\
 	extern void __dtrace_##prov##___##name(unsigned long);	\
 	__dtrace_##prov##___##name((unsigned long)arg1);	\
-}
+} while (0)
 
-#define	DTRACE_PROBE2(prov, name, arg1, arg2) {			\
+#define	DTRACE_PROBE2(prov, name, arg1, arg2) do {		\
 	extern void __dtrace_##prov##___##name(unsigned long,	\
 	unsigned long);	\
 	__dtrace_##prov##___##name((unsigned long)arg1,		\
 	(unsigned long)arg2);\
-}
+} while (0)
 
-#define	DTRACE_PROBE3(prov, name, arg1, arg2, arg3) {		\
+#define	DTRACE_PROBE3(prov, name, arg1, arg2, arg3) do {	\
 	extern void __dtrace_##prov##___##name(unsigned long,	\
 	unsigned long, unsigned long);			\
 	__dtrace_##prov##___##name((unsigned long)arg1,		\
 	(unsigned long)arg2, (unsigned long)arg3);		\
-}
+} while (0)
 
-#define	DTRACE_PROBE4(prov, name, arg1, arg2, arg3, arg4) {	\
+#define	DTRACE_PROBE4(prov, name, arg1, arg2, arg3, arg4) do {	\
 	extern void __dtrace_##prov##___##name(unsigned long,	\
 	unsigned long, unsigned long, unsigned long);	\
 	__dtrace_##prov##___##name((unsigned long)arg1,		\
 	(unsigned long)arg2, (unsigned long)arg3,		\
 	(unsigned long)arg4);\
-}
+} while (0)
 
-#define	DTRACE_PROBE5(prov, name, arg1, arg2, arg3, arg4, arg5) {	\
+#define	DTRACE_PROBE5(prov, name, arg1, arg2, arg3, arg4, arg5) do {	\
 	extern void __dtrace_##prov##___##name(unsigned long,		\
 	unsigned long, unsigned long, unsigned long, unsigned long);\
 	__dtrace_##prov##___##name((unsigned long)arg1,			\
 	(unsigned long)arg2, (unsigned long)arg3,			\
 	(unsigned long)arg4, (unsigned long)arg5);			\
-}
+} while (0)
 
 #else /* _KERNEL */
 



CVS commit: src/sys/sys

2020-04-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Apr 19 03:12:35 UTC 2020

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

Log Message:
Need  for uint32_t and uintptr_t.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/sys/sdt.h

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



CVS commit: src

2020-04-18 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Apr 19 01:06:16 UTC 2020

Modified Files:
src/lib/libc/gen: pthread_atfork.c
src/libexec/ld.elf_so: rtld.c rtld.h symbols.map

Log Message:
Rename __atomic_fork to __locked_fork and give it  as argument.
rtld and libc use different storage, so the initial version would
incorrectly report the failure reason for fork().

There is still a small race condition inside ld.elf_so as it doesn't use
thread-safe errno internally, but that's a more contained internal
issue.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/gen/pthread_atfork.c
cvs rdiff -u -r1.204 -r1.205 src/libexec/ld.elf_so/rtld.c
cvs rdiff -u -r1.139 -r1.140 src/libexec/ld.elf_so/rtld.h
cvs rdiff -u -r1.3 -r1.4 src/libexec/ld.elf_so/symbols.map

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



CVS commit: src

2020-04-18 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Apr 19 01:06:16 UTC 2020

Modified Files:
src/lib/libc/gen: pthread_atfork.c
src/libexec/ld.elf_so: rtld.c rtld.h symbols.map

Log Message:
Rename __atomic_fork to __locked_fork and give it  as argument.
rtld and libc use different storage, so the initial version would
incorrectly report the failure reason for fork().

There is still a small race condition inside ld.elf_so as it doesn't use
thread-safe errno internally, but that's a more contained internal
issue.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/gen/pthread_atfork.c
cvs rdiff -u -r1.204 -r1.205 src/libexec/ld.elf_so/rtld.c
cvs rdiff -u -r1.139 -r1.140 src/libexec/ld.elf_so/rtld.h
cvs rdiff -u -r1.3 -r1.4 src/libexec/ld.elf_so/symbols.map

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

Modified files:

Index: src/lib/libc/gen/pthread_atfork.c
diff -u src/lib/libc/gen/pthread_atfork.c:1.13 src/lib/libc/gen/pthread_atfork.c:1.14
--- src/lib/libc/gen/pthread_atfork.c:1.13	Thu Apr 16 14:39:58 2020
+++ src/lib/libc/gen/pthread_atfork.c	Sun Apr 19 01:06:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread_atfork.c,v 1.13 2020/04/16 14:39:58 joerg Exp $	*/
+/*	$NetBSD: pthread_atfork.c,v 1.14 2020/04/19 01:06:15 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: pthread_atfork.c,v 1.13 2020/04/16 14:39:58 joerg Exp $");
+__RCSID("$NetBSD: pthread_atfork.c,v 1.14 2020/04/19 01:06:15 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -48,10 +48,10 @@ __weak_alias(fork, _fork)
 #endif /* __weak_alias */
 
 pid_t	__fork(void);	/* XXX */
-pid_t	__atomic_fork(void) __weak; /* XXX */
+pid_t	__locked_fork(int *) __weak; /* XXX */
 
 pid_t
-__atomic_fork(void)
+__locked_fork(int *my_errno)
 {
 	return __fork();
 }
@@ -164,7 +164,7 @@ fork(void)
 	SIMPLEQ_FOREACH(iter, , next)
 		(*iter->fn)();
 
-	ret = __atomic_fork();
+	ret = __locked_fork();
 
 	if (ret != 0) {
 		/*

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.204 src/libexec/ld.elf_so/rtld.c:1.205
--- src/libexec/ld.elf_so/rtld.c:1.204	Thu Apr 16 14:39:58 2020
+++ src/libexec/ld.elf_so/rtld.c	Sun Apr 19 01:06:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.204 2020/04/16 14:39:58 joerg Exp $	 */
+/*	$NetBSD: rtld.c,v 1.205 2020/04/19 01:06:15 joerg Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: rtld.c,v 1.204 2020/04/16 14:39:58 joerg Exp $");
+__RCSID("$NetBSD: rtld.c,v 1.205 2020/04/19 01:06:15 joerg Exp $");
 #endif /* not lint */
 
 #include 
@@ -1535,13 +1535,15 @@ __dl_cxa_refcount(void *addr, ssize_t de
 pid_t __fork(void);
 
 __dso_public pid_t
-__atomic_fork(void)
+__locked_fork(int *my_errno)
 {
 	sigset_t mask;
 	pid_t result;
 
 	_rtld_exclusive_enter();
 	result = __fork();
+	if (result == -1)
+		*my_errno = errno;
 	_rtld_exclusive_exit();
 
 	return result;

Index: src/libexec/ld.elf_so/rtld.h
diff -u src/libexec/ld.elf_so/rtld.h:1.139 src/libexec/ld.elf_so/rtld.h:1.140
--- src/libexec/ld.elf_so/rtld.h:1.139	Thu Apr 16 14:39:58 2020
+++ src/libexec/ld.elf_so/rtld.h	Sun Apr 19 01:06:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.h,v 1.139 2020/04/16 14:39:58 joerg Exp $	 */
+/*	$NetBSD: rtld.h,v 1.140 2020/04/19 01:06:15 joerg Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -370,7 +370,7 @@ __dso_public int dl_iterate_phdr(int (*)
 __dso_public void *_dlauxinfo(void) __pure;
 __dso_public void __dl_cxa_refcount(void *addr, ssize_t delta);
 
-__dso_public pid_t __atomic_fork(void);
+__dso_public pid_t __locked_fork(int *);
 
 #if defined(__ARM_EABI__) && !defined(__ARM_DWARF_EH__)
 /*

Index: src/libexec/ld.elf_so/symbols.map
diff -u src/libexec/ld.elf_so/symbols.map:1.3 src/libexec/ld.elf_so/symbols.map:1.4
--- src/libexec/ld.elf_so/symbols.map:1.3	Thu Apr 16 14:39:58 2020
+++ src/libexec/ld.elf_so/symbols.map	Sun Apr 19 01:06:15 2020
@@ -23,6 +23,6 @@
 ___tls_get_addr;
 __gnu_Unwind_Find_exidx;
 __dl_cxa_refcount;
-__atomic_fork;
+__locked_fork;
   local: *;
 };



CVS commit: src/lib/libc

2020-04-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr 18 23:55:52 UTC 2020

Modified Files:
src/lib/libc/arch/aarch64/sys: syscall.S
src/lib/libc/arch/alpha/sys: syscall.S
src/lib/libc/arch/arm/sys: syscall.S
src/lib/libc/arch/hppa/sys: syscall.S
src/lib/libc/arch/i386/sys: syscall.S
src/lib/libc/arch/ia64/sys: syscall.S
src/lib/libc/arch/m68k/sys: syscall.S
src/lib/libc/arch/mips/sys: __syscall.S syscall.S
src/lib/libc/arch/or1k/sys: __syscall.S
src/lib/libc/arch/powerpc/sys: __syscall.S
src/lib/libc/arch/powerpc64/sys: __syscall.S
src/lib/libc/arch/riscv/sys: __syscall.S
src/lib/libc/arch/sh3/sys: syscall.S
src/lib/libc/arch/sparc/sys: syscall.S
src/lib/libc/arch/sparc64/sys: syscall.S
src/lib/libc/arch/vax/sys: syscall.S
src/lib/libc/arch/x86_64/sys: syscall.S
src/lib/libc/include: namespace.h

Log Message:
Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/sys/syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/alpha/sys/syscall.S
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/arm/sys/syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/hppa/sys/syscall.S
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/i386/sys/syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/ia64/sys/syscall.S
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/m68k/sys/syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/mips/sys/__syscall.S
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/mips/sys/syscall.S
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/or1k/sys/__syscall.S
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/powerpc/sys/__syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/powerpc64/sys/__syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/riscv/sys/__syscall.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/sh3/sys/syscall.S
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/sparc/sys/syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/sparc64/sys/syscall.S
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/vax/sys/syscall.S
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/x86_64/sys/syscall.S
cvs rdiff -u -r1.197 -r1.198 src/lib/libc/include/namespace.h

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/arch/aarch64/sys/syscall.S
diff -u src/lib/libc/arch/aarch64/sys/syscall.S:1.1 src/lib/libc/arch/aarch64/sys/syscall.S:1.2
--- src/lib/libc/arch/aarch64/sys/syscall.S:1.1	Sun Aug 10 05:47:37 2014
+++ src/lib/libc/arch/aarch64/sys/syscall.S	Sat Apr 18 23:55:50 2020
@@ -1,6 +1,7 @@
-/* $NetBSD: syscall.S,v 1.1 2014/08/10 05:47:37 matt Exp $ */
+/* $NetBSD: syscall.S,v 1.2 2020/04/18 23:55:50 thorpej Exp $ */
 
-#define FUNCNAME	syscall
+#define FUNCNAME	_syscall
 #define	SYSTRAP_SYSCALL	SYSTRAP(syscall)
 
 #include "__syscall.S"
+WEAK_ALIAS(syscall,_syscall)

Index: src/lib/libc/arch/alpha/sys/syscall.S
diff -u src/lib/libc/arch/alpha/sys/syscall.S:1.2 src/lib/libc/arch/alpha/sys/syscall.S:1.3
--- src/lib/libc/arch/alpha/sys/syscall.S:1.2	Wed Jun 14 06:49:03 2000
+++ src/lib/libc/arch/alpha/sys/syscall.S	Sat Apr 18 23:55:50 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: syscall.S,v 1.2 2000/06/14 06:49:03 cgd Exp $ */
+/* $NetBSD: syscall.S,v 1.3 2020/04/18 23:55:50 thorpej Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -29,4 +29,4 @@
 
 #include "SYS.h"
 
-RSYSCALL(syscall)
+WSYSCALL(syscall,_syscall)

Index: src/lib/libc/arch/arm/sys/syscall.S
diff -u src/lib/libc/arch/arm/sys/syscall.S:1.4 src/lib/libc/arch/arm/sys/syscall.S:1.5
--- src/lib/libc/arch/arm/sys/syscall.S:1.4	Thu Aug  7 16:42:05 2003
+++ src/lib/libc/arch/arm/sys/syscall.S	Sat Apr 18 23:55:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.S,v 1.4 2003/08/07 16:42:05 agc Exp $	*/
+/*	$NetBSD: syscall.S,v 1.5 2020/04/18 23:55:50 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -33,4 +33,4 @@
 
 #include "SYS.h"
 
-RSYSCALL(syscall)
+WSYSCALL(syscall,_syscall)

Index: src/lib/libc/arch/hppa/sys/syscall.S
diff -u src/lib/libc/arch/hppa/sys/syscall.S:1.2 src/lib/libc/arch/hppa/sys/syscall.S:1.3
--- src/lib/libc/arch/hppa/sys/syscall.S:1.2	Tue Nov  3 05:07:25 2009
+++ src/lib/libc/arch/hppa/sys/syscall.S	Sat Apr 18 23:55:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscall.S,v 1.2 2009/11/03 05:07:25 snj Exp $	*/
+/*	$NetBSD: syscall.S,v 1.3 2020/04/18 23:55:50 thorpej Exp $	*/
 
 /*	$OpenBSD: syscall.S,v 1.4 2001/03/29 01:43:53 mickey Exp $	*/
 
@@ -31,9 +31,9 @@
 #include "SYS.h"
 
 #if defined(LIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: syscall.S,v 1.2 2009/11/03 05:07:25 snj Exp $")
+	RCSID("$NetBSD: syscall.S,v 1.3 2020/04/18 23:55:50 thorpej Exp $")
 #endif /* LIBC_SCCS and not lint */
 
-RSYSCALL(syscall)
+WSYSCALL(syscall,_syscall)
 
 	.end

Index: src/lib/libc/arch/i386/sys/syscall.S
diff -u 

CVS commit: src/lib/libc

2020-04-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr 18 23:55:52 UTC 2020

Modified Files:
src/lib/libc/arch/aarch64/sys: syscall.S
src/lib/libc/arch/alpha/sys: syscall.S
src/lib/libc/arch/arm/sys: syscall.S
src/lib/libc/arch/hppa/sys: syscall.S
src/lib/libc/arch/i386/sys: syscall.S
src/lib/libc/arch/ia64/sys: syscall.S
src/lib/libc/arch/m68k/sys: syscall.S
src/lib/libc/arch/mips/sys: __syscall.S syscall.S
src/lib/libc/arch/or1k/sys: __syscall.S
src/lib/libc/arch/powerpc/sys: __syscall.S
src/lib/libc/arch/powerpc64/sys: __syscall.S
src/lib/libc/arch/riscv/sys: __syscall.S
src/lib/libc/arch/sh3/sys: syscall.S
src/lib/libc/arch/sparc/sys: syscall.S
src/lib/libc/arch/sparc64/sys: syscall.S
src/lib/libc/arch/vax/sys: syscall.S
src/lib/libc/arch/x86_64/sys: syscall.S
src/lib/libc/include: namespace.h

Log Message:
Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/aarch64/sys/syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/alpha/sys/syscall.S
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/arm/sys/syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/hppa/sys/syscall.S
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/arch/i386/sys/syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/ia64/sys/syscall.S
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/arch/m68k/sys/syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/mips/sys/__syscall.S
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/mips/sys/syscall.S
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/or1k/sys/__syscall.S
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/powerpc/sys/__syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/powerpc64/sys/__syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/riscv/sys/__syscall.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/sh3/sys/syscall.S
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/sparc/sys/syscall.S
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/sparc64/sys/syscall.S
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/vax/sys/syscall.S
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/x86_64/sys/syscall.S
cvs rdiff -u -r1.197 -r1.198 src/lib/libc/include/namespace.h

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



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

2020-04-18 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Apr 18 23:24:49 UTC 2020

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

Log Message:
read feature-persistent value on connect, e.g. the Linux Dom0 writes
the value only together with the device info; no functional difference,
since we don't allow persistent mappings


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/xen/xen/xbd_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.119 src/sys/arch/xen/xen/xbd_xenbus.c:1.120
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.119	Sat Apr 18 16:58:00 2020
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Sat Apr 18 23:24:49 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.119 2020/04/18 16:58:00 jdolecek Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.120 2020/04/18 23:24:49 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.119 2020/04/18 16:58:00 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.120 2020/04/18 23:24:49 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -702,6 +702,18 @@ xbd_connect(struct xbd_xenbus_softc *sc)
 {
 	int err;
 	unsigned long long sectors;
+	u_long val;
+
+	/*
+	 * Must read feature-persistent later, e.g. Linux Dom0 writes
+	 * this together with the device info.
+	 */
+	err = xenbus_read_ul(NULL, sc->sc_xbusd->xbusd_otherend,
+	"feature-persistent", , 10);
+	if (err)
+		val = 0;
+	if (val > 0)
+		sc->sc_features |= BLKIF_FEATURE_PERSISTENT;
 
 	err = xenbus_read_ul(NULL,
 	sc->sc_xbusd->xbusd_path, "virtual-device", >sc_handle, 10);
@@ -754,13 +766,6 @@ xbd_features(struct xbd_xenbus_softc *sc
 		sc->sc_features |= BLKIF_FEATURE_BARRIER;
 
 	err = xenbus_read_ul(NULL, sc->sc_xbusd->xbusd_otherend,
-	"feature-persistent", , 10);
-	if (err)
-		val = 0;
-	if (val > 0)
-		sc->sc_features |= BLKIF_FEATURE_PERSISTENT;
-
-	err = xenbus_read_ul(NULL, sc->sc_xbusd->xbusd_otherend,
 	"feature-max-indirect-segments", , 10);
 	if (err)
 		val = 0;



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

2020-04-18 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Apr 18 23:24:49 UTC 2020

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

Log Message:
read feature-persistent value on connect, e.g. the Linux Dom0 writes
the value only together with the device info; no functional difference,
since we don't allow persistent mappings


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/xen/xen/xbd_xenbus.c

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



CVS commit: src/libexec/utmp_update

2020-04-18 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Apr 18 22:03:51 UTC 2020

Modified Files:
src/libexec/utmp_update: utmp_update.8

Log Message:
document history


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/libexec/utmp_update/utmp_update.8

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

Modified files:

Index: src/libexec/utmp_update/utmp_update.8
diff -u src/libexec/utmp_update/utmp_update.8:1.2 src/libexec/utmp_update/utmp_update.8:1.3
--- src/libexec/utmp_update/utmp_update.8:1.2	Wed Apr 30 13:10:52 2008
+++ src/libexec/utmp_update/utmp_update.8	Sat Apr 18 22:03:51 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: utmp_update.8,v 1.2 2008/04/30 13:10:52 martin Exp $
+.\"	$NetBSD: utmp_update.8,v 1.3 2020/04/18 22:03:51 sevan Exp $
 .\"
 .\" Copyright (c) 2002 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 December 12, 2002
+.Dd April 18, 2020
 .Dt UTMP_UPDATE 8
 .Os
 .Sh NAME
@@ -59,3 +59,8 @@ returns 0 on success, and 1 if an error 
 .Sh SEE ALSO
 .Xr pututxline 3 ,
 .Xr utmpx 5
+.Sh HISTORY
+A
+.Nm
+utility appeared in
+.Nx 2.0 .



CVS commit: src/libexec/utmp_update

2020-04-18 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Apr 18 22:03:51 UTC 2020

Modified Files:
src/libexec/utmp_update: utmp_update.8

Log Message:
document history


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/libexec/utmp_update/utmp_update.8

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



CVS commit: src/sbin/fsck

2020-04-18 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Apr 18 22:02:11 UTC 2020

Modified Files:
src/sbin/fsck: fsck.8

Log Message:
grammar


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sbin/fsck/fsck.8

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

Modified files:

Index: src/sbin/fsck/fsck.8
diff -u src/sbin/fsck/fsck.8:1.40 src/sbin/fsck/fsck.8:1.41
--- src/sbin/fsck/fsck.8:1.40	Sun Sep 11 09:09:54 2016
+++ src/sbin/fsck/fsck.8	Sat Apr 18 22:02:11 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fsck.8,v 1.40 2016/09/11 09:09:54 wiz Exp $
+.\"	$NetBSD: fsck.8,v 1.41 2020/04/18 22:02:11 sevan Exp $
 .\"
 .\" Copyright (c) 1996 Christos Zoulas.  All rights reserved.
 .\"
@@ -22,7 +22,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 11, 2016
+.Dd April 18, 2020
 .Dt FSCK 8
 .Os
 .Sh NAME
@@ -175,7 +175,7 @@ from the terminal).
 .Xr fsck_msdos 8 ,
 .Xr mount 8
 .Sh HISTORY
-A
+An
 .Nm
 utility appeared in
 .Bx 4.0 .



CVS commit: src/sbin/fsck

2020-04-18 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Apr 18 22:02:11 UTC 2020

Modified Files:
src/sbin/fsck: fsck.8

Log Message:
grammar


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sbin/fsck/fsck.8

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



CVS commit: [bouyer-xenpvh] src/sys/arch/xen/xen

2020-04-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr 18 20:36:31 UTC 2020

Modified Files:
src/sys/arch/xen/xen [bouyer-xenpvh]: evtchn.c

Log Message:
If we get an event for another CPU just ignore it. The hypervisor will
callback on the other CPU anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.5 -r1.88.2.6 src/sys/arch/xen/xen/evtchn.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/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.88.2.5 src/sys/arch/xen/xen/evtchn.c:1.88.2.6
--- src/sys/arch/xen/xen/evtchn.c:1.88.2.5	Sat Apr 18 15:06:18 2020
+++ src/sys/arch/xen/xen/evtchn.c	Sat Apr 18 20:36:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.88.2.5 2020/04/18 15:06:18 bouyer Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.88.2.6 2020/04/18 20:36:31 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.88.2.5 2020/04/18 15:06:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.88.2.6 2020/04/18 20:36:31 bouyer Exp $");
 
 #include "opt_xen.h"
 #include "isa.h"
@@ -341,15 +341,14 @@ evtchn_do_event(int evtch, struct intrfr
 	}
 
 	KASSERTMSG(evtsource[evtch] != NULL, "unknown event %d", evtch);
+
+	if (evtsource[evtch]->ev_cpu != ci)
+		return 0;
+
 	ci->ci_data.cpu_nintr++;
 	evtsource[evtch]->ev_evcnt.ev_count++;
 	ilevel = ci->ci_ilevel;
 
-	if (evtsource[evtch]->ev_cpu != ci /* XXX: get stats */) {
-		hypervisor_send_event(evtsource[evtch]->ev_cpu, evtch);
-		return 0;
-	}
-
 	if (evtsource[evtch]->ev_maxlevel <= ilevel) {
 #ifdef IRQ_DEBUG
 		if (evtch == IRQ_DEBUG)



CVS commit: [bouyer-xenpvh] src/sys/arch/xen/xen

2020-04-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr 18 20:36:31 UTC 2020

Modified Files:
src/sys/arch/xen/xen [bouyer-xenpvh]: evtchn.c

Log Message:
If we get an event for another CPU just ignore it. The hypervisor will
callback on the other CPU anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.88.2.5 -r1.88.2.6 src/sys/arch/xen/xen/evtchn.c

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



CVS commit: [bouyer-xenpvh] src/sys/arch

2020-04-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr 18 20:03:02 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64 [bouyer-xenpvh]: vector.S
src/sys/arch/i386/i386 [bouyer-xenpvh]: vector.S
src/sys/arch/xen/xen [bouyer-xenpvh]: hypervisor.c

Log Message:
If possible, register a per-cpu callback via HVMOP_set_evtchn_upcall_vector.
>From FreeBSD. This requires acking the interrupt in hypervisor_pvhvm_callback.

Don't try to use x86_cpu_idle_xen() for PVHVM, it cause the domU to hang.
FreeBSD doesn't seem to use it either.


To generate a diff of this commit:
cvs rdiff -u -r1.73.6.5 -r1.73.6.6 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.85.6.6 -r1.85.6.7 src/sys/arch/i386/i386/vector.S
cvs rdiff -u -r1.73.2.6 -r1.73.2.7 src/sys/arch/xen/xen/hypervisor.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/amd64/amd64/vector.S
diff -u src/sys/arch/amd64/amd64/vector.S:1.73.6.5 src/sys/arch/amd64/amd64/vector.S:1.73.6.6
--- src/sys/arch/amd64/amd64/vector.S:1.73.6.5	Thu Apr 16 17:50:51 2020
+++ src/sys/arch/amd64/amd64/vector.S	Sat Apr 18 20:03:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.73.6.5 2020/04/16 17:50:51 bouyer Exp $	*/
+/*	$NetBSD: vector.S,v 1.73.6.6 2020/04/18 20:03:02 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -772,6 +772,14 @@ IDTVEC(hypervisor_pvhvm_callback)
 	incl	CPUVAR(IDEPTH)
 	movq	%rsp,%rdi
 	call	do_hypervisor_callback
+#ifndef XENPV
+	movzbl	_C_LABEL(xenhvm_use_percpu_callback),%edi
+	testl	%edi, %edi
+	jz 1f
+	movq	_C_LABEL(local_apic_va),%rdi
+	movl	$0,LAPIC_EOI(%rdi)
+1:
+#endif
 	jmp 	_C_LABEL(Xdoreti)
 IDTVEC_END(hypervisor_pvhvm_callback)
 	TEXT_USER_END

Index: src/sys/arch/i386/i386/vector.S
diff -u src/sys/arch/i386/i386/vector.S:1.85.6.6 src/sys/arch/i386/i386/vector.S:1.85.6.7
--- src/sys/arch/i386/i386/vector.S:1.85.6.6	Thu Apr 16 17:50:52 2020
+++ src/sys/arch/i386/i386/vector.S	Sat Apr 18 20:03:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.85.6.6 2020/04/16 17:50:52 bouyer Exp $	*/
+/*	$NetBSD: vector.S,v 1.85.6.7 2020/04/18 20:03:02 bouyer Exp $	*/
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.85.6.6 2020/04/16 17:50:52 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.85.6.7 2020/04/18 20:03:02 bouyer Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -1019,6 +1019,14 @@ IDTVEC(hypervisor_pvhvm_callback)	
 	 * Xdoreti needs it too.
 	 */
 	call	do_hypervisor_callback
+#ifndef XENPV
+	movzbl	_C_LABEL(xenhvm_use_percpu_callback),%eax
+	testl	%eax, %eax
+	jz	1f
+	movl	_C_LABEL(local_apic_va),%eax
+	movl	$0, LAPIC_EOI(%eax)
+1:
+#endif
 	jmp	_C_LABEL(Xdoreti)
 IDTVEC_END(hypervisor_pvhvm_callback)
 END(hypervisor_callback)

Index: src/sys/arch/xen/xen/hypervisor.c
diff -u src/sys/arch/xen/xen/hypervisor.c:1.73.2.6 src/sys/arch/xen/xen/hypervisor.c:1.73.2.7
--- src/sys/arch/xen/xen/hypervisor.c:1.73.2.6	Sat Apr 18 15:06:18 2020
+++ src/sys/arch/xen/xen/hypervisor.c	Sat Apr 18 20:03:02 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.73.2.6 2020/04/18 15:06:18 bouyer Exp $ */
+/* $NetBSD: hypervisor.c,v 1.73.2.7 2020/04/18 20:03:02 bouyer Exp $ */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.73.2.6 2020/04/18 15:06:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.73.2.7 2020/04/18 20:03:02 bouyer Exp $");
 
 #include 
 #include 
@@ -207,6 +207,8 @@ enum {
 
 #ifdef XENPVHVM
 
+bool xenhvm_use_percpu_callback = 0;
+
 static bool
 xen_check_hypervisordev(void)
 {
@@ -373,7 +375,6 @@ xen_hvm_init(void)
 	delay_func = xen_delay;
 	x86_initclock_func = xen_initclocks;
 	x86_cpu_initclock_func = xen_cpu_initclocks;
-	x86_cpu_idle_set(x86_cpu_idle_xen, "xen", true);
 	vm_guest = VM_GUEST_XENPVHVM; /* Be more specific */
 	return 1;
 }
@@ -383,6 +384,8 @@ xen_hvm_init_cpu(struct cpu_info *ci)
 {
 	u_int32_t descs[4];
 	struct xen_hvm_param xen_hvm_param;
+	int error;
+	static bool again = 0;
 
 	if (vm_guest != VM_GUEST_XENPVHVM)
 		return 0;
@@ -410,13 +413,43 @@ xen_hvm_init_cpu(struct cpu_info *ci)
 	/* val[63:56] = 2, val[7:0] = vec */
 	xen_hvm_param.value = ((int64_t)0x2 << 56) | xen_hvm_vec;
 
+	/* First try to set up a per-cpu vector. */
+	if (!again || xenhvm_use_percpu_callback) {
+		struct xen_hvm_evtchn_upcall_vector xen_hvm_uvec;
+		xen_hvm_uvec.vcpu = ci->ci_vcpuid;
+		xen_hvm_uvec.vector = xen_hvm_vec;
+
+		xenhvm_use_percpu_callback = 1;
+		error = HYPERVISOR_hvm_op(
+		HVMOP_set_evtchn_upcall_vector, _hvm_uvec);
+		if (error < 0) {
+			aprint_error_dev(ci->ci_dev,
+			"failed to set event upcall vector: %d\n", error);
+			if (again)
+panic("event upcall vector");
+			aprint_error_dev(ci->ci_dev,
+			"falling back to global vector\n");
+		} else {
+			/*
+			

CVS commit: [bouyer-xenpvh] src/sys/arch

2020-04-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr 18 20:03:02 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64 [bouyer-xenpvh]: vector.S
src/sys/arch/i386/i386 [bouyer-xenpvh]: vector.S
src/sys/arch/xen/xen [bouyer-xenpvh]: hypervisor.c

Log Message:
If possible, register a per-cpu callback via HVMOP_set_evtchn_upcall_vector.
>From FreeBSD. This requires acking the interrupt in hypervisor_pvhvm_callback.

Don't try to use x86_cpu_idle_xen() for PVHVM, it cause the domU to hang.
FreeBSD doesn't seem to use it either.


To generate a diff of this commit:
cvs rdiff -u -r1.73.6.5 -r1.73.6.6 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.85.6.6 -r1.85.6.7 src/sys/arch/i386/i386/vector.S
cvs rdiff -u -r1.73.2.6 -r1.73.2.7 src/sys/arch/xen/xen/hypervisor.c

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



CVS commit: src/external/bsd/cron/dist

2020-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 18 19:32:20 UTC 2020

Modified Files:
src/external/bsd/cron/dist: cron.c crontab.5 do_command.c entry.c
externs.h funcs.h job.c structs.h user.c

Log Message:
Add -s (SINGLE_JOB) from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/cron/dist/cron.c \
src/external/bsd/cron/dist/entry.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/cron/dist/crontab.5
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/cron/dist/do_command.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/cron/dist/externs.h \
src/external/bsd/cron/dist/job.c src/external/bsd/cron/dist/user.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/cron/dist/funcs.h
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/cron/dist/structs.h

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

Modified files:

Index: src/external/bsd/cron/dist/cron.c
diff -u src/external/bsd/cron/dist/cron.c:1.10 src/external/bsd/cron/dist/cron.c:1.11
--- src/external/bsd/cron/dist/cron.c:1.10	Fri Jun  9 13:36:30 2017
+++ src/external/bsd/cron/dist/cron.c	Sat Apr 18 15:32:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cron.c,v 1.10 2017/06/09 17:36:30 christos Exp $	*/
+/*	$NetBSD: cron.c,v 1.11 2020/04/18 19:32:19 christos Exp $	*/
 
 /* Copyright 1988,1990,1993,1994 by Paul Vixie
  * All rights reserved
@@ -25,7 +25,7 @@
 #if 0
 static char rcsid[] = "Id: cron.c,v 1.12 2004/01/23 18:56:42 vixie Exp";
 #else
-__RCSID("$NetBSD: cron.c,v 1.10 2017/06/09 17:36:30 christos Exp $");
+__RCSID("$NetBSD: cron.c,v 1.11 2020/04/18 19:32:19 christos Exp $");
 #endif
 #endif
 
@@ -532,6 +532,7 @@ sigchld_reaper(void) {
 			Debug(DPROC,
 			  ("[%ld] sigchld...pid #%ld died, stat=%d\n",
 			   (long)getpid(), (long)pid, WEXITSTATUS(waiter)));
+			job_exit(pid);
 			break;
 		}
 	}
Index: src/external/bsd/cron/dist/entry.c
diff -u src/external/bsd/cron/dist/entry.c:1.10 src/external/bsd/cron/dist/entry.c:1.11
--- src/external/bsd/cron/dist/entry.c:1.10	Sat Jul 28 09:55:08 2018
+++ src/external/bsd/cron/dist/entry.c	Sat Apr 18 15:32:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: entry.c,v 1.10 2018/07/28 13:55:08 kre Exp $	*/
+/*	$OpenBSD: entry.c,v 1.51 2020/04/16 17:51:56 millert Exp $	*/
 
 /*
  * Copyright 1988,1990,1993,1994 by Paul Vixie
@@ -26,7 +26,7 @@
 #if 0
 static char rcsid[] = "Id: entry.c,v 1.17 2004/01/23 18:56:42 vixie Exp";
 #else
-__RCSID("$NetBSD: entry.c,v 1.10 2018/07/28 13:55:08 kre Exp $");
+__RCSID("$NetBSD: entry.c,v 1.11 2020/04/18 19:32:19 christos Exp $");
 #endif
 #endif
 
@@ -361,6 +361,14 @@ load_entry(FILE *file, void (*error_func
 			}
 			e->flags |= DONT_LOG;
 			break;
+		case 's':
+			/* only allow the user to set the option once */
+			if ((e->flags & SINGLE_JOB) == SINGLE_JOB) {
+ecode = e_option;
+goto eof;
+			}
+			e->flags |= SINGLE_JOB;
+			break;
 		default:
 			ecode = e_option;
 			goto eof;

Index: src/external/bsd/cron/dist/crontab.5
diff -u src/external/bsd/cron/dist/crontab.5:1.9 src/external/bsd/cron/dist/crontab.5:1.10
--- src/external/bsd/cron/dist/crontab.5:1.9	Fri Apr 17 15:42:14 2020
+++ src/external/bsd/cron/dist/crontab.5	Sat Apr 18 15:32:19 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: crontab.5,v 1.9 2020/04/17 19:42:14 pgoyette Exp $
+.\" $NetBSD: crontab.5,v 1.10 2020/04/18 19:32:19 christos Exp $
 .\"
 .\"/* Copyright 1988,1990,1993,1994 by Paul Vixie
 .\" * All rights reserved
@@ -227,6 +227,13 @@ option is an attempt to cure potentially
 .Xr cron 8 .
 .It Fl q Ar command
 Execution will not be logged.
+.It Fl s Ar command
+Only a single instance of
+.Ar command
+will be run concurrently.
+Additional instances of
+.Ar command
+will not be scheduled until the earlier one completes.
 .El
 .Pp
 Commands are executed by

Index: src/external/bsd/cron/dist/do_command.c
diff -u src/external/bsd/cron/dist/do_command.c:1.14 src/external/bsd/cron/dist/do_command.c:1.15
--- src/external/bsd/cron/dist/do_command.c:1.14	Sat Aug  3 03:06:47 2019
+++ src/external/bsd/cron/dist/do_command.c	Sat Apr 18 15:32:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: do_command.c,v 1.14 2019/08/03 07:06:47 christos Exp $	*/
+/*	$NetBSD: do_command.c,v 1.15 2020/04/18 19:32:19 christos Exp $	*/
 
 /* Copyright 1988,1990,1993,1994 by Paul Vixie
  * All rights reserved
@@ -25,7 +25,7 @@
 #if 0
 static char rcsid[] = "Id: do_command.c,v 1.9 2004/01/23 18:56:42 vixie Exp";
 #else
-__RCSID("$NetBSD: do_command.c,v 1.14 2019/08/03 07:06:47 christos Exp $");
+__RCSID("$NetBSD: do_command.c,v 1.15 2020/04/18 19:32:19 christos Exp $");
 #endif
 #endif
 
@@ -35,7 +35,7 @@ __RCSID("$NetBSD: do_command.c,v 1.14 20
 static int		child_process(entry *);
 static int		safe_p(const char *, const char *);
 
-void
+pid_t
 do_command(entry *e, user *u) {
 	int retval;
 
@@ -66,9 +66,14 @@ do_command(entry *e, user *u) {
 		break;
 	default:
 		/* parent process */
+		if ((e->flags & SINGLE_JOB) == 0)
+			jobpid = -1;
 		break;
 	}
 	

CVS commit: src/external/bsd/cron/dist

2020-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 18 19:32:20 UTC 2020

Modified Files:
src/external/bsd/cron/dist: cron.c crontab.5 do_command.c entry.c
externs.h funcs.h job.c structs.h user.c

Log Message:
Add -s (SINGLE_JOB) from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/cron/dist/cron.c \
src/external/bsd/cron/dist/entry.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/cron/dist/crontab.5
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/cron/dist/do_command.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/cron/dist/externs.h \
src/external/bsd/cron/dist/job.c src/external/bsd/cron/dist/user.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/cron/dist/funcs.h
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/cron/dist/structs.h

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



CVS commit: src/crypto/external/bsd/netpgp/dist

2020-04-18 Thread Jason High
Module Name:src
Committed By:   jhigh
Date:   Sat Apr 18 19:27:49 UTC 2020

Modified Files:
src/crypto/external/bsd/netpgp/dist: configure.ac
src/crypto/external/bsd/netpgp/dist/src/lib: config.h.in misc.c
symmetric.c

Log Message:
added blowfish symmetric cipher per RFC4880 9.2


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/crypto/external/bsd/netpgp/dist/configure.ac
cvs rdiff -u -r1.17 -r1.18 \
src/crypto/external/bsd/netpgp/dist/src/lib/config.h.in
cvs rdiff -u -r1.42 -r1.43 src/crypto/external/bsd/netpgp/dist/src/lib/misc.c
cvs rdiff -u -r1.18 -r1.19 \
src/crypto/external/bsd/netpgp/dist/src/lib/symmetric.c

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



CVS commit: src/crypto/external/bsd/netpgp/dist

2020-04-18 Thread Jason High
Module Name:src
Committed By:   jhigh
Date:   Sat Apr 18 19:27:49 UTC 2020

Modified Files:
src/crypto/external/bsd/netpgp/dist: configure.ac
src/crypto/external/bsd/netpgp/dist/src/lib: config.h.in misc.c
symmetric.c

Log Message:
added blowfish symmetric cipher per RFC4880 9.2


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/crypto/external/bsd/netpgp/dist/configure.ac
cvs rdiff -u -r1.17 -r1.18 \
src/crypto/external/bsd/netpgp/dist/src/lib/config.h.in
cvs rdiff -u -r1.42 -r1.43 src/crypto/external/bsd/netpgp/dist/src/lib/misc.c
cvs rdiff -u -r1.18 -r1.19 \
src/crypto/external/bsd/netpgp/dist/src/lib/symmetric.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/external/bsd/netpgp/dist/configure.ac
diff -u src/crypto/external/bsd/netpgp/dist/configure.ac:1.42 src/crypto/external/bsd/netpgp/dist/configure.ac:1.43
--- src/crypto/external/bsd/netpgp/dist/configure.ac:1.42	Sun Mar  9 00:33:50 2014
+++ src/crypto/external/bsd/netpgp/dist/configure.ac	Sat Apr 18 19:27:49 2020
@@ -1,10 +1,10 @@
-# $NetBSD: configure.ac,v 1.42 2014/03/09 00:33:50 agc Exp $
+# $NetBSD: configure.ac,v 1.43 2020/04/18 19:27:49 jhigh Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
 AC_INIT([netpgp],[20140220],[Alistair Crooks  c0596823])
 AC_PREREQ(2.69)
-AC_REVISION([$Revision: 1.42 $])
+AC_REVISION([$Revision: 1.43 $])
 
 AS_SHELL_SANITIZE
 
@@ -60,7 +60,7 @@ AC_CHECK_HEADERS([dmalloc.h direct.h err
 AC_CHECK_HEADERS([openssl/aes.h openssl/bn.h openssl/camellia.h openssl/cast.h \
 		  openssl/des.h openssl/dsa.h openssl/err.h openssl/idea.h \
 		  openssl/md5.h openssl/rand.h openssl/rsa.h openssl/sha.h \
-		  openssl/err.h openssl/sha.h])
+		  openssl/err.h openssl/sha.h openssl/blowfish.h])
 AC_CHECK_HEADERS([sys/cdefs.h sys/file.h sys/mman.h sys/param.h \
   sys/resource.h sys/uio.h])
 

Index: src/crypto/external/bsd/netpgp/dist/src/lib/config.h.in
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/config.h.in:1.17 src/crypto/external/bsd/netpgp/dist/src/lib/config.h.in:1.18
--- src/crypto/external/bsd/netpgp/dist/src/lib/config.h.in:1.17	Mon Feb 17 06:38:07 2014
+++ src/crypto/external/bsd/netpgp/dist/src/lib/config.h.in	Sat Apr 18 19:27:48 2020
@@ -39,6 +39,9 @@
 /* Define to 1 if you have the  header file. */
 #undef HAVE_OPENSSL_AES_H
 
+/* Define to 1 if you have the  header file. */
+#undef HAVE_OPENSSL_BLOWFISH_H
+
 /* Define to 1 if you have the  header file. */
 #undef HAVE_OPENSSL_BN_H
 
@@ -120,8 +123,7 @@
 /* Define to 1 if you have the  header file. */
 #undef HAVE_ZLIB_H
 
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
 #undef LT_OBJDIR
 
 /* Name of package */

Index: src/crypto/external/bsd/netpgp/dist/src/lib/misc.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/misc.c:1.42 src/crypto/external/bsd/netpgp/dist/src/lib/misc.c:1.43
--- src/crypto/external/bsd/netpgp/dist/src/lib/misc.c:1.42	Tue Nov 13 14:52:30 2018
+++ src/crypto/external/bsd/netpgp/dist/src/lib/misc.c	Sat Apr 18 19:27:48 2020
@@ -57,7 +57,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: misc.c,v 1.42 2018/11/13 14:52:30 mlelstv Exp $");
+__RCSID("$NetBSD: misc.c,v 1.43 2020/04/18 19:27:48 jhigh Exp $");
 #endif
 
 #include 
@@ -816,6 +816,7 @@ static str2cipher_t	str2cipher[] = {
 	{	"idea",			PGP_SA_IDEA		},
 	{	"aes128",		PGP_SA_AES_128		},
 	{	"aes256",		PGP_SA_AES_256		},
+	{	"blowfish",		PGP_SA_BLOWFISH		},
 	{	"camellia128",		PGP_SA_CAMELLIA_128	},
 	{	"camellia256",		PGP_SA_CAMELLIA_256	},
 	{	"tripledes",		PGP_SA_TRIPLEDES	},

Index: src/crypto/external/bsd/netpgp/dist/src/lib/symmetric.c
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/symmetric.c:1.18 src/crypto/external/bsd/netpgp/dist/src/lib/symmetric.c:1.19
--- src/crypto/external/bsd/netpgp/dist/src/lib/symmetric.c:1.18	Sun Nov  7 08:39:59 2010
+++ src/crypto/external/bsd/netpgp/dist/src/lib/symmetric.c	Sat Apr 18 19:27:48 2020
@@ -54,7 +54,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: symmetric.c,v 1.18 2010/11/07 08:39:59 agc Exp $");
+__RCSID("$NetBSD: symmetric.c,v 1.19 2020/04/18 19:27:48 jhigh Exp $");
 #endif
 
 #include "crypto.h"
@@ -82,6 +82,10 @@ __RCSID("$NetBSD: symmetric.c,v 1.18 201
 #include 
 #endif
 
+#ifdef HAVE_OPENSSL_BLOWFISH_H
+#include 
+#endif
+
 #include "crypto.h"
 #include "netpgpdefs.h"
 
@@ -192,6 +196,81 @@ static pgp_crypt_t cast5 =
 	TRAILER
 };
 
+#ifdef HAVE_OPENSSL_BLOWFISH_H
+
+/* RFC 4880 9.2 Blowfish 128 */
+#define BLOWFISH_KEY_LENGTH	16
+
+static int
+blowfish_init(pgp_crypt_t *crypt)
+{
+if (crypt->encrypt_key) {
+   

CVS commit: src/sys

2020-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 18 19:18:34 UTC 2020

Modified Files:
src/sys/modules/ffs: Makefile
src/sys/rump/fs/lib/libffs: Makefile
src/sys/ufs: files.ufs
src/sys/ufs/ffs: ffs_alloc.c ffs_balloc.c ffs_extern.h ffs_inode.c
ffs_snapshot.c ffs_vnops.c fs.h
src/sys/ufs/ufs: extattr.h inode.h ufs_extern.h ufs_inode.c ufs_vnops.c
Added Files:
src/sys/ufs/ffs: ffs_extattr.c

Log Message:
Extended attribute support for ffsv2, from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/modules/ffs/Makefile
cvs rdiff -u -r1.17 -r1.18 src/sys/rump/fs/lib/libffs/Makefile
cvs rdiff -u -r1.46 -r1.47 src/sys/ufs/files.ufs
cvs rdiff -u -r1.166 -r1.167 src/sys/ufs/ffs/ffs_alloc.c
cvs rdiff -u -r1.63 -r1.64 src/sys/ufs/ffs/ffs_balloc.c
cvs rdiff -u -r0 -r1.1 src/sys/ufs/ffs/ffs_extattr.c
cvs rdiff -u -r1.85 -r1.86 src/sys/ufs/ffs/ffs_extern.h
cvs rdiff -u -r1.126 -r1.127 src/sys/ufs/ffs/ffs_inode.c
cvs rdiff -u -r1.151 -r1.152 src/sys/ufs/ffs/ffs_snapshot.c
cvs rdiff -u -r1.130 -r1.131 src/sys/ufs/ffs/ffs_vnops.c
cvs rdiff -u -r1.66 -r1.67 src/sys/ufs/ffs/fs.h
cvs rdiff -u -r1.11 -r1.12 src/sys/ufs/ufs/extattr.h
cvs rdiff -u -r1.76 -r1.77 src/sys/ufs/ufs/inode.h
cvs rdiff -u -r1.84 -r1.85 src/sys/ufs/ufs/ufs_extern.h
cvs rdiff -u -r1.109 -r1.110 src/sys/ufs/ufs/ufs_inode.c
cvs rdiff -u -r1.251 -r1.252 src/sys/ufs/ufs/ufs_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/modules/ffs/Makefile
diff -u src/sys/modules/ffs/Makefile:1.13 src/sys/modules/ffs/Makefile:1.14
--- src/sys/modules/ffs/Makefile:1.13	Mon Aug 19 05:31:30 2019
+++ src/sys/modules/ffs/Makefile	Sat Apr 18 15:18:33 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2019/08/19 09:31:30 christos Exp $
+#	$NetBSD: Makefile,v 1.14 2020/04/18 19:18:33 christos Exp $
 
 .include "../Makefile.inc"
 
@@ -11,7 +11,7 @@ CPPFLAGS+=	-DUFS_EXTATTR
 CWARNFLAGS.clang=	-Wno-conversion
 
 SRCS+=	ffs_alloc.c ffs_balloc.c ffs_inode.c ffs_subr.c ffs_tables.c \
-	ffs_vfsops.c ffs_vnops.c ffs_snapshot.c \
+	ffs_vfsops.c ffs_vnops.c ffs_snapshot.c ffs_extattr.c \
 	ffs_bswap.c ffs_wapbl.c ffs_appleufs.c ffs_quota2.c
 
 WARNS=	3

Index: src/sys/rump/fs/lib/libffs/Makefile
diff -u src/sys/rump/fs/lib/libffs/Makefile:1.17 src/sys/rump/fs/lib/libffs/Makefile:1.18
--- src/sys/rump/fs/lib/libffs/Makefile:1.17	Sat Apr 11 20:04:45 2020
+++ src/sys/rump/fs/lib/libffs/Makefile	Sat Apr 18 15:18:33 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2020/04/12 00:04:45 christos Exp $
+#	$NetBSD: Makefile,v 1.18 2020/04/18 19:18:33 christos Exp $
 #
 
 .PATH:  ${.CURDIR}/../../../../ufs/ffs ${.CURDIR}/../../../../ufs/ufs
@@ -8,7 +8,7 @@ COMMENT=Berkeley Fast File System
 
 SRCS=	ffs_alloc.c ffs_appleufs.c ffs_balloc.c ffs_bswap.c ffs_inode.c	\
 	ffs_snapshot.c ffs_subr.c ffs_tables.c ffs_vfsops.c ffs_vnops.c	\
-	ffs_wapbl.c ffs_quota2.c
+	ffs_wapbl.c ffs_quota2.c ffs_extattr.c
 
 SRCS+=	ufs_bmap.c ufs_dirhash.c ufs_extattr.c ufs_inode.c	\
 	ufs_lookup.c ufs_rename.c ufs_vfsops.c ufs_vnops.c	\

Index: src/sys/ufs/files.ufs
diff -u src/sys/ufs/files.ufs:1.46 src/sys/ufs/files.ufs:1.47
--- src/sys/ufs/files.ufs:1.46	Sat Apr 11 13:43:54 2020
+++ src/sys/ufs/files.ufs	Sat Apr 18 15:18:33 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ufs,v 1.46 2020/04/11 17:43:54 jdolecek Exp $
+#	$NetBSD: files.ufs,v 1.47 2020/04/18 19:18:33 christos Exp $
 
 deffs	FFS
 deffs	EXT2FS
@@ -52,6 +52,7 @@ define	ffs: vfs, ufs
 file	ufs/ffs/ffs_alloc.c		ffs
 file	ufs/ffs/ffs_balloc.c		ffs
 file	ufs/ffs/ffs_bswap.c		(ffs | mfs) & ffs_ei
+file	ufs/ffs/ffs_extattr.c		ffs & ufs_extattr
 file	ufs/ffs/ffs_inode.c		ffs
 file	ufs/ffs/ffs_snapshot.c		ffs
 file	ufs/ffs/ffs_subr.c		ffs

Index: src/sys/ufs/ffs/ffs_alloc.c
diff -u src/sys/ufs/ffs/ffs_alloc.c:1.166 src/sys/ufs/ffs/ffs_alloc.c:1.167
--- src/sys/ufs/ffs/ffs_alloc.c:1.166	Sun Feb 23 10:46:42 2020
+++ src/sys/ufs/ffs/ffs_alloc.c	Sat Apr 18 15:18:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_alloc.c,v 1.166 2020/02/23 15:46:42 ad Exp $	*/
+/*	$NetBSD: ffs_alloc.c,v 1.167 2020/04/18 19:18:34 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.166 2020/02/23 15:46:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.167 2020/04/18 19:18:34 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -257,7 +257,10 @@ ffs_alloc(struct inode *ip, daddr_t lbn,
 	bno = ffs_hashalloc(ip, cg, bpref, size, 0, flags, ffs_alloccg);
 	if (bno > 0) {
 		DIP_ADD(ip, blocks, btodb(size));
-		ip->i_flag |= IN_CHANGE | IN_UPDATE;
+		if (flags & IO_EXT)
+			ip->i_flag |= IN_CHANGE;
+		else
+			ip->i_flag |= IN_CHANGE | IN_UPDATE;
 		*bnp = bno;
 		return (0);
 	}
@@ -300,14 +303,15 @@ nospace:
  * => return with um_lock released
  */
 int

CVS commit: src/sys

2020-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 18 19:18:34 UTC 2020

Modified Files:
src/sys/modules/ffs: Makefile
src/sys/rump/fs/lib/libffs: Makefile
src/sys/ufs: files.ufs
src/sys/ufs/ffs: ffs_alloc.c ffs_balloc.c ffs_extern.h ffs_inode.c
ffs_snapshot.c ffs_vnops.c fs.h
src/sys/ufs/ufs: extattr.h inode.h ufs_extern.h ufs_inode.c ufs_vnops.c
Added Files:
src/sys/ufs/ffs: ffs_extattr.c

Log Message:
Extended attribute support for ffsv2, from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/modules/ffs/Makefile
cvs rdiff -u -r1.17 -r1.18 src/sys/rump/fs/lib/libffs/Makefile
cvs rdiff -u -r1.46 -r1.47 src/sys/ufs/files.ufs
cvs rdiff -u -r1.166 -r1.167 src/sys/ufs/ffs/ffs_alloc.c
cvs rdiff -u -r1.63 -r1.64 src/sys/ufs/ffs/ffs_balloc.c
cvs rdiff -u -r0 -r1.1 src/sys/ufs/ffs/ffs_extattr.c
cvs rdiff -u -r1.85 -r1.86 src/sys/ufs/ffs/ffs_extern.h
cvs rdiff -u -r1.126 -r1.127 src/sys/ufs/ffs/ffs_inode.c
cvs rdiff -u -r1.151 -r1.152 src/sys/ufs/ffs/ffs_snapshot.c
cvs rdiff -u -r1.130 -r1.131 src/sys/ufs/ffs/ffs_vnops.c
cvs rdiff -u -r1.66 -r1.67 src/sys/ufs/ffs/fs.h
cvs rdiff -u -r1.11 -r1.12 src/sys/ufs/ufs/extattr.h
cvs rdiff -u -r1.76 -r1.77 src/sys/ufs/ufs/inode.h
cvs rdiff -u -r1.84 -r1.85 src/sys/ufs/ufs/ufs_extern.h
cvs rdiff -u -r1.109 -r1.110 src/sys/ufs/ufs/ufs_inode.c
cvs rdiff -u -r1.251 -r1.252 src/sys/ufs/ufs/ufs_vnops.c

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



CVS commit: src/share/man/man9

2020-04-18 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr 18 18:55:20 UTC 2020

Modified Files:
src/share/man/man9: time_second.9

Log Message:
Remove trailing comma.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/share/man/man9/time_second.9

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



CVS commit: src/share/man/man9

2020-04-18 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr 18 18:55:20 UTC 2020

Modified Files:
src/share/man/man9: time_second.9

Log Message:
Remove trailing comma.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/share/man/man9/time_second.9

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/man9/time_second.9
diff -u src/share/man/man9/time_second.9:1.8 src/share/man/man9/time_second.9:1.9
--- src/share/man/man9/time_second.9:1.8	Fri Apr 17 17:43:38 2020
+++ src/share/man/man9/time_second.9	Sat Apr 18 18:55:20 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: time_second.9,v 1.8 2020/04/17 17:43:38 jdolecek Exp $
+.\" $NetBSD: time_second.9,v 1.9 2020/04/18 18:55:20 wiz Exp $
 .\"
 .\" Copyright (c) 1994 Christopher G. Demetriou
 .\" All rights reserved.
@@ -37,7 +37,7 @@
 .Os
 .Sh NAME
 .Nm time_second ,
-.Nm time_uptime ,
+.Nm time_uptime
 .Nd system time variables
 .Sh SYNOPSIS
 .In sys/time.h



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

2020-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 18 17:45:16 UTC 2020

Added Files:
src/tests/lib/libc/sys: t_mprotect_helper.h

Log Message:
Oops, need the header too.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/sys/t_mprotect_helper.h

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



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

2020-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 18 17:45:16 UTC 2020

Added Files:
src/tests/lib/libc/sys: t_mprotect_helper.h

Log Message:
Oops, need the header too.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/sys/t_mprotect_helper.h

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

Added files:

Index: src/tests/lib/libc/sys/t_mprotect_helper.h
diff -u /dev/null src/tests/lib/libc/sys/t_mprotect_helper.h:1.1
--- /dev/null	Sat Apr 18 13:45:16 2020
+++ src/tests/lib/libc/sys/t_mprotect_helper.h	Sat Apr 18 13:45:16 2020
@@ -0,0 +1,3 @@
+int return_1(void);
+int return_2(void);
+int return_3(void);



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

2020-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 18 17:44:53 UTC 2020

Modified Files:
src/tests/lib/libc/sys: Makefile t_mprotect.c
Added Files:
src/tests/lib/libc/sys: t_mprotect_helper.c

Log Message:
PR/55177: Carlo Arenas: mremap(MAP_REMAPDUP) fails after fork()


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libc/sys/t_mprotect.c
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/sys/t_mprotect_helper.c

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



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

2020-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 18 17:44:53 UTC 2020

Modified Files:
src/tests/lib/libc/sys: Makefile t_mprotect.c
Added Files:
src/tests/lib/libc/sys: t_mprotect_helper.c

Log Message:
PR/55177: Carlo Arenas: mremap(MAP_REMAPDUP) fails after fork()


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libc/sys/t_mprotect.c
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/sys/t_mprotect_helper.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/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.61 src/tests/lib/libc/sys/Makefile:1.62
--- src/tests/lib/libc/sys/Makefile:1.61	Fri Mar  6 13:32:35 2020
+++ src/tests/lib/libc/sys/Makefile	Sat Apr 18 13:44:53 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.61 2020/03/06 18:32:35 kamil Exp $
+# $NetBSD: Makefile,v 1.62 2020/04/18 17:44:53 christos Exp $
 
 MKMAN=	no
 
@@ -85,7 +85,7 @@ TESTS_C+=		t_wait_noproc
 TESTS_C+=		t_wait_noproc_wnohang
 TESTS_C+=		t_write
 
-SRCS.t_mprotect=	t_mprotect.c ${SRCS_EXEC_PROT}
+SRCS.t_mprotect=	t_mprotect.c ${SRCS_EXEC_PROT} t_mprotect_helper.c
 
 LDADD.t_getpid+=-lpthread
 

Index: src/tests/lib/libc/sys/t_mprotect.c
diff -u src/tests/lib/libc/sys/t_mprotect.c:1.8 src/tests/lib/libc/sys/t_mprotect.c:1.9
--- src/tests/lib/libc/sys/t_mprotect.c:1.8	Tue Jul 16 13:29:18 2019
+++ src/tests/lib/libc/sys/t_mprotect.c	Sat Apr 18 13:44:53 2020
@@ -1,7 +1,7 @@
-/* $NetBSD: t_mprotect.c,v 1.8 2019/07/16 17:29:18 martin Exp $ */
+/* $NetBSD: t_mprotect.c,v 1.9 2020/04/18 17:44:53 christos Exp $ */
 
 /*-
- * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * Copyright (c) 2011, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_mprotect.c,v 1.8 2019/07/16 17:29:18 martin Exp $");
+__RCSID("$NetBSD: t_mprotect.c,v 1.9 2020/04/18 17:44:53 christos Exp $");
 
 #include 
 #include 
@@ -45,6 +45,7 @@ __RCSID("$NetBSD: t_mprotect.c,v 1.8 201
 #include 
 
 #include "../common/exec_prot.h"
+#include "t_mprotect_helper.h"
 
 static long	page = 0;
 static char	path[] = "mmap";
@@ -243,8 +244,8 @@ ATF_TC_BODY(mprotect_pax, tc)
 	 *   (3) making a non-executable mapping executable
 	 *
 	 *   (4) making an executable/read-only file mapping
-	 *   writable except for performing relocations
-	 *   on an ET_DYN ELF file (non-PIC shared library)
+	 *	 writable except for performing relocations
+	 *	 on an ET_DYN ELF file (non-PIC shared library)
 	 *
 	 *  The following will test only the case (3).
 	 *
@@ -383,6 +384,60 @@ ATF_TC_BODY(mprotect_mremap_exec, tc)
 	ATF_REQUIRE(munmap(map2, page) == 0);
 }
 
+ATF_TC(mprotect_mremap_fork_exec);
+ATF_TC_HEAD(mprotect_mremap_fork_exec, tc)
+{
+   atf_tc_set_md_var(tc, "descr",
+	   "Test mremap(2)+fork(2)+mprotect(2) executable space protections");
+}
+
+ATF_TC_BODY(mprotect_mremap_fork_exec, tc)
+{
+	void *map, *map2;
+	pid_t pid;
+
+	atf_tc_expect_fail("PR lib/55177");
+
+	/*
+	 * Map a page read/write/exec and duplicate it.
+	 * Map the copy executable.
+	 * Copy a function to the writeable mapping and execute it
+	 * Fork a child and wait for it
+	 * Copy a different function to the writeable mapping and execute it
+	 * The original function shouldn't be called
+	 */
+
+	map = mmap(NULL, page, PROT_READ|PROT_WRITE|PROT_MPROTECT(PROT_EXEC),
+	MAP_ANON, -1, 0);
+	ATF_REQUIRE(map != MAP_FAILED);
+	map2 = mremap(map, page, NULL, page, MAP_REMAPDUP);
+	ATF_REQUIRE(map2 != MAP_FAILED);
+	ATF_REQUIRE(mprotect(map2, page, PROT_EXEC|PROT_READ) == 0);
+
+	memcpy(map, (void *)return_1,
+	(uintptr_t)return_2 - (uintptr_t)return_1);
+	__builtin___clear_cache(map, (void *)((uintptr_t)map + page));
+
+	ATF_REQUIRE(((int (*)(void))map2)() == 1);
+
+	pid = fork();
+	ATF_REQUIRE(pid >= 0);
+
+	if (pid == 0)
+		_exit(0);
+
+	(void)wait(NULL);
+
+	memcpy(map, (void *)return_2,
+	(uintptr_t)return_3 - (uintptr_t)return_2);
+	__builtin___clear_cache(map, (void *)((uintptr_t)map + page));
+
+	ATF_REQUIRE(((int (*)(void))map2)() == 2);
+
+	ATF_REQUIRE(munmap(map, page) == 0);
+	ATF_REQUIRE(munmap(map2, page) == 0);
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 	page = sysconf(_SC_PAGESIZE);
@@ -394,6 +449,7 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC(tp, mprotect_pax);
 	ATF_TP_ADD_TC(tp, mprotect_write);
 	ATF_TP_ADD_TC(tp, mprotect_mremap_exec);
+	ATF_TP_ADD_TC(tp, mprotect_mremap_fork_exec);
 
 	return atf_no_error();
 }

Added files:

Index: src/tests/lib/libc/sys/t_mprotect_helper.c
diff -u /dev/null src/tests/lib/libc/sys/t_mprotect_helper.c:1.1
--- /dev/null	Sat Apr 18 13:44:53 2020
+++ src/tests/lib/libc/sys/t_mprotect_helper.c	Sat Apr 18 13:44:53 2020
@@ -0,0 +1,17 @@
+#include "t_mprotect_helper.h"
+
+int

CVS commit: src/sys/dev/pci

2020-04-18 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Apr 18 17:31:53 UTC 2020

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

Log Message:
msk(4): Avoid bus_dmamap_destroy() in msk_stop()

bus_dmamap_destroy() can not be executed in soft interrupt context,
and msk_stop() can be called in soft interrupt context.

As such, move creation and destruction of tx dmamaps to attach() and
detach() functions.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/pci/if_msk.c

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



CVS commit: src/sys/dev/pci

2020-04-18 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sat Apr 18 17:31:53 UTC 2020

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

Log Message:
msk(4): Avoid bus_dmamap_destroy() in msk_stop()

bus_dmamap_destroy() can not be executed in soft interrupt context,
and msk_stop() can be called in soft interrupt context.

As such, move creation and destruction of tx dmamaps to attach() and
detach() functions.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/pci/if_msk.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_msk.c
diff -u src/sys/dev/pci/if_msk.c:1.98 src/sys/dev/pci/if_msk.c:1.99
--- src/sys/dev/pci/if_msk.c:1.98	Tue Feb  4 05:44:14 2020
+++ src/sys/dev/pci/if_msk.c	Sat Apr 18 17:31:52 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.98 2020/02/04 05:44:14 thorpej Exp $ */
+/* $NetBSD: if_msk.c,v 1.99 2020/04/18 17:31:52 jakllsch Exp $ */
 /*	$OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $	*/
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.98 2020/02/04 05:44:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.99 2020/04/18 17:31:52 jakllsch Exp $");
 
 #include 
 #include 
@@ -456,17 +456,13 @@ msk_init_rx_ring(struct sk_if_softc *sc_
 static int
 msk_init_tx_ring(struct sk_if_softc *sc_if)
 {
-	struct sk_softc		*sc = sc_if->sk_softc;
 	struct msk_chain_data	*cd = _if->sk_cdata;
 	struct msk_ring_data	*rd = sc_if->sk_rdata;
 	struct msk_tx_desc	*t;
-	bus_dmamap_t		dmamap;
-	struct sk_txmap_entry	*entry;
 	int			i, nexti;
 
 	memset(rd->sk_tx_ring, 0, sizeof(struct msk_tx_desc) * MSK_TX_RING_CNT);
 
-	SIMPLEQ_INIT(_if->sk_txmap_head);
 	for (i = 0; i < MSK_TX_RING_CNT; i++) {
 		cd->sk_tx_chain[i].sk_le = >sk_tx_ring[i];
 		if (i == (MSK_TX_RING_CNT - 1))
@@ -474,18 +470,6 @@ msk_init_tx_ring(struct sk_if_softc *sc_
 		else
 			nexti = i + 1;
 		cd->sk_tx_chain[i].sk_next = >sk_tx_chain[nexti];
-
-		if (bus_dmamap_create(sc->sc_dmatag, SK_JLEN, SK_NTXSEG,
-		   SK_JLEN, 0, BUS_DMA_NOWAIT, ))
-			return ENOBUFS;
-
-		entry = malloc(sizeof(*entry), M_DEVBUF, M_NOWAIT);
-		if (!entry) {
-			bus_dmamap_destroy(sc->sc_dmatag, dmamap);
-			return ENOBUFS;
-		}
-		entry->dmamap = dmamap;
-		SIMPLEQ_INSERT_HEAD(_if->sk_txmap_head, entry, link);
 	}
 
 	sc_if->sk_cdata.sk_tx_prod = 0;
@@ -1135,6 +1119,8 @@ msk_attach(device_t parent, device_t sel
 	struct sk_if_softc *sc_if = device_private(self);
 	struct sk_softc *sc = device_private(parent);
 	struct skc_attach_args *sa = aux;
+	bus_dmamap_t dmamap;
+	struct sk_txmap_entry *entry;
 	struct ifnet *ifp;
 	struct mii_data * const mii = _if->sk_mii;
 	void *kva;
@@ -1211,6 +1197,23 @@ msk_attach(device_t parent, device_t sel
 		aprint_error(": can't load dma map\n");
 		goto fail_3;
 	}
+
+	SIMPLEQ_INIT(_if->sk_txmap_head);
+	for (i = 0; i < MSK_TX_RING_CNT; i++) {
+		sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf = NULL;
+
+		if (bus_dmamap_create(sc->sc_dmatag, SK_JLEN, SK_NTXSEG,
+		SK_JLEN, 0, BUS_DMA_NOWAIT, )) {
+			aprint_error_dev(sc_if->sk_dev,
+			"Can't create TX dmamap\n");
+			goto fail_3;
+		}
+
+		entry = malloc(sizeof(*entry), M_DEVBUF, M_WAITOK);
+		entry->dmamap = dmamap;
+		SIMPLEQ_INSERT_HEAD(_if->sk_txmap_head, entry, link);
+	}
+
 	sc_if->sk_rdata = (struct msk_ring_data *)kva;
 	memset(sc_if->sk_rdata, 0, sizeof(struct msk_ring_data));
 
@@ -1312,6 +1315,7 @@ msk_detach(device_t self, int flags)
 {
 	struct sk_if_softc *sc_if = device_private(self);
 	struct sk_softc *sc = sc_if->sk_softc;
+	struct sk_txmap_entry *entry;
 	struct ifnet *ifp = _if->sk_ethercom.ec_if;
 
 	if (sc->sk_if[sc_if->sk_port] == NULL)
@@ -1319,6 +1323,12 @@ msk_detach(device_t self, int flags)
 
 	msk_stop(ifp, 1);
 
+	while ((entry = SIMPLEQ_FIRST(_if->sk_txmap_head))) {
+		SIMPLEQ_REMOVE_HEAD(_if->sk_txmap_head, link);
+		bus_dmamap_destroy(sc->sc_dmatag, entry->dmamap);
+		free(entry, M_DEVBUF);
+	}
+
 	if (--sc->rnd_attached == 0)
 		rnd_detach_source(>rnd_source);
 
@@ -2679,23 +2689,15 @@ msk_stop(struct ifnet *ifp, int disable)
 			dma->dmamap->dm_mapsize, BUS_DMASYNC_POSTWRITE);
 
 			bus_dmamap_unload(sc->sc_dmatag, dma->dmamap);
-#if 1
+
 			SIMPLEQ_INSERT_HEAD(_if->sk_txmap_head,
 			sc_if->sk_cdata.sk_tx_map[i], link);
 			sc_if->sk_cdata.sk_tx_map[i] = 0;
-#endif
+
 			m_freem(sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf);
 			sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf = NULL;
 		}
 	}
-
-#if 1
-	while ((dma = SIMPLEQ_FIRST(_if->sk_txmap_head))) {
-		SIMPLEQ_REMOVE_HEAD(_if->sk_txmap_head, link);
-		bus_dmamap_destroy(sc->sc_dmatag, dma->dmamap);
-		free(dma, M_DEVBUF);
-	}
-#endif
 }
 
 CFATTACH_DECL3_NEW(mskc, sizeof(struct sk_softc), mskc_probe, mskc_attach,



CVS commit: src/sys/uvm

2020-04-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Apr 18 17:22:26 UTC 2020

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
Fix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.379 -r1.380 src/sys/uvm/uvm_map.c

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

Modified files:

Index: src/sys/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.379 src/sys/uvm/uvm_map.c:1.380
--- src/sys/uvm/uvm_map.c:1.379	Sat Apr 18 03:27:13 2020
+++ src/sys/uvm/uvm_map.c	Sat Apr 18 17:22:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.379 2020/04/18 03:27:13 thorpej Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.380 2020/04/18 17:22:26 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.379 2020/04/18 03:27:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.380 2020/04/18 17:22:26 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -2613,7 +2613,7 @@ uvm_map_extract(struct vm_map *srcmap, v
 
 	if ((flags & UVM_EXTRACT_RESERVED) == 0) {
 		dstaddr = vm_map_min(dstmap);
-		if (!uvm_map_reserve(dstmap, len, start, 
+		if (!uvm_map_reserve(dstmap, len, start,
 		atop(start) & uvmexp.colormask, ,
 		UVM_FLAG_COLORMATCH))
 			return (ENOMEM);
@@ -4171,7 +4171,7 @@ uvmspace_exec(struct lwp *l, vaddr_t sta
 
 		/*
 		 * now unmap the old program.
-		 * 
+		 *
 		 * XXX set VM_MAP_DYING for the duration, so pmap_update()
 		 * is not called until the pmap has been totally cleared out
 		 * after pmap_remove_all(), or it can confuse some pmap
@@ -5020,12 +5020,12 @@ uvm_voaddr_compare(const struct uvm_voad
 
 	KASSERT(voaddr2->type == UVM_VOADDR_TYPE_OBJECT ||
 		voaddr2->type == UVM_VOADDR_TYPE_ANON);
-	
+
 	if (voaddr1->type < voaddr2->type)
 		return -1;
 	if (voaddr1->type > voaddr2->type)
 		return 1;
-	
+
 	/* These fields are unioned together. */
 	CTASSERT(offsetof(struct uvm_voaddr, uobj) ==
 		 offsetof(struct uvm_voaddr, anon));
@@ -5036,12 +5036,12 @@ uvm_voaddr_compare(const struct uvm_voad
 		return -1;
 	if (addr1 > addr2)
 		return 1;
-	
+
 	if (voaddr1->offset < voaddr2->offset)
 		return -1;
 	if (voaddr1->offset > voaddr2->offset)
 		return 1;
-	
+
 	return 0;
 }
 



CVS commit: src/sys/uvm

2020-04-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Apr 18 17:22:26 UTC 2020

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
Fix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.379 -r1.380 src/sys/uvm/uvm_map.c

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



CVS commit: src/sys/external/bsd/ipf/netinet

2020-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 18 17:02:00 UTC 2020

Modified Files:
src/sys/external/bsd/ipf/netinet: ip_state.c

Log Message:
be consistent about byte flipping (cosmetic no functional change)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/ipf/netinet/ip_state.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/external/bsd/ipf/netinet/ip_state.c
diff -u src/sys/external/bsd/ipf/netinet/ip_state.c:1.11 src/sys/external/bsd/ipf/netinet/ip_state.c:1.12
--- src/sys/external/bsd/ipf/netinet/ip_state.c:1.11	Sun Jun  3 06:37:23 2018
+++ src/sys/external/bsd/ipf/netinet/ip_state.c	Sat Apr 18 13:02:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_state.c,v 1.11 2018/06/03 10:37:23 maxv Exp $	*/
+/*	$NetBSD: ip_state.c,v 1.12 2020/04/18 17:02:00 christos Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -100,7 +100,7 @@ struct file;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.11 2018/06/03 10:37:23 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.12 2020/04/18 17:02:00 christos Exp $");
 #else
 static const char sccsid[] = "@(#)ip_state.c	1.8 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_state.c,v 1.1.1.2 2012/07/22 13:45:37 darrenr Exp";
@@ -2411,7 +2411,7 @@ ipf_matchsrcdst(fr_info_t *fin, ipstate_
 
 	if (tcp != NULL) {
 		sp = htons(fin->fin_sport);
-		dp = ntohs(fin->fin_dport);
+		dp = htons(fin->fin_dport);
 	}
 	if (!rev) {
 		if (tcp != NULL) {



CVS commit: src/sys/external/bsd/ipf/netinet

2020-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 18 17:02:00 UTC 2020

Modified Files:
src/sys/external/bsd/ipf/netinet: ip_state.c

Log Message:
be consistent about byte flipping (cosmetic no functional change)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/ipf/netinet/ip_state.c

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



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

2020-04-18 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Apr 18 16:58:00 UTC 2020

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

Log Message:
make compile with XBD_DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/xen/xen/xbd_xenbus.c

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



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

2020-04-18 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Apr 18 16:58:00 UTC 2020

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

Log Message:
make compile with XBD_DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/xen/xen/xbd_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.118 src/sys/arch/xen/xen/xbd_xenbus.c:1.119
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.118	Fri Apr 17 10:35:06 2020
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Sat Apr 18 16:58:00 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.118 2020/04/17 10:35:06 jdolecek Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.119 2020/04/18 16:58:00 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.118 2020/04/17 10:35:06 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.119 2020/04/18 16:58:00 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -281,12 +281,6 @@ xbd_xenbus_attach(device_t parent, devic
 	struct xenbusdev_attach_args *xa = aux;
 	blkif_sring_t *ring;
 	RING_IDX i;
-#ifdef XBD_DEBUG
-	char **dir, *val;
-	int dir_n = 0;
-	char id_str[20];
-	int err;
-#endif
 
 	config_pending_incr(self);
 	aprint_normal(": Xen Virtual Block Device Interface\n");
@@ -933,7 +927,7 @@ xbdopen(dev_t dev, int flags, int fmt, s
 	if ((flags & FWRITE) && (sc->sc_info & VDISK_READONLY))
 		return EROFS;
 
-	DPRINTF(("xbdopen(0x%04x, %d)\n", dev, flags));
+	DPRINTF(("xbdopen(%" PRIx64 ", %d)\n", dev, flags));
 	return dk_open(>sc_dksc, dev, flags, fmt, l);
 }
 
@@ -944,7 +938,7 @@ xbdclose(dev_t dev, int flags, int fmt, 
 
 	sc = device_lookup_private(_cd, DISKUNIT(dev));
 
-	DPRINTF(("xbdclose(%d, %d)\n", dev, flags));
+	DPRINTF(("xbdclose(%" PRIx64 ", %d)\n", dev, flags));
 	return dk_close(>sc_dksc, dev, flags, fmt, l);
 }
 
@@ -979,7 +973,7 @@ xbdsize(dev_t dev)
 {
 	struct	xbd_xenbus_softc *sc;
 
-	DPRINTF(("xbdsize(%d)\n", dev));
+	DPRINTF(("xbdsize(%" PRIx64 ")\n", dev));
 
 	sc = device_lookup_private(_cd, DISKUNIT(dev));
 	if (sc == NULL || sc->sc_shutdown != BLKIF_SHUTDOWN_RUN)
@@ -1024,7 +1018,7 @@ xbdioctl(dev_t dev, u_long cmd, void *da
 	blkif_request_t *req;
 	int notify;
 
-	DPRINTF(("xbdioctl(%d, %08lx, %p, %d, %p)\n",
+	DPRINTF(("xbdioctl(%" PRIx64 ", %08lx, %p, %d, %p)\n",
 	dev, cmd, data, flag, l));
 	dksc = >sc_dksc;
 
@@ -1093,7 +1087,7 @@ xbddump(dev_t dev, daddr_t blkno, void *
 	if (sc == NULL)
 		return (ENXIO);
 
-	DPRINTF(("xbddump(%d, %" PRId64 ", %p, %lu)\n", dev, blkno, va,
+	DPRINTF(("xbddump(%" PRIx64 ", %" PRId64 ", %p, %lu)\n", dev, blkno, va,
 	(unsigned long)size));
 	return dk_dump(>sc_dksc, dev, blkno, va, size, 0);
 }



CVS commit: src/sys/net

2020-04-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr 18 15:56:26 UTC 2020

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

Log Message:
In _if_down(), release the link state change lock before calling
workqueue_wait().  Add a comment explaining how the locking here
works.

PR kern/55018.


To generate a diff of this commit:
cvs rdiff -u -r1.473 -r1.474 src/sys/net/if.c

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



CVS commit: src/sys/net

2020-04-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Apr 18 15:56:26 UTC 2020

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

Log Message:
In _if_down(), release the link state change lock before calling
workqueue_wait().  Add a comment explaining how the locking here
works.

PR kern/55018.


To generate a diff of this commit:
cvs rdiff -u -r1.473 -r1.474 src/sys/net/if.c

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

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.473 src/sys/net/if.c:1.474
--- src/sys/net/if.c:1.473	Fri Feb 21 00:26:23 2020
+++ src/sys/net/if.c	Sat Apr 18 15:56:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.473 2020/02/21 00:26:23 joerg Exp $	*/
+/*	$NetBSD: if.c,v 1.474 2020/04/18 15:56:26 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.473 2020/02/21 00:26:23 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.474 2020/04/18 15:56:26 thorpej Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -2519,11 +2519,22 @@ _if_down(struct ifnet *ifp)
 	pserialize_read_exit(s);
 	curlwp_bindx(bound);
 
+	/*
+	 * Modification of if_link_cansched is serialized with the
+	 * ifnet ioctl lock.
+	 *
+	 * The link state change lock is taken to synchronize with the
+	 * read in if_link_state_change_work_schedule().  Once we set
+	 * this to false, our if_link_work won't be scheduled.  But
+	 * we need to wait for our if_link_work to drain in case we
+	 * lost that race.
+	 */
 	IF_LINK_STATE_CHANGE_LOCK(ifp);
 	ifp->if_link_cansched = false;
-	workqueue_wait(ifnet_link_state_wq, >if_link_work);
 	IF_LINK_STATE_CHANGE_UNLOCK(ifp);
 
+	workqueue_wait(ifnet_link_state_wq, >if_link_work);
+
 	IFQ_PURGE(>if_snd);
 #if NCARP > 0
 	if (ifp->if_carp)



CVS commit: [bouyer-xenpvh] src/sys/arch

2020-04-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr 18 15:06:18 UTC 2020

Modified Files:
src/sys/arch/x86/include [bouyer-xenpvh]: cpu.h cpuvar.h
src/sys/arch/x86/x86 [bouyer-xenpvh]: cpu.c mainbus.c
src/sys/arch/xen/include [bouyer-xenpvh]: hypervisor.h xen.h
src/sys/arch/xen/x86 [bouyer-xenpvh]: cpu.c hypervisor_machdep.c
xen_ipi.c xen_mainbus.c
src/sys/arch/xen/xen [bouyer-xenpvh]: evtchn.c hypervisor.c xen_clock.c

Log Message:
Add PVHVM multiprocessor support:
We need the hypervisor to be set up before cpus attaches.
Move hypervisor setup to a new function xen_hvm_init(), called at the
beggining of mainbus_attach(). This function searches the cfdata[] array
to see if the hypervisor device is enabled (so you can disable PV
support with
disable hypervisor
from userconf).
For HVM, ci_cpuid doens't match the virtual CPU index needed by Xen.
Introduce ci_vcpuid to cpu_info. Introduce xen_hvm_init_cpu(), to be
called for each CPU in in its context, which initialize ci_vcpuid and
ci_vcpu, and setup the event callback.
Change Xen code to use ci_vcpuid.

Do not call lapic_calibrate_timer() for VM_GUEST_XENPVHVM, we will use
Xen timers.

Don't call lapic_initclocks() from cpu_hatch(); instead set
x86_cpu_initclock_func to lapic_initclocks() in lapic_calibrate_timer(),
and call *(x86_cpu_initclock_func)() from cpu_hatch().
Also call x86_cpu_initclock_func from cpu_attach() for the boot CPU.
As x86_cpu_initclock_func is called for all CPUs, x86_initclock_func can
be a NOP for lapic timer.

Reorganize Xen code for x86_initclock_func/x86_cpu_initclock_func.
Move x86_cpu_idle_xen() to hypervisor_machdep.c


To generate a diff of this commit:
cvs rdiff -u -r1.117.4.5 -r1.117.4.6 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.51 -r1.51.10.1 src/sys/arch/x86/include/cpuvar.h
cvs rdiff -u -r1.181.4.2 -r1.181.4.3 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.3.12.2 -r1.3.12.3 src/sys/arch/x86/x86/mainbus.c
cvs rdiff -u -r1.49.10.2 -r1.49.10.3 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.44 -r1.44.8.1 src/sys/arch/xen/include/xen.h
cvs rdiff -u -r1.133 -r1.133.4.1 src/sys/arch/xen/x86/cpu.c
cvs rdiff -u -r1.36.8.3 -r1.36.8.4 src/sys/arch/xen/x86/hypervisor_machdep.c
cvs rdiff -u -r1.35.6.3 -r1.35.6.4 src/sys/arch/xen/x86/xen_ipi.c
cvs rdiff -u -r1.6.12.2 -r1.6.12.3 src/sys/arch/xen/x86/xen_mainbus.c
cvs rdiff -u -r1.88.2.4 -r1.88.2.5 src/sys/arch/xen/xen/evtchn.c
cvs rdiff -u -r1.73.2.5 -r1.73.2.6 src/sys/arch/xen/xen/hypervisor.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/xen/xen/xen_clock.c

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



CVS commit: [bouyer-xenpvh] src/sys/arch

2020-04-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr 18 15:06:18 UTC 2020

Modified Files:
src/sys/arch/x86/include [bouyer-xenpvh]: cpu.h cpuvar.h
src/sys/arch/x86/x86 [bouyer-xenpvh]: cpu.c mainbus.c
src/sys/arch/xen/include [bouyer-xenpvh]: hypervisor.h xen.h
src/sys/arch/xen/x86 [bouyer-xenpvh]: cpu.c hypervisor_machdep.c
xen_ipi.c xen_mainbus.c
src/sys/arch/xen/xen [bouyer-xenpvh]: evtchn.c hypervisor.c xen_clock.c

Log Message:
Add PVHVM multiprocessor support:
We need the hypervisor to be set up before cpus attaches.
Move hypervisor setup to a new function xen_hvm_init(), called at the
beggining of mainbus_attach(). This function searches the cfdata[] array
to see if the hypervisor device is enabled (so you can disable PV
support with
disable hypervisor
from userconf).
For HVM, ci_cpuid doens't match the virtual CPU index needed by Xen.
Introduce ci_vcpuid to cpu_info. Introduce xen_hvm_init_cpu(), to be
called for each CPU in in its context, which initialize ci_vcpuid and
ci_vcpu, and setup the event callback.
Change Xen code to use ci_vcpuid.

Do not call lapic_calibrate_timer() for VM_GUEST_XENPVHVM, we will use
Xen timers.

Don't call lapic_initclocks() from cpu_hatch(); instead set
x86_cpu_initclock_func to lapic_initclocks() in lapic_calibrate_timer(),
and call *(x86_cpu_initclock_func)() from cpu_hatch().
Also call x86_cpu_initclock_func from cpu_attach() for the boot CPU.
As x86_cpu_initclock_func is called for all CPUs, x86_initclock_func can
be a NOP for lapic timer.

Reorganize Xen code for x86_initclock_func/x86_cpu_initclock_func.
Move x86_cpu_idle_xen() to hypervisor_machdep.c


To generate a diff of this commit:
cvs rdiff -u -r1.117.4.5 -r1.117.4.6 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.51 -r1.51.10.1 src/sys/arch/x86/include/cpuvar.h
cvs rdiff -u -r1.181.4.2 -r1.181.4.3 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.3.12.2 -r1.3.12.3 src/sys/arch/x86/x86/mainbus.c
cvs rdiff -u -r1.49.10.2 -r1.49.10.3 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.44 -r1.44.8.1 src/sys/arch/xen/include/xen.h
cvs rdiff -u -r1.133 -r1.133.4.1 src/sys/arch/xen/x86/cpu.c
cvs rdiff -u -r1.36.8.3 -r1.36.8.4 src/sys/arch/xen/x86/hypervisor_machdep.c
cvs rdiff -u -r1.35.6.3 -r1.35.6.4 src/sys/arch/xen/x86/xen_ipi.c
cvs rdiff -u -r1.6.12.2 -r1.6.12.3 src/sys/arch/xen/x86/xen_mainbus.c
cvs rdiff -u -r1.88.2.4 -r1.88.2.5 src/sys/arch/xen/xen/evtchn.c
cvs rdiff -u -r1.73.2.5 -r1.73.2.6 src/sys/arch/xen/xen/hypervisor.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/xen/xen/xen_clock.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/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.117.4.5 src/sys/arch/x86/include/cpu.h:1.117.4.6
--- src/sys/arch/x86/include/cpu.h:1.117.4.5	Thu Apr 16 17:44:54 2020
+++ src/sys/arch/x86/include/cpu.h	Sat Apr 18 15:06:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.117.4.5 2020/04/16 17:44:54 bouyer Exp $	*/
+/*	$NetBSD: cpu.h,v 1.117.4.6 2020/04/18 15:06:18 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -223,6 +223,7 @@ struct cpu_info {
 	uint32_t 	ci_flags __aligned(64);/* general flags */
 	uint32_t 	ci_acpiid;	/* our ACPI/MADT ID */
 	uint32_t 	ci_initapicid;	/* our initial APIC ID */
+	uint32_t 	ci_vcpuid;	/* our CPU id for hypervisor */
 	cpuid_t		ci_cpuid;	/* our CPU ID */
 	struct cpu_info	*ci_next;	/* next cpu */
 
@@ -530,6 +531,7 @@ void	lwp_trampoline(void);
 void	xen_startrtclock(void);
 void	xen_delay(unsigned int);
 void	xen_initclocks(void);
+void	xen_cpu_initclocks(void);
 void	xen_suspendclocks(struct cpu_info *);
 void	xen_resumeclocks(struct cpu_info *);
 #endif /* XEN */

Index: src/sys/arch/x86/include/cpuvar.h
diff -u src/sys/arch/x86/include/cpuvar.h:1.51 src/sys/arch/x86/include/cpuvar.h:1.51.10.1
--- src/sys/arch/x86/include/cpuvar.h:1.51	Mon Feb 11 14:59:32 2019
+++ src/sys/arch/x86/include/cpuvar.h	Sat Apr 18 15:06:18 2020
@@ -1,4 +1,4 @@
-/* 	$NetBSD: cpuvar.h,v 1.51 2019/02/11 14:59:32 cherry Exp $ */
+/* 	$NetBSD: cpuvar.h,v 1.51.10.1 2020/04/18 15:06:18 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -99,6 +99,7 @@ struct cpufeature_attach_args {
 #include 
 #if defined(_KERNEL_OPT)
 #include "opt_multiprocessor.h"
+#include "opt_xen.h"
 #endif /* defined(_KERNEL_OPT) */
 
 extern int (*x86_ipi)(int, int, int);
@@ -115,7 +116,7 @@ void cpu_init_first(void);
 void x86_cpu_idle_init(void);
 void x86_cpu_idle_halt(void);
 void x86_cpu_idle_mwait(void);
-#ifdef XENPV
+#ifdef XEN
 void x86_cpu_idle_xen(void);
 #endif
 

Index: src/sys/arch/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.181.4.2 src/sys/arch/x86/x86/cpu.c:1.181.4.3
--- src/sys/arch/x86/x86/cpu.c:1.181.4.2	Thu Apr 16 09:45:56 2020
+++ src/sys/arch/x86/x86/cpu.c	Sat Apr 18 15:06:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 

CVS commit: [bouyer-xenpvh] src/sys/arch/i386/i386

2020-04-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr 18 14:49:57 UTC 2020

Modified Files:
src/sys/arch/i386/i386 [bouyer-xenpvh]: i386_trap.S locore.S

Log Message:
Call stipending() only on XenPV. Fix spurious fpudna from kernel mode


To generate a diff of this commit:
cvs rdiff -u -r1.20.6.1 -r1.20.6.2 src/sys/arch/i386/i386/i386_trap.S
cvs rdiff -u -r1.179.2.2 -r1.179.2.3 src/sys/arch/i386/i386/locore.S

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

Modified files:

Index: src/sys/arch/i386/i386/i386_trap.S
diff -u src/sys/arch/i386/i386/i386_trap.S:1.20.6.1 src/sys/arch/i386/i386/i386_trap.S:1.20.6.2
--- src/sys/arch/i386/i386/i386_trap.S:1.20.6.1	Sun Apr 12 17:25:52 2020
+++ src/sys/arch/i386/i386/i386_trap.S	Sat Apr 18 14:49:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386_trap.S,v 1.20.6.1 2020/04/12 17:25:52 bouyer Exp $	*/
+/*	$NetBSD: i386_trap.S,v 1.20.6.2 2020/04/18 14:49:57 bouyer Exp $	*/
 
 /*
  * Copyright 2002 (c) Wasabi Systems, Inc.
@@ -66,7 +66,7 @@
 
 #if 0
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.20.6.1 2020/04/12 17:25:52 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.20.6.2 2020/04/18 14:49:57 bouyer Exp $");
 #endif
 
 /*
@@ -434,7 +434,7 @@ calltrap:
 3:	CHECK_DEFERRED_SWITCH
 	jnz	9f
 
-#ifdef XEN
+#ifdef XENPV
 	STIC(%eax)
 	jz	22f
 	call	_C_LABEL(stipending)
@@ -456,7 +456,7 @@ calltrap:
 11:	movl	%ebx,CPUVAR(ILEVEL)	/* restore cpl */
 	jmp	.Lalltraps_checkusr
 22:
-#endif
+#endif /* XEN */
 
 	HANDLE_DEFERRED_FPU
 

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.179.2.2 src/sys/arch/i386/i386/locore.S:1.179.2.3
--- src/sys/arch/i386/i386/locore.S:1.179.2.2	Sun Apr 12 17:25:52 2020
+++ src/sys/arch/i386/i386/locore.S	Sat Apr 18 14:49:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.179.2.2 2020/04/12 17:25:52 bouyer Exp $	*/
+/*	$NetBSD: locore.S,v 1.179.2.3 2020/04/18 14:49:57 bouyer Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,7 +128,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.179.2.2 2020/04/12 17:25:52 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.179.2.3 2020/04/18 14:49:57 bouyer Exp $");
 
 #include "opt_copy_symtab.h"
 #include "opt_ddb.h"
@@ -1478,7 +1478,7 @@ IDTVEC(syscall)
 	orl	CPUVAR(WANT_PMAPLOAD), %eax
 	jnz	9f
 
-#ifdef XEN
+#ifdef XENPV
 	STIC(%eax)
 	jz	14f
 	call	_C_LABEL(stipending)
@@ -1500,7 +1500,7 @@ IDTVEC(syscall)
 17:	movl	%ebx, CPUVAR(ILEVEL)	/* restore cpl  */
 	jmp	.Lsyscall_checkast
 14:
-#endif /* XEN */
+#endif /* XENPV */
 
 #ifdef DIAGNOSTIC
 	cmpl	$IPL_NONE,CPUVAR(ILEVEL)



CVS commit: [bouyer-xenpvh] src/sys/arch/i386/i386

2020-04-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr 18 14:49:57 UTC 2020

Modified Files:
src/sys/arch/i386/i386 [bouyer-xenpvh]: i386_trap.S locore.S

Log Message:
Call stipending() only on XenPV. Fix spurious fpudna from kernel mode


To generate a diff of this commit:
cvs rdiff -u -r1.20.6.1 -r1.20.6.2 src/sys/arch/i386/i386/i386_trap.S
cvs rdiff -u -r1.179.2.2 -r1.179.2.3 src/sys/arch/i386/i386/locore.S

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



CVS commit: [bouyer-xenpvh] src/sys/arch

2020-04-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr 18 14:47:56 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64 [bouyer-xenpvh]: machdep.c
src/sys/arch/i386/i386 [bouyer-xenpvh]: machdep.c
src/sys/arch/x86/include [bouyer-xenpvh]: machdep.h
src/sys/arch/x86/isa [bouyer-xenpvh]: clock.c
src/sys/arch/x86/x86 [bouyer-xenpvh]: lapic.c x86_machdep.c

Log Message:
Centralize initialisations of delay_func and initclock_func
in x86_machdep.c and export from 
Introduce a x86_dummy_initclock() and a x86_cpu_initclock_func pointer,
to be used later for Xen HVM native clock support.
rename rtclock_tval to x86_rtclock_tval and export from ,
for the benefit of lapic.c


To generate a diff of this commit:
cvs rdiff -u -r1.346.4.2 -r1.346.4.3 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.825.4.2 -r1.825.4.3 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.9 -r1.9.26.1 src/sys/arch/x86/include/machdep.h
cvs rdiff -u -r1.36 -r1.36.6.1 src/sys/arch/x86/isa/clock.c
cvs rdiff -u -r1.76.6.2 -r1.76.6.3 src/sys/arch/x86/x86/lapic.c
cvs rdiff -u -r1.137.2.4 -r1.137.2.5 src/sys/arch/x86/x86/x86_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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.346.4.2 src/sys/arch/amd64/amd64/machdep.c:1.346.4.3
--- src/sys/arch/amd64/amd64/machdep.c:1.346.4.2	Thu Apr 16 09:45:56 2020
+++ src/sys/arch/amd64/amd64/machdep.c	Sat Apr 18 14:47:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.346.4.2 2020/04/16 09:45:56 bouyer Exp $	*/
+/*	$NetBSD: machdep.c,v 1.346.4.3 2020/04/18 14:47:55 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.346.4.2 2020/04/16 09:45:56 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.346.4.3 2020/04/18 14:47:55 bouyer Exp $");
 
 #include "opt_modular.h"
 #include "opt_user_ldt.h"
@@ -280,14 +280,6 @@ extern paddr_t avail_start, avail_end;
 extern paddr_t pmap_pa_start, pmap_pa_end;
 #endif
 
-#ifndef XENPV
-void (*delay_func)(unsigned int) = i8254_delay;
-void (*initclock_func)(void) = i8254_initclocks;
-#else /* XENPV */
-void (*delay_func)(unsigned int) = xen_delay;
-void (*initclock_func)(void) = xen_initclocks;
-#endif
-
 struct nmistore {
 	uint64_t cr3;
 	uint64_t scratch;
@@ -2129,12 +2121,6 @@ cpu_mcontext_validate(struct lwp *l, con
 	return 0;
 }
 
-void
-cpu_initclocks(void)
-{
-	(*initclock_func)();
-}
-
 int
 mm_md_kernacc(void *ptr, vm_prot_t prot, bool *handled)
 {

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.825.4.2 src/sys/arch/i386/i386/machdep.c:1.825.4.3
--- src/sys/arch/i386/i386/machdep.c:1.825.4.2	Thu Apr 16 08:46:34 2020
+++ src/sys/arch/i386/i386/machdep.c	Sat Apr 18 14:47:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.825.4.2 2020/04/16 08:46:34 bouyer Exp $	*/
+/*	$NetBSD: machdep.c,v 1.825.4.3 2020/04/18 14:47:55 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.825.4.2 2020/04/16 08:46:34 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.825.4.3 2020/04/18 14:47:55 bouyer Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_freebsd.h"
@@ -235,14 +235,6 @@ void hypervisor_callback(void);
 void failsafe_callback(void);
 #endif
 
-#ifdef XENPV
-void (*delay_func)(unsigned int) = xen_delay;
-void (*initclock_func)(void) = xen_initclocks;
-#else
-void (*delay_func)(unsigned int) = i8254_delay;
-void (*initclock_func)(void) = i8254_initclocks;
-#endif
-
 /*
  * Size of memory segments, before any memory is stolen.
  */
@@ -1624,13 +1616,6 @@ cpu_setmcontext(struct lwp *l, const mco
 	return (0);
 }
 
-void
-cpu_initclocks(void)
-{
-
-	(*initclock_func)();
-}
-
 #define	DEV_IO 14		/* iopl for compat_10 */
 
 int

Index: src/sys/arch/x86/include/machdep.h
diff -u src/sys/arch/x86/include/machdep.h:1.9 src/sys/arch/x86/include/machdep.h:1.9.26.1
--- src/sys/arch/x86/include/machdep.h:1.9	Mon Dec 26 17:54:07 2016
+++ src/sys/arch/x86/include/machdep.h	Sat Apr 18 14:47:55 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.9 2016/12/26 17:54:07 cherry Exp $ */
+/* $NetBSD: machdep.h,v 1.9.26.1 2020/04/18 14:47:55 bouyer Exp $ */
 /*
  * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -51,6 +51,12 @@ void	x86_cpu_idle_init(void);
 void	x86_cpu_idle_get(void (**)(void), char *, size_t);
 void	x86_cpu_idle_set(void (*)(void), const char *, bool);
 
+extern u_long x86_rtclock_tval;
+extern void (*x86_initclock_func)(void);
+extern void (*x86_cpu_initclock_func)(void);
+
+void x86_dummy_initclock(void);
+
 int	x86_select_freelist(uint64_t);
 
 void	init_x86_clusters(void);

Index: src/sys/arch/x86/isa/clock.c
diff -u 

CVS commit: [bouyer-xenpvh] src/sys/arch

2020-04-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Apr 18 14:47:56 UTC 2020

Modified Files:
src/sys/arch/amd64/amd64 [bouyer-xenpvh]: machdep.c
src/sys/arch/i386/i386 [bouyer-xenpvh]: machdep.c
src/sys/arch/x86/include [bouyer-xenpvh]: machdep.h
src/sys/arch/x86/isa [bouyer-xenpvh]: clock.c
src/sys/arch/x86/x86 [bouyer-xenpvh]: lapic.c x86_machdep.c

Log Message:
Centralize initialisations of delay_func and initclock_func
in x86_machdep.c and export from 
Introduce a x86_dummy_initclock() and a x86_cpu_initclock_func pointer,
to be used later for Xen HVM native clock support.
rename rtclock_tval to x86_rtclock_tval and export from ,
for the benefit of lapic.c


To generate a diff of this commit:
cvs rdiff -u -r1.346.4.2 -r1.346.4.3 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.825.4.2 -r1.825.4.3 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.9 -r1.9.26.1 src/sys/arch/x86/include/machdep.h
cvs rdiff -u -r1.36 -r1.36.6.1 src/sys/arch/x86/isa/clock.c
cvs rdiff -u -r1.76.6.2 -r1.76.6.3 src/sys/arch/x86/x86/lapic.c
cvs rdiff -u -r1.137.2.4 -r1.137.2.5 src/sys/arch/x86/x86/x86_machdep.c

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



CVS commit: src/distrib/utils

2020-04-18 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Apr 18 12:56:38 UTC 2020

Modified Files:
src/distrib/utils/x_fsck_ffs: Makefile
src/distrib/utils/x_newfs: Makefile

Log Message:
enable NO_IOBUF_ALIGNED for x_newfs and x_fsck_ffs


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/x_fsck_ffs/Makefile
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/x_newfs/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/utils/x_fsck_ffs/Makefile
diff -u src/distrib/utils/x_fsck_ffs/Makefile:1.1 src/distrib/utils/x_fsck_ffs/Makefile:1.2
--- src/distrib/utils/x_fsck_ffs/Makefile:1.1	Wed Feb  8 16:11:39 2017
+++ src/distrib/utils/x_fsck_ffs/Makefile	Sat Apr 18 12:56:38 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2017/02/08 16:11:39 rin Exp $
+# $NetBSD: Makefile,v 1.2 2020/04/18 12:56:38 jdolecek Exp $
 # Build a smaller fsck_ffs (i.e. for boot media).
 # Support for Endian-Independent FFS and Apple UFS is dropped unless FFS_EI=1
 # and APPLE_UFS=1 are added to CRUNCHENV, respectively.
@@ -21,6 +21,8 @@ SRCS+=		ffs_appleufs.c
 CPPFLAGS+=	-DNO_APPLE_UFS
 .endif
 
+CPPFLAGS+=	-DNO_IOBUF_ALIGNED
+
 .PATH:		${SRCDIR}
 
 .include "${SRCDIR}/Makefile.common"

Index: src/distrib/utils/x_newfs/Makefile
diff -u src/distrib/utils/x_newfs/Makefile:1.1 src/distrib/utils/x_newfs/Makefile:1.2
--- src/distrib/utils/x_newfs/Makefile:1.1	Wed Feb  8 16:11:40 2017
+++ src/distrib/utils/x_newfs/Makefile	Sat Apr 18 12:56:38 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2017/02/08 16:11:40 rin Exp $
+# $NetBSD: Makefile,v 1.2 2020/04/18 12:56:38 jdolecek Exp $
 # Build a smaller newfs (i.e. for boot media).
 # Support for Endian-Independent FFS and Apple UFS is dropped unless FFS_EI=1
 # and APPLE_UFS=1 are added to CRUNCHENV, respectively.
@@ -21,6 +21,9 @@ SRCS+=		ffs_appleufs.c
 CPPFLAGS+=	-DNO_APPLE_UFS
 .endif
 
+CPPFLAGS+=	-DSMALL
+CPPFLAGS+=	-DNO_IOBUF_ALIGNED
+
 .PATH:		${SRCDIR}
 
 .include "${SRCDIR}/Makefile.common"



CVS commit: src/distrib/utils

2020-04-18 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Apr 18 12:56:38 UTC 2020

Modified Files:
src/distrib/utils/x_fsck_ffs: Makefile
src/distrib/utils/x_newfs: Makefile

Log Message:
enable NO_IOBUF_ALIGNED for x_newfs and x_fsck_ffs


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/x_fsck_ffs/Makefile
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/x_newfs/Makefile

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



CVS commit: src/sbin

2020-04-18 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Apr 18 12:54:38 UTC 2020

Modified Files:
src/sbin/fsck_ffs: fsck.h
src/sbin/newfs: extern.h

Log Message:
add NO_IOBUF_ALIGNED to not pull aligned_alloc() for really constrained
boot media


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sbin/fsck_ffs/fsck.h
cvs rdiff -u -r1.18 -r1.19 src/sbin/newfs/extern.h

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

Modified files:

Index: src/sbin/fsck_ffs/fsck.h
diff -u src/sbin/fsck_ffs/fsck.h:1.54 src/sbin/fsck_ffs/fsck.h:1.55
--- src/sbin/fsck_ffs/fsck.h:1.54	Sun Apr  5 15:25:40 2020
+++ src/sbin/fsck_ffs/fsck.h	Sat Apr 18 12:54:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsck.h,v 1.54 2020/04/05 15:25:40 joerg Exp $	*/
+/*	$NetBSD: fsck.h,v 1.55 2020/04/18 12:54:38 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -394,3 +394,7 @@ iswap64(u_int64_t x)
 #define	iswap32(x) (x)
 #define	iswap64(x) (x)
 #endif /* NO_FFS_EI */
+
+#ifdef NO_IOBUF_ALIGNED
+#define	aligned_alloc(align, size)	malloc((size))
+#endif

Index: src/sbin/newfs/extern.h
diff -u src/sbin/newfs/extern.h:1.18 src/sbin/newfs/extern.h:1.19
--- src/sbin/newfs/extern.h:1.18	Wed Feb  8 18:05:25 2017
+++ src/sbin/newfs/extern.h	Sat Apr 18 12:54:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.18 2017/02/08 18:05:25 rin Exp $	*/
+/*	$NetBSD: extern.h,v 1.19 2020/04/18 12:54:38 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1997 Christos Zoulas.  All rights reserved.
@@ -72,3 +72,8 @@ extern char	*appleufs_volname;	/* Apple 
 /* Disable Apple UFS support for install media */
 #define		isappleufs		(0)
 #endif
+
+#ifdef NO_IOBUF_ALIGNED
+#define	aligned_alloc(align, size)	malloc((size))
+#endif
+



CVS commit: src/sbin

2020-04-18 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Apr 18 12:54:38 UTC 2020

Modified Files:
src/sbin/fsck_ffs: fsck.h
src/sbin/newfs: extern.h

Log Message:
add NO_IOBUF_ALIGNED to not pull aligned_alloc() for really constrained
boot media


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sbin/fsck_ffs/fsck.h
cvs rdiff -u -r1.18 -r1.19 src/sbin/newfs/extern.h

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



CVS commit: src/usr.sbin/makefs

2020-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Apr 18 12:25:01 UTC 2020

Modified Files:
src/usr.sbin/makefs: udf.c

Log Message:
Remove unused variable (to fix the build)


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/makefs/udf.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/makefs/udf.c
diff -u src/usr.sbin/makefs/udf.c:1.20 src/usr.sbin/makefs/udf.c:1.21
--- src/usr.sbin/makefs/udf.c:1.20	Sat Apr 18 09:45:45 2020
+++ src/usr.sbin/makefs/udf.c	Sat Apr 18 12:25:01 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.c,v 1.20 2020/04/18 09:45:45 reinoud Exp $ */
+/* $NetBSD: udf.c,v 1.21 2020/04/18 12:25:01 martin Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: udf.c,v 1.20 2020/04/18 09:45:45 reinoud Exp $");
+__RCSID("$NetBSD: udf.c,v 1.21 2020/04/18 12:25:01 martin Exp $");
 
 #include 
 #include 
@@ -562,7 +562,6 @@ udf_file_inject_blob(union dscrptr *dscr
 	struct extfile_entry *efe;
 	uint64_t inf_len, obj_size;
 	uint32_t l_ea, l_ad;
-	uint32_t desc_size;
 	uint16_t crclen;
 	uint8_t *data, *pos;
 
@@ -576,7 +575,6 @@ udf_file_inject_blob(union dscrptr *dscr
 		icb   = >icbtag;
 		inf_len   = udf_rw64(fe->inf_len);
 		obj_size  = 0;
-		desc_size = sizeof(struct file_entry);
 	} else if (udf_rw16(dscr->tag.id) == TAGID_EXTFENTRY) {
 		efe   = >efe;
 		data  = efe->data;
@@ -585,7 +583,6 @@ udf_file_inject_blob(union dscrptr *dscr
 		icb   = >icbtag;
 		inf_len   = udf_rw64(efe->inf_len);
 		obj_size  = udf_rw64(efe->obj_size);
-		desc_size = sizeof(struct extfile_entry);
 	} else {
 		errx(1, "Bad tag passed to udf_file_inject_blob");
 	}



CVS commit: src/usr.sbin/makefs

2020-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Apr 18 12:25:01 UTC 2020

Modified Files:
src/usr.sbin/makefs: udf.c

Log Message:
Remove unused variable (to fix the build)


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/makefs/udf.c

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



Re: CVS commit: src/sys

2020-04-18 Thread Robert Elz
Date:Sat, 18 Apr 2020 10:29:33 +
From:m...@netbsd.org
Message-ID:  <20200418102933.ga24...@homeworld.netbsd.org>

  | I feel like it's difficult to decide which is objectively better.

It all depends upon usage patterns, and objectives.

  | CVS encourages you to keep your local changes uncommitted, so they do
  | not show up in a change to RCSID at all.

Yes, that's a problem.   I'd actually prefer it if the compiler were to
add a note (of some kind, as long as it appears in the actual binary)
with the filename, mod date, and checksum, of every file it includes in
each compilation unit.   If there's also a VCS ID of some kind that can be
associated, even better.

The point was that a single identifier for the whole build simply
isn't detailed enough to be useful in many cases - it certainly wasn't
that CVS is better than something else.

  | But as a person with access to the repository, you are in a better
  | position in this case, because the DVCS will make it easy to go back to
  | the state of the tree given a hash, even after you add changes later.

I have had an off-list discussion with wiz about some of this - part of the
point is that often the person who wants to know whether a particular
version of a file was included has no reporitory access at all.   The
repository might not even still exist.   One of the questions we would
like to be able to answer is whether two different distributions were
built with the same version of some particular file - if that file is
later discovered to have been harbouring a bug.  And it would be nice to
be able to do that in isolation (no references to anything other than the
two (binary) distributions).

  | I imagine it isn't impossible to find 'closest parent which is also in
  | the remote' and embed it as well, mitigating the "outsider can't tell
  | how far you are" concern, if someone wants to pursue that.

To my mind, within reasonable cost bounds (space and effort) the more info
that is included the better.   It is always easy to simply ignore if not
needed, or redundant, but often impossible to reconstruct if missing.

kre



CVS commit: src/sys/arch

2020-04-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 18 11:00:42 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c
src/sys/arch/aarch64/conf: files.aarch64
src/sys/arch/acorn32/acorn32: rpc_machdep.c
src/sys/arch/acorn32/conf: EB7500ATX GENERIC INSTALL LOWMEM_WSCONS NC
src/sys/arch/acorn32/eb7500atx: eb7500atx_machdep.c
src/sys/arch/arm/arm32: arm32_machdep.c vm_machdep.c
src/sys/arch/arm/at91: at91bus.c
src/sys/arch/arm/conf: files.arm
src/sys/arch/arm/include/arm32: pmap.h
src/sys/arch/cats/cats: cats_machdep.c
src/sys/arch/cats/conf: GENERIC INSTALL
src/sys/arch/evbarm/adi_brh: brh_machdep.c
src/sys/arch/evbarm/armadillo: armadillo9_machdep.c
src/sys/arch/evbarm/conf: ADI_BRH ARMADAXP ARMADILLO-IOT-G3
ARMADILLO210 ARMADILLO9 BCM5301X BCM56340 CP3100 CUBOX CUBOX-I
DNS323 DUOVERO GEMINI GEMINI_MASTER GEMINI_SLAVE GENERIC
GENERIC.common GENERIC64 GUMSTIX HDL_G HPT5325 HUMMINGBOARD IMX
IMX31LITE IMX6UL-STARTER INTEGRATOR INTEGRATOR_CP IQ31244 IQ80310
IQ80321 IXDP425 IXM1200 IYONIX KOBO KUROBOX_PRO KURONAS_X4 LUBBOCK
MARVELL_NAS MINI2440 N900 NAPPI NETWALKER NSLU2 OMAP5EVM
OPENBLOCKS_A6 OPENBLOCKS_AX3 OSK5912 PANDABOARD PARALLELLA PEPPER
RPI SHEEVAPLUG SMDK2410 SMDK2800 TEAMASA_NPWR TEAMASA_NPWR_FC
TISDP2420 TISDP2430 TS7200 TWINTAIL VIPER VIRT VTC100 ZAO425
ZEDBOARD
src/sys/arch/evbarm/g42xxeb: g42xxeb_machdep.c
src/sys/arch/evbarm/gumstix: gumstix_machdep.c
src/sys/arch/evbarm/hdl_g: hdlg_machdep.c
src/sys/arch/evbarm/imx31: imx31lk_machdep.c
src/sys/arch/evbarm/integrator: integrator_machdep.c
src/sys/arch/evbarm/iq80310: iq80310_machdep.c
src/sys/arch/evbarm/iq80321: iq80321_machdep.c
src/sys/arch/evbarm/ixdp425: ixdp425_machdep.c
src/sys/arch/evbarm/ixm1200: ixm1200_machdep.c
src/sys/arch/evbarm/iyonix: iyonix_machdep.c
src/sys/arch/evbarm/lubbock: lubbock_machdep.c
src/sys/arch/evbarm/mini2440: mini2440_machdep.c
src/sys/arch/evbarm/mmnet: mmnet_machdep.c
src/sys/arch/evbarm/mpcsa: mpcsa_machdep.c
src/sys/arch/evbarm/npwr_fc: npwr_fc_machdep.c
src/sys/arch/evbarm/nslu2: nslu2_machdep.c
src/sys/arch/evbarm/smdk2xx0: smdk2410_machdep.c smdk2800_machdep.c
src/sys/arch/evbarm/tsarm: tsarm_machdep.c
src/sys/arch/evbarm/viper: viper_machdep.c
src/sys/arch/hpcarm/conf: IPAQ JORNADA720 JORNADA820 NETBOOKPRO WZERO3
src/sys/arch/hpcarm/hpcarm: pxa2x0_hpc_machdep.c sa11x0_hpc_machdep.c
src/sys/arch/iyonix/conf: GENERIC
src/sys/arch/iyonix/iyonix: iyonix_machdep.c
src/sys/arch/netwinder/conf: GENERIC
src/sys/arch/netwinder/netwinder: netwinder_machdep.c
src/sys/arch/shark/conf: GENERIC INSTALL
src/sys/arch/zaurus/zaurus: machdep.c

Log Message:
PMAP_DEBUG has been deleted on arm


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/aarch64/conf/files.aarch64
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/acorn32/acorn32/rpc_machdep.c
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/acorn32/conf/EB7500ATX
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/acorn32/conf/GENERIC
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/acorn32/conf/INSTALL
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/acorn32/conf/LOWMEM_WSCONS
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/acorn32/conf/NC
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/arm/arm32/arm32_machdep.c
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/arm/arm32/vm_machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/at91/at91bus.c
cvs rdiff -u -r1.156 -r1.157 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.166 -r1.167 src/sys/arch/arm/include/arm32/pmap.h
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/cats/cats/cats_machdep.c
cvs rdiff -u -r1.179 -r1.180 src/sys/arch/cats/conf/GENERIC
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/cats/conf/INSTALL
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/evbarm/adi_brh/brh_machdep.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbarm/armadillo/armadillo9_machdep.c
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/evbarm/conf/ADI_BRH \
src/sys/arch/evbarm/conf/SMDK2410
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbarm/conf/ARMADAXP
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3 \
src/sys/arch/evbarm/conf/VTC100
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/evbarm/conf/ARMADILLO210
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/evbarm/conf/ARMADILLO9 \
src/sys/arch/evbarm/conf/LUBBOCK
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/conf/BCM5301X \
src/sys/arch/evbarm/conf/IMX31LITE
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/conf/BCM56340
cvs rdiff -u -r1.49 -r1.50 

CVS commit: src/sys/arch

2020-04-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 18 11:00:42 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c
src/sys/arch/aarch64/conf: files.aarch64
src/sys/arch/acorn32/acorn32: rpc_machdep.c
src/sys/arch/acorn32/conf: EB7500ATX GENERIC INSTALL LOWMEM_WSCONS NC
src/sys/arch/acorn32/eb7500atx: eb7500atx_machdep.c
src/sys/arch/arm/arm32: arm32_machdep.c vm_machdep.c
src/sys/arch/arm/at91: at91bus.c
src/sys/arch/arm/conf: files.arm
src/sys/arch/arm/include/arm32: pmap.h
src/sys/arch/cats/cats: cats_machdep.c
src/sys/arch/cats/conf: GENERIC INSTALL
src/sys/arch/evbarm/adi_brh: brh_machdep.c
src/sys/arch/evbarm/armadillo: armadillo9_machdep.c
src/sys/arch/evbarm/conf: ADI_BRH ARMADAXP ARMADILLO-IOT-G3
ARMADILLO210 ARMADILLO9 BCM5301X BCM56340 CP3100 CUBOX CUBOX-I
DNS323 DUOVERO GEMINI GEMINI_MASTER GEMINI_SLAVE GENERIC
GENERIC.common GENERIC64 GUMSTIX HDL_G HPT5325 HUMMINGBOARD IMX
IMX31LITE IMX6UL-STARTER INTEGRATOR INTEGRATOR_CP IQ31244 IQ80310
IQ80321 IXDP425 IXM1200 IYONIX KOBO KUROBOX_PRO KURONAS_X4 LUBBOCK
MARVELL_NAS MINI2440 N900 NAPPI NETWALKER NSLU2 OMAP5EVM
OPENBLOCKS_A6 OPENBLOCKS_AX3 OSK5912 PANDABOARD PARALLELLA PEPPER
RPI SHEEVAPLUG SMDK2410 SMDK2800 TEAMASA_NPWR TEAMASA_NPWR_FC
TISDP2420 TISDP2430 TS7200 TWINTAIL VIPER VIRT VTC100 ZAO425
ZEDBOARD
src/sys/arch/evbarm/g42xxeb: g42xxeb_machdep.c
src/sys/arch/evbarm/gumstix: gumstix_machdep.c
src/sys/arch/evbarm/hdl_g: hdlg_machdep.c
src/sys/arch/evbarm/imx31: imx31lk_machdep.c
src/sys/arch/evbarm/integrator: integrator_machdep.c
src/sys/arch/evbarm/iq80310: iq80310_machdep.c
src/sys/arch/evbarm/iq80321: iq80321_machdep.c
src/sys/arch/evbarm/ixdp425: ixdp425_machdep.c
src/sys/arch/evbarm/ixm1200: ixm1200_machdep.c
src/sys/arch/evbarm/iyonix: iyonix_machdep.c
src/sys/arch/evbarm/lubbock: lubbock_machdep.c
src/sys/arch/evbarm/mini2440: mini2440_machdep.c
src/sys/arch/evbarm/mmnet: mmnet_machdep.c
src/sys/arch/evbarm/mpcsa: mpcsa_machdep.c
src/sys/arch/evbarm/npwr_fc: npwr_fc_machdep.c
src/sys/arch/evbarm/nslu2: nslu2_machdep.c
src/sys/arch/evbarm/smdk2xx0: smdk2410_machdep.c smdk2800_machdep.c
src/sys/arch/evbarm/tsarm: tsarm_machdep.c
src/sys/arch/evbarm/viper: viper_machdep.c
src/sys/arch/hpcarm/conf: IPAQ JORNADA720 JORNADA820 NETBOOKPRO WZERO3
src/sys/arch/hpcarm/hpcarm: pxa2x0_hpc_machdep.c sa11x0_hpc_machdep.c
src/sys/arch/iyonix/conf: GENERIC
src/sys/arch/iyonix/iyonix: iyonix_machdep.c
src/sys/arch/netwinder/conf: GENERIC
src/sys/arch/netwinder/netwinder: netwinder_machdep.c
src/sys/arch/shark/conf: GENERIC INSTALL
src/sys/arch/zaurus/zaurus: machdep.c

Log Message:
PMAP_DEBUG has been deleted on arm


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/aarch64/conf/files.aarch64
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/acorn32/acorn32/rpc_machdep.c
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/acorn32/conf/EB7500ATX
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/acorn32/conf/GENERIC
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/acorn32/conf/INSTALL
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/acorn32/conf/LOWMEM_WSCONS
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/acorn32/conf/NC
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/arm/arm32/arm32_machdep.c
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/arm/arm32/vm_machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/at91/at91bus.c
cvs rdiff -u -r1.156 -r1.157 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.166 -r1.167 src/sys/arch/arm/include/arm32/pmap.h
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/cats/cats/cats_machdep.c
cvs rdiff -u -r1.179 -r1.180 src/sys/arch/cats/conf/GENERIC
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/cats/conf/INSTALL
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/evbarm/adi_brh/brh_machdep.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbarm/armadillo/armadillo9_machdep.c
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/evbarm/conf/ADI_BRH \
src/sys/arch/evbarm/conf/SMDK2410
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbarm/conf/ARMADAXP
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbarm/conf/ARMADILLO-IOT-G3 \
src/sys/arch/evbarm/conf/VTC100
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/evbarm/conf/ARMADILLO210
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/evbarm/conf/ARMADILLO9 \
src/sys/arch/evbarm/conf/LUBBOCK
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/conf/BCM5301X \
src/sys/arch/evbarm/conf/IMX31LITE
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/evbarm/conf/BCM56340
cvs rdiff -u -r1.49 -r1.50 

CVS commit: src/sys/arch

2020-04-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 18 10:55:47 UTC 2020

Modified Files:
src/sys/arch/acorn32/acorn32: rpc_machdep.c
src/sys/arch/acorn32/conf: EB7500ATX
src/sys/arch/acorn32/eb7500atx: eb7500atx_machdep.c
src/sys/arch/arm/at91: at91bus.c
src/sys/arch/cats/conf: GENERIC
src/sys/arch/evbarm/adi_brh: brh_machdep.c
src/sys/arch/evbarm/armadillo: armadillo9_machdep.c
src/sys/arch/evbarm/conf: GENERIC64 IYONIX MARVELL_NAS
src/sys/arch/evbarm/g42xxeb: g42xxeb_machdep.c
src/sys/arch/evbarm/hdl_g: hdlg_machdep.c
src/sys/arch/evbarm/imx31: imx31lk_machdep.c
src/sys/arch/evbarm/integrator: integrator_machdep.c
src/sys/arch/evbarm/iq80310: iq80310_machdep.c
src/sys/arch/evbarm/iq80321: iq80321_machdep.c
src/sys/arch/evbarm/ixdp425: ixdp425_machdep.c
src/sys/arch/evbarm/ixm1200: ixm1200_machdep.c
src/sys/arch/evbarm/iyonix: iyonix_machdep.c
src/sys/arch/evbarm/lubbock: lubbock_machdep.c
src/sys/arch/evbarm/mini2440: mini2440_machdep.c
src/sys/arch/evbarm/mmnet: mmnet_machdep.c
src/sys/arch/evbarm/mpcsa: mpcsa_machdep.c
src/sys/arch/evbarm/npwr_fc: npwr_fc_machdep.c
src/sys/arch/evbarm/nslu2: nslu2_machdep.c
src/sys/arch/evbarm/smdk2xx0: smdk2410_machdep.c smdk2800_machdep.c
src/sys/arch/evbarm/tsarm: tsarm_machdep.c
src/sys/arch/evbarm/viper: viper_machdep.c
src/sys/arch/hpcarm/hpcarm: pxa2x0_hpc_machdep.c sa11x0_hpc_machdep.c
src/sys/arch/iyonix/conf: GENERIC
src/sys/arch/iyonix/iyonix: iyonix_machdep.c
src/sys/arch/netwinder/conf: GENERIC
src/sys/arch/netwinder/netwinder: netwinder_machdep.c
src/sys/arch/zaurus/zaurus: machdep.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/acorn32/acorn32/rpc_machdep.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/acorn32/conf/EB7500ATX
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/at91/at91bus.c
cvs rdiff -u -r1.178 -r1.179 src/sys/arch/cats/conf/GENERIC
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/evbarm/adi_brh/brh_machdep.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/armadillo/armadillo9_machdep.c
cvs rdiff -u -r1.152 -r1.153 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/conf/IYONIX
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/conf/MARVELL_NAS
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbarm/hdl_g/hdlg_machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbarm/imx31/imx31lk_machdep.c
cvs rdiff -u -r1.77 -r1.78 \
src/sys/arch/evbarm/integrator/integrator_machdep.c
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/evbarm/iq80310/iq80310_machdep.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/evbarm/iq80321/iq80321_machdep.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/evbarm/ixdp425/ixdp425_machdep.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/evbarm/ixm1200/ixm1200_machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/iyonix/iyonix_machdep.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/evbarm/lubbock/lubbock_machdep.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/mini2440/mini2440_machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/mmnet/mmnet_machdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/mpcsa/mpcsa_machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/nslu2/nslu2_machdep.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbarm/tsarm/tsarm_machdep.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/evbarm/viper/viper_machdep.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/iyonix/conf/GENERIC
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/iyonix/iyonix/iyonix_machdep.c
cvs rdiff -u -r1.137 -r1.138 src/sys/arch/netwinder/conf/GENERIC
cvs rdiff -u -r1.88 -r1.89 \
src/sys/arch/netwinder/netwinder/netwinder_machdep.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/zaurus/zaurus/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/acorn32/acorn32/rpc_machdep.c
diff -u src/sys/arch/acorn32/acorn32/rpc_machdep.c:1.96 src/sys/arch/acorn32/acorn32/rpc_machdep.c:1.97
--- src/sys/arch/acorn32/acorn32/rpc_machdep.c:1.96	Fri Oct  4 12:08:33 2019
+++ src/sys/arch/acorn32/acorn32/rpc_machdep.c	Sat Apr 18 10:55:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpc_machdep.c,v 1.96 2019/10/04 12:08:33 christos Exp $	*/
+/*	$NetBSD: rpc_machdep.c,v 1.97 

CVS commit: src/sys/arch

2020-04-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 18 10:55:47 UTC 2020

Modified Files:
src/sys/arch/acorn32/acorn32: rpc_machdep.c
src/sys/arch/acorn32/conf: EB7500ATX
src/sys/arch/acorn32/eb7500atx: eb7500atx_machdep.c
src/sys/arch/arm/at91: at91bus.c
src/sys/arch/cats/conf: GENERIC
src/sys/arch/evbarm/adi_brh: brh_machdep.c
src/sys/arch/evbarm/armadillo: armadillo9_machdep.c
src/sys/arch/evbarm/conf: GENERIC64 IYONIX MARVELL_NAS
src/sys/arch/evbarm/g42xxeb: g42xxeb_machdep.c
src/sys/arch/evbarm/hdl_g: hdlg_machdep.c
src/sys/arch/evbarm/imx31: imx31lk_machdep.c
src/sys/arch/evbarm/integrator: integrator_machdep.c
src/sys/arch/evbarm/iq80310: iq80310_machdep.c
src/sys/arch/evbarm/iq80321: iq80321_machdep.c
src/sys/arch/evbarm/ixdp425: ixdp425_machdep.c
src/sys/arch/evbarm/ixm1200: ixm1200_machdep.c
src/sys/arch/evbarm/iyonix: iyonix_machdep.c
src/sys/arch/evbarm/lubbock: lubbock_machdep.c
src/sys/arch/evbarm/mini2440: mini2440_machdep.c
src/sys/arch/evbarm/mmnet: mmnet_machdep.c
src/sys/arch/evbarm/mpcsa: mpcsa_machdep.c
src/sys/arch/evbarm/npwr_fc: npwr_fc_machdep.c
src/sys/arch/evbarm/nslu2: nslu2_machdep.c
src/sys/arch/evbarm/smdk2xx0: smdk2410_machdep.c smdk2800_machdep.c
src/sys/arch/evbarm/tsarm: tsarm_machdep.c
src/sys/arch/evbarm/viper: viper_machdep.c
src/sys/arch/hpcarm/hpcarm: pxa2x0_hpc_machdep.c sa11x0_hpc_machdep.c
src/sys/arch/iyonix/conf: GENERIC
src/sys/arch/iyonix/iyonix: iyonix_machdep.c
src/sys/arch/netwinder/conf: GENERIC
src/sys/arch/netwinder/netwinder: netwinder_machdep.c
src/sys/arch/zaurus/zaurus: machdep.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/acorn32/acorn32/rpc_machdep.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/acorn32/conf/EB7500ATX
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/at91/at91bus.c
cvs rdiff -u -r1.178 -r1.179 src/sys/arch/cats/conf/GENERIC
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/evbarm/adi_brh/brh_machdep.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/armadillo/armadillo9_machdep.c
cvs rdiff -u -r1.152 -r1.153 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/conf/IYONIX
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/conf/MARVELL_NAS
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/evbarm/hdl_g/hdlg_machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbarm/imx31/imx31lk_machdep.c
cvs rdiff -u -r1.77 -r1.78 \
src/sys/arch/evbarm/integrator/integrator_machdep.c
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/evbarm/iq80310/iq80310_machdep.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/evbarm/iq80321/iq80321_machdep.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/evbarm/ixdp425/ixdp425_machdep.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/evbarm/ixm1200/ixm1200_machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/iyonix/iyonix_machdep.c
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/evbarm/lubbock/lubbock_machdep.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/mini2440/mini2440_machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/mmnet/mmnet_machdep.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbarm/mpcsa/mpcsa_machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/nslu2/nslu2_machdep.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbarm/tsarm/tsarm_machdep.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/evbarm/viper/viper_machdep.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/hpcarm/hpcarm/pxa2x0_hpc_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hpcarm/hpcarm/sa11x0_hpc_machdep.c
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/iyonix/conf/GENERIC
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/iyonix/iyonix/iyonix_machdep.c
cvs rdiff -u -r1.137 -r1.138 src/sys/arch/netwinder/conf/GENERIC
cvs rdiff -u -r1.88 -r1.89 \
src/sys/arch/netwinder/netwinder/netwinder_machdep.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/zaurus/zaurus/machdep.c

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



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

2020-04-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 18 10:46:33 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Remove PMAP_DEBUG by converting to UVMHIST


To generate a diff of this commit:
cvs rdiff -u -r1.407 -r1.408 src/sys/arch/arm/arm32/pmap.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.407 src/sys/arch/arm/arm32/pmap.c:1.408
--- src/sys/arch/arm/arm32/pmap.c:1.407	Fri Apr 17 11:21:06 2020
+++ src/sys/arch/arm/arm32/pmap.c	Sat Apr 18 10:46:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.407 2020/04/17 11:21:06 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.408 2020/04/18 10:46:32 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -179,16 +179,10 @@
  *   in a significant slow-down if both processes are in tight loops.
  */
 
-/*
- * Special compilation symbols
- * PMAP_DEBUG		- Build in pmap_debug_level code
- */
-
 /* Include header files */
 
 #include "opt_arm_debug.h"
 #include "opt_cpuoptions.h"
-#include "opt_pmap_debug.h"
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
 #include "opt_multiprocessor.h"
@@ -198,7 +192,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.407 2020/04/17 11:21:06 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.408 2020/04/18 10:46:32 skrll Exp $");
 
 #include 
 #include 
@@ -224,46 +218,6 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.4
 #include 
 #endif
 
-//#define PMAP_DEBUG
-#ifdef PMAP_DEBUG
-
-/* XXX need to get rid of all refs to this */
-int pmap_debug_level = 0;
-
-/*
- * for switching to potentially finer grained debugging
- */
-#define	PDB_FOLLOW	0x0001
-#define	PDB_INIT	0x0002
-#define	PDB_ENTER	0x0004
-#define	PDB_REMOVE	0x0008
-#define	PDB_CREATE	0x0010
-#define	PDB_PTPAGE	0x0020
-#define	PDB_GROWKERN	0x0040
-#define	PDB_BITS	0x0080
-#define	PDB_COLLECT	0x0100
-#define	PDB_PROTECT	0x0200
-#define	PDB_MAP_L1	0x0400
-#define	PDB_BOOTSTRAP	0x1000
-#define	PDB_PARANOIA	0x2000
-#define	PDB_WIRING	0x4000
-#define	PDB_PVDUMP	0x8000
-#define	PDB_VAC		0x1
-#define	PDB_KENTER	0x2
-#define	PDB_KREMOVE	0x4
-#define	PDB_EXEC	0x8
-
-int debugmap = 1;
-int pmapdebug = 0;
-#define	NPDEBUG(_lev_,_stat_) \
-	if (pmapdebug & (_lev_)) \
-	((_stat_))
-
-#else	/* PMAP_DEBUG */
-#define NPDEBUG(_lev_,_stat_) /* Nothing */
-#endif	/* PMAP_DEBUG */
-
-
 #ifdef VERBOSE_INIT_ARM
 #define VPRINTF(...)	printf(__VA_ARGS__)
 #else
@@ -808,17 +762,6 @@ pv_addr_t kernelpages;
 pv_addr_t kernel_l1pt;
 pv_addr_t systempage;
 
-/* Function to set the debug level of the pmap code */
-
-#ifdef PMAP_DEBUG
-void
-pmap_debug(int level)
-{
-	pmap_debug_level = level;
-	printf("pmap_debug: level=%d\n", pmap_debug_level);
-}
-#endif	/* PMAP_DEBUG */
-
 #ifdef PMAP_CACHE_VIPT
 #define PMAP_VALIDATE_MD_PAGE(md)	\
 	KASSERTMSG(arm_cache_prefer_mask == 0 || (((md)->pvh_attrs & PVF_WRITE) == 0) == ((md)->urw_mappings + (md)->krw_mappings == 0), \
@@ -1018,10 +961,13 @@ static void
 pmap_enter_pv(struct vm_page_md *md, paddr_t pa, struct pv_entry *pv, pmap_t pm,
 vaddr_t va, u_int flags)
 {
-	struct pv_entry **pvp;
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLARGS(maphist, "md %#jx pa %#jx pm %#jx va %#jx",
+	(uintptr_t)md, (uintptr_t)pa, (uintptr_t)pm, va);
+	UVMHIST_LOG(maphist, "...pv %#jx flags %#jx",
+	(uintptr_t)pv, flags, 0, 0);
 
-	NPDEBUG(PDB_PVDUMP,
-	printf("pmap_enter_pv: pm %p, md %p, flags 0x%x\n", pm, md, flags));
+	struct pv_entry **pvp;
 
 	pv->pv_pmap = pm;
 	pv->pv_va = va;
@@ -1126,18 +1072,19 @@ pmap_find_pv(struct vm_page_md *md, pmap
 static struct pv_entry *
 pmap_remove_pv(struct vm_page_md *md, paddr_t pa, pmap_t pm, vaddr_t va)
 {
-	struct pv_entry *pv, **prevptr;
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLARGS(maphist, "md %#jx pa %#jx pm %#jx va %#jx",
+	(uintptr_t)md, (uintptr_t)pa, (uintptr_t)pm, va);
 
-	NPDEBUG(PDB_PVDUMP,
-	printf("pmap_remove_pv: pm %p, md %p, va 0x%08lx\n", pm, md, va));
+	struct pv_entry *pv, **prevptr;
 
 	prevptr = _FIRST(>pvh_list); /* prev pv_entry ptr */
 	pv = *prevptr;
 
 	while (pv) {
 		if (pv->pv_pmap == pm && pv->pv_va == va) {	/* match? */
-			NPDEBUG(PDB_PVDUMP, printf("pmap_remove_pv: pm %p, md "
-			"%p, flags 0x%x\n", pm, md, pv->pv_flags));
+			UVMHIST_LOG(maphist, "pm %#jx md %#jx flags %#jx",
+			(uintptr_t)pm, (uintptr_t)md, pv->pv_flags, 0);
 			if (pv->pv_flags & PVF_WIRED) {
 --pm->pm_stats.wired_count;
 			}
@@ -1222,15 +1169,18 @@ pmap_modify_pv(struct vm_page_md *md, pa
 {
 	struct pv_entry *npv;
 	u_int flags, oflags;
+	UVMHIST_FUNC(__func__);
+	UVMHIST_CALLARGS(maphist, "md %#jx pa %#jx pm %#jx va %#jx",
+	(uintptr_t)md, (uintptr_t)pa, (uintptr_t)pm, va);
+	UVMHIST_LOG(maphist, "... clr %#jx set %#jx", clr_mask, set_mask, 0, 0);
 
 	KASSERT(!PV_IS_KENTRY_P(clr_mask));
 	KASSERT(!PV_IS_KENTRY_P(set_mask));
 
-	if ((npv = 

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

2020-04-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Apr 18 10:46:33 UTC 2020

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Remove PMAP_DEBUG by converting to UVMHIST


To generate a diff of this commit:
cvs rdiff -u -r1.407 -r1.408 src/sys/arch/arm/arm32/pmap.c

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



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

2020-04-18 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Apr 18 10:37:37 UTC 2020

Modified Files:
src/sys/arch/powerpc/include: asm.h

Log Message:
It's __RCSID for an extra level of indirection on PPC


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/powerpc/include/asm.h

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



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

2020-04-18 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Apr 18 10:37:37 UTC 2020

Modified Files:
src/sys/arch/powerpc/include: asm.h

Log Message:
It's __RCSID for an extra level of indirection on PPC


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/powerpc/include/asm.h

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

Modified files:

Index: src/sys/arch/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.50 src/sys/arch/powerpc/include/asm.h:1.51
--- src/sys/arch/powerpc/include/asm.h:1.50	Fri Apr 17 14:19:44 2020
+++ src/sys/arch/powerpc/include/asm.h	Sat Apr 18 10:37:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.50 2020/04/17 14:19:44 joerg Exp $	*/
+/*	$NetBSD: asm.h,v 1.51 2020/04/18 10:37:37 joerg Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -156,7 +156,7 @@ y:	.quad	.##y,.TOC.@tocbase,0;	\
 
 #undef __RCSID
 #define RCSID(x)	__RCSID(x)
-#define RCSID(x)	.pushsection ".ident","MS",@progbits,1;		\
+#define __RCSID(x)	.pushsection ".ident","MS",@progbits,1;		\
 			.asciz x;	\
 			.popsection
 



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

2020-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Apr 18 10:30:49 UTC 2020

Modified Files:
src/sys/arch/alpha/include: asm.h

Log Message:
Fix copy & pasto in previous (to fix the build)


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/alpha/include/asm.h

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

Modified files:

Index: src/sys/arch/alpha/include/asm.h
diff -u src/sys/arch/alpha/include/asm.h:1.37 src/sys/arch/alpha/include/asm.h:1.38
--- src/sys/arch/alpha/include/asm.h:1.37	Fri Apr 17 14:19:43 2020
+++ src/sys/arch/alpha/include/asm.h	Sat Apr 18 10:30:49 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: asm.h,v 1.37 2020/04/17 14:19:43 joerg Exp $ */
+/* $NetBSD: asm.h,v 1.38 2020/04/18 10:30:49 martin Exp $ */
 
 /*
  * Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University
@@ -644,7 +644,7 @@ label:	ASCIZ msg;		\
  */
 #define	__SECTIONSTRING(_sec, _str)\
 	.pushsection _sec,"MS",@progbits,1;			\
-	.asciz x;		\
+	.asciz _str;		\
 	.popsection
 
 #ifdef _KERNEL



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

2020-04-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Apr 18 10:30:49 UTC 2020

Modified Files:
src/sys/arch/alpha/include: asm.h

Log Message:
Fix copy & pasto in previous (to fix the build)


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/alpha/include/asm.h

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



Re: CVS commit: src/sys

2020-04-18 Thread maya
On Fri, Apr 17, 2020 at 11:39:01PM +0700, Robert Elz wrote:
> Date:Fri, 17 Apr 2020 07:52:53 -0700
> From:Jason Thorpe 
> Message-ID:  <7e54033f-9f14-4db3-a11a-01d63cd92...@me.com>
> 
>   | The New Hotness (which isn't particularly new, at this point)
>   | is to create branches and merge what you want into that branch.
> 
> What I don't understand, is how this single commit-id works in practice
> (not how it is generated, I mean how it is used).   Say you've got some
> local changes you're testing, maybe some ARM device driver (or related
> stuff), and I have local changes as well (maybe some new sh code - I
> actually have a lot of that, though most of it is no longer "new" and
> quite possibly none of it will appear in public) - so we're both working
> from different states of the overall tree.   Hence different ID's right?
> 
> Now imagine that while testing, some schedueller bug causes a panic,
> or the ATF tests detect some (unrelated to both of us) failure that
> shouldn't be happening (perhaps rump was neglected in someone's
> changes from elsewhere, yet again).
> 
> If we both, along with someone running a pristine tree, all see this
> failure, perhaps manifesting in slightly different ways, how do we
> all determine that we're running the same versions of all of the
> relevant files, and hence are probably all seeing the same bug?
> 
> Currently, with each file having its own version identfifier, it
> is easy, but if everything is to share one single "it is this version"
> ID, how can we know that we are all actually running the same version
> of whatever code broke and is affecting all of us?
> 

I feel like it's difficult to decide which is objectively better.
CVS encourages you to keep your local changes uncommitted, so they do
not show up in a change to RCSID at all.

Once you do local commits, it is hard as an outsider to know how far you
are from a remote tree.

But as a person with access to the repository, you are in a better
position in this case, because the DVCS will make it easy to go back to
the state of the tree given a hash, even after you add changes later.

I imagine it isn't impossible to find 'closest parent which is also in
the remote' and embed it as well, mitigating the "outsider can't tell
how far you are" concern, if someone wants to pursue that.


CVS commit: src/usr.sbin/makefs

2020-04-18 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sat Apr 18 09:45:45 UTC 2020

Modified Files:
src/usr.sbin/makefs: udf.c

Log Message:
Believe the datablocks predictor when determining if data on a node gets
stored internal or not. Also make a note that the datablocks predictor takes
NO extended attributes stored in the node into account

In rare cases it could lead to confusion where the predictor would say it
wouldn't fit internally when it could just have fitted. This would trigger the
assertion. Now it will on rare accasions create a datablock even though it
might have fitted.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/makefs/udf.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/makefs/udf.c
diff -u src/usr.sbin/makefs/udf.c:1.19 src/usr.sbin/makefs/udf.c:1.20
--- src/usr.sbin/makefs/udf.c:1.19	Sun Feb  3 03:19:31 2019
+++ src/usr.sbin/makefs/udf.c	Sat Apr 18 09:45:45 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.c,v 1.19 2019/02/03 03:19:31 mrg Exp $ */
+/* $NetBSD: udf.c,v 1.20 2020/04/18 09:45:45 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: udf.c,v 1.19 2019/02/03 03:19:31 mrg Exp $");
+__RCSID("$NetBSD: udf.c,v 1.20 2020/04/18 09:45:45 reinoud Exp $");
 
 #include 
 #include 
@@ -514,6 +514,7 @@ static uint32_t
 udf_datablocks(off_t sz)
 {
 	/* predictor if it can be written inside the node */
+	/* XXX the predictor assumes NO extended attributes in the node */
 	if (sz < context.sector_size - UDF_EXTFENTRY_SIZE - 16)
 		return 0;
 
@@ -561,7 +562,7 @@ udf_file_inject_blob(union dscrptr *dscr
 	struct extfile_entry *efe;
 	uint64_t inf_len, obj_size;
 	uint32_t l_ea, l_ad;
-	uint32_t free_space, desc_size;
+	uint32_t desc_size;
 	uint16_t crclen;
 	uint8_t *data, *pos;
 
@@ -590,10 +591,9 @@ udf_file_inject_blob(union dscrptr *dscr
 	}
 	crclen = udf_rw16(dscr->tag.desc_crc_len);
 
-	/* calculate free space */
-	free_space = context.sector_size - (l_ea + l_ad) - desc_size;
+	/* check if it will fit internally */
 	if (udf_datablocks(size)) {
-		assert(free_space < size);
+		/* the predictor tells it won't fit internally */
 		return 1;
 	}
 
@@ -602,7 +602,6 @@ udf_file_inject_blob(union dscrptr *dscr
 	assert((udf_rw16(icb->flags) & UDF_ICB_TAG_FLAGS_ALLOC_MASK) ==
 			UDF_ICB_INTERN_ALLOC);
 
-	// assert(free_space >= size);
 	pos = data + l_ea + l_ad;
 	memcpy(pos, blob, size);
 	l_ad   += size;



CVS commit: src/usr.sbin/makefs

2020-04-18 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Sat Apr 18 09:45:45 UTC 2020

Modified Files:
src/usr.sbin/makefs: udf.c

Log Message:
Believe the datablocks predictor when determining if data on a node gets
stored internal or not. Also make a note that the datablocks predictor takes
NO extended attributes stored in the node into account

In rare cases it could lead to confusion where the predictor would say it
wouldn't fit internally when it could just have fitted. This would trigger the
assertion. Now it will on rare accasions create a datablock even though it
might have fitted.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/makefs/udf.c

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



CVS commit: src/sys/dev/pci

2020-04-18 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr 18 07:10:29 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1394 -r1.1395 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1393 -r1.1394 src/sys/dev/pci/pcidevs_data.h

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



CVS commit: src/sys/dev/pci

2020-04-18 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr 18 07:09:33 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add ATI Radeon R5/R6/R7 Graphics.


To generate a diff of this commit:
cvs rdiff -u -r1.1406 -r1.1407 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.1406 src/sys/dev/pci/pcidevs:1.1407
--- src/sys/dev/pci/pcidevs:1.1406	Thu Apr 16 18:20:46 2020
+++ src/sys/dev/pci/pcidevs	Sat Apr 18 07:09:33 2020
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1406 2020/04/16 18:20:46 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1407 2020/04/18 07:09:33 simonb Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1782,6 +1782,7 @@ product ATI RADEON_HD6320	0x9806	Radeon 
 product ATI RADEON_HD7340	0x9808	Radeon HD7340 Graphics
 product ATI RADEON_HDMI_DP_AUDIO	0x9840	HDMI/DP Audio
 product ATI RADEON_R2_R3_R3E_R4	0x9854	Radeon R2/R3/R4 Graphics
+product ATI RADEON_R5_R6_R7	0x9874	Radeon R5/R6/R7 Graphics
 product ATI RADEON_HD2900_HDA	0xaa00	Radeon HD 2900 HD Audio Controller
 product ATI RADEON_HD3650_HDA	0xaa01	Radeon HD 3650/3730/3750 HD Audio Controller
 product ATI RADEON_HD2600_HDA	0xaa08	Radeon HD 2600 HD Audio Controller



CVS commit: src/sys/dev/pci

2020-04-18 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Apr 18 07:09:33 UTC 2020

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add ATI Radeon R5/R6/R7 Graphics.


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

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