CVS commit: src/sys/dev/iscsi

2017-12-02 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec  3 07:24:47 UTC 2017

Modified Files:
src/sys/dev/iscsi: iscsi_main.c

Log Message:
unreference session only for responses to SCSI commands.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/iscsi/iscsi_main.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/iscsi/iscsi_main.c
diff -u src/sys/dev/iscsi/iscsi_main.c:1.25 src/sys/dev/iscsi/iscsi_main.c:1.26
--- src/sys/dev/iscsi/iscsi_main.c:1.25	Thu Nov 30 20:25:55 2017
+++ src/sys/dev/iscsi/iscsi_main.c	Sun Dec  3 07:24:47 2017
@@ -559,6 +559,7 @@ iscsi_done(ccb_t *ccb)
 	DEB(9, ("iscsi_done\n"));
 
 	if (xs != NULL) {
+		ccb->xs = NULL;
 		xs->resid = ccb->residual;
 
 		switch (ccb->status) {
@@ -596,14 +597,14 @@ iscsi_done(ccb_t *ccb)
 			break;
 		}
 
+		unref_session(ccb->session);
+
 		DEB(99, ("Calling scsipi_done (%p), err = %d\n", xs, xs->error));
 		scsipi_done(xs);
 		DEB(99, ("scsipi_done returned\n"));
 	} else {
 		DEBOUT(("ISCSI: iscsi_done CCB %p without XS\n", ccb));
 	}
-
-	unref_session(ccb->session);
 }
 
 SYSCTL_SETUP(sysctl_iscsi_setup, "ISCSI subtree setup")



CVS commit: src/sys/dev/iscsi

2017-12-02 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec  3 07:24:47 UTC 2017

Modified Files:
src/sys/dev/iscsi: iscsi_main.c

Log Message:
unreference session only for responses to SCSI commands.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/iscsi/iscsi_main.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/iscsi

2017-12-02 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec  3 07:23:45 UTC 2017

Modified Files:
src/sys/dev/iscsi: iscsi_ioctl.c

Log Message:
use same lock for ref/deref.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/iscsi/iscsi_ioctl.c

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

Modified files:

Index: src/sys/dev/iscsi/iscsi_ioctl.c
diff -u src/sys/dev/iscsi/iscsi_ioctl.c:1.26 src/sys/dev/iscsi/iscsi_ioctl.c:1.27
--- src/sys/dev/iscsi/iscsi_ioctl.c:1.26	Sat Jun 24 11:31:26 2017
+++ src/sys/dev/iscsi/iscsi_ioctl.c	Sun Dec  3 07:23:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi_ioctl.c,v 1.26 2017/06/24 11:31:26 mlelstv Exp $	*/
+/*	$NetBSD: iscsi_ioctl.c,v 1.27 2017/12/03 07:23:45 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -464,12 +464,12 @@ void
 unref_session(session_t *session)
 {
 
-	mutex_enter(>lock);
+	mutex_enter(_cleanup_mtx);
 	KASSERT(session != NULL);
 	KASSERT(session->refcount > 0);
 	if (--session->refcount == 0)
 		cv_broadcast(>sess_cv);
-	mutex_exit(>lock);
+	mutex_exit(_cleanup_mtx);
 }
 
 



CVS commit: src/sys/dev/iscsi

2017-12-02 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec  3 07:23:12 UTC 2017

Modified Files:
src/sys/dev/iscsi: iscsi_send.c

Log Message:
add debug messages


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/iscsi/iscsi_send.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/iscsi/iscsi_send.c
diff -u src/sys/dev/iscsi/iscsi_send.c:1.34 src/sys/dev/iscsi/iscsi_send.c:1.35
--- src/sys/dev/iscsi/iscsi_send.c:1.34	Sat Feb 25 12:03:57 2017
+++ src/sys/dev/iscsi/iscsi_send.c	Sun Dec  3 07:23:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi_send.c,v 1.34 2017/02/25 12:03:57 mlelstv Exp $	*/
+/*	$NetBSD: iscsi_send.c,v 1.35 2017/12/03 07:23:12 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -395,7 +395,7 @@ iscsi_send_thread(void *par)
 		/* notify event handlers of connection shutdown */
 		DEBC(conn, 1, ("%s\n", (conn->destroy) ? "TERMINATED" : "RECOVER"));
 		add_event((conn->destroy) ? ISCSI_CONNECTION_TERMINATED
-  : ISCSI_RECOVER_CONNECTION,
+	  : ISCSI_RECOVER_CONNECTION,
   sess->id, conn->id, conn->terminating);
 
 		DEBC(conn, 1, ("Waiting for conn_idle\n"));
@@ -1251,10 +1251,15 @@ send_task_management(connection_t *conn,
 
 	ccb = get_ccb(conn, xs == NULL);
 	/* can only happen if terminating... */
-	if (ccb == NULL)
+	if (ccb == NULL) {
+		DEBC(conn, 0, ("send_task_management, ref_ccb=%p, xs=%p, term=%d. No CCB\n",
+			ref_ccb, xs, conn->terminating));
 		return conn->terminating;
+	}
 	ppdu = get_pdu(conn, xs == NULL);
 	if (ppdu == NULL) {
+		DEBC(conn, 0, ("send_task_management, ref_ccb=%p, xs=%p, term=%d. No PDU\n",
+			ref_ccb, xs, conn->terminating));
 		free_ccb(ccb);
 		return conn->terminating;
 	}
@@ -1489,6 +1494,7 @@ send_run_xfer(session_t *session, struct
 
 	if (xs->xs_control & XS_CTL_RESET) {
 		if (send_task_management(conn, NULL, xs, TARGET_WARM_RESET)) {
+			DEBC(conn, 0, ("send_task_management TARGET_WARM_RESET failed\n"));
 			xs->error = XS_SELTIMEOUT;
 			scsipi_done(xs);
 			unref_session(session);



CVS commit: src/sys/dev/iscsi

2017-12-02 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec  3 07:23:12 UTC 2017

Modified Files:
src/sys/dev/iscsi: iscsi_send.c

Log Message:
add debug messages


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/iscsi/iscsi_send.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/iscsi

2017-12-02 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Dec  3 07:23:45 UTC 2017

Modified Files:
src/sys/dev/iscsi: iscsi_ioctl.c

Log Message:
use same lock for ref/deref.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/iscsi/iscsi_ioctl.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/arch

2017-12-02 Thread matthew green
> > You alone do not have sufficient authority to do this.
> 
> I maintain amd64.

this is 100% false.

dsl@ is the amd64 maintainer.  you're just the latest
person to work on it heavily.


.mrg.


Re: CVS commit: src

2017-12-02 Thread Valery Ushakov
On Sun, Dec 03, 2017 at 02:22:10 +, David Holland wrote:

> On Wed, Oct 04, 2017 at 07:54:33PM -0400, Christos Zoulas wrote:
>  > Log Message:
>  > Add NOBINARIES, useful to build tools are libraries which is what's needed
>  > for mknative.
> 
> Wouldn't it make more sense for this to be a build target than a
> setting (as in, say, "build.sh libs")?

That would be my stylistic preference too.

I used that to get a cross toolchain which I was using to compile j2me
for netbsd/arm http://www.stderr.spb.ru/~uwe/netbsd/cross.html

We might want to add in-tree x11 includes/libs into the mix.
E.g. when qt-embedded was still a separate project, the resulting
toolchain+destdir would be suitable for cross compiling it.

I think we should promote this and make it easy for people.  Someone
might want to make a package too :)

-uwe


Re: CVS commit: src

2017-12-02 Thread David Holland
On Wed, Oct 04, 2017 at 07:54:33PM -0400, Christos Zoulas wrote:
 > Log Message:
 > Add NOBINARIES, useful to build tools are libraries which is what's needed
 > for mknative.

Wouldn't it make more sense for this to be a build target than a
setting (as in, say, "build.sh libs")?

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/sys/arch

2017-12-02 Thread Christos Zoulas
In article ,
Kamil Rytarowski   wrote:
>
>For the record, we were fixing 0.9 compat in HEAD at least in May 2017,
>after the breakage from vm.user_va0_disable. (I recall commits fixing
>syscalls that were introduced later).
>
>http://gnats.netbsd.org/52246
>
>It used to work on a NetBSD-7.99.71/amd64 kernel with NetBSD-0.9/i386
>a.out executables.
>
>I still want to use this software as reference, but I will ask core@
>what to do.

And it still works in current after I undid the commits:

[8:48pm] 2507>./lisp
Franz Lisp, Opus 38.92
-> ^D 
Goodbye
[8:48pm] 2508>uname -a
NetBSD mb1.astron.com 8.99.8 NetBSD 8.99.8 (GENERIC) #154: Sat Dec  2 20:40:18 
EST 2017  chris...@mb1.astron.com:/usr/src/sys/arch/amd64/compile/GENERIC amd64
[8:48pm] 2509>
[8:48pm] 2509>file lisp
lisp: a.out little-endian 32-bit demand paged pure executable not stripped
[8:48pm] 2510>

I am inclined to put it back, but I will ask core@ first.

christos



CVS commit: src/external/gpl3

2017-12-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Dec  2 23:05:52 UTC 2017

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/i386: netbsd-elf.h
src/external/gpl3/gcc/dist/gcc/config/i386: netbsd-elf.h

Log Message:
Don't override X87_ENABLE_ARITH. Since we default to long double
rounding, the default value is correct for us.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/netbsd-elf.h
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h

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

Modified files:

Index: src/external/gpl3/gcc.old/dist/gcc/config/i386/netbsd-elf.h
diff -u src/external/gpl3/gcc.old/dist/gcc/config/i386/netbsd-elf.h:1.5 src/external/gpl3/gcc.old/dist/gcc/config/i386/netbsd-elf.h:1.6
--- src/external/gpl3/gcc.old/dist/gcc/config/i386/netbsd-elf.h:1.5	Sun Jul 23 01:11:06 2017
+++ src/external/gpl3/gcc.old/dist/gcc/config/i386/netbsd-elf.h	Sat Dec  2 23:05:52 2017
@@ -112,10 +112,6 @@ along with GCC; see the file COPYING3.  
 
 #define IX86_MAYBE_NO_LIBGCC_TFMODE
 
-#undef X87_ENABLE_ARITH
-#define X87_ENABLE_ARITH(MODE) \
-  (flag_excess_precision == EXCESS_PRECISION_FAST || (MODE) == DFmode)
-
 /* Preserve i386 psABI  */
 #undef PREFERRED_STACK_BOUNDARY_DEFAULT
 #define PREFERRED_STACK_BOUNDARY_DEFAULT MIN_STACK_BOUNDARY

Index: src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h
diff -u src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h:1.7 src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h:1.8
--- src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h:1.7	Fri Aug 19 05:11:09 2016
+++ src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h	Sat Dec  2 23:05:52 2017
@@ -112,10 +112,6 @@ along with GCC; see the file COPYING3.  
 
 #define IX86_MAYBE_NO_LIBGCC_TFMODE
 
-#undef X87_ENABLE_ARITH
-#define X87_ENABLE_ARITH(MODE) \
-  (flag_excess_precision == EXCESS_PRECISION_FAST || (MODE) == DFmode)
-
 /* Preserve i386 psABI  */
 #undef PREFERRED_STACK_BOUNDARY_DEFAULT
 #define PREFERRED_STACK_BOUNDARY_DEFAULT MIN_STACK_BOUNDARY



CVS commit: src/external/gpl3

2017-12-02 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Dec  2 23:05:52 UTC 2017

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/config/i386: netbsd-elf.h
src/external/gpl3/gcc/dist/gcc/config/i386: netbsd-elf.h

Log Message:
Don't override X87_ENABLE_ARITH. Since we default to long double
rounding, the default value is correct for us.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc.old/dist/gcc/config/i386/netbsd-elf.h
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h

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



CVS commit: src/sys/kern

2017-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  2 22:51:22 UTC 2017

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

Log Message:
Also wait interruptibly when exiting. Avoids deadlocked on exit processes
create by golang.


To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 src/sys/kern/kern_lwp.c

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



CVS commit: src/sys/kern

2017-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  2 22:51:22 UTC 2017

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

Log Message:
Also wait interruptibly when exiting. Avoids deadlocked on exit processes
create by golang.


To generate a diff of this commit:
cvs rdiff -u -r1.190 -r1.191 src/sys/kern/kern_lwp.c

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

Modified files:

Index: src/sys/kern/kern_lwp.c
diff -u src/sys/kern/kern_lwp.c:1.190 src/sys/kern/kern_lwp.c:1.191
--- src/sys/kern/kern_lwp.c:1.190	Thu Jun 22 05:05:09 2017
+++ src/sys/kern/kern_lwp.c	Sat Dec  2 17:51:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lwp.c,v 1.190 2017/06/22 09:05:09 skrll Exp $	*/
+/*	$NetBSD: kern_lwp.c,v 1.191 2017/12/02 22:51:22 christos Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -211,7 +211,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.190 2017/06/22 09:05:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lwp.c,v 1.191 2017/12/02 22:51:22 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_lockdebug.h"
@@ -645,8 +645,9 @@ lwp_wait(struct lwp *l, lwpid_t lid, lwp
 		 */
 		if (exiting) {
 			KASSERT(p->p_nlwps > 1);
-			cv_wait(>p_lwpcv, p->p_lock);
-			error = EAGAIN;
+			error = cv_wait_sig(>p_lwpcv, p->p_lock);
+			if (error == 0)
+error = EAGAIN;
 			break;
 		}
 



Re: CVS commit: src/sys/arch

2017-12-02 Thread Kamil Rytarowski
On 02.12.2017 22:23, David Holland wrote:
> On Sat, Dec 02, 2017 at 10:04:26PM +0100, Maxime Villard wrote:
>  > > Revert this. Compat on amd64 must be available all the way back to
>  > > 0.9, same as i386.
>  > > 
>  > > Also, please stop unilaterally breaking the world.
>  > 
>  > You are kidding, right? Everything below COMPAT_15 has *never* been
>  > enabled.  This change does not break anything, since nothing was
>  > enabled in the first.
> 
> No, I am not kidding. It is there in GENERIC so it can be enabled for
> people who want to run very old i386 binaries.
> 
>  > "Compat on amd64 must be available"
>  > 
>  > What authority do you have to say that? It has never been this way.
> 
> Providing compat has been policy for 25+ years.
> 
> Since you bring up the notion of authority... what authority do you
> think you have to make declarations about what will and won't be
> removed?
> 

For the record, we were fixing 0.9 compat in HEAD at least in May 2017,
after the breakage from vm.user_va0_disable. (I recall commits fixing
syscalls that were introduced later).

http://gnats.netbsd.org/52246

It used to work on a NetBSD-7.99.71/amd64 kernel with NetBSD-0.9/i386
a.out executables.

I still want to use this software as reference, but I will ask core@
what to do.



signature.asc
Description: OpenPGP digital signature


Re: CVS commit: src/sys/arch

2017-12-02 Thread David Holland
On Sat, Dec 02, 2017 at 10:04:26PM +0100, Maxime Villard wrote:
 > > Revert this. Compat on amd64 must be available all the way back to
 > > 0.9, same as i386.
 > > 
 > > Also, please stop unilaterally breaking the world.
 > 
 > You are kidding, right? Everything below COMPAT_15 has *never* been
 > enabled.  This change does not break anything, since nothing was
 > enabled in the first.

No, I am not kidding. It is there in GENERIC so it can be enabled for
people who want to run very old i386 binaries.

 > "Compat on amd64 must be available"
 > 
 > What authority do you have to say that? It has never been this way.

Providing compat has been policy for 25+ years.

Since you bring up the notion of authority... what authority do you
think you have to make declarations about what will and won't be
removed?

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/sys/arch

2017-12-02 Thread Maxime Villard

On Sat, Dec 02, 2017 at 01:03:15PM +, Maxime Villard wrote:
  > Modified Files:
  >  src/sys/arch/amd64/conf: GENERIC files.amd64
  >  src/sys/arch/xen/conf: files.xen
  > Removed Files:
  >  src/sys/arch/amd64/amd64: compat_13_machdep.c
  >
  > Log Message:
  > Drop COMPAT_13 on amd64, already not enabled. Reduces the number of
  > critical places.

Revert this. Compat on amd64 must be available all the way back to
0.9, same as i386.

Also, please stop unilaterally breaking the world.


You are kidding, right? Everything below COMPAT_15 has *never* been enabled.
This change does not break anything, since nothing was enabled in the first.

"Compat on amd64 must be available"

What authority do you have to say that? It has never been this way.

Maxime


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

2017-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  2 21:04:59 UTC 2017

Modified Files:
src/sys/arch/x86/include: cpu.h

Log Message:
Add padding to make the 32/64 bit structs the same.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/x86/include/cpu.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/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.82 src/sys/arch/x86/include/cpu.h:1.83
--- src/sys/arch/x86/include/cpu.h:1.82	Mon Nov 27 04:10:12 2017
+++ src/sys/arch/x86/include/cpu.h	Sat Dec  2 16:04:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.82 2017/11/27 09:10:12 maxv Exp $	*/
+/*	$NetBSD: cpu.h,v 1.83 2017/12/02 21:04:59 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -526,6 +526,7 @@ void x86_bus_space_mallocok(void);
 
 struct disklist {
 	int dl_nbiosdisks;			   /* number of bios disks */
+	int dl_unused;
 	struct biosdisk_info {
 		int bi_dev;			   /* BIOS device # (0x80 ..) */
 		int bi_cyl;			   /* cylinders on disk */
@@ -535,6 +536,7 @@ struct disklist {
 #define BIFLAG_INVALID		0x01
 #define BIFLAG_EXTINT13		0x02
 		int bi_flags;
+		int bi_unused;
 	} dl_biosdisks[MAX_BIOSDISKS];
 
 	int dl_nnativedisks;			   /* number of native disks */



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

2017-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  2 21:04:59 UTC 2017

Modified Files:
src/sys/arch/x86/include: cpu.h

Log Message:
Add padding to make the 32/64 bit structs the same.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/x86/include/cpu.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/arch

2017-12-02 Thread Maxime Villard

Le 02/12/2017 à 21:26, Jonathan A. Kollasch a écrit :

On Sat, Dec 02, 2017 at 05:45:08PM +0100, Maxime Villard wrote:

Le 02/12/2017 à 17:33, Kamil Rytarowski a écrit :

OK, I will prompt about it myself.


Just to clarify. The < compat_20 options *will* be dropped on amd64.


What authority do you have to decree this?

You alone do not have sufficient authority to do this.


I maintain amd64.


If you meant to drop everything below compat_20 in all our supported
architectures in general, then ask if you want.


No, he did not mean that. 


I'm not asking you what he meant, I'm asking *him* what he meant.

Please stop insinuating we meant things we obviously did not mean. 


We? I'm responding to him, not you.


This attitude and behavior is not acceptable.


Maxime


Re: CVS commit: src/sys/arch

2017-12-02 Thread David Holland
On Sat, Dec 02, 2017 at 01:03:15PM +, Maxime Villard wrote:
 > Modified Files:
 >  src/sys/arch/amd64/conf: GENERIC files.amd64
 >  src/sys/arch/xen/conf: files.xen
 > Removed Files:
 >  src/sys/arch/amd64/amd64: compat_13_machdep.c
 > 
 > Log Message:
 > Drop COMPAT_13 on amd64, already not enabled. Reduces the number of
 > critical places.

Revert this. Compat on amd64 must be available all the way back to
0.9, same as i386.

Also, please stop unilaterally breaking the world. This is getting to
be a regular occurrence and that is not the way things are supposed to
be done in this project.

-- 
David A. Holland
dholl...@netbsd.org


Re: CVS commit: src/sys/arch

2017-12-02 Thread Jonathan A. Kollasch
On Sat, Dec 02, 2017 at 05:45:08PM +0100, Maxime Villard wrote:
> Le 02/12/2017 à 17:33, Kamil Rytarowski a écrit :
> >OK, I will prompt about it myself.
> 
> Just to clarify. The < compat_20 options *will* be dropped on amd64.

What authority do you have to decree this?

You alone do not have sufficient authority to do this.

> If you
> meant to drop everything below compat_20 in all our supported architectures in
> general, then ask if you want.

No, he did not mean that.  Please stop insinuating we meant things we
obviously did not mean.  This attitude and behavior is not acceptable.

Jonathan Kollasch


Re: CVS commit: src/sys/arch

2017-12-02 Thread Maxime Villard

Le 02/12/2017 à 17:33, Kamil Rytarowski a écrit :

OK, I will prompt about it myself.


Just to clarify. The < compat_20 options *will* be dropped on amd64. If you
meant to drop everything below compat_20 in all our supported architectures in
general, then ask if you want.


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

2017-12-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Dec  2 18:56:18 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sunxi_twi.c

Log Message:
Support nodes w/o a defined clock.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sunxi/sunxi_twi.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/sunxi

2017-12-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Dec  2 18:56:18 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sunxi_twi.c

Log Message:
Support nodes w/o a defined clock.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sunxi/sunxi_twi.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/sunxi/sunxi_twi.c
diff -u src/sys/arch/arm/sunxi/sunxi_twi.c:1.7 src/sys/arch/arm/sunxi/sunxi_twi.c:1.8
--- src/sys/arch/arm/sunxi/sunxi_twi.c:1.7	Thu Nov 30 20:41:21 2017
+++ src/sys/arch/arm/sunxi/sunxi_twi.c	Sat Dec  2 18:56:18 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_twi.c,v 1.7 2017/11/30 20:41:21 jmcneill Exp $ */
+/* $NetBSD: sunxi_twi.c,v 1.8 2017/12/02 18:56:18 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -33,7 +33,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_twi.c,v 1.7 2017/11/30 20:41:21 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_twi.c,v 1.8 2017/12/02 18:56:18 jmcneill Exp $");
 
 #include 
 #include 
@@ -189,11 +189,11 @@ sunxi_twi_attach(device_t parent, device
 		return;
 	}
 
-	clk = fdtbus_clock_get_index(phandle, 0);
-	if (clk == NULL || clk_enable(clk) != 0) {
-		aprint_error(": couldn't enable clock\n");
-		return;
-	}
+	if ((clk = fdtbus_clock_get_index(phandle, 0)) != NULL)
+		if (clk_enable(clk) != 0) {
+			aprint_error(": couldn't enable clock\n");
+			return;
+		}
 	if ((rst = fdtbus_reset_get_index(phandle, 0)) != NULL)
 		if (fdtbus_reset_deassert(rst) != 0) {
 			aprint_error(": couldn't de-assert reset\n");
@@ -212,7 +212,8 @@ sunxi_twi_attach(device_t parent, device
 	/*
 	 * Set clock rate to 100kHz.
 	 */
-	sunxi_twi_set_clock(sc, clk_get_rate(clk), 10);
+	if (clk != NULL)
+		sunxi_twi_set_clock(sc, clk_get_rate(clk), 10);
 
 	ih = fdtbus_intr_establish(phandle, 0, IPL_VM, 0, gttwsi_intr, sc);
 	if (ih == NULL) {



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  2 18:39:52 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: mips-nbsd-nat.c

Log Message:
include nbsd-nat.h


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c

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

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c:1.4 src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c:1.5
--- src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c:1.4	Thu Nov 30 10:26:54 2017
+++ src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c	Sat Dec  2 13:39:52 2017
@@ -39,6 +39,7 @@ typedef struct fpreg fpregset_t;
 #include "gregset.h"
 
 #include "mips-tdep.h"
+#include "nbsd-nat.h"
 #include "mips-nbsd-tdep.h"
 #include "inf-ptrace.h"
 #include "bsd-kvm.h"



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  2 18:39:52 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: mips-nbsd-nat.c

Log Message:
include nbsd-nat.h


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/gdb/dist/gdb/mips-nbsd-nat.c

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



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

2017-12-02 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Dec  2 18:07:34 UTC 2017

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

Log Message:
Mention the Sand Creek massacre.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/calendar/calendars/calendar.history

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

Modified files:

Index: src/usr.bin/calendar/calendars/calendar.history
diff -u src/usr.bin/calendar/calendars/calendar.history:1.34 src/usr.bin/calendar/calendars/calendar.history:1.35
--- src/usr.bin/calendar/calendars/calendar.history:1.34	Mon Feb 15 20:58:02 2016
+++ src/usr.bin/calendar/calendars/calendar.history	Sat Dec  2 18:07:34 2017
@@ -492,6 +492,7 @@
 11/27	Alfred Nobel establishes Nobel Prize, 1895
 11/27	Friction match invented, England, 1826
 11/27	Hoosac Railroad Tunnel completed, 1873, in NW Massachusetts
+11/29	Sand Creek massacre, Colorado, USA, 1864
 11/29	King Tut's tomb opened, 1922
 
 12/01	Martin Luther King Jr., leads black boycott of Montgomery buses, 1955



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

2017-12-02 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Dec  2 18:07:34 UTC 2017

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

Log Message:
Mention the Sand Creek massacre.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/calendar/calendars/calendar.history

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



Re: CVS commit: src/sys/arch

2017-12-02 Thread Maxime Villard

Le 02/12/2017 à 14:22, Kamil Rytarowski a écrit :

There are still users of NetBSD/i386 0.9 executables (like myself - of
Franz Lisp).


And? compat_09 is available on i386.


It's reasonable to drop compat for pre-ELF (approximately < 2.0) ...


Yes, amd64 needs to start from compat_20. But compat_20 does not compile: if
you include compat_netbsd20.config in GENERIC, you get "multiple definition
of _KERNEL_OPT_COMPAT_15 _KERNEL_OPT_COMPAT_16 etc".

However, the current compat_netbsd15.config inclusion works, even though
compat_15 enables compat_20.

So it looks like there is something going wrong in the dependencies. It
wouldn't be a big surprise, since no one has ever tested that.


... but it should be discussed and decided by core.


No. I am not going to discuss basic changes like this one all the time. (And
I am not mentioning here that in each of the two times I asked core@ to
decide on what to do, they were unable to formulate a single answer after
months, not recognizing the rules they had themselves stated when these were
to be enforced. Fool me again.)

Maxime


CVS commit: src/sys/kern

2017-12-02 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Dec  2 17:29:55 UTC 2017

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

Log Message:
according to benchmark extracting pkgsrc.tar, using FUA and hence waiting
for each transfer to write through to the medium is way slower than just
letting the drive use a cached write and doing DIOCCACHESYNC on the end

Results were (fs block 32KB / frag 4KB, partition aligned on 32KB boundary):
HDD at siisata(4):  no-FUA: 108 sec w/FUA: 294 sec
SSD at ahcisata(4): no-FUA:  73 sec w/FUA: 502 sec

change the flag so that FUA is only used for the commit block write;
for journal data write, only pass DPO, rely on the cache flush to get them
to media


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/kern/vfs_wapbl.c

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

Modified files:

Index: src/sys/kern/vfs_wapbl.c
diff -u src/sys/kern/vfs_wapbl.c:1.100 src/sys/kern/vfs_wapbl.c:1.101
--- src/sys/kern/vfs_wapbl.c:1.100	Fri Oct 27 12:25:15 2017
+++ src/sys/kern/vfs_wapbl.c	Sat Dec  2 17:29:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_wapbl.c,v 1.100 2017/10/27 12:25:15 joerg Exp $	*/
+/*	$NetBSD: vfs_wapbl.c,v 1.101 2017/12/02 17:29:55 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define WAPBL_INTERNAL
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.100 2017/10/27 12:25:15 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.101 2017/12/02 17:29:55 jdolecek Exp $");
 
 #include 
 #include 
@@ -239,10 +239,9 @@ struct wapbl {
 		(wapbl_allow_dpofua && ISSET((wl)->wl_dkcache, DKCACHE_FUA))
 #define WAPBL_JFLAGS(wl)	\
 		(WAPBL_USE_FUA(wl) ? (wl)->wl_jwrite_flags : 0)
-#define WAPBL_MFLAGS(wl)	\
-		(WAPBL_USE_FUA(wl) ? (wl)->wl_mwrite_flags : 0)
+#define WAPBL_JDATA_FLAGS(wl)	\
+		(WAPBL_JFLAGS(wl) & B_MEDIA_DPO)	/* only DPO */
 	int wl_jwrite_flags;	/* r: 	journal write flags */
-	int wl_mwrite_flags;	/* r:	metadata write flags */
 };
 
 #ifdef WAPBL_DEBUG_PRINT
@@ -444,10 +443,8 @@ wapbl_dkcache_init(struct wapbl *wl)
 	}
 
 	/* Use FUA instead of cache flush if available */
-	if (ISSET(wl->wl_dkcache, DKCACHE_FUA)) {
+	if (ISSET(wl->wl_dkcache, DKCACHE_FUA))
 		wl->wl_jwrite_flags |= B_MEDIA_FUA;
-		wl->wl_mwrite_flags |= B_MEDIA_FUA;
-	}
 
 	/* Use DPO for journal writes if available */
 	if (ISSET(wl->wl_dkcache, DKCACHE_DPO))
@@ -998,7 +995,7 @@ wapbl_buffered_write_async(struct wapbl 
 	KASSERT(TAILQ_FIRST(>wl_iobufs) == bp);
 	TAILQ_REMOVE(>wl_iobufs, bp, b_wapbllist);
 
-	bp->b_flags = B_WRITE | WAPBL_JFLAGS(wl);
+	bp->b_flags |= B_WRITE;
 	bp->b_cflags = BC_BUSY;	/* mandatory, asserted by biowait() */
 	bp->b_oflags = 0;
 	bp->b_bcount = bp->b_resid;
@@ -1043,7 +1040,7 @@ again:
 		error = biowait(bp);
 
 		/* reset for reuse */
-		bp->b_blkno = bp->b_resid = 0;
+		bp->b_blkno = bp->b_resid = bp->b_flags = 0;
 		TAILQ_INSERT_TAIL(>wl_iobufs, bp, b_wapbllist);
 		found = true;
 
@@ -1067,7 +1064,8 @@ again:
  *	wapbl_buffered_flush.
  */
 static int
-wapbl_buffered_write(void *data, size_t len, struct wapbl *wl, daddr_t pbn)
+wapbl_buffered_write(void *data, size_t len, struct wapbl *wl, daddr_t pbn,
+int bflags)
 {
 	size_t resid;
 	struct buf *bp;
@@ -1096,8 +1094,10 @@ again:
 	 * If this write goes to an empty buffer we have to
 	 * save the disk block address first.
 	 */
-	if (bp->b_blkno == 0)
+	if (bp->b_blkno == 0) {
 		bp->b_blkno = pbn;
+		bp->b_flags |= bflags;
+	}
 
 	/*
 	 * Remaining space so this buffer ends on a buffer size boundary.
@@ -1164,7 +1164,8 @@ wapbl_circ_write(struct wapbl *wl, void 
 #ifdef _KERNEL
 		pbn = btodb(pbn << wl->wl_log_dev_bshift);
 #endif
-		error = wapbl_buffered_write(data, slen, wl, pbn);
+		error = wapbl_buffered_write(data, slen, wl, pbn,
+		WAPBL_JDATA_FLAGS(wl));
 		if (error)
 			return error;
 		data = (uint8_t *)data + slen;
@@ -1175,7 +1176,8 @@ wapbl_circ_write(struct wapbl *wl, void 
 #ifdef _KERNEL
 	pbn = btodb(pbn << wl->wl_log_dev_bshift);
 #endif
-	error = wapbl_buffered_write(data, len, wl, pbn);
+	error = wapbl_buffered_write(data, len, wl, pbn,
+	WAPBL_JDATA_FLAGS(wl));
 	if (error)
 		return error;
 	off += len;
@@ -1925,9 +1927,6 @@ wapbl_flush(struct wapbl *wl, int waitfo
 		bp->b_iodone = wapbl_biodone;
 		bp->b_private = we;
 
-		/* make sure the block is saved sync when FUA in use */
-		bp->b_flags |= WAPBL_MFLAGS(wl);
-
 		bremfree(bp);
 		wapbl_remove_buf_locked(wl, bp);
 		mutex_exit(>wl_mtx);
@@ -2399,8 +2398,8 @@ wapbl_cache_sync(struct wapbl *wl, const
 	int force = 1;
 	int error;
 
-	/* Skip full cache sync if disabled, or when using FUA */
-	if (!wapbl_flush_disk_cache || WAPBL_USE_FUA(wl)) {
+	/* Skip full cache sync if disabled */
+	if (!wapbl_flush_disk_cache) {
 		return 0;
 	}
 	if (verbose) {
@@ -2459,8 +2458,10 @@ wapbl_write_commit(struct wapbl *wl, off
 	if (error)
 		return error;
 	/*
-	 * flush 

CVS commit: src/sys/kern

2017-12-02 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Dec  2 17:29:55 UTC 2017

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

Log Message:
according to benchmark extracting pkgsrc.tar, using FUA and hence waiting
for each transfer to write through to the medium is way slower than just
letting the drive use a cached write and doing DIOCCACHESYNC on the end

Results were (fs block 32KB / frag 4KB, partition aligned on 32KB boundary):
HDD at siisata(4):  no-FUA: 108 sec w/FUA: 294 sec
SSD at ahcisata(4): no-FUA:  73 sec w/FUA: 502 sec

change the flag so that FUA is only used for the commit block write;
for journal data write, only pass DPO, rely on the cache flush to get them
to media


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/kern/vfs_wapbl.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/arch

2017-12-02 Thread Kamil Rytarowski
On 02.12.2017 16:55, Maxime Villard wrote:
> Le 02/12/2017 à 14:22, Kamil Rytarowski a écrit :
>> There are still users of NetBSD/i386 0.9 executables (like myself - of
>> Franz Lisp).
> 
> And? compat_09 is available on i386.
> 

It used to work on the NetBSD/amd64 kernel.

>> It's reasonable to drop compat for pre-ELF (approximately < 2.0) ...
> 
> Yes, amd64 needs to start from compat_20. But compat_20 does not
> compile: if
> you include compat_netbsd20.config in GENERIC, you get "multiple definition
> of _KERNEL_OPT_COMPAT_15 _KERNEL_OPT_COMPAT_16 etc".
> 
> However, the current compat_netbsd15.config inclusion works, even though
> compat_15 enables compat_20.
> 
> So it looks like there is something going wrong in the dependencies. It
> wouldn't be a big surprise, since no one has ever tested that.
> 

< 2.0 compat is rotten on all levels.

>> ... but it should be discussed and decided by core.
> 
> No. I am not going to discuss basic changes like this one all the time.
> (And
> I am not mentioning here that in each of the two times I asked core@ to
> decide on what to do, they were unable to formulate a single answer after
> months, not recognizing the rules they had themselves stated when these
> were
> to be enforced. Fool me again.)
> 
> Maxime

OK, I will prompt about it myself.



signature.asc
Description: OpenPGP digital signature


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

2017-12-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Dec  2 15:36:24 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: netbsd32_machdep.c

Log Message:
Remove a piece of COMPAT_13, that I mistakenly didn't commit three
hours ago (in my change to drop COMPAT_13 on amd64).


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/amd64/amd64/netbsd32_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/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.112 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.113
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.112	Thu Oct 19 10:01:09 2017
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Sat Dec  2 15:36:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.112 2017/10/19 10:01:09 maxv Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.113 2017/12/02 15:36:24 maxv Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.112 2017/10/19 10:01:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.113 2017/12/02 15:36:24 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1133,67 +1133,3 @@ netbsd32_vm_default_addr(struct proc *p,
 	else
 		return VM_DEFAULT_ADDRESS32_BOTTOMUP(base, sz);
 }
-
-#ifdef COMPAT_13
-int
-compat_13_netbsd32_sigreturn(struct lwp *l, const struct compat_13_netbsd32_sigreturn_args *uap, register_t *retval)
-{
-	/* {
-		syscallarg(struct netbsd32_sigcontext13 *) sigcntxp;
-	} */
-	struct proc *p = l->l_proc;
-	struct netbsd32_sigcontext13 *scp, context;
-	struct trapframe *tf;
-	sigset_t mask;
-	int error;
-
-	/*
-	 * The trampoline code hands us the context.
-	 * It is unsafe to keep track of it ourselves, in the event that a
-	 * program jumps out of a signal handler.
-	 */
-	scp = (struct netbsd32_sigcontext13 *)NETBSD32PTR64(SCARG(uap, sigcntxp));
-	if (copyin((void *)scp, , sizeof(*scp)) != 0)
-		return (EFAULT);
-
-	/* Restore register context. */
-	tf = l->l_md.md_regs;
-
-	/*
-	 * Check for security violations.
-	 */
-	error = check_sigcontext32(l, (const struct netbsd32_sigcontext *));
-	if (error != 0)
-		return error;
-
-	tf->tf_gs = context.sc_gs & 0x;
-	tf->tf_fs = context.sc_fs & 0x;		
-	tf->tf_es = context.sc_es & 0x;
-	tf->tf_ds = context.sc_ds & 0x;
-	tf->tf_rflags = context.sc_eflags;
-	tf->tf_rdi = context.sc_edi;
-	tf->tf_rsi = context.sc_esi;
-	tf->tf_rbp = context.sc_ebp;
-	tf->tf_rbx = context.sc_ebx;
-	tf->tf_rdx = context.sc_edx;
-	tf->tf_rcx = context.sc_ecx;
-	tf->tf_rax = context.sc_eax;
-	tf->tf_rip = context.sc_eip;
-	tf->tf_cs = context.sc_cs & 0x;
-	tf->tf_rsp = context.sc_esp;
-	tf->tf_ss = context.sc_ss & 0x;
-
-	mutex_enter(p->p_lock);
-	/* Restore signal stack. */
-	if (context.sc_onstack & SS_ONSTACK)
-		l->l_sigstk.ss_flags |= SS_ONSTACK;
-	else
-		l->l_sigstk.ss_flags &= ~SS_ONSTACK;
-	/* Restore signal mask. */
-	native_sigset13_to_sigset((sigset13_t *)_mask, );
-	(void) sigprocmask1(l, SIG_SETMASK, , 0);
-	mutex_exit(p->p_lock);
-
-	return (EJUSTRETURN);
-}
-#endif



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

2017-12-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Dec  2 15:36:24 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: netbsd32_machdep.c

Log Message:
Remove a piece of COMPAT_13, that I mistakenly didn't commit three
hours ago (in my change to drop COMPAT_13 on amd64).


To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/amd64/amd64/netbsd32_machdep.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/compat

2017-12-02 Thread Christos Zoulas
In article <19b5c128-7725-0638-67f8-749532353...@m00nbsd.net>,
Maxime Villard   wrote:
>
>So is making the system vulnerable by default with marginal features. The
>system is broken now. All you had to do is one sysctl; but that takes too much
>time, and you're probably too busy handling serious business like debating
>about your favorite hitler quotes.

The problem is that nothing is black and white:
1. You probably don't use the feature most of the time, others might.
   [this determines how marginal the feature is]
2. How critical are the bugs, how easy it is to find them all? For
   example, are there similar bugs in other places in the system;
   do we disable those parts? [security vs usability]

Here you unilateraly made a decision to disable a feature that was
previously enabled. Regardless if the decision was correct or
incorrect, you made a determination based on your assessment and
affected not only yourself, but everyone else using the system.
Such decisions should be made by consensus not by force. It is a
different story if there was a critical bug that could not be fixed,
so the feature had to be disabled for safety. Here we are talking
about a feature that was enabled for a long time, and was disabled
without enough prior discussion.

I understand we perhaps are not moving fast enough or making
decisions fast enough, but process needs to be followed otherwise
everyone is unhappy with the results.

christos



Re: CVS commit: src/sys/arch

2017-12-02 Thread Kamil Rytarowski
On 02.12.2017 14:03, Maxime Villard wrote:
> Module Name:  src
> Committed By: maxv
> Date: Sat Dec  2 13:03:15 UTC 2017
> 
> Modified Files:
>   src/sys/arch/amd64/conf: GENERIC files.amd64
>   src/sys/arch/xen/conf: files.xen
> Removed Files:
>   src/sys/arch/amd64/amd64: compat_13_machdep.c
> 
> Log Message:
> Drop COMPAT_13 on amd64, already not enabled. Reduces the number of
> critical places.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.1 -r0 src/sys/arch/amd64/amd64/compat_13_machdep.c
> cvs rdiff -u -r1.470 -r1.471 src/sys/arch/amd64/conf/GENERIC
> cvs rdiff -u -r1.94 -r1.95 src/sys/arch/amd64/conf/files.amd64
> cvs rdiff -u -r1.163 -r1.164 src/sys/arch/xen/conf/files.xen
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 
> 
> 
> Modified files:
> 
> Index: src/sys/arch/amd64/conf/GENERIC
> diff -u src/sys/arch/amd64/conf/GENERIC:1.470 
> src/sys/arch/amd64/conf/GENERIC:1.471
> --- src/sys/arch/amd64/conf/GENERIC:1.470 Sat Dec  2 12:40:03 2017
> +++ src/sys/arch/amd64/conf/GENERIC   Sat Dec  2 13:03:15 2017
> @@ -1,4 +1,4 @@
> -# $NetBSD: GENERIC,v 1.470 2017/12/02 12:40:03 maxv Exp $
> +# $NetBSD: GENERIC,v 1.471 2017/12/02 13:03:15 maxv Exp $
>  #
>  # GENERIC machine description file
>  #
> @@ -22,7 +22,7 @@ include "arch/amd64/conf/std.amd64"
>  
>  options  INCLUDE_CONFIG_FILE # embed config file in kernel binary
>  
> -#ident   "GENERIC-$Revision: 1.470 $"
> +#ident   "GENERIC-$Revision: 1.471 $"
>  
>  maxusers 64  # estimated number of users
>  
> @@ -117,7 +117,7 @@ options   KDTRACE_HOOKS   # kernel DTrace h
>  # Compatibility options
>  #options EXEC_AOUT   # required by binaries from before 1.5
>  
> -# NetBSD backward compatibility. Support goes from COMPAT_11 up until
> +# NetBSD backward compatibility. Support goes from COMPAT_15 up until
>  # the latest release. Note that really old compat (< COMPAT_16) is only
>  # useful for 32-bit binaries.
>  include  "conf/compat_netbsd15.config"
> 
> Index: src/sys/arch/amd64/conf/files.amd64
> diff -u src/sys/arch/amd64/conf/files.amd64:1.94 
> src/sys/arch/amd64/conf/files.amd64:1.95
> --- src/sys/arch/amd64/conf/files.amd64:1.94  Sun Oct  8 09:06:50 2017
> +++ src/sys/arch/amd64/conf/files.amd64   Sat Dec  2 13:03:15 2017
> @@ -1,4 +1,4 @@
> -#$NetBSD: files.amd64,v 1.94 2017/10/08 09:06:50 maxv Exp $
> +#$NetBSD: files.amd64,v 1.95 2017/12/02 13:03:15 maxv Exp $
>  #
>  # new style config file for amd64 architecture
>  #
> @@ -136,7 +136,6 @@ attachfd at fdc
>  # Compatibility modules
>  #
>  # Binary compatibility with previous NetBSD releases (COMPAT_XX)
> -file arch/amd64/amd64/compat_13_machdep.ccompat_13
>  file arch/amd64/amd64/compat_16_machdep.ccompat_16
>  
>  # NetBSD/i386 32-bit binary compatibility (COMPAT_NETBSD32)
> 
> Index: src/sys/arch/xen/conf/files.xen
> diff -u src/sys/arch/xen/conf/files.xen:1.163 
> src/sys/arch/xen/conf/files.xen:1.164
> --- src/sys/arch/xen/conf/files.xen:1.163 Mon Nov  6 15:21:23 2017
> +++ src/sys/arch/xen/conf/files.xen   Sat Dec  2 13:03:15 2017
> @@ -1,4 +1,4 @@
> -#$NetBSD: files.xen,v 1.163 2017/11/06 15:21:23 cherry Exp $
> +#$NetBSD: files.xen,v 1.164 2017/12/02 13:03:15 maxv Exp $
>  #NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
>  #NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
>  
> @@ -330,7 +330,6 @@ include   "compat/freebsd/files.freebsd"
>  elifdef amd64
>  
>  # Binary compatibility with previous NetBSD releases (COMPAT_XX)
> -file arch/amd64/amd64/compat_13_machdep.ccompat_13
>  file arch/amd64/amd64/compat_16_machdep.ccompat_16
>  
>  # NetBSD/i386 32-bit binary compatibility (COMPAT_NETBSD32)
> 

There are still users of NetBSD/i386 0.9 executables (like myself - of
Franz Lisp).

It's reasonable to drop compat for pre-ELF (approximately < 2.0) as we
can use emulators, but it should be discussed and decided by core.

pkgsrc for early compat distributions (emulators/compat12, 13, 14) never
worked well for me and I had to build them manually.



signature.asc
Description: OpenPGP digital signature


CVS commit: src/sys/arch

2017-12-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Dec  2 13:03:15 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: GENERIC files.amd64
src/sys/arch/xen/conf: files.xen
Removed Files:
src/sys/arch/amd64/amd64: compat_13_machdep.c

Log Message:
Drop COMPAT_13 on amd64, already not enabled. Reduces the number of
critical places.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/sys/arch/amd64/amd64/compat_13_machdep.c
cvs rdiff -u -r1.470 -r1.471 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.163 -r1.164 src/sys/arch/xen/conf/files.xen

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

Modified files:

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.470 src/sys/arch/amd64/conf/GENERIC:1.471
--- src/sys/arch/amd64/conf/GENERIC:1.470	Sat Dec  2 12:40:03 2017
+++ src/sys/arch/amd64/conf/GENERIC	Sat Dec  2 13:03:15 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.470 2017/12/02 12:40:03 maxv Exp $
+# $NetBSD: GENERIC,v 1.471 2017/12/02 13:03:15 maxv Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.470 $"
+#ident		"GENERIC-$Revision: 1.471 $"
 
 maxusers	64		# estimated number of users
 
@@ -117,7 +117,7 @@ options 	KDTRACE_HOOKS	# kernel DTrace h
 # Compatibility options
 #options 	EXEC_AOUT	# required by binaries from before 1.5
 
-# NetBSD backward compatibility. Support goes from COMPAT_11 up until
+# NetBSD backward compatibility. Support goes from COMPAT_15 up until
 # the latest release. Note that really old compat (< COMPAT_16) is only
 # useful for 32-bit binaries.
 include 	"conf/compat_netbsd15.config"

Index: src/sys/arch/amd64/conf/files.amd64
diff -u src/sys/arch/amd64/conf/files.amd64:1.94 src/sys/arch/amd64/conf/files.amd64:1.95
--- src/sys/arch/amd64/conf/files.amd64:1.94	Sun Oct  8 09:06:50 2017
+++ src/sys/arch/amd64/conf/files.amd64	Sat Dec  2 13:03:15 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amd64,v 1.94 2017/10/08 09:06:50 maxv Exp $
+#	$NetBSD: files.amd64,v 1.95 2017/12/02 13:03:15 maxv Exp $
 #
 # new style config file for amd64 architecture
 #
@@ -136,7 +136,6 @@ attach	fd at fdc
 # Compatibility modules
 #
 # Binary compatibility with previous NetBSD releases (COMPAT_XX)
-file	arch/amd64/amd64/compat_13_machdep.c	compat_13
 file	arch/amd64/amd64/compat_16_machdep.c	compat_16
 
 # NetBSD/i386 32-bit binary compatibility (COMPAT_NETBSD32)

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.163 src/sys/arch/xen/conf/files.xen:1.164
--- src/sys/arch/xen/conf/files.xen:1.163	Mon Nov  6 15:21:23 2017
+++ src/sys/arch/xen/conf/files.xen	Sat Dec  2 13:03:15 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.163 2017/11/06 15:21:23 cherry Exp $
+#	$NetBSD: files.xen,v 1.164 2017/12/02 13:03:15 maxv Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -330,7 +330,6 @@ include	"compat/freebsd/files.freebsd"
 elifdef amd64
 
 # Binary compatibility with previous NetBSD releases (COMPAT_XX)
-file	arch/amd64/amd64/compat_13_machdep.c	compat_13
 file	arch/amd64/amd64/compat_16_machdep.c	compat_16
 
 # NetBSD/i386 32-bit binary compatibility (COMPAT_NETBSD32)



CVS commit: src/sys/arch

2017-12-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Dec  2 13:03:15 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: GENERIC files.amd64
src/sys/arch/xen/conf: files.xen
Removed Files:
src/sys/arch/amd64/amd64: compat_13_machdep.c

Log Message:
Drop COMPAT_13 on amd64, already not enabled. Reduces the number of
critical places.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/sys/arch/amd64/amd64/compat_13_machdep.c
cvs rdiff -u -r1.470 -r1.471 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.163 -r1.164 src/sys/arch/xen/conf/files.xen

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



CVS commit: src/sys/arch/amd64

2017-12-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Dec  2 12:40:03 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: trap.c
src/sys/arch/amd64/conf: ALL GENERIC

Log Message:
Drop COMPAT_10 on amd64. The support for it comes down to one ifdef in
trap.c - code that is incorrect anyway, there were originally three lcall
LDT slots, and here only one instruction is decoded.

Given that one of these slots was used by BSDi's syscall, also remove the
references to COMPAT_NOMID to make clear we don't support that (it already
is not enabled).

Note: for some reason, COMPAT_10 does not even compile, because there are
"multiple definitions of _KERNEL_OPT_COMPAT_...", and I don't really
understand where this comes from.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/amd64/amd64/trap.c
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.469 -r1.470 src/sys/arch/amd64/conf/GENERIC

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

Modified files:

Index: src/sys/arch/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.104 src/sys/arch/amd64/amd64/trap.c:1.105
--- src/sys/arch/amd64/amd64/trap.c:1.104	Sat Oct 21 08:08:26 2017
+++ src/sys/arch/amd64/amd64/trap.c	Sat Dec  2 12:40:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.104 2017/10/21 08:08:26 maxv Exp $	*/
+/*	$NetBSD: trap.c,v 1.105 2017/12/02 12:40:03 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2017 The NetBSD Foundation, Inc.
@@ -64,14 +64,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.104 2017/10/21 08:08:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.105 2017/12/02 12:40:03 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
 #include "opt_xen.h"
 #include "opt_dtrace.h"
-#include "opt_compat_netbsd.h"
-#include "opt_compat_netbsd32.h"
 
 #include 
 #include 
@@ -88,11 +86,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.1
 
 #include 
 
-#ifdef COMPAT_NETBSD32
-#include 
-#include 
-#endif
-
 #include 
 #include 
 #include 
@@ -414,28 +407,7 @@ trap(struct trapframe *frame)
 		trap_user_kernelmode(frame, type, l, p);
 		goto we_re_toast;
 
-	case T_PROTFLT|T_USER:		/* protection fault */
-#if defined(COMPAT_NETBSD32) && defined(COMPAT_10)
-	{
-		static const char lcall[7] = { 0x9a, 0, 0, 0, 0, 7, 0 };
-		const size_t sz = sizeof(lcall);
-		char tmp[sz];
-
-		/* Check for the oosyscall lcall instruction. */
-		if (p->p_emul == _netbsd32 &&
-		frame->tf_rip < VM_MAXUSER_ADDRESS32 - sz &&
-		copyin((void *)frame->tf_rip, tmp, sz) == 0 &&
-		memcmp(tmp, lcall, sz) == 0) {
-
-			/* Advance past the lcall. */
-			frame->tf_rip += sz;
-
-			/* Do the syscall. */
-			p->p_md.md_syscall(frame);
-			goto out;
-		}
-	}
-#endif
+	case T_PROTFLT|T_USER:
 	case T_TSSFLT|T_USER:
 	case T_SEGNPFLT|T_USER:
 	case T_STKFLT|T_USER:

Index: src/sys/arch/amd64/conf/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.73 src/sys/arch/amd64/conf/ALL:1.74
--- src/sys/arch/amd64/conf/ALL:1.73	Sat Dec  2 09:59:02 2017
+++ src/sys/arch/amd64/conf/ALL	Sat Dec  2 12:40:03 2017
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.73 2017/12/02 09:59:02 maxv Exp $
+# $NetBSD: ALL,v 1.74 2017/12/02 12:40:03 maxv Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.73 $"
+#ident		"ALL-$Revision: 1.74 $"
 
 maxusers	64		# estimated number of users
 
@@ -130,7 +130,6 @@ options 	UVMHIST		# kernhist for uvm sub
 options 	BIOHIST		# kernhist for buff I/O
 
 # Compatibility options
-options 	COMPAT_NOMID	# NetBSD 0.8, 386BSD, and BSDI
 options 	EXEC_AOUT	# required by binaries from before 1.5
 options 	COMPAT_386BSD_MBRPART # recognize old partition ID
 include 	"conf/compat_netbsd09.config"

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.469 src/sys/arch/amd64/conf/GENERIC:1.470
--- src/sys/arch/amd64/conf/GENERIC:1.469	Sat Nov 25 16:32:48 2017
+++ src/sys/arch/amd64/conf/GENERIC	Sat Dec  2 12:40:03 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.469 2017/11/25 16:32:48 jmcneill Exp $
+# $NetBSD: GENERIC,v 1.470 2017/12/02 12:40:03 maxv Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.469 $"
+#ident		"GENERIC-$Revision: 1.470 $"
 
 maxusers	64		# estimated number of users
 
@@ -115,11 +115,13 @@ makeoptions	DEBUG="-g"	# compile full sy
 options 	KDTRACE_HOOKS	# kernel DTrace hooks
 
 # Compatibility options
-# (note that really old compat (< 1.6) is only useful for 32-bit binaries)
 #options 	EXEC_AOUT	# required by binaries from before 1.5
-#options 	COMPAT_NOMID	# NetBSD 0.8, 386BSD, and BSDI
 
+# NetBSD backward compatibility. Support goes 

CVS commit: src/sys/arch/amd64

2017-12-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Dec  2 12:40:03 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: trap.c
src/sys/arch/amd64/conf: ALL GENERIC

Log Message:
Drop COMPAT_10 on amd64. The support for it comes down to one ifdef in
trap.c - code that is incorrect anyway, there were originally three lcall
LDT slots, and here only one instruction is decoded.

Given that one of these slots was used by BSDi's syscall, also remove the
references to COMPAT_NOMID to make clear we don't support that (it already
is not enabled).

Note: for some reason, COMPAT_10 does not even compile, because there are
"multiple definitions of _KERNEL_OPT_COMPAT_...", and I don't really
understand where this comes from.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/amd64/amd64/trap.c
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.469 -r1.470 src/sys/arch/amd64/conf/GENERIC

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



Re: CVS commit: src/sys/compat

2017-12-02 Thread Maxime Villard

Le 02/12/2017 à 02:27, Joerg Sonnenberger a écrit :

On Fri, Dec 01, 2017 at 11:32:08PM +0100, Maxime Villard wrote:

Le 01/12/2017 à 23:14, Joerg Sonnenberger a écrit :

Module Name:src
Committed By:   joerg
Date:   Fri Dec  1 22:14:52 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_mod.c
src/sys/compat/linux32/common: linux32_mod.c

Log Message:
Unbreak Linux emulation by default. While not loading it automatically
is somewhat sensible, breaking functionality of GENERIC is not and has
been objected to on a regular base.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux32/common/linux32_mod.c

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


tell us what is "broken", exactly


Every Linux binary failing by default is the very definition of broken.


So is making the system vulnerable by default with marginal features. The
system is broken now. All you had to do is one sysctl; but that takes too much
time, and you're probably too busy handling serious business like debating
about your favorite hitler quotes.

Bye,
Maxime


CVS commit: [netbsd-7] src/doc

2017-12-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Dec  2 10:54:01 UTC 2017

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
1535


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.54 -r1.1.2.55 src/doc/CHANGES-7.2

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



CVS commit: [netbsd-7] src/doc

2017-12-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Dec  2 10:54:01 UTC 2017

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
1535


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.54 -r1.1.2.55 src/doc/CHANGES-7.2

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

Modified files:

Index: src/doc/CHANGES-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.54 src/doc/CHANGES-7.2:1.1.2.55
--- src/doc/CHANGES-7.2:1.1.2.54	Fri Nov 17 20:19:00 2017
+++ src/doc/CHANGES-7.2	Sat Dec  2 10:54:01 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.54 2017/11/17 20:19:00 snj Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.55 2017/12/02 10:54:01 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -4865,3 +4865,20 @@ tests/lib/libc/stdlib/t_strtol.c		1.7 vi
 	valid numeric prefix, which is 0.
 	[joerg, ticket #1448]
 
+xsrc/external/mit/libXcursor/dist/src/file.c	patch
+xsrc/external/mit/libXcursor/dist/src/library.c	patch
+xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c patch
+xsrc/external/mit/libXfont/dist/src/fontfile/dirfile.c patch
+xsrc/external/mit/libXfont/dist/src/fontfile/fileio.c patch
+xsrc/external/mit/libXfont/dist/src/fontfile/fontdir.c patch
+xsrc/xfree/xc/lib/Xcursor/file.c		patch
+xsrc/xfree/xc/lib/Xcursor/library.c		patch
+xsrc/xfree/xc/lib/font/bitmap/pcfread.c		patch
+xsrc/xfree/xc/lib/font/fontfile/dirfile.c	patch
+xsrc/xfree/xc/lib/font/fontfile/fileio.c	patch
+xsrc/xfree/xc/lib/font/fontfile/fontdir.c	patch
+
+	Pull up fixes to libXfont and libXcurses for CVEs
+	2017-13722, 2017-13720, 2017-16611, and 2017-16612.
+	[mrg, ticket #1535]
+



CVS commit: [netbsd-7-1] src/doc

2017-12-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Dec  2 10:53:44 UTC 2017

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.1

Log Message:
1535


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.38 -r1.1.2.39 src/doc/CHANGES-7.1.1

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

Modified files:

Index: src/doc/CHANGES-7.1.1
diff -u src/doc/CHANGES-7.1.1:1.1.2.38 src/doc/CHANGES-7.1.1:1.1.2.39
--- src/doc/CHANGES-7.1.1:1.1.2.38	Mon Nov  6 09:23:51 2017
+++ src/doc/CHANGES-7.1.1	Sat Dec  2 10:53:44 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.1,v 1.1.2.38 2017/11/06 09:23:51 snj Exp $
+# $NetBSD: CHANGES-7.1.1,v 1.1.2.39 2017/12/02 10:53:44 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.1.1
 release:
@@ -3803,3 +3803,20 @@ sys/dev/pci/if_wm.c1.497
 	Fix panic on shutdown.  PR kern/52039.
 	[kardel, ticket #1385]
 
+xsrc/external/mit/libXcursor/dist/src/file.c	patch
+xsrc/external/mit/libXcursor/dist/src/library.c	patch
+xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c patch
+xsrc/external/mit/libXfont/dist/src/fontfile/dirfile.c patch
+xsrc/external/mit/libXfont/dist/src/fontfile/fileio.c patch
+xsrc/external/mit/libXfont/dist/src/fontfile/fontdir.c patch
+xsrc/xfree/xc/lib/Xcursor/file.c		patch
+xsrc/xfree/xc/lib/Xcursor/library.c		patch
+xsrc/xfree/xc/lib/font/bitmap/pcfread.c		patch
+xsrc/xfree/xc/lib/font/fontfile/dirfile.c	patch
+xsrc/xfree/xc/lib/font/fontfile/fileio.c	patch
+xsrc/xfree/xc/lib/font/fontfile/fontdir.c	patch
+
+	Pull up fixes to libXfont and libXcurses for CVEs
+	2017-13722, 2017-13720, 2017-16611, and 2017-16612.
+	[mrg, ticket #1535]
+



CVS commit: [netbsd-7-0] src/doc

2017-12-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Dec  2 10:53:23 UTC 2017

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
1535


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.69 -r1.1.2.70 src/doc/CHANGES-7.0.3

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

Modified files:

Index: src/doc/CHANGES-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.69 src/doc/CHANGES-7.0.3:1.1.2.70
--- src/doc/CHANGES-7.0.3:1.1.2.69	Sun Nov  5 21:08:24 2017
+++ src/doc/CHANGES-7.0.3	Sat Dec  2 10:53:23 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.69 2017/11/05 21:08:24 snj Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.70 2017/12/02 10:53:23 snj Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5100,3 +5100,21 @@ xsrc/xfree/xc/programs/Xserver/render/re
 	apply fixes for CVEs 2017-12176 to 2017-12187
 	[mrg, ticket #1523]
 
+xsrc/external/mit/libXcursor/dist/src/file.c	patch
+xsrc/external/mit/libXcursor/dist/src/library.c	patch
+xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c patch
+xsrc/external/mit/libXfont/dist/src/fontfile/dirfile.c patch
+xsrc/external/mit/libXfont/dist/src/fontfile/fileio.c patch
+xsrc/external/mit/libXfont/dist/src/fontfile/fontdir.c patch
+xsrc/xfree/xc/lib/Xcursor/file.c		patch
+xsrc/xfree/xc/lib/Xcursor/library.c		patch
+xsrc/xfree/xc/lib/font/bitmap/pcfread.c		patch
+xsrc/xfree/xc/lib/font/fontfile/dirfile.c	patch
+xsrc/xfree/xc/lib/font/fontfile/fileio.c	patch
+xsrc/xfree/xc/lib/font/fontfile/fontdir.c	patch
+
+	Pull up fixes to libXfont and libXcurses for CVEs
+	2017-13722, 2017-13720, 2017-16611, and 2017-16612.
+	[mrg, ticket #1535]
+
+



CVS commit: [netbsd-7-1] src/doc

2017-12-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Dec  2 10:53:44 UTC 2017

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.1

Log Message:
1535


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.38 -r1.1.2.39 src/doc/CHANGES-7.1.1

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



CVS commit: [netbsd-7-0] src/doc

2017-12-02 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Dec  2 10:53:23 UTC 2017

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
1535


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.69 -r1.1.2.70 src/doc/CHANGES-7.0.3

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



CVS commit: [netbsd-7] xsrc

2017-12-02 Thread Soren Jacobsen
Module Name:xsrc
Committed By:   snj
Date:   Sat Dec  2 10:52:54 UTC 2017

Modified Files:
xsrc/external/mit/libXcursor/dist/src [netbsd-7]: file.c library.c
xsrc/external/mit/libXfont/dist/src/bitmap [netbsd-7]: pcfread.c
xsrc/external/mit/libXfont/dist/src/fontfile [netbsd-7]: dirfile.c
fileio.c fontdir.c
xsrc/xfree/xc/lib/Xcursor [netbsd-7]: file.c library.c
xsrc/xfree/xc/lib/font/bitmap [netbsd-7]: pcfread.c
xsrc/xfree/xc/lib/font/fontfile [netbsd-7]: dirfile.c fileio.c
fontdir.c

Log Message:
Apply patch, requested by mrg in ticket #1535:
Pull up fixes to libXfont and libXcurses for CVEs 2017-13722, 2017-13720,
2017-16611, and 2017-16612.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.4.1 \
xsrc/external/mit/libXcursor/dist/src/file.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.4.1 \
xsrc/external/mit/libXcursor/dist/src/library.c
cvs rdiff -u -r1.3 -r1.3.4.1 \
xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c
cvs rdiff -u -r1.3.2.1 -r1.3.2.2 \
xsrc/external/mit/libXfont/dist/src/fontfile/dirfile.c
cvs rdiff -u -r1.1.1.3.4.1 -r1.1.1.3.4.2 \
xsrc/external/mit/libXfont/dist/src/fontfile/fileio.c
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.2.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/fontdir.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.38.1 xsrc/xfree/xc/lib/Xcursor/file.c
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.36.1 xsrc/xfree/xc/lib/Xcursor/library.c
cvs rdiff -u -r1.3 -r1.3.18.1 xsrc/xfree/xc/lib/font/bitmap/pcfread.c
cvs rdiff -u -r1.5 -r1.5.2.1 xsrc/xfree/xc/lib/font/fontfile/dirfile.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.38.1 \
xsrc/xfree/xc/lib/font/fontfile/fileio.c
cvs rdiff -u -r1.2 -r1.2.18.1 xsrc/xfree/xc/lib/font/fontfile/fontdir.c

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

Modified files:

Index: xsrc/external/mit/libXcursor/dist/src/file.c
diff -u xsrc/external/mit/libXcursor/dist/src/file.c:1.1.1.4 xsrc/external/mit/libXcursor/dist/src/file.c:1.1.1.4.4.1
--- xsrc/external/mit/libXcursor/dist/src/file.c:1.1.1.4	Thu May 30 20:23:56 2013
+++ xsrc/external/mit/libXcursor/dist/src/file.c	Sat Dec  2 10:52:53 2017
@@ -29,6 +29,11 @@ XcursorImageCreate (int width, int heigh
 {
 XcursorImage*image;
 
+if (width < 0 || height < 0)
+   return NULL;
+if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE)
+   return NULL;
+
 image = malloc (sizeof (XcursorImage) +
 		width * height * sizeof (XcursorPixel));
 if (!image)
@@ -102,7 +107,7 @@ XcursorCommentCreate (XcursorUInt commen
 {
 XcursorComment  *comment;
 
-if (length > XCURSOR_COMMENT_MAX_LEN)
+if (length < 0 || length > XCURSOR_COMMENT_MAX_LEN)
 	return NULL;
 
 comment = malloc (sizeof (XcursorComment) + length + 1);
@@ -449,7 +454,8 @@ _XcursorReadImage (XcursorFile		*file,
 if (!_XcursorReadUInt (file, ))
 	return NULL;
 /* sanity check data */
-if (head.width >= 0x1 || head.height > 0x1)
+if (head.width > XCURSOR_IMAGE_MAX_SIZE  ||
+	head.height > XCURSOR_IMAGE_MAX_SIZE)
 	return NULL;
 if (head.width == 0 || head.height == 0)
 	return NULL;
@@ -458,6 +464,8 @@ _XcursorReadImage (XcursorFile		*file,
 
 /* Create the image and initialize it */
 image = XcursorImageCreate (head.width, head.height);
+if (image == NULL)
+	return NULL;
 if (chunkHeader.version < image->version)
 	image->version = chunkHeader.version;
 image->size = chunkHeader.subtype;

Index: xsrc/external/mit/libXcursor/dist/src/library.c
diff -u xsrc/external/mit/libXcursor/dist/src/library.c:1.1.1.3 xsrc/external/mit/libXcursor/dist/src/library.c:1.1.1.3.4.1
--- xsrc/external/mit/libXcursor/dist/src/library.c:1.1.1.3	Thu May 30 20:23:56 2013
+++ xsrc/external/mit/libXcursor/dist/src/library.c	Sat Dec  2 10:52:53 2017
@@ -180,7 +180,7 @@ _XcursorThemeInherits (const char *full)
 		if (*l != '=') continue;
 		l++;
 		while (*l == ' ') l++;
-		result = malloc (strlen (l));
+		result = malloc (strlen (l) + 1);
 		if (result)
 		{
 		r = result;

Index: xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c
diff -u xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c:1.3 xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c:1.3.4.1
--- xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c:1.3	Fri May 31 01:18:45 2013
+++ xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c	Sat Dec  2 10:52:53 2017
@@ -44,6 +44,7 @@ from The Open Group.
 
 #include 
 #include 
+#include 
 
 void
 pcfError(const char* message, ...)
@@ -310,11 +311,19 @@ pcfGetProperties(FontInfoPtr pFontInfo, 
 if (IS_EOF(file)) goto Bail;
 position += string_size;
 for (i = 0; i < nprops; i++) {
+	if (props[i].name >= string_size) {
+	pcfError("pcfGetProperties(): String starts out of bounds (%ld/%d)\n", props[i].name, string_size);
+	goto Bail;
+	}
 	props[i].name = MakeAtom(strings + props[i].name,
- 

CVS commit: [netbsd-7-0] xsrc

2017-12-02 Thread Soren Jacobsen
Module Name:xsrc
Committed By:   snj
Date:   Sat Dec  2 10:52:31 UTC 2017

Modified Files:
xsrc/external/mit/libXcursor/dist/src [netbsd-7-0]: file.c library.c
xsrc/external/mit/libXfont/dist/src/bitmap [netbsd-7-0]: pcfread.c
xsrc/external/mit/libXfont/dist/src/fontfile [netbsd-7-0]: dirfile.c
fileio.c fontdir.c
xsrc/xfree/xc/lib/Xcursor [netbsd-7-0]: file.c library.c
xsrc/xfree/xc/lib/font/bitmap [netbsd-7-0]: pcfread.c
xsrc/xfree/xc/lib/font/fontfile [netbsd-7-0]: dirfile.c fileio.c
fontdir.c

Log Message:
Apply patch, requested by mrg in ticket #1535:
Pull up fixes to libXfont and libXcurses for CVEs 2017-13722, 2017-13720,
2017-16611, and 2017-16612.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.6.1 \
xsrc/external/mit/libXcursor/dist/src/file.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.6.1 \
xsrc/external/mit/libXcursor/dist/src/library.c
cvs rdiff -u -r1.3 -r1.3.6.1 \
xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c
cvs rdiff -u -r1.3.2.1 -r1.3.2.1.2.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/dirfile.c
cvs rdiff -u -r1.1.1.3.4.1 -r1.1.1.3.4.1.2.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/fileio.c
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.4.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/fontdir.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.40.1 xsrc/xfree/xc/lib/Xcursor/file.c
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.38.1 xsrc/xfree/xc/lib/Xcursor/library.c
cvs rdiff -u -r1.3 -r1.3.20.1 xsrc/xfree/xc/lib/font/bitmap/pcfread.c
cvs rdiff -u -r1.5 -r1.5.4.1 xsrc/xfree/xc/lib/font/fontfile/dirfile.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.40.1 \
xsrc/xfree/xc/lib/font/fontfile/fileio.c
cvs rdiff -u -r1.2 -r1.2.20.1 xsrc/xfree/xc/lib/font/fontfile/fontdir.c

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

Modified files:

Index: xsrc/external/mit/libXcursor/dist/src/file.c
diff -u xsrc/external/mit/libXcursor/dist/src/file.c:1.1.1.4 xsrc/external/mit/libXcursor/dist/src/file.c:1.1.1.4.6.1
--- xsrc/external/mit/libXcursor/dist/src/file.c:1.1.1.4	Thu May 30 20:23:56 2013
+++ xsrc/external/mit/libXcursor/dist/src/file.c	Sat Dec  2 10:52:31 2017
@@ -29,6 +29,11 @@ XcursorImageCreate (int width, int heigh
 {
 XcursorImage*image;
 
+if (width < 0 || height < 0)
+   return NULL;
+if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE)
+   return NULL;
+
 image = malloc (sizeof (XcursorImage) +
 		width * height * sizeof (XcursorPixel));
 if (!image)
@@ -102,7 +107,7 @@ XcursorCommentCreate (XcursorUInt commen
 {
 XcursorComment  *comment;
 
-if (length > XCURSOR_COMMENT_MAX_LEN)
+if (length < 0 || length > XCURSOR_COMMENT_MAX_LEN)
 	return NULL;
 
 comment = malloc (sizeof (XcursorComment) + length + 1);
@@ -449,7 +454,8 @@ _XcursorReadImage (XcursorFile		*file,
 if (!_XcursorReadUInt (file, ))
 	return NULL;
 /* sanity check data */
-if (head.width >= 0x1 || head.height > 0x1)
+if (head.width > XCURSOR_IMAGE_MAX_SIZE  ||
+	head.height > XCURSOR_IMAGE_MAX_SIZE)
 	return NULL;
 if (head.width == 0 || head.height == 0)
 	return NULL;
@@ -458,6 +464,8 @@ _XcursorReadImage (XcursorFile		*file,
 
 /* Create the image and initialize it */
 image = XcursorImageCreate (head.width, head.height);
+if (image == NULL)
+	return NULL;
 if (chunkHeader.version < image->version)
 	image->version = chunkHeader.version;
 image->size = chunkHeader.subtype;

Index: xsrc/external/mit/libXcursor/dist/src/library.c
diff -u xsrc/external/mit/libXcursor/dist/src/library.c:1.1.1.3 xsrc/external/mit/libXcursor/dist/src/library.c:1.1.1.3.6.1
--- xsrc/external/mit/libXcursor/dist/src/library.c:1.1.1.3	Thu May 30 20:23:56 2013
+++ xsrc/external/mit/libXcursor/dist/src/library.c	Sat Dec  2 10:52:31 2017
@@ -180,7 +180,7 @@ _XcursorThemeInherits (const char *full)
 		if (*l != '=') continue;
 		l++;
 		while (*l == ' ') l++;
-		result = malloc (strlen (l));
+		result = malloc (strlen (l) + 1);
 		if (result)
 		{
 		r = result;

Index: xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c
diff -u xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c:1.3 xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c:1.3.6.1
--- xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c:1.3	Fri May 31 01:18:45 2013
+++ xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c	Sat Dec  2 10:52:31 2017
@@ -44,6 +44,7 @@ from The Open Group.
 
 #include 
 #include 
+#include 
 
 void
 pcfError(const char* message, ...)
@@ -310,11 +311,19 @@ pcfGetProperties(FontInfoPtr pFontInfo, 
 if (IS_EOF(file)) goto Bail;
 position += string_size;
 for (i = 0; i < nprops; i++) {
+	if (props[i].name >= string_size) {
+	pcfError("pcfGetProperties(): String starts out of bounds (%ld/%d)\n", props[i].name, string_size);
+	goto Bail;
+	}
 	props[i].name = MakeAtom(strings + 

CVS commit: [netbsd-7-1] xsrc

2017-12-02 Thread Soren Jacobsen
Module Name:xsrc
Committed By:   snj
Date:   Sat Dec  2 10:52:43 UTC 2017

Modified Files:
xsrc/external/mit/libXcursor/dist/src [netbsd-7-1]: file.c library.c
xsrc/external/mit/libXfont/dist/src/bitmap [netbsd-7-1]: pcfread.c
xsrc/external/mit/libXfont/dist/src/fontfile [netbsd-7-1]: dirfile.c
fileio.c fontdir.c
xsrc/xfree/xc/lib/Xcursor [netbsd-7-1]: file.c library.c
xsrc/xfree/xc/lib/font/bitmap [netbsd-7-1]: pcfread.c
xsrc/xfree/xc/lib/font/fontfile [netbsd-7-1]: dirfile.c fileio.c
fontdir.c

Log Message:
Apply patch, requested by mrg in ticket #1535:
Pull up fixes to libXfont and libXcurses for CVEs 2017-13722, 2017-13720,
2017-16611, and 2017-16612.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.8.1 \
xsrc/external/mit/libXcursor/dist/src/file.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.8.1 \
xsrc/external/mit/libXcursor/dist/src/library.c
cvs rdiff -u -r1.3 -r1.3.8.1 \
xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c
cvs rdiff -u -r1.3.2.1 -r1.3.2.1.4.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/dirfile.c
cvs rdiff -u -r1.1.1.3.4.1 -r1.1.1.3.4.1.4.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/fileio.c
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.6.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/fontdir.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.42.1 xsrc/xfree/xc/lib/Xcursor/file.c
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.40.1 xsrc/xfree/xc/lib/Xcursor/library.c
cvs rdiff -u -r1.3 -r1.3.22.1 xsrc/xfree/xc/lib/font/bitmap/pcfread.c
cvs rdiff -u -r1.5 -r1.5.6.1 xsrc/xfree/xc/lib/font/fontfile/dirfile.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.42.1 \
xsrc/xfree/xc/lib/font/fontfile/fileio.c
cvs rdiff -u -r1.2 -r1.2.22.1 xsrc/xfree/xc/lib/font/fontfile/fontdir.c

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



CVS commit: [netbsd-7-0] xsrc

2017-12-02 Thread Soren Jacobsen
Module Name:xsrc
Committed By:   snj
Date:   Sat Dec  2 10:52:31 UTC 2017

Modified Files:
xsrc/external/mit/libXcursor/dist/src [netbsd-7-0]: file.c library.c
xsrc/external/mit/libXfont/dist/src/bitmap [netbsd-7-0]: pcfread.c
xsrc/external/mit/libXfont/dist/src/fontfile [netbsd-7-0]: dirfile.c
fileio.c fontdir.c
xsrc/xfree/xc/lib/Xcursor [netbsd-7-0]: file.c library.c
xsrc/xfree/xc/lib/font/bitmap [netbsd-7-0]: pcfread.c
xsrc/xfree/xc/lib/font/fontfile [netbsd-7-0]: dirfile.c fileio.c
fontdir.c

Log Message:
Apply patch, requested by mrg in ticket #1535:
Pull up fixes to libXfont and libXcurses for CVEs 2017-13722, 2017-13720,
2017-16611, and 2017-16612.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.6.1 \
xsrc/external/mit/libXcursor/dist/src/file.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.6.1 \
xsrc/external/mit/libXcursor/dist/src/library.c
cvs rdiff -u -r1.3 -r1.3.6.1 \
xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c
cvs rdiff -u -r1.3.2.1 -r1.3.2.1.2.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/dirfile.c
cvs rdiff -u -r1.1.1.3.4.1 -r1.1.1.3.4.1.2.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/fileio.c
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.4.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/fontdir.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.40.1 xsrc/xfree/xc/lib/Xcursor/file.c
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.38.1 xsrc/xfree/xc/lib/Xcursor/library.c
cvs rdiff -u -r1.3 -r1.3.20.1 xsrc/xfree/xc/lib/font/bitmap/pcfread.c
cvs rdiff -u -r1.5 -r1.5.4.1 xsrc/xfree/xc/lib/font/fontfile/dirfile.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.40.1 \
xsrc/xfree/xc/lib/font/fontfile/fileio.c
cvs rdiff -u -r1.2 -r1.2.20.1 xsrc/xfree/xc/lib/font/fontfile/fontdir.c

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



CVS commit: [netbsd-7] xsrc

2017-12-02 Thread Soren Jacobsen
Module Name:xsrc
Committed By:   snj
Date:   Sat Dec  2 10:52:54 UTC 2017

Modified Files:
xsrc/external/mit/libXcursor/dist/src [netbsd-7]: file.c library.c
xsrc/external/mit/libXfont/dist/src/bitmap [netbsd-7]: pcfread.c
xsrc/external/mit/libXfont/dist/src/fontfile [netbsd-7]: dirfile.c
fileio.c fontdir.c
xsrc/xfree/xc/lib/Xcursor [netbsd-7]: file.c library.c
xsrc/xfree/xc/lib/font/bitmap [netbsd-7]: pcfread.c
xsrc/xfree/xc/lib/font/fontfile [netbsd-7]: dirfile.c fileio.c
fontdir.c

Log Message:
Apply patch, requested by mrg in ticket #1535:
Pull up fixes to libXfont and libXcurses for CVEs 2017-13722, 2017-13720,
2017-16611, and 2017-16612.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.4.1 \
xsrc/external/mit/libXcursor/dist/src/file.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.4.1 \
xsrc/external/mit/libXcursor/dist/src/library.c
cvs rdiff -u -r1.3 -r1.3.4.1 \
xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c
cvs rdiff -u -r1.3.2.1 -r1.3.2.2 \
xsrc/external/mit/libXfont/dist/src/fontfile/dirfile.c
cvs rdiff -u -r1.1.1.3.4.1 -r1.1.1.3.4.2 \
xsrc/external/mit/libXfont/dist/src/fontfile/fileio.c
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.2.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/fontdir.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.38.1 xsrc/xfree/xc/lib/Xcursor/file.c
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.36.1 xsrc/xfree/xc/lib/Xcursor/library.c
cvs rdiff -u -r1.3 -r1.3.18.1 xsrc/xfree/xc/lib/font/bitmap/pcfread.c
cvs rdiff -u -r1.5 -r1.5.2.1 xsrc/xfree/xc/lib/font/fontfile/dirfile.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.38.1 \
xsrc/xfree/xc/lib/font/fontfile/fileio.c
cvs rdiff -u -r1.2 -r1.2.18.1 xsrc/xfree/xc/lib/font/fontfile/fontdir.c

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



CVS commit: [netbsd-7-1] xsrc

2017-12-02 Thread Soren Jacobsen
Module Name:xsrc
Committed By:   snj
Date:   Sat Dec  2 10:52:43 UTC 2017

Modified Files:
xsrc/external/mit/libXcursor/dist/src [netbsd-7-1]: file.c library.c
xsrc/external/mit/libXfont/dist/src/bitmap [netbsd-7-1]: pcfread.c
xsrc/external/mit/libXfont/dist/src/fontfile [netbsd-7-1]: dirfile.c
fileio.c fontdir.c
xsrc/xfree/xc/lib/Xcursor [netbsd-7-1]: file.c library.c
xsrc/xfree/xc/lib/font/bitmap [netbsd-7-1]: pcfread.c
xsrc/xfree/xc/lib/font/fontfile [netbsd-7-1]: dirfile.c fileio.c
fontdir.c

Log Message:
Apply patch, requested by mrg in ticket #1535:
Pull up fixes to libXfont and libXcurses for CVEs 2017-13722, 2017-13720,
2017-16611, and 2017-16612.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.8.1 \
xsrc/external/mit/libXcursor/dist/src/file.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.8.1 \
xsrc/external/mit/libXcursor/dist/src/library.c
cvs rdiff -u -r1.3 -r1.3.8.1 \
xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c
cvs rdiff -u -r1.3.2.1 -r1.3.2.1.4.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/dirfile.c
cvs rdiff -u -r1.1.1.3.4.1 -r1.1.1.3.4.1.4.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/fileio.c
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.6.1 \
xsrc/external/mit/libXfont/dist/src/fontfile/fontdir.c
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.42.1 xsrc/xfree/xc/lib/Xcursor/file.c
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.40.1 xsrc/xfree/xc/lib/Xcursor/library.c
cvs rdiff -u -r1.3 -r1.3.22.1 xsrc/xfree/xc/lib/font/bitmap/pcfread.c
cvs rdiff -u -r1.5 -r1.5.6.1 xsrc/xfree/xc/lib/font/fontfile/dirfile.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.42.1 \
xsrc/xfree/xc/lib/font/fontfile/fileio.c
cvs rdiff -u -r1.2 -r1.2.22.1 xsrc/xfree/xc/lib/font/fontfile/fontdir.c

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

Modified files:

Index: xsrc/external/mit/libXcursor/dist/src/file.c
diff -u xsrc/external/mit/libXcursor/dist/src/file.c:1.1.1.4 xsrc/external/mit/libXcursor/dist/src/file.c:1.1.1.4.8.1
--- xsrc/external/mit/libXcursor/dist/src/file.c:1.1.1.4	Thu May 30 20:23:56 2013
+++ xsrc/external/mit/libXcursor/dist/src/file.c	Sat Dec  2 10:52:42 2017
@@ -29,6 +29,11 @@ XcursorImageCreate (int width, int heigh
 {
 XcursorImage*image;
 
+if (width < 0 || height < 0)
+   return NULL;
+if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE)
+   return NULL;
+
 image = malloc (sizeof (XcursorImage) +
 		width * height * sizeof (XcursorPixel));
 if (!image)
@@ -102,7 +107,7 @@ XcursorCommentCreate (XcursorUInt commen
 {
 XcursorComment  *comment;
 
-if (length > XCURSOR_COMMENT_MAX_LEN)
+if (length < 0 || length > XCURSOR_COMMENT_MAX_LEN)
 	return NULL;
 
 comment = malloc (sizeof (XcursorComment) + length + 1);
@@ -449,7 +454,8 @@ _XcursorReadImage (XcursorFile		*file,
 if (!_XcursorReadUInt (file, ))
 	return NULL;
 /* sanity check data */
-if (head.width >= 0x1 || head.height > 0x1)
+if (head.width > XCURSOR_IMAGE_MAX_SIZE  ||
+	head.height > XCURSOR_IMAGE_MAX_SIZE)
 	return NULL;
 if (head.width == 0 || head.height == 0)
 	return NULL;
@@ -458,6 +464,8 @@ _XcursorReadImage (XcursorFile		*file,
 
 /* Create the image and initialize it */
 image = XcursorImageCreate (head.width, head.height);
+if (image == NULL)
+	return NULL;
 if (chunkHeader.version < image->version)
 	image->version = chunkHeader.version;
 image->size = chunkHeader.subtype;

Index: xsrc/external/mit/libXcursor/dist/src/library.c
diff -u xsrc/external/mit/libXcursor/dist/src/library.c:1.1.1.3 xsrc/external/mit/libXcursor/dist/src/library.c:1.1.1.3.8.1
--- xsrc/external/mit/libXcursor/dist/src/library.c:1.1.1.3	Thu May 30 20:23:56 2013
+++ xsrc/external/mit/libXcursor/dist/src/library.c	Sat Dec  2 10:52:42 2017
@@ -180,7 +180,7 @@ _XcursorThemeInherits (const char *full)
 		if (*l != '=') continue;
 		l++;
 		while (*l == ' ') l++;
-		result = malloc (strlen (l));
+		result = malloc (strlen (l) + 1);
 		if (result)
 		{
 		r = result;

Index: xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c
diff -u xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c:1.3 xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c:1.3.8.1
--- xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c:1.3	Fri May 31 01:18:45 2013
+++ xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c	Sat Dec  2 10:52:42 2017
@@ -44,6 +44,7 @@ from The Open Group.
 
 #include 
 #include 
+#include 
 
 void
 pcfError(const char* message, ...)
@@ -310,11 +311,19 @@ pcfGetProperties(FontInfoPtr pFontInfo, 
 if (IS_EOF(file)) goto Bail;
 position += string_size;
 for (i = 0; i < nprops; i++) {
+	if (props[i].name >= string_size) {
+	pcfError("pcfGetProperties(): String starts out of bounds (%ld/%d)\n", props[i].name, string_size);
+	goto Bail;
+	}
 	props[i].name = MakeAtom(strings + 

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

2017-12-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Dec  2 09:59:02 UTC 2017

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

Log Message:
Remove options that do not exist on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/amd64/conf/ALL

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

Modified files:

Index: src/sys/arch/amd64/conf/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.72 src/sys/arch/amd64/conf/ALL:1.73
--- src/sys/arch/amd64/conf/ALL:1.72	Sat Nov 25 16:32:48 2017
+++ src/sys/arch/amd64/conf/ALL	Sat Dec  2 09:59:02 2017
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.72 2017/11/25 16:32:48 jmcneill Exp $
+# $NetBSD: ALL,v 1.73 2017/12/02 09:59:02 maxv Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.72 $"
+#ident		"ALL-$Revision: 1.73 $"
 
 maxusers	64		# estimated number of users
 
@@ -139,13 +139,7 @@ options 	COMPAT_OSSAUDIO	# OSS (Voxware)
 options 	COMPAT_NETBSD32 # NetBSD 32-bit
 options 	COMPAT_LINUX	# binary compatibility with Linux
 options 	COMPAT_LINUX32	# binary compatibility with Linux 32-bit
-options 	COMPAT_FREEBSD	# binary compatibility with FreeBSD
 options 	COMPAT_NDIS	# NDIS network driver
-options 	COMPAT_OSF1	# OSF1 binary compatibility
-#options 	COMPAT_SVR4	# SVR4 binary compatibility (no amd64)
-#options 	COMPAT_SVR4_32	# SVR4 32-bit binary compatibility (no amd64)
-options 	COMPAT_ULTRIX	# DEC Ultrix binary compatibility
-options 	COMPAT_SUNOS	# SunOS 4.x binary compatibility
 
 # Wedge support
 options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances



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

2017-12-02 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Dec  2 09:59:02 UTC 2017

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

Log Message:
Remove options that do not exist on amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/amd64/conf/ALL

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



CVS commit: src/sys/kern

2017-12-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Dec  2 08:22:04 UTC 2017

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

Log Message:
include opt_compat_netbsd.h, so that eg COMPAT_70 will be set.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/kern/uipc_usrreq.c

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

Modified files:

Index: src/sys/kern/uipc_usrreq.c
diff -u src/sys/kern/uipc_usrreq.c:1.181 src/sys/kern/uipc_usrreq.c:1.182
--- src/sys/kern/uipc_usrreq.c:1.181	Mon Oct 31 15:05:05 2016
+++ src/sys/kern/uipc_usrreq.c	Sat Dec  2 08:22:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_usrreq.c,v 1.181 2016/10/31 15:05:05 maxv Exp $	*/
+/*	$NetBSD: uipc_usrreq.c,v 1.182 2017/12/02 08:22:04 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2004, 2008, 2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.181 2016/10/31 15:05:05 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.182 2017/12/02 08:22:04 mrg Exp $");
+
+#ifdef _KERNEL_OPT
+#include "opt_compat_netbsd.h"
+#endif
 
 #include 
 #include 



CVS commit: src/sys/kern

2017-12-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Dec  2 08:22:04 UTC 2017

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

Log Message:
include opt_compat_netbsd.h, so that eg COMPAT_70 will be set.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/kern/uipc_usrreq.c

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



CVS commit: src

2017-12-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Dec  2 08:15:43 UTC 2017

Modified Files:
src/sys/kern: subr_pool.c
src/sys/sys: pool.h
src/sys/uvm: uvm_extern.h uvm_meter.c uvm_page.c uvm_stat.c
src/usr.bin/vmstat: vmstat.c

Log Message:
add two new members to uvmexp_sysctl{}:  bootpages and poolpages.
bootpages is set to the pages allocated via uvm_pageboot_alloc().
poolpages is calculated from the list of pools nr_pages members.

this brings us closer to having a valid total of pages known by
the system, vs actual pages originally managed.

XXX: poolpages needs some handling for PR_RECURSIVE pools still.


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/sys/kern/subr_pool.c
cvs rdiff -u -r1.80 -r1.81 src/sys/sys/pool.h
cvs rdiff -u -r1.206 -r1.207 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.66 -r1.67 src/sys/uvm/uvm_meter.c
cvs rdiff -u -r1.194 -r1.195 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.38 -r1.39 src/sys/uvm/uvm_stat.c
cvs rdiff -u -r1.220 -r1.221 src/usr.bin/vmstat/vmstat.c

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

Modified files:

Index: src/sys/kern/subr_pool.c
diff -u src/sys/kern/subr_pool.c:1.216 src/sys/kern/subr_pool.c:1.217
--- src/sys/kern/subr_pool.c:1.216	Tue Nov 14 15:02:06 2017
+++ src/sys/kern/subr_pool.c	Sat Dec  2 08:15:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pool.c,v 1.216 2017/11/14 15:02:06 christos Exp $	*/
+/*	$NetBSD: subr_pool.c,v 1.217 2017/12/02 08:15:42 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014, 2015
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.216 2017/11/14 15:02:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.217 2017/12/02 08:15:42 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1453,6 +1453,27 @@ pool_drain(struct pool **ppp)
 }
 
 /*
+ * Calculate the total number of pages consumed by pools.
+ */
+int
+pool_totalpages(void)
+{
+	struct pool *pp;
+	int total = 0;
+
+	mutex_enter(_head_lock);
+	TAILQ_FOREACH(pp, _head, pr_poollist)
+		/*
+		 * XXXMRG
+		if ((pp->pr_roflags & PR_RECURSIVE) == 0)
+		 */
+			total += pp->pr_npages;
+	mutex_exit(_head_lock);
+
+	return total;
+}
+
+/*
  * Diagnostic helpers.
  */
 

Index: src/sys/sys/pool.h
diff -u src/sys/sys/pool.h:1.80 src/sys/sys/pool.h:1.81
--- src/sys/sys/pool.h:1.80	Sat Oct 28 19:19:10 2017
+++ src/sys/sys/pool.h	Sat Dec  2 08:15:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pool.h,v 1.80 2017/10/28 19:19:10 riastradh Exp $	*/
+/*	$NetBSD: pool.h,v 1.81 2017/12/02 08:15:43 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2000, 2007 The NetBSD Foundation, Inc.
@@ -307,6 +307,7 @@ void		pool_setlowat(struct pool *, int);
 void		pool_sethiwat(struct pool *, int);
 void		pool_sethardlimit(struct pool *, int, const char *, int);
 bool		pool_drain(struct pool **);
+int		pool_totalpages(void);
 
 /*
  * Debugging and diagnostic aides.

Index: src/sys/uvm/uvm_extern.h
diff -u src/sys/uvm/uvm_extern.h:1.206 src/sys/uvm/uvm_extern.h:1.207
--- src/sys/uvm/uvm_extern.h:1.206	Sat May 20 07:27:15 2017
+++ src/sys/uvm/uvm_extern.h	Sat Dec  2 08:15:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_extern.h,v 1.206 2017/05/20 07:27:15 chs Exp $	*/
+/*	$NetBSD: uvm_extern.h,v 1.207 2017/12/02 08:15:43 mrg Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -408,6 +408,8 @@ struct uvmexp {
 	int pdreanon;	/* anon pages reactivated due to thresholds */
 	int pdrefile;	/* file pages reactivated due to thresholds */
 	int pdreexec;	/* executable pages reactivated due to thresholds */
+
+	int bootpages;  /* number of pages stolen at boot */
 };
 
 /*
@@ -493,6 +495,8 @@ struct uvmexp_sysctl {
 	int64_t colorhit;
 	int64_t colormiss;
 	int64_t ncolors;
+	int64_t bootpages;
+	int64_t poolpages;
 };
 
 #ifdef _KERNEL

Index: src/sys/uvm/uvm_meter.c
diff -u src/sys/uvm/uvm_meter.c:1.66 src/sys/uvm/uvm_meter.c:1.67
--- src/sys/uvm/uvm_meter.c:1.66	Sun Jul  2 16:41:33 2017
+++ src/sys/uvm/uvm_meter.c	Sat Dec  2 08:15:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_meter.c,v 1.66 2017/07/02 16:41:33 joerg Exp $	*/
+/*	$NetBSD: uvm_meter.c,v 1.67 2017/12/02 08:15:43 mrg Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.66 2017/07/02 16:41:33 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.67 2017/12/02 08:15:43 mrg Exp $");
 
 #include 
 #include 
@@ -177,6 +177,8 @@ sysctl_vm_uvmexp2(SYSCTLFN_ARGS)
 	u.colorhit = uvmexp.colorhit;
 	u.colormiss = uvmexp.colormiss;
 	u.ncolors = uvmexp.ncolors;
+	u.bootpages = uvmexp.bootpages;
+	u.poolpages = pool_totalpages();
 
 	node = *rnode;
 	node.sysctl_data = 

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.194 src/sys/uvm/uvm_page.c:1.195
--- src/sys/uvm/uvm_page.c:1.194	Sat Oct 28 00:37:13 2017
+++ 

CVS commit: src

2017-12-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Dec  2 08:15:43 UTC 2017

Modified Files:
src/sys/kern: subr_pool.c
src/sys/sys: pool.h
src/sys/uvm: uvm_extern.h uvm_meter.c uvm_page.c uvm_stat.c
src/usr.bin/vmstat: vmstat.c

Log Message:
add two new members to uvmexp_sysctl{}:  bootpages and poolpages.
bootpages is set to the pages allocated via uvm_pageboot_alloc().
poolpages is calculated from the list of pools nr_pages members.

this brings us closer to having a valid total of pages known by
the system, vs actual pages originally managed.

XXX: poolpages needs some handling for PR_RECURSIVE pools still.


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/sys/kern/subr_pool.c
cvs rdiff -u -r1.80 -r1.81 src/sys/sys/pool.h
cvs rdiff -u -r1.206 -r1.207 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.66 -r1.67 src/sys/uvm/uvm_meter.c
cvs rdiff -u -r1.194 -r1.195 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.38 -r1.39 src/sys/uvm/uvm_stat.c
cvs rdiff -u -r1.220 -r1.221 src/usr.bin/vmstat/vmstat.c

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