CVS commit: [netbsd-9] src/doc

2020-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan  8 07:58:48 UTC 2020

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #608.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.155 -r1.1.2.156 src/doc/CHANGES-9.0

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-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.155 src/doc/CHANGES-9.0:1.1.2.156
--- src/doc/CHANGES-9.0:1.1.2.155	Tue Jan  7 11:56:10 2020
+++ src/doc/CHANGES-9.0	Wed Jan  8 07:58:48 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.155 2020/01/07 11:56:10 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.156 2020/01/08 07:58:48 msaitoh Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -7630,4 +7630,8 @@ sys/kern/kern_ksyms.c1.88
 	/dev/ksyms has been opened.
 	[pgoyette, ticket #609]
 
+distrib/notes/Makefile.inc			1.53
 
+	PR install/54836: Fix broken conditional, passing the wrong set name
+	suffix to groff.
+	[martin, ticket #608]



CVS commit: [netbsd-9] src/doc

2020-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan  8 07:58:48 UTC 2020

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #608.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.155 -r1.1.2.156 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/distrib/notes

2020-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan  8 07:53:30 UTC 2020

Modified Files:
src/distrib/notes [netbsd-9]: Makefile.inc

Log Message:
Pull up following revision(s) (requested by martin in ticket #608):
distrib/notes/Makefile.inc: revision 1.53
PR install/54836: fix broken conditional, passing the wrong set name suffix
to groff.


To generate a diff of this commit:
cvs rdiff -u -r1.43.18.5 -r1.43.18.6 src/distrib/notes/Makefile.inc

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



CVS commit: [netbsd-9] src/distrib/notes

2020-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan  8 07:53:30 UTC 2020

Modified Files:
src/distrib/notes [netbsd-9]: Makefile.inc

Log Message:
Pull up following revision(s) (requested by martin in ticket #608):
distrib/notes/Makefile.inc: revision 1.53
PR install/54836: fix broken conditional, passing the wrong set name suffix
to groff.


To generate a diff of this commit:
cvs rdiff -u -r1.43.18.5 -r1.43.18.6 src/distrib/notes/Makefile.inc

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

Modified files:

Index: src/distrib/notes/Makefile.inc
diff -u src/distrib/notes/Makefile.inc:1.43.18.5 src/distrib/notes/Makefile.inc:1.43.18.6
--- src/distrib/notes/Makefile.inc:1.43.18.5	Mon Dec  9 13:00:22 2019
+++ src/distrib/notes/Makefile.inc	Wed Jan  8 07:53:30 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.43.18.5 2019/12/09 13:00:22 martin Exp $
+#	$NetBSD: Makefile.inc,v 1.43.18.6 2020/01/08 07:53:30 msaitoh Exp $
 #
 
 # Ross Harvey 
@@ -29,7 +29,7 @@ whatis: .OPTIONAL
 
 PRESET=	${GFLAGS} -U -dM=${M} -dV=${DISTRIBVER} -d.CURDIR=${.CURDIR} -r${M}=1
 PRESET+=	-rmajor=${DISTRIBVER:C/\..*$//}
-.if ${USE_XZ_SETS}
+.if ${USE_XZ_SETS:Uno} == "yes"
 PRESET+=	-dsetsuffix=tar.xz
 .else
 PRESET+=	-dsetsuffix=tgz



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

2020-01-07 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Jan  8 05:41:07 UTC 2020

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

Log Message:
fix panic when modload.

>panic: kernel diagnostic assertion "!pmap_extract(pmap_kernel(), loopva, 
>NULL)" failed: file "../../../../uvm/uvm_km.c", line 674 
>loopva=0xffc00100'

The space allocated by bootpage_alloc() is only used as a physical page
for pagetable pages, so there is no need to map it with KVA.
And kernend_extra should not have consumed any KVA space.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/aarch64/aarch64/locore.S

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.36 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.37
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.36	Mon Dec 30 15:54:55 2019
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Wed Jan  8 05:41:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.36 2019/12/30 15:54:55 skrll Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.37 2020/01/08 05:41:07 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.36 2019/12/30 15:54:55 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.37 2020/01/08 05:41:07 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -99,7 +99,7 @@ vaddr_t physical_end;
 /* filled in before cleaning bss. keep in .data */
 u_long kern_vtopdiff __attribute__((__section__(".data")));
 
-long kernend_extra;	/* extra memory allocated from round_page(_end[]) */
+long kernend_extra;	/* extra physicalmemory allocated from round_page(_end[]) */
 
 /* dump configuration */
 int	cpu_dump(void);
@@ -227,7 +227,7 @@ cpu_kernel_vm_init(uint64_t memory_start
 	pmapboot_protect(L2_TRUNC_BLOCK(kernstart),
 	L2_TRUNC_BLOCK(data_start), VM_PROT_WRITE);
 	pmapboot_protect(L2_ROUND_BLOCK(rodata_start),
-	L2_ROUND_BLOCK(kernend + kernend_extra), VM_PROT_EXECUTE);
+	L2_ROUND_BLOCK(kernend), VM_PROT_EXECUTE);
 
 	aarch64_tlbi_all();
 
@@ -287,7 +287,7 @@ initarm_common(vaddr_t kvm_base, vsize_t
 	kernstart = trunc_page((vaddr_t)__kernel_text);
 	kernend = round_page((vaddr_t)_end);
 	kernstart_l2 = L2_TRUNC_BLOCK(kernstart);
-	kernend_l2 = L2_ROUND_BLOCK(kernend + kernend_extra);
+	kernend_l2 = L2_ROUND_BLOCK(kernend);
 	kernelvmstart = kernend_l2;
 
 #ifdef MODULAR
@@ -341,14 +341,14 @@ initarm_common(vaddr_t kvm_base, vsize_t
 	"physical_start= 0x%016lx\n"
 	"kernel_start_phys = 0x%016lx\n"
 	"kernel_end_phys   = 0x%016lx\n"
+	"pagetables_start_phys = 0x%016lx\n"
+	"pagetables_end_phys   = 0x%016lx\n"
 	"msgbuf= 0x%016lx\n"
 	"physical_end  = 0x%016lx\n"
 	"VM_MIN_KERNEL_ADDRESS = 0x%016lx\n"
 	"kernel_start_l2   = 0x%016lx\n"
 	"kernel_start  = 0x%016lx\n"
 	"kernel_end= 0x%016lx\n"
-	"pagetables= 0x%016lx\n"
-	"pagetables_end= 0x%016lx\n"
 	"kernel_end_l2 = 0x%016lx\n"
 #ifdef MODULAR
 	"module_start  = 0x%016lx\n"
@@ -362,14 +362,14 @@ initarm_common(vaddr_t kvm_base, vsize_t
 	physical_start,
 	kernstart_phys,
 	kernend_phys,
+	round_page(kernend_phys),
+	round_page(kernend_phys) + kernend_extra,
 	msgbufaddr,
 	physical_end,
 	VM_MIN_KERNEL_ADDRESS,
 	kernstart_l2,
 	kernstart,
 	kernend,
-	round_page(kernend),
-	round_page(kernend) + kernend_extra,
 	kernend_l2,
 #ifdef MODULAR
 	module_start,
@@ -553,7 +553,7 @@ mm_md_kernacc(void *ptr, vm_prot_t prot,
 #define IN_RANGE(addr,sta,end)	(((sta) <= (addr)) && ((addr) < (end)))
 
 	*handled = false;
-	if (IN_RANGE(v, kernstart, kernend + kernend_extra)) {
+	if (IN_RANGE(v, kernstart, kernend)) {
 		*handled = true;
 		if ((v < data_start) && (prot & VM_PROT_WRITE))
 			return EFAULT;

Index: src/sys/arch/aarch64/aarch64/locore.S
diff -u src/sys/arch/aarch64/aarch64/locore.S:1.49 src/sys/arch/aarch64/aarch64/locore.S:1.50
--- src/sys/arch/aarch64/aarch64/locore.S:1.49	Sat Dec 28 17:19:43 2019
+++ src/sys/arch/aarch64/aarch64/locore.S	Wed Jan  8 05:41:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.49 2019/12/28 17:19:43 jmcneill Exp $	*/
+/*	$NetBSD: locore.S,v 1.50 2020/01/08 05:41:07 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -38,7 +38,7 @@
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: locore.S,v 1.49 2019/12/28 17:19:43 jmcneill Exp $")
+RCSID("$NetBSD: locore.S,v 1.50 2020/01/08 05:41:07 ryo Exp $")
 
 #ifdef AARCH64_DEVICE_MEM_STRONGLY_ORDERED
 #define	MAIR_DEVICE_MEM		MAIR_DEVICE_nGnRnE
@@ -848,7 +848,6 @@ 

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

2020-01-07 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Jan  8 05:41:07 UTC 2020

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

Log Message:
fix panic when modload.

>panic: kernel diagnostic assertion "!pmap_extract(pmap_kernel(), loopva, 
>NULL)" failed: file "../../../../uvm/uvm_km.c", line 674 
>loopva=0xffc00100'

The space allocated by bootpage_alloc() is only used as a physical page
for pagetable pages, so there is no need to map it with KVA.
And kernend_extra should not have consumed any KVA space.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/aarch64/aarch64/locore.S

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



CVS commit: src/sys/dev/ic

2020-01-07 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Wed Jan  8 04:53:38 UTC 2020

Modified Files:
src/sys/dev/ic: rndisreg.h

Log Message:
Added some RNDIS status definitions from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ic/rndisreg.h

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



CVS commit: src/sys/dev/ic

2020-01-07 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Wed Jan  8 04:53:38 UTC 2020

Modified Files:
src/sys/dev/ic: rndisreg.h

Log Message:
Added some RNDIS status definitions from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ic/rndisreg.h

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

Modified files:

Index: src/sys/dev/ic/rndisreg.h
diff -u src/sys/dev/ic/rndisreg.h:1.4 src/sys/dev/ic/rndisreg.h:1.5
--- src/sys/dev/ic/rndisreg.h:1.4	Fri Dec  6 12:41:17 2019
+++ src/sys/dev/ic/rndisreg.h	Wed Jan  8 04:53:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rndisreg.h,v 1.4 2019/12/06 12:41:17 nonaka Exp $ */
+/*	$NetBSD: rndisreg.h,v 1.5 2020/01/08 04:53:38 nonaka Exp $ */
 /*	NetBSD: if_urndisreg.h,v 1.4 2018/11/09 21:57:09 maya Exp */
 /*	$OpenBSD: if_urndisreg.h,v 1.14 2010/07/08 18:22:01 ckuethe Exp $ */
 
@@ -32,6 +32,8 @@
 #define RNDIS_STATUS_PENDING		0x0103L
 #define RNDIS_STATUS_MEDIA_CONNECT	0x4001000BL
 #define RNDIS_STATUS_MEDIA_DISCONNECT	0x4001000CL
+#define RNDIS_STATUS_LINK_SPEED_CHANGE	0x40010013L
+#define RNDIS_STATUS_NETWORK_CHANGE	0x40010018L
 #define RNDIS_STATUS_OFFLOAD_CURRENT_CONFIG	0x40020006
 #define RNDIS_STATUS_BUFFER_OVERFLOW	0x8005L
 #define RNDIS_STATUS_FAILURE		0xC001L



CVS commit: src/share/mk

2020-01-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan  8 04:15:46 UTC 2020

Modified Files:
src/share/mk: sys.mk

Log Message:
tweak the DBG rule that -fomit-frame-pointer for aarch64 when profiling
(because the compiler complains), to use a match with the compile flags
and *pg*, instead of using a match to a target suffix (which is NetBSD
build-specific). Pointed out by phone@.


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/share/mk/sys.mk

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

Modified files:

Index: src/share/mk/sys.mk
diff -u src/share/mk/sys.mk:1.140 src/share/mk/sys.mk:1.141
--- src/share/mk/sys.mk:1.140	Thu Dec 19 23:04:25 2019
+++ src/share/mk/sys.mk	Tue Jan  7 23:15:45 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: sys.mk,v 1.140 2019/12/20 04:04:25 christos Exp $
+#	$NetBSD: sys.mk,v 1.141 2020/01/08 04:15:45 christos Exp $
 #	@(#)sys.mk	8.2 (Berkeley) 3/21/94
 #
 # This file contains the basic rules for make(1) and is read first
@@ -34,7 +34,7 @@ DBG?=	-O2 -fno-reorder-blocks
 .elif ${MACHINE_ARCH} == "coldfire"
 DBG?=	-O1
 .elif !empty(MACHINE_ARCH:Maarch64*)
-DBG?=	-O2 ${"${.TARGET:M*.po}" == "":? -fomit-frame-pointer:}
+DBG?=	-O2 ${!empty(COMPILE.c:M*-pg*) || !empty(COMPILE.cc:M*-pg*) :? -fomit-frame-pointer:}
 .else
 DBG?=	-O2
 .endif



CVS commit: src/share/mk

2020-01-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan  8 04:15:46 UTC 2020

Modified Files:
src/share/mk: sys.mk

Log Message:
tweak the DBG rule that -fomit-frame-pointer for aarch64 when profiling
(because the compiler complains), to use a match with the compile flags
and *pg*, instead of using a match to a target suffix (which is NetBSD
build-specific). Pointed out by phone@.


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/share/mk/sys.mk

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



CVS commit: src/sys/dev/pci

2020-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan  8 03:51:37 UTC 2020

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

Log Message:
- Fix SFF_SFP_ETH_FLAGS_100FX. It's not 0x10 but 0x20.
- Define SFF_SFP_ETH_FLAGS_100LX with 0x10.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/pci/if_wmreg.h

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

Modified files:

Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.118 src/sys/dev/pci/if_wmreg.h:1.119
--- src/sys/dev/pci/if_wmreg.h:1.118	Wed Dec 11 10:28:19 2019
+++ src/sys/dev/pci/if_wmreg.h	Wed Jan  8 03:51:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wmreg.h,v 1.118 2019/12/11 10:28:19 msaitoh Exp $	*/
+/*	$NetBSD: if_wmreg.h,v 1.119 2020/01/08 03:51:37 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -1620,7 +1620,8 @@ struct livengood_tcpip_ctxdesc {
 #define SFF_SFP_ETH_FLAGS_1000LX	0x02
 #define SFF_SFP_ETH_FLAGS_1000CX	0x04
 #define SFF_SFP_ETH_FLAGS_1000T		0x08
-#define SFF_SFP_ETH_FLAGS_100FX		0x10
+#define SFF_SFP_ETH_FLAGS_100LX		0x10
+#define SFF_SFP_ETH_FLAGS_100FX		0x20
 
 /* I21[01] PHY related definitions */
 #define GS40G_PAGE_SELECT	0x16



CVS commit: src/sys/dev/pci

2020-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Jan  8 03:51:37 UTC 2020

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

Log Message:
- Fix SFF_SFP_ETH_FLAGS_100FX. It's not 0x10 but 0x20.
- Define SFF_SFP_ETH_FLAGS_100LX with 0x10.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/pci/if_wmreg.h

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



CVS commit: src/usr.bin/make/unit-tests

2020-01-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jan  7 22:42:14 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: modorder.mk

Log Message:
usr.bin/make: document probabilities for random test failures

Side node: this test will never fail between 2024-04-15 and 2024-07-06.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/modorder.mk

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/make/unit-tests/modorder.mk
diff -u src/usr.bin/make/unit-tests/modorder.mk:1.1 src/usr.bin/make/unit-tests/modorder.mk:1.2
--- src/usr.bin/make/unit-tests/modorder.mk:1.1	Thu Aug 21 13:44:51 2014
+++ src/usr.bin/make/unit-tests/modorder.mk	Tue Jan  7 22:42:14 2020
@@ -1,4 +1,4 @@
-# $NetBSD: modorder.mk,v 1.1 2014/08/21 13:44:51 apb Exp $
+# $NetBSD: modorder.mk,v 1.2 2020/01/07 22:42:14 rillig Exp $
 
 LIST=		one two three four five six seven eight nine ten
 LISTX=		${LIST:Ox}
@@ -12,8 +12,9 @@ all:
 	@echo "LIST:O= ${LIST:O}"
 	# Note that 1 in every 10! trials two independently generated
 	# randomized orderings will be the same.  The test framework doesn't
-	# support checking probabilistic output, so we accept that the test
-	# will incorrectly fail with probability 2.8E-7.
+	# support checking probabilistic output, so we accept that each of the
+	# 3 :Ox tests will incorrectly fail with probability 2.756E-7, which
+	# lets the whole test fail once in 1.209.600 runs, on average.
 	@echo "LIST:Ox   = `test '${LIST:Ox}' != '${LIST:Ox}' ${TEST_RESULT}`"
 	@echo "LIST:O:Ox = `test '${LIST:O:Ox}' != '${LIST:O:Ox}' ${TEST_RESULT}`"
 	@echo "LISTX = `test '${LISTX}' != '${LISTX}' ${TEST_RESULT}`"



CVS commit: src/usr.bin/make/unit-tests

2020-01-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jan  7 22:42:14 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: modorder.mk

Log Message:
usr.bin/make: document probabilities for random test failures

Side node: this test will never fail between 2024-04-15 and 2024-07-06.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/modorder.mk

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



CVS commit: src/usr.bin/make

2020-01-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jan  7 21:24:16 UTC 2020

Modified Files:
src/usr.bin/make: util.c

Log Message:
usr.bin/make: remove dead code

The preprocessor conditions contradicted each other: __hpux__ or __hpux
would need to be defined, and at the same time none of them would need to
be defined.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/make/util.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/make

2020-01-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jan  7 21:24:16 UTC 2020

Modified Files:
src/usr.bin/make: util.c

Log Message:
usr.bin/make: remove dead code

The preprocessor conditions contradicted each other: __hpux__ or __hpux
would need to be defined, and at the same time none of them would need to
be defined.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/make/util.c

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

Modified files:

Index: src/usr.bin/make/util.c
diff -u src/usr.bin/make/util.c:1.54 src/usr.bin/make/util.c:1.55
--- src/usr.bin/make/util.c:1.54	Tue Nov 26 13:44:41 2013
+++ src/usr.bin/make/util.c	Tue Jan  7 21:24:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.54 2013/11/26 13:44:41 joerg Exp $	*/
+/*	$NetBSD: util.c,v 1.55 2020/01/07 21:24:16 rillig Exp $	*/
 
 /*
  * Missing stuff from OS's
@@ -8,11 +8,11 @@
 #endif
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: util.c,v 1.54 2013/11/26 13:44:41 joerg Exp $";
+static char rcsid[] = "$NetBSD: util.c,v 1.55 2020/01/07 21:24:16 rillig Exp $";
 #else
 #include 
 #ifndef lint
-__RCSID("$NetBSD: util.c,v 1.54 2013/11/26 13:44:41 joerg Exp $");
+__RCSID("$NetBSD: util.c,v 1.55 2020/01/07 21:24:16 rillig Exp $");
 #endif
 #endif
 
@@ -229,32 +229,6 @@ killpg(int pid, int sig)
 return kill(-pid, sig);
 }
 
-#if !defined(__hpux__) && !defined(__hpux)
-void
-srandom(long seed)
-{
-srand48(seed);
-}
-
-long
-random(void)
-{
-return lrand48();
-}
-#endif
-
-#if !defined(__hpux__) && !defined(__hpux)
-int
-utimes(char *file, struct timeval tvp[2])
-{
-struct utimbuf t;
-
-t.actime  = tvp[0].tv_sec;
-t.modtime = tvp[1].tv_sec;
-return(utime(file, ));
-}
-#endif
-
 #if !defined(BSD) && !defined(d_fileno)
 # define d_fileno d_ino
 #endif



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

2020-01-07 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Jan  7 21:18:24 UTC 2020

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

Log Message:
pmap_ept_enter(): PTE -> EPT in two places.


To generate a diff of this commit:
cvs rdiff -u -r1.353 -r1.354 src/sys/arch/x86/x86/pmap.c

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

Modified files:

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.353 src/sys/arch/x86/x86/pmap.c:1.354
--- src/sys/arch/x86/x86/pmap.c:1.353	Sat Jan  4 22:49:20 2020
+++ src/sys/arch/x86/x86/pmap.c	Tue Jan  7 21:18:24 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.353 2020/01/04 22:49:20 ad Exp $	*/
+/*	$NetBSD: pmap.c,v 1.354 2020/01/07 21:18:24 ad Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017, 2019 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.353 2020/01/04 22:49:20 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.354 2020/01/07 21:18:24 ad Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -5281,7 +5281,7 @@ pmap_ept_enter(struct pmap *pmap, vaddr_
 	 */
 	if (((opte ^ npte) & (PTE_FRAME | EPT_R)) == 0) {
 		KASSERT(((opte ^ npte) & EPT_PVLIST) == 0);
-		if ((opte & PTE_PVLIST) != 0 && pve != NULL) {
+		if ((opte & EPT_PVLIST) != 0 && pve != NULL) {
 			KASSERT(pve->pve_pte.pte_ptp == ptp);
 			KASSERT(pve->pve_pte.pte_va == va);
 		}
@@ -5304,7 +5304,7 @@ pmap_ept_enter(struct pmap *pmap, vaddr_
 		}
 
 		(void)pmap_remove_pv(pmap, old_pp, ptp, va, pve);
-		old_pp->pp_attrs |= pmap_pte_to_pp_attrs(opte);
+		old_pp->pp_attrs |= pmap_ept_to_pp_attrs(opte);
 	}
 
 	/*



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

2020-01-07 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Jan  7 21:18:24 UTC 2020

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

Log Message:
pmap_ept_enter(): PTE -> EPT in two places.


To generate a diff of this commit:
cvs rdiff -u -r1.353 -r1.354 src/sys/arch/x86/x86/pmap.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/make/unit-tests

2020-01-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jan  7 20:50:12 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: escape.mk

Log Message:
usr.bin/make: fix typos in comment


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/escape.mk

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/make/unit-tests/escape.mk
diff -u src/usr.bin/make/unit-tests/escape.mk:1.10 src/usr.bin/make/unit-tests/escape.mk:1.11
--- src/usr.bin/make/unit-tests/escape.mk:1.10	Tue Sep  9 10:22:27 2014
+++ src/usr.bin/make/unit-tests/escape.mk	Tue Jan  7 20:50:12 2020
@@ -1,4 +1,4 @@
-# $Id: escape.mk,v 1.10 2014/09/09 10:22:27 apb Exp $
+# $Id: escape.mk,v 1.11 2020/01/07 20:50:12 rillig Exp $
 #
 # Test backslash escaping.
 
@@ -35,8 +35,8 @@
 # Also, our practice is that an even number of backslashes before a
 # newline in a variable assignment simply stores the backslashes as part
 # of the value, and treats the newline as though it was not escaped.
-# Similarly, ann even number of backslashes before a newline in a
-# command simply uses the backslashes as part of the command test, but
+# Similarly, an even number of backslashes before a newline in a
+# command simply uses the backslashes as part of the command, but
 # does not escape the newline.  This is compatible with GNU make.
 
 all: .PHONY



CVS commit: src/usr.bin/make/unit-tests

2020-01-07 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Tue Jan  7 20:50:12 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: escape.mk

Log Message:
usr.bin/make: fix typos in comment


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/escape.mk

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



Re: [x86 pmap changes] CVS commit: src/sys/arch

2020-01-07 Thread Andrew Doran
On Tue, Jan 07, 2020 at 09:39:22AM +0100, Maxime Villard wrote:

> You can test with this on an Intel CPU:
> 
>   # modload nvmm
>   # /usr/tests/lib/libnvmm/./h_mem_assist
> 
> This currently gives random crashes.

I'll dig into it.  There were also reports of NVMM failures on the lists but
unrelated to this set of changes.

Andrew


Re: [x86 pmap changes] CVS commit: src/sys/arch

2020-01-07 Thread Andrew Doran
On Tue, Jan 07, 2020 at 09:50:42AM +0100, Maxime Villard wrote:

> Also unrelated remark:
> 
> + kmutex_t pm_lock/* locks for pm_objs */
> + __aligned(64);  /* give lock own cache line */
> 
> x86 CPUs will soon have 128-byte cache lines, and to ease the upgrade,
> it is better to use COHERENCY_UNIT rather than hardcoded values.

I totally agree.  However in this instance it looked like it could leave me
in dependency hell.  I don't have much time left to get my changes in and
tested, so left it to come back to some other time.

Andrew


CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2020-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jan  7 13:51:38 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_atombios_dp.c

Log Message:
 Don't call memcpy() when the length is 0 (and the source pointer is NULL)
in radeon_dp_aux_transfer_atom() to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c

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



CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2020-01-07 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jan  7 13:51:38 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_atombios_dp.c

Log Message:
 Don't call memcpy() when the length is 0 (and the source pointer is NULL)
in radeon_dp_aux_transfer_atom() to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c:1.1 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c:1.2
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c:1.1	Mon Aug 27 14:38:20 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_atombios_dp.c	Tue Jan  7 13:51:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_atombios_dp.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $	*/
+/*	$NetBSD: radeon_atombios_dp.c,v 1.2 2020/01/07 13:51:38 msaitoh Exp $	*/
 
 /*
  * Copyright 2007-8 Advanced Micro Devices, Inc.
@@ -27,7 +27,7 @@
  *  Jerome Glisse
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_atombios_dp.c,v 1.1 2018/08/27 14:38:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_atombios_dp.c,v 1.2 2020/01/07 13:51:38 msaitoh Exp $");
 
 #include 
 #include 
@@ -196,9 +196,10 @@ radeon_dp_aux_transfer_atom(struct drm_d
 		tx_size = HEADER_SIZE + msg->size;
 		if (msg->size == 0)
 			tx_buf[3] |= BARE_ADDRESS_SIZE << 4;
-		else
+		else {
 			tx_buf[3] |= tx_size << 4;
-		memcpy(tx_buf + HEADER_SIZE, msg->buffer, msg->size);
+			memcpy(tx_buf + HEADER_SIZE, msg->buffer, msg->size);
+		}
 		ret = radeon_process_aux_ch(chan,
 	tx_buf, tx_size, NULL, 0, delay, );
 		if (ret >= 0)



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

2020-01-07 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Jan  7 13:48:01 UTC 2020

Modified Files:
src/sys/arch/xen/x86: xen_pmap.c

Log Message:
Correction to previous.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/xen/x86/xen_pmap.c

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

Modified files:

Index: src/sys/arch/xen/x86/xen_pmap.c
diff -u src/sys/arch/xen/x86/xen_pmap.c:1.36 src/sys/arch/xen/x86/xen_pmap.c:1.37
--- src/sys/arch/xen/x86/xen_pmap.c:1.36	Tue Jan  7 13:20:18 2020
+++ src/sys/arch/xen/x86/xen_pmap.c	Tue Jan  7 13:48:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_pmap.c,v 1.36 2020/01/07 13:20:18 ad Exp $	*/
+/*	$NetBSD: xen_pmap.c,v 1.37 2020/01/07 13:48:01 ad Exp $	*/
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -101,7 +101,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.36 2020/01/07 13:20:18 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.37 2020/01/07 13:48:01 ad Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -220,7 +220,9 @@ pmap_extract_ma(struct pmap *pmap, vaddr
 	pmap_map_ptes(pmap, , , );
 	if (!pmap_pdes_valid(va, pdes, , )) {
 		pmap_unmap_ptes(pmap, pmap2);
-		mutex_exit(>pm_lock);
+		if (pmap != pmap_kernel()) {
+			mutex_exit(>pm_lock);
+		}
 		return false;
 	}
 



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

2020-01-07 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Jan  7 13:48:01 UTC 2020

Modified Files:
src/sys/arch/xen/x86: xen_pmap.c

Log Message:
Correction to previous.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/xen/x86/xen_pmap.c

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



CVS commit: src/sys

2020-01-07 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Jan  7 13:44:23 UTC 2020

Modified Files:
src/sys/arch/hppa/include: mutex.h
src/sys/kern: kern_mutex.c

Log Message:
hppa has custom adaptive mutexes.  Allow it to build again while not
reintroducing the main read of mtx_owner that I wanted to eliminate.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hppa/include/mutex.h
cvs rdiff -u -r1.87 -r1.88 src/sys/kern/kern_mutex.c

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



CVS commit: src/sys

2020-01-07 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Jan  7 13:44:23 UTC 2020

Modified Files:
src/sys/arch/hppa/include: mutex.h
src/sys/kern: kern_mutex.c

Log Message:
hppa has custom adaptive mutexes.  Allow it to build again while not
reintroducing the main read of mtx_owner that I wanted to eliminate.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hppa/include/mutex.h
cvs rdiff -u -r1.87 -r1.88 src/sys/kern/kern_mutex.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/hppa/include/mutex.h
diff -u src/sys/arch/hppa/include/mutex.h:1.14 src/sys/arch/hppa/include/mutex.h:1.15
--- src/sys/arch/hppa/include/mutex.h:1.14	Fri Nov 29 20:05:29 2019
+++ src/sys/arch/hppa/include/mutex.h	Tue Jan  7 13:44:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mutex.h,v 1.14 2019/11/29 20:05:29 riastradh Exp $	*/
+/*	$NetBSD: mutex.h,v 1.15 2020/01/07 13:44:23 ad Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -141,15 +141,15 @@ MUTEX_DEBUG_P(const volatile struct kmut
 }
 
 static inline int
-MUTEX_SPIN_P(const volatile struct kmutex *mtx)
+MUTEX_SPIN_P(const uintptr_t owner)
 {
-	return mtx->mtx_owner == MUTEX_SPIN_FLAG;
+	return owner == MUTEX_SPIN_FLAG;
 }
 
 static inline int
-MUTEX_ADAPTIVE_P(const volatile struct kmutex *mtx)
+MUTEX_ADAPTIVE_P(const uintptr_t owner)
 {
-	return mtx->mtx_owner != MUTEX_SPIN_FLAG;
+	return owner != MUTEX_SPIN_FLAG;
 }
 
 /* Acquire an adaptive mutex */

Index: src/sys/kern/kern_mutex.c
diff -u src/sys/kern/kern_mutex.c:1.87 src/sys/kern/kern_mutex.c:1.88
--- src/sys/kern/kern_mutex.c:1.87	Mon Jan  6 11:12:55 2020
+++ src/sys/kern/kern_mutex.c	Tue Jan  7 13:44:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_mutex.c,v 1.87 2020/01/06 11:12:55 ad Exp $	*/
+/*	$NetBSD: kern_mutex.c,v 1.88 2020/01/07 13:44:23 ad Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 #define	__MUTEX_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.87 2020/01/06 11:12:55 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.88 2020/01/07 13:44:23 ad Exp $");
 
 #include 
 #include 
@@ -186,8 +186,8 @@ do {	\
 
 #define	MUTEX_OWNER(owner)		\
 	(owner & MUTEX_THREAD)
-#define	MUTEX_HAS_WAITERS(owner)	\
-	((owner & MUTEX_BIT_WAITERS) != 0)
+#define	MUTEX_HAS_WAITERS(mtx)		\
+	(((int)(mtx)->mtx_owner & MUTEX_BIT_WAITERS) != 0)
 
 #define	MUTEX_INITIALIZE_ADAPTIVE(mtx, dodebug)\
 do {	\
@@ -313,7 +313,7 @@ mutex_dump(const volatile void *cookie, 
 	uintptr_t owner = mtx->mtx_owner;
 
 	pr("owner field  : %#018lx wait/spin: %16d/%d\n",
-	(long)MUTEX_OWNER(owner), MUTEX_HAS_WAITERS(owner),
+	(long)MUTEX_OWNER(owner), MUTEX_HAS_WAITERS(mtx),
 	MUTEX_SPIN_P(owner));
 }
 
@@ -385,7 +385,7 @@ mutex_destroy(kmutex_t *mtx)
 
 	if (MUTEX_ADAPTIVE_P(owner)) {
 		MUTEX_ASSERT(mtx, !MUTEX_OWNED(owner) &&
-		!MUTEX_HAS_WAITERS(owner));
+		!MUTEX_HAS_WAITERS(mtx));
 	} else {
 		MUTEX_ASSERT(mtx, !MUTEX_SPINBIT_LOCKED_P(mtx));
 	}
@@ -677,9 +677,9 @@ mutex_vector_enter(kmutex_t *mtx)
 			continue;
 		}
 		membar_consumer();
-		owner = mtx->mtx_owner;
-		if (!MUTEX_HAS_WAITERS(owner)) {
+		if (!MUTEX_HAS_WAITERS(mtx)) {
 			turnstile_exit(mtx);
+			owner = mtx->mtx_owner;
 			continue;
 		}
 #endif	/* MULTIPROCESSOR */
@@ -757,7 +757,7 @@ mutex_vector_exit(kmutex_t *mtx)
 	 */
 	{
 		int s = splhigh();
-		if (!MUTEX_HAS_WAITERS(mtx->mtx_owner)) {
+		if (!MUTEX_HAS_WAITERS(mtx)) {
 			MUTEX_RELEASE(mtx);
 			splx(s);
 			return;



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

2020-01-07 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Jan  7 13:20:18 UTC 2020

Modified Files:
src/sys/arch/xen/x86: xen_pmap.c

Log Message:
pmap_extract_ma(): don't need to take pm_lock for pmap_kernel().


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/xen/x86/xen_pmap.c

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

Modified files:

Index: src/sys/arch/xen/x86/xen_pmap.c
diff -u src/sys/arch/xen/x86/xen_pmap.c:1.35 src/sys/arch/xen/x86/xen_pmap.c:1.36
--- src/sys/arch/xen/x86/xen_pmap.c:1.35	Sat Jan  4 22:49:20 2020
+++ src/sys/arch/xen/x86/xen_pmap.c	Tue Jan  7 13:20:18 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_pmap.c,v 1.35 2020/01/04 22:49:20 ad Exp $	*/
+/*	$NetBSD: xen_pmap.c,v 1.36 2020/01/07 13:20:18 ad Exp $	*/
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -101,7 +101,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.35 2020/01/04 22:49:20 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_pmap.c,v 1.36 2020/01/07 13:20:18 ad Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -214,7 +214,9 @@ pmap_extract_ma(struct pmap *pmap, vaddr
 	struct pmap *pmap2;
 	int lvl;
 
-	mutex_enter(>pm_lock);
+	if (pmap != pmap_kernel()) {
+		mutex_enter(>pm_lock);
+	}
 	pmap_map_ptes(pmap, , , );
 	if (!pmap_pdes_valid(va, pdes, , )) {
 		pmap_unmap_ptes(pmap, pmap2);
@@ -225,7 +227,9 @@ pmap_extract_ma(struct pmap *pmap, vaddr
 	KASSERT(lvl == 1);
 	pte = ptes[pl1_i(va)];
 	pmap_unmap_ptes(pmap, pmap2);
-	mutex_exit(>pm_lock);
+	if (pmap != pmap_kernel()) {
+		mutex_exit(>pm_lock);
+	}
 
 	if (__predict_true((pte & PTE_P) != 0)) {
 		if (pap != NULL)



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

2020-01-07 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Tue Jan  7 13:20:18 UTC 2020

Modified Files:
src/sys/arch/xen/x86: xen_pmap.c

Log Message:
pmap_extract_ma(): don't need to take pm_lock for pmap_kernel().


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/xen/x86/xen_pmap.c

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



CVS commit: [netbsd-8] src/doc

2020-01-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan  7 12:01:33 UTC 2020

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

Log Message:
Ticket #1482


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.87 -r1.1.2.88 src/doc/CHANGES-8.2

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



CVS commit: [netbsd-8] src/doc

2020-01-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan  7 12:01:33 UTC 2020

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

Log Message:
Ticket #1482


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.87 -r1.1.2.88 src/doc/CHANGES-8.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-8.2
diff -u src/doc/CHANGES-8.2:1.1.2.87 src/doc/CHANGES-8.2:1.1.2.88
--- src/doc/CHANGES-8.2:1.1.2.87	Sun Jan  5 15:12:40 2020
+++ src/doc/CHANGES-8.2	Tue Jan  7 12:01:32 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.87 2020/01/05 15:12:40 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.88 2020/01/07 12:01:32 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -1845,3 +1845,9 @@ sys/conf/copyright1.18
 	Welcome to 2020.
 	[mlelstv, ticket #1481]
 
+sys/kern/kern_ksyms.c1.88 (patch)
+
+	Better deal with symbols removed by unloaded modules when
+	/dev/ksyms has been opened.
+	[pgoyette, ticket #1482]
+



CVS commit: [netbsd-8] src/sys/kern

2020-01-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan  7 11:59:49 UTC 2020

Modified Files:
src/sys/kern [netbsd-8]: kern_ksyms.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1482):

sys/kern/kern_ksyms.c: revision 1.88 (patch)

When reading from /dev/ksyms we need to skip over entries that have
been marked as sd_gone.  Otherwise we might try to uiomove() data from
memory that has been unmapped, resulting in EFAULT.

XXX This (along with other pre-existing checks st->sd_gone) is still
racy, but it's an improvement over current code.  Ideally we would
make a complete copy of the symbol table when we open /dev/ksyms so
we could ignore any changes that occur.

ad@ says "good enough for now"

XXX Pullup to -9 and -8


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.84.10.1 src/sys/kern/kern_ksyms.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_ksyms.c
diff -u src/sys/kern/kern_ksyms.c:1.84 src/sys/kern/kern_ksyms.c:1.84.10.1
--- src/sys/kern/kern_ksyms.c:1.84	Thu Jul  7 06:55:43 2016
+++ src/sys/kern/kern_ksyms.c	Tue Jan  7 11:59:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_ksyms.c,v 1.84 2016/07/07 06:55:43 msaitoh Exp $	*/
+/*	$NetBSD: kern_ksyms.c,v 1.84.10.1 2020/01/07 11:59:48 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.84 2016/07/07 06:55:43 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.84.10.1 2020/01/07 11:59:48 martin Exp $");
 
 #if defined(_KERNEL) && defined(_KERNEL_OPT)
 #include "opt_copy_symtab.h"
@@ -754,9 +754,9 @@ ksyms_modunload(const char *name)
 		if (strcmp(name, st->sd_name) != 0)
 			continue;
 		st->sd_gone = true;
+		ksyms_sizes_calc();
 		if (!ksyms_isopen) {
 			TAILQ_REMOVE(_symtabs, st, sd_queue);
-			ksyms_sizes_calc();
 			kmem_free(st, sizeof(*st));
 		}
 		break;
@@ -843,6 +843,8 @@ ksyms_sizes_calc(void)
 
 	ksyms_symsz = ksyms_strsz = 0;
 	TAILQ_FOREACH(st, _symtabs, sd_queue) {
+		if (__predict_false(st->sd_gone))
+			continue;
 		delta = ksyms_strsz - st->sd_usroffset;
 		if (delta != 0) {
 			for (i = 0; i < st->sd_symsize/sizeof(Elf_Sym); i++)
@@ -1019,6 +1021,8 @@ ksymsread(dev_t dev, struct uio *uio, in
 	 */
 	filepos = sizeof(struct ksyms_hdr);
 	TAILQ_FOREACH(st, _symtabs, sd_queue) {
+		if (__predict_false(st->sd_gone))
+			continue;
 		if (uio->uio_resid == 0)
 			return 0;
 		if (uio->uio_offset <= st->sd_symsize + filepos) {
@@ -1037,6 +1041,8 @@ ksymsread(dev_t dev, struct uio *uio, in
 	KASSERT(filepos == sizeof(struct ksyms_hdr) +
 	ksyms_hdr.kh_shdr[SYMTAB].sh_size);
 	TAILQ_FOREACH(st, _symtabs, sd_queue) {
+		if (__predict_false(st->sd_gone))
+			continue;
 		if (uio->uio_resid == 0)
 			return 0;
 		if (uio->uio_offset <= st->sd_strsize + filepos) {



CVS commit: [netbsd-8] src/sys/kern

2020-01-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan  7 11:59:49 UTC 2020

Modified Files:
src/sys/kern [netbsd-8]: kern_ksyms.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1482):

sys/kern/kern_ksyms.c: revision 1.88 (patch)

When reading from /dev/ksyms we need to skip over entries that have
been marked as sd_gone.  Otherwise we might try to uiomove() data from
memory that has been unmapped, resulting in EFAULT.

XXX This (along with other pre-existing checks st->sd_gone) is still
racy, but it's an improvement over current code.  Ideally we would
make a complete copy of the symbol table when we open /dev/ksyms so
we could ignore any changes that occur.

ad@ says "good enough for now"

XXX Pullup to -9 and -8


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.84.10.1 src/sys/kern/kern_ksyms.c

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



CVS commit: [netbsd-9] src/doc

2020-01-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan  7 11:56:10 UTC 2020

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #609


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.154 -r1.1.2.155 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/doc

2020-01-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan  7 11:56:10 UTC 2020

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Ticket #609


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.154 -r1.1.2.155 src/doc/CHANGES-9.0

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-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.154 src/doc/CHANGES-9.0:1.1.2.155
--- src/doc/CHANGES-9.0:1.1.2.154	Sun Jan  5 11:07:04 2020
+++ src/doc/CHANGES-9.0	Tue Jan  7 11:56:10 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.154 2020/01/05 11:07:04 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.155 2020/01/07 11:56:10 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -7624,3 +7624,10 @@ sys/external/bsd/drm2/drm/files.drmkms		
 	Build drm_panel.c with drmkms.
 	[jmcneill, ticket #607]
 
+sys/kern/kern_ksyms.c1.88
+
+	Better deal with symbols removed by unloaded modules when
+	/dev/ksyms has been opened.
+	[pgoyette, ticket #609]
+
+



CVS commit: [netbsd-9] src/sys/kern

2020-01-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan  7 11:54:58 UTC 2020

Modified Files:
src/sys/kern [netbsd-9]: kern_ksyms.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #609):

sys/kern/kern_ksyms.c: revision 1.88

When reading from /dev/ksyms we need to skip over entries that have
been marked as sd_gone.  Otherwise we might try to uiomove() data from
memory that has been unmapped, resulting in EFAULT.

XXX This (along with other pre-existing checks st->sd_gone) is still
racy, but it's an improvement over current code.  Ideally we would
make a complete copy of the symbol table when we open /dev/ksyms so
we could ignore any changes that occur.

ad@ says "good enough for now"

XXX Pullup to -9 and -8


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.87.8.1 src/sys/kern/kern_ksyms.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_ksyms.c
diff -u src/sys/kern/kern_ksyms.c:1.87 src/sys/kern/kern_ksyms.c:1.87.8.1
--- src/sys/kern/kern_ksyms.c:1.87	Sat Nov  4 22:17:55 2017
+++ src/sys/kern/kern_ksyms.c	Tue Jan  7 11:54:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_ksyms.c,v 1.87 2017/11/04 22:17:55 christos Exp $	*/
+/*	$NetBSD: kern_ksyms.c,v 1.87.8.1 2020/01/07 11:54:57 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.87 2017/11/04 22:17:55 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.87.8.1 2020/01/07 11:54:57 martin Exp $");
 
 #if defined(_KERNEL) && defined(_KERNEL_OPT)
 #include "opt_copy_symtab.h"
@@ -765,9 +765,9 @@ ksyms_modunload(const char *name)
 		if (strcmp(name, st->sd_name) != 0)
 			continue;
 		st->sd_gone = true;
+		ksyms_sizes_calc();
 		if (!ksyms_isopen) {
 			TAILQ_REMOVE(_symtabs, st, sd_queue);
-			ksyms_sizes_calc();
 			kmem_free(st->sd_nmap,
   st->sd_nmapsize * sizeof(uint32_t));
 			kmem_free(st, sizeof(*st));
@@ -856,6 +856,8 @@ ksyms_sizes_calc(void)
 
 	ksyms_symsz = ksyms_strsz = 0;
 	TAILQ_FOREACH(st, _symtabs, sd_queue) {
+		if (__predict_false(st->sd_gone))
+			continue;
 		delta = ksyms_strsz - st->sd_usroffset;
 		if (delta != 0) {
 			for (i = 0; i < st->sd_symsize/sizeof(Elf_Sym); i++)
@@ -1034,6 +1036,8 @@ ksymsread(dev_t dev, struct uio *uio, in
 	 */
 	filepos = sizeof(struct ksyms_hdr);
 	TAILQ_FOREACH(st, _symtabs, sd_queue) {
+		if (__predict_false(st->sd_gone))
+			continue;
 		if (uio->uio_resid == 0)
 			return 0;
 		if (uio->uio_offset <= st->sd_symsize + filepos) {
@@ -1052,6 +1056,8 @@ ksymsread(dev_t dev, struct uio *uio, in
 	KASSERT(filepos == sizeof(struct ksyms_hdr) +
 	ksyms_hdr.kh_shdr[SYMTAB].sh_size);
 	TAILQ_FOREACH(st, _symtabs, sd_queue) {
+		if (__predict_false(st->sd_gone))
+			continue;
 		if (uio->uio_resid == 0)
 			return 0;
 		if (uio->uio_offset <= st->sd_strsize + filepos) {



CVS commit: [netbsd-9] src/sys/kern

2020-01-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan  7 11:54:58 UTC 2020

Modified Files:
src/sys/kern [netbsd-9]: kern_ksyms.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #609):

sys/kern/kern_ksyms.c: revision 1.88

When reading from /dev/ksyms we need to skip over entries that have
been marked as sd_gone.  Otherwise we might try to uiomove() data from
memory that has been unmapped, resulting in EFAULT.

XXX This (along with other pre-existing checks st->sd_gone) is still
racy, but it's an improvement over current code.  Ideally we would
make a complete copy of the symbol table when we open /dev/ksyms so
we could ignore any changes that occur.

ad@ says "good enough for now"

XXX Pullup to -9 and -8


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.87.8.1 src/sys/kern/kern_ksyms.c

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



Re: [x86 pmap changes] CVS commit: src/sys/arch

2020-01-07 Thread Maxime Villard

Le 07/01/2020 à 09:39, Maxime Villard a écrit :

Module Name:    src
Committed By:   ad
Date:   Sat Jan  4 22:49:20 UTC 2020

Modified Files:
    src/sys/arch/x86/include: pmap.h pmap_pv.h
    src/sys/arch/x86/x86: pmap.c
    src/sys/arch/xen/x86: xen_pmap.c

Log Message:
x86 pmap improvements, reducing system time during a build by about 15% on
my test machine:


This breaks nvmm-intel. I have only given a quick glance, but this change
already is wrong:

-    old_pp->pp_attrs |= pmap_ept_to_pp_attrs(opte);
+    old_pp->pp_attrs |= pmap_pte_to_pp_attrs(opte);

This is an EPT function handling EPT PTEs, so "ept" was correct. Fixing
this bug is not sufficient, so it seems that there are more bugs.

Reverting the whole change puts nvmm-intel back in a functional state.

You can test with this on an Intel CPU:

 # modload nvmm
 # /usr/tests/lib/libnvmm/./h_mem_assist

This currently gives random crashes.

Maxime


Also unrelated remark:

+   kmutex_t pm_lock/* locks for pm_objs */
+   __aligned(64);  /* give lock own cache line */

x86 CPUs will soon have 128-byte cache lines, and to ease the upgrade,
it is better to use COHERENCY_UNIT rather than hardcoded values.


CVS commit: src/sys/arch/arm

2020-01-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  7 10:20:07 UTC 2020

Modified Files:
src/sys/arch/arm/fdt: pcihost_fdt.c
src/sys/arch/arm/nvidia: tegra_pcie.c
src/sys/arch/arm/sunxi: sunxi_intc.c sunxi_nmi.c

Log Message:
Fix arm __HAVE_PREEMPTION build

__HAVE_PREEMPTION requires TPIDRPRW_IS_CURLWP and curcpu is defined as

#define curcpu()lwp_getcpu(_curlwp())


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/fdt/pcihost_fdt.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/nvidia/tegra_pcie.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sunxi_intc.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sunxi_nmi.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

2020-01-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  7 10:20:07 UTC 2020

Modified Files:
src/sys/arch/arm/fdt: pcihost_fdt.c
src/sys/arch/arm/nvidia: tegra_pcie.c
src/sys/arch/arm/sunxi: sunxi_intc.c sunxi_nmi.c

Log Message:
Fix arm __HAVE_PREEMPTION build

__HAVE_PREEMPTION requires TPIDRPRW_IS_CURLWP and curcpu is defined as

#define curcpu()lwp_getcpu(_curlwp())


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/fdt/pcihost_fdt.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/nvidia/tegra_pcie.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sunxi_intc.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sunxi_nmi.c

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

Modified files:

Index: src/sys/arch/arm/fdt/pcihost_fdt.c
diff -u src/sys/arch/arm/fdt/pcihost_fdt.c:1.14 src/sys/arch/arm/fdt/pcihost_fdt.c:1.15
--- src/sys/arch/arm/fdt/pcihost_fdt.c:1.14	Tue Jan  7 10:01:09 2020
+++ src/sys/arch/arm/fdt/pcihost_fdt.c	Tue Jan  7 10:20:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pcihost_fdt.c,v 1.14 2020/01/07 10:01:09 skrll Exp $ */
+/* $NetBSD: pcihost_fdt.c,v 1.15 2020/01/07 10:20:07 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.14 2020/01/07 10:01:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.15 2020/01/07 10:20:07 skrll Exp $");
 
 #include 
 
@@ -37,6 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Index: src/sys/arch/arm/nvidia/tegra_pcie.c
diff -u src/sys/arch/arm/nvidia/tegra_pcie.c:1.28 src/sys/arch/arm/nvidia/tegra_pcie.c:1.29
--- src/sys/arch/arm/nvidia/tegra_pcie.c:1.28	Tue Jan  7 09:57:11 2020
+++ src/sys/arch/arm/nvidia/tegra_pcie.c	Tue Jan  7 10:20:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_pcie.c,v 1.28 2020/01/07 09:57:11 skrll Exp $ */
+/* $NetBSD: tegra_pcie.c,v 1.29 2020/01/07 10:20:07 skrll Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.28 2020/01/07 09:57:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.29 2020/01/07 10:20:07 skrll Exp $");
 
 #include 
 
@@ -37,6 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Index: src/sys/arch/arm/sunxi/sunxi_intc.c
diff -u src/sys/arch/arm/sunxi/sunxi_intc.c:1.4 src/sys/arch/arm/sunxi/sunxi_intc.c:1.5
--- src/sys/arch/arm/sunxi/sunxi_intc.c:1.4	Tue Jan  7 09:57:11 2020
+++ src/sys/arch/arm/sunxi/sunxi_intc.c	Tue Jan  7 10:20:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_intc.c,v 1.4 2020/01/07 09:57:11 skrll Exp $ */
+/* $NetBSD: sunxi_intc.c,v 1.5 2020/01/07 10:20:07 skrll Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -29,13 +29,14 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_intc.c,v 1.4 2020/01/07 09:57:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_intc.c,v 1.5 2020/01/07 10:20:07 skrll Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 

Index: src/sys/arch/arm/sunxi/sunxi_nmi.c
diff -u src/sys/arch/arm/sunxi/sunxi_nmi.c:1.3 src/sys/arch/arm/sunxi/sunxi_nmi.c:1.4
--- src/sys/arch/arm/sunxi/sunxi_nmi.c:1.3	Tue Jan  7 09:57:11 2020
+++ src/sys/arch/arm/sunxi/sunxi_nmi.c	Tue Jan  7 10:20:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_nmi.c,v 1.3 2020/01/07 09:57:11 skrll Exp $ */
+/* $NetBSD: sunxi_nmi.c,v 1.4 2020/01/07 10:20:07 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -29,7 +29,7 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_nmi.c,v 1.3 2020/01/07 09:57:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_nmi.c,v 1.4 2020/01/07 10:20:07 skrll Exp $");
 
 #include 
 #include 
@@ -37,6 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_nmi.c,
 #include 
 #include 
 #include 
+#include 
 
 #include 
 



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

2020-01-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  7 10:01:09 UTC 2020

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

Log Message:
oops more KNF


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/fdt/pcihost_fdt.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/fdt

2020-01-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  7 10:01:09 UTC 2020

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

Log Message:
oops more KNF


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/fdt/pcihost_fdt.c

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

Modified files:

Index: src/sys/arch/arm/fdt/pcihost_fdt.c
diff -u src/sys/arch/arm/fdt/pcihost_fdt.c:1.13 src/sys/arch/arm/fdt/pcihost_fdt.c:1.14
--- src/sys/arch/arm/fdt/pcihost_fdt.c:1.13	Tue Jan  7 09:57:11 2020
+++ src/sys/arch/arm/fdt/pcihost_fdt.c	Tue Jan  7 10:01:09 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pcihost_fdt.c,v 1.13 2020/01/07 09:57:11 skrll Exp $ */
+/* $NetBSD: pcihost_fdt.c,v 1.14 2020/01/07 10:01:09 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared D. McNeill 
@@ -27,13 +27,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.13 2020/01/07 09:57:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.14 2020/01/07 10:01:09 skrll Exp $");
 
 #include 
 
-#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/arch/arm

2020-01-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  7 09:57:11 UTC 2020

Modified Files:
src/sys/arch/arm/arm: arm_machdep.c
src/sys/arch/arm/fdt: pcihost_fdt.c
src/sys/arch/arm/nvidia: tegra_pcie.c
src/sys/arch/arm/sunxi: sunxi_intc.c sunxi_nmi.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/arm/arm/arm_machdep.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/fdt/pcihost_fdt.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/nvidia/tegra_pcie.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sunxi_intc.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/sunxi/sunxi_nmi.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/arm/arm_machdep.c
diff -u src/sys/arch/arm/arm/arm_machdep.c:1.59 src/sys/arch/arm/arm/arm_machdep.c:1.60
--- src/sys/arch/arm/arm/arm_machdep.c:1.59	Tue Jan  7 09:55:30 2020
+++ src/sys/arch/arm/arm/arm_machdep.c	Tue Jan  7 09:57:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm_machdep.c,v 1.59 2020/01/07 09:55:30 skrll Exp $	*/
+/*	$NetBSD: arm_machdep.c,v 1.60 2020/01/07 09:57:10 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -80,17 +80,17 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.59 2020/01/07 09:55:30 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.60 2020/01/07 09:57:10 skrll Exp $");
 
+#include 
+#include 
+#include 
 #include 
+#include 
+#include 
 #include 
 #include 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
 
 #ifdef EXEC_AOUT
 #include 

Index: src/sys/arch/arm/fdt/pcihost_fdt.c
diff -u src/sys/arch/arm/fdt/pcihost_fdt.c:1.12 src/sys/arch/arm/fdt/pcihost_fdt.c:1.13
--- src/sys/arch/arm/fdt/pcihost_fdt.c:1.12	Sat Dec 28 17:19:43 2019
+++ src/sys/arch/arm/fdt/pcihost_fdt.c	Tue Jan  7 09:57:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pcihost_fdt.c,v 1.12 2019/12/28 17:19:43 jmcneill Exp $ */
+/* $NetBSD: pcihost_fdt.c,v 1.13 2020/01/07 09:57:11 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared D. McNeill 
@@ -27,18 +27,19 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.12 2019/12/28 17:19:43 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.13 2020/01/07 09:57:11 skrll Exp $");
 
 #include 
+
+#include 
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
-#include 
-#include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 

Index: src/sys/arch/arm/nvidia/tegra_pcie.c
diff -u src/sys/arch/arm/nvidia/tegra_pcie.c:1.27 src/sys/arch/arm/nvidia/tegra_pcie.c:1.28
--- src/sys/arch/arm/nvidia/tegra_pcie.c:1.27	Sat Dec 28 17:19:43 2019
+++ src/sys/arch/arm/nvidia/tegra_pcie.c	Tue Jan  7 09:57:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_pcie.c,v 1.27 2019/12/28 17:19:43 jmcneill Exp $ */
+/* $NetBSD: tegra_pcie.c,v 1.28 2020/01/07 09:57:11 skrll Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,18 +27,19 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.27 2019/12/28 17:19:43 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.28 2020/01/07 09:57:11 skrll Exp $");
 
 #include 
+
 #include 
 #include 
+#include 
 #include 
-#include 
+#include 
 #include 
-#include 
-#include 
 #include 
-#include 
+#include 
+#include 
 
 #include 
 

Index: src/sys/arch/arm/sunxi/sunxi_intc.c
diff -u src/sys/arch/arm/sunxi/sunxi_intc.c:1.3 src/sys/arch/arm/sunxi/sunxi_intc.c:1.4
--- src/sys/arch/arm/sunxi/sunxi_intc.c:1.3	Tue Oct 24 15:07:09 2017
+++ src/sys/arch/arm/sunxi/sunxi_intc.c	Tue Jan  7 09:57:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_intc.c,v 1.3 2017/10/24 15:07:09 jmcneill Exp $ */
+/* $NetBSD: sunxi_intc.c,v 1.4 2020/01/07 09:57:11 skrll Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -29,13 +29,13 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_intc.c,v 1.3 2017/10/24 15:07:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_intc.c,v 1.4 2020/01/07 09:57:11 skrll Exp $");
 
 #include 
-#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 

Index: src/sys/arch/arm/sunxi/sunxi_nmi.c
diff -u src/sys/arch/arm/sunxi/sunxi_nmi.c:1.2 src/sys/arch/arm/sunxi/sunxi_nmi.c:1.3
--- src/sys/arch/arm/sunxi/sunxi_nmi.c:1.2	Mon May 27 21:11:51 2019
+++ src/sys/arch/arm/sunxi/sunxi_nmi.c	Tue Jan  7 09:57:11 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_nmi.c,v 1.2 2019/05/27 21:11:51 jmcneill Exp $ */
+/* $NetBSD: sunxi_nmi.c,v 1.3 2020/01/07 09:57:11 skrll Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -29,13 +29,13 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_nmi.c,v 1.2 2019/05/27 21:11:51 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_nmi.c,v 1.3 2020/01/07 09:57:11 skrll Exp $");
 
 #include 
-#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 



CVS commit: src/sys/arch/arm

2020-01-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  7 09:57:11 UTC 2020

Modified Files:
src/sys/arch/arm/arm: arm_machdep.c
src/sys/arch/arm/fdt: pcihost_fdt.c
src/sys/arch/arm/nvidia: tegra_pcie.c
src/sys/arch/arm/sunxi: sunxi_intc.c sunxi_nmi.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/arm/arm/arm_machdep.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/fdt/pcihost_fdt.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/nvidia/tegra_pcie.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sunxi_intc.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/sunxi/sunxi_nmi.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/arm

2020-01-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  7 09:55:30 UTC 2020

Modified Files:
src/sys/arch/arm/arm: arm_machdep.c

Log Message:
Give __HAVE_PIC_FAST_SOFTINTS a chance of compiling


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/arm/arm/arm_machdep.c

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



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

2020-01-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  7 09:55:30 UTC 2020

Modified Files:
src/sys/arch/arm/arm: arm_machdep.c

Log Message:
Give __HAVE_PIC_FAST_SOFTINTS a chance of compiling


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/arm/arm/arm_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/arm/arm/arm_machdep.c
diff -u src/sys/arch/arm/arm/arm_machdep.c:1.58 src/sys/arch/arm/arm/arm_machdep.c:1.59
--- src/sys/arch/arm/arm/arm_machdep.c:1.58	Tue Dec  3 15:20:59 2019
+++ src/sys/arch/arm/arm/arm_machdep.c	Tue Jan  7 09:55:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm_machdep.c,v 1.58 2019/12/03 15:20:59 riastradh Exp $	*/
+/*	$NetBSD: arm_machdep.c,v 1.59 2020/01/07 09:55:30 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.58 2019/12/03 15:20:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.59 2020/01/07 09:55:30 skrll Exp $");
 
 #include 
 #include 
@@ -273,7 +273,7 @@ cpu_intr_p(void)
 		__insn_barrier();
 		idepth = l->l_cpu->ci_intr_depth;
 #ifdef __HAVE_PIC_FAST_SOFTINTS
-		cpl = ci->ci_cpl;
+		cpl = l->l_cpu->ci_cpl;
 #endif
 		__insn_barrier();
 	} while (__predict_false(ncsw != l->l_ncsw));



CVS commit: src/sys/kern

2020-01-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  7 08:52:47 UTC 2020

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

Log Message:
Appease gcc


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/sys/kern/tty.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/tty.c
diff -u src/sys/kern/tty.c:1.284 src/sys/kern/tty.c:1.285
--- src/sys/kern/tty.c:1.284	Mon Jan  6 11:18:51 2020
+++ src/sys/kern/tty.c	Tue Jan  7 08:52:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty.c,v 1.284 2020/01/06 11:18:51 ad Exp $	*/
+/*	$NetBSD: tty.c,v 1.285 2020/01/07 08:52:47 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.284 2020/01/06 11:18:51 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.285 2020/01/07 08:52:47 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -2530,7 +2530,7 @@ ttygetinfo(struct tty *tp, int fromsig, 
 	struct timeval	utime, stime;
 	int		tmp;
 	fixpt_t		pctcpu = 0;
-	const char	*msg;
+	const char	*msg = NULL;
 	char		lmsg[100];
 	long		rss;
 	bool		again = false;
@@ -2588,7 +2588,6 @@ ttygetinfo(struct tty *tp, int fromsig, 
 mutex_exit(pick->p_lock);
 return;
 			}
-			msg = NULL;
 		}
 	}
 



CVS commit: src/sys/kern

2020-01-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  7 08:52:47 UTC 2020

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

Log Message:
Appease gcc


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/sys/kern/tty.c

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



[x86 pmap changes] CVS commit: src/sys/arch

2020-01-07 Thread Maxime Villard

Module Name:src
Committed By:   ad
Date:   Sat Jan  4 22:49:20 UTC 2020

Modified Files:
src/sys/arch/x86/include: pmap.h pmap_pv.h
src/sys/arch/x86/x86: pmap.c
src/sys/arch/xen/x86: xen_pmap.c

Log Message:
x86 pmap improvements, reducing system time during a build by about 15% on
my test machine:


This breaks nvmm-intel. I have only given a quick glance, but this change
already is wrong:

-   old_pp->pp_attrs |= pmap_ept_to_pp_attrs(opte);
+   old_pp->pp_attrs |= pmap_pte_to_pp_attrs(opte);

This is an EPT function handling EPT PTEs, so "ept" was correct. Fixing
this bug is not sufficient, so it seems that there are more bugs.

Reverting the whole change puts nvmm-intel back in a functional state.

You can test with this on an Intel CPU:

# modload nvmm
# /usr/tests/lib/libnvmm/./h_mem_assist

This currently gives random crashes.

Maxime


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

2020-01-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  7 08:22:23 UTC 2020

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

Log Message:
arm_platform requires gtmr and psci.  Should fix build failures.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/fdt/files.fdt

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

Modified files:

Index: src/sys/arch/arm/fdt/files.fdt
diff -u src/sys/arch/arm/fdt/files.fdt:1.30 src/sys/arch/arm/fdt/files.fdt:1.31
--- src/sys/arch/arm/fdt/files.fdt:1.30	Sun Jan  5 17:26:31 2020
+++ src/sys/arch/arm/fdt/files.fdt	Tue Jan  7 08:22:23 2020
@@ -1,11 +1,11 @@
-# $NetBSD: files.fdt,v 1.30 2020/01/05 17:26:31 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.31 2020/01/07 08:22:23 skrll Exp $
 
 include	"dev/pckbport/files.pckbport"
 
 device	armfdt { }: bus_space_generic, fdt
 attach	armfdt at root with arm_fdt
 file	arch/arm/fdt/arm_fdt.c			arm_fdt
-file	arch/arm/fdt/arm_platform.c		arm_fdt
+file	arch/arm/fdt/arm_platform.c		arm_fdt & gtmr_fdt & psci_fdt
 
 attach	cpu at fdt with cpu_fdt
 file	arch/arm/fdt/cpu_fdt.c			cpu_fdt



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

2020-01-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  7 08:22:23 UTC 2020

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

Log Message:
arm_platform requires gtmr and psci.  Should fix build failures.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/fdt/files.fdt

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