CVS commit: src/sys/conf

2020-01-17 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Sat Jan 18 07:54:26 UTC 2020

Modified Files:
src/sys/conf: compat_netbsd80.config compat_netbsd90.config

Log Message:
Fix version numbers in comments


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/conf/compat_netbsd80.config
cvs rdiff -u -r1.1 -r1.2 src/sys/conf/compat_netbsd90.config

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

Modified files:

Index: src/sys/conf/compat_netbsd80.config
diff -u src/sys/conf/compat_netbsd80.config:1.2 src/sys/conf/compat_netbsd80.config:1.3
--- src/sys/conf/compat_netbsd80.config:1.2	Sun Jan 27 02:08:41 2019
+++ src/sys/conf/compat_netbsd80.config	Sat Jan 18 07:54:26 2020
@@ -1,6 +1,6 @@
-#	$NetBSD: compat_netbsd80.config,v 1.2 2019/01/27 02:08:41 pgoyette Exp $
+#	$NetBSD: compat_netbsd80.config,v 1.3 2020/01/18 07:54:26 ryoon Exp $
 
-# Common fragment for all NetBSD targets wanting NetBSD 7.0 and newer
+# Common fragment for all NetBSD targets wanting NetBSD 8.0 and newer
 # compatibility support.
 #
 # Note that COMPAT_80 implies all newer COMPAT_XX options.

Index: src/sys/conf/compat_netbsd90.config
diff -u src/sys/conf/compat_netbsd90.config:1.1 src/sys/conf/compat_netbsd90.config:1.2
--- src/sys/conf/compat_netbsd90.config:1.1	Sun Sep 22 22:59:38 2019
+++ src/sys/conf/compat_netbsd90.config	Sat Jan 18 07:54:26 2020
@@ -1,9 +1,9 @@
-#	$NetBSD: compat_netbsd90.config,v 1.1 2019/09/22 22:59:38 christos Exp $
+#	$NetBSD: compat_netbsd90.config,v 1.2 2020/01/18 07:54:26 ryoon Exp $
 
-# Common fragment for all NetBSD targets wanting NetBSD 7.0 and newer
+# Common fragment for all NetBSD targets wanting NetBSD 9.0 and newer
 # compatibility support.
 #
-# Note that COMPAT_80 implies all newer COMPAT_XX options.
+# Note that COMPAT_90 implies all newer COMPAT_XX options.
 
 include"conf/compat_netbsd.config"
 options 	COMPAT_90	# NetBSD 9.0 and beyond.



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

2020-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 18 07:52:34 UTC 2020

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

Log Message:
Trailing whitespace


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

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.378 src/sys/arch/arm/arm32/pmap.c:1.379
--- src/sys/arch/arm/arm32/pmap.c:1.378	Fri Jan 17 16:59:07 2020
+++ src/sys/arch/arm/arm32/pmap.c	Sat Jan 18 07:52:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.378 2020/01/17 16:59:07 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.379 2020/01/18 07:52:33 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -221,7 +221,7 @@
 #include 
 #endif
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.378 2020/01/17 16:59:07 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.379 2020/01/18 07:52:33 skrll Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -547,7 +547,7 @@ pmap_acquire_pmap_lock(pmap_t pm)
 	if (__predict_false(db_onproc != NULL))
 		return;
 #endif
-	
+
 	mutex_enter(pm->pm_lock);
 }
 



CVS commit: src/sys/compat/netbsd32

2020-01-17 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Jan 18 07:33:24 UTC 2020

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c syscalls.master

Log Message:
Catch up after getpid/getgid/getuid changes in native ABI in 2008

getpid(), getuid() and getgid() used to call respectively sys_getpid(),
sys_getuid() and sys_getgid(). In the BSD4.3 compat mode there was a
fallback to call sys_getpid_with_ppid() and related functions.

In 2008 the compat ifdef was removed in sys/kern/syscalls.master r. 1.216.

For purity reasons we probably shall restore the NetBSD original behavior
and implement BSD4.3 one as a compat module, however it is not worth the
complexity.

Align the netbsd32 compat ABI to native ABI and call functions that return
two integers as in BSD4.3.


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.145 -r1.146 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.25 -r1.26 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.144 -r1.145 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.36 -r1.37 src/sys/compat/netbsd32/netbsd32_systrace_args.c
cvs rdiff -u -r1.130 -r1.131 src/sys/compat/netbsd32/syscalls.master

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.146 src/sys/compat/netbsd32/netbsd32_syscall.h:1.147
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.146	Mon Nov  4 11:33:01 2019
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Sat Jan 18 07:33:24 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.146 2019/11/04 11:33:01 rin Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.147 2020/01/18 07:33:24 kamil Exp $ */
 
 /*
  * System call numbers.

Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.145 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.146
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.145	Mon Nov  4 11:33:01 2019
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Sat Jan 18 07:33:24 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.145 2019/11/04 11:33:01 rin Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.146 2020/01/18 07:33:24 kamil Exp $ */
 
 /*
  * System call argument lists.
@@ -2693,7 +2693,7 @@ int	compat_20_netbsd32_getfsstat(struct 
 
 int	compat_43_netbsd32_olseek(struct lwp *, const struct compat_43_netbsd32_olseek_args *, register_t *);
 
-int	sys_getpid(struct lwp *, const void *, register_t *);
+int	sys_getpid_with_ppid(struct lwp *, const void *, register_t *);
 
 int	compat_40_netbsd32_mount(struct lwp *, const struct compat_40_netbsd32_mount_args *, register_t *);
 
@@ -2701,7 +2701,7 @@ int	netbsd32_unmount(struct lwp *, const
 
 int	netbsd32_setuid(struct lwp *, const struct netbsd32_setuid_args *, register_t *);
 
-int	sys_getuid(struct lwp *, const void *, register_t *);
+int	sys_getuid_with_euid(struct lwp *, const void *, register_t *);
 
 int	sys_geteuid(struct lwp *, const void *, register_t *);
 
@@ -2747,7 +2747,7 @@ int	netbsd32_ktrace(struct lwp *, const 
 
 int	netbsd32_sigaction(struct lwp *, const struct netbsd32_sigaction_args *, register_t *);
 
-int	sys_getgid(struct lwp *, const void *, register_t *);
+int	sys_getgid_with_egid(struct lwp *, const void *, register_t *);
 
 int	compat_13_netbsd32_sigprocmask(struct lwp *, const struct compat_13_netbsd32_sigprocmask_args *, register_t *);
 
Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.145 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.146
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.145	Mon Nov  4 11:33:01 2019
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Sat Jan 18 07:33:24 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.145 2019/11/04 11:33:01 rin Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.146 2020/01/18 07:33:24 kamil Exp $ */
 
 /*
  * System call names.
@@ -8,7 +8,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.145 2019/11/04 11:33:01 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.146 2020/01/18 07:33:24 kamil Exp $");
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
@@ -584,11 +584,11 @@ const char *const altnetbsd32_syscallnam
 	/*  17 */	"break",
 	/*  18 */	NULL, /* compat_20_netbsd32_getfsstat */
 	/*  19 */	NULL, /* compat_43_netbsd32_olseek */
-	/*  20 */	NULL, /* getpid */
+	/*  20 */	"getpid_with_ppid",
 	/*  21 */	NULL, /* compat_40_netbsd32_mount */
 	/*  22 */	"unmount",
 	/*  23 */	"setuid",
-	/*  24 */	NULL, /* getuid */
+	/*  24 */	"getuid_with_euid",
 	/*  25 

CVS commit: src/sys/arch/x68k/stand

2020-01-17 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan 18 07:25:12 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: Makefile boot_ufs.ldscript
src/sys/arch/x68k/stand/boot_ustar: Makefile boot_ustar.ldscript
src/sys/arch/x68k/stand/xxboot: Makefile.xxboot xxboot.ldscript

Log Message:
Check whether the text+data+bss doesn't reach 0x6000 where secondary
bootloader should be.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/x68k/stand/boot_ufs/Makefile
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/x68k/stand/boot_ustar/Makefile
cvs rdiff -u -r1.5 -r1.6 \
src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x68k/stand/xxboot/xxboot.ldscript

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/x68k/stand/boot_ufs/Makefile
diff -u src/sys/arch/x68k/stand/boot_ufs/Makefile:1.35 src/sys/arch/x68k/stand/boot_ufs/Makefile:1.36
--- src/sys/arch/x68k/stand/boot_ufs/Makefile:1.35	Sat Jan 18 06:44:23 2020
+++ src/sys/arch/x68k/stand/boot_ufs/Makefile	Sat Jan 18 07:25:11 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.35 2020/01/18 06:44:23 isaki Exp $
+#	$NetBSD: Makefile,v 1.36 2020/01/18 07:25:11 isaki Exp $
 
 NOMAN=		# defined
 
@@ -44,6 +44,7 @@ CPPFLAGS+= -I${COMMONDIR} -I${LIBIOCS} -
 AFLAGS=	   ${CFLAGS:M-[ID]*}
 LINKFLAGS=   -n -Bstatic -T ${.CURDIR}/${BOOT}.ldscript
 LINKFLAGS+=  --defsym=TEXTADDR=$(TEXT)
+LINKFLAGS+=  --defsym=BOOT_TEXTADDR=$(BOOT_TEXT)
 
 .include "${.CURDIR}/../Makefile.booters"
 .include "${S}/../common/lib/libc/Makefile.inc"

Index: src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript
diff -u src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.6 src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.7
--- src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.6	Sat Jan 18 07:09:32 2020
+++ src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript	Sat Jan 18 07:25:11 2020
@@ -48,3 +48,4 @@ SECTIONS
 
 ASSERT(first_kbyte - TEXTADDR <= 1024, "Error: first_kbyte exceeds 1KB");
 ASSERT(_edata - TEXTADDR <= 8192, "Error: text+data is too large to bootarea");
+ASSERT(_end <= BOOT_TEXTADDR, "Error: _end conflicts BOOT_TEXT");

Index: src/sys/arch/x68k/stand/boot_ustar/Makefile
diff -u src/sys/arch/x68k/stand/boot_ustar/Makefile:1.29 src/sys/arch/x68k/stand/boot_ustar/Makefile:1.30
--- src/sys/arch/x68k/stand/boot_ustar/Makefile:1.29	Sat Jan 18 06:44:23 2020
+++ src/sys/arch/x68k/stand/boot_ustar/Makefile	Sat Jan 18 07:25:11 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.29 2020/01/18 06:44:23 isaki Exp $
+#	$NetBSD: Makefile,v 1.30 2020/01/18 07:25:11 isaki Exp $
 
 NOMAN=		# defined
 
@@ -39,6 +39,7 @@ AFLAGS=	   ${CFLAGS:M-[ID]*}
 AFLAGS+=   -Wa,-march=m68000 -Wa,-mcpu=m68000
 LINKFLAGS=   -n -Bstatic -T ${.CURDIR}/${BOOT}.ldscript
 LINKFLAGS+=  --defsym=TEXTADDR=$(TEXT)
+LINKFLAGS+=  --defsym=BOOT_TEXTADDR=$(BOOT_TEXT)
 
 .include "${.CURDIR}/../Makefile.booters"
 .include "${S}/../common/lib/libc/Makefile.inc"

Index: src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript
diff -u src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript:1.5 src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript:1.6
--- src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript:1.5	Sat Jan 18 06:44:23 2020
+++ src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript	Sat Jan 18 07:25:11 2020
@@ -48,3 +48,4 @@ SECTIONS
 
 ASSERT(first_kbyte - TEXTADDR <= 1024, "Error: first_kbyte exceeds 1KB");
 ASSERT(_edata - TEXTADDR <= 8192, "Error: text+data is too large to bootarea");
+ASSERT(_end <= BOOT_TEXTADDR, "Error: _end conflicts BOOT_TEXT");

Index: src/sys/arch/x68k/stand/xxboot/Makefile.xxboot
diff -u src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.10 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.11
--- src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.10	Sat Jan 18 06:44:23 2020
+++ src/sys/arch/x68k/stand/xxboot/Makefile.xxboot	Sat Jan 18 07:25:12 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.xxboot,v 1.10 2020/01/18 06:44:23 isaki Exp $
+#	$NetBSD: Makefile.xxboot,v 1.11 2020/01/18 07:25:12 isaki Exp $
 
 NOMAN=		# defined
 
@@ -41,6 +41,7 @@ CPPFLAGS+= -I$M/stand/libiocs -I$M/stand
 AFLAGS=	   ${CFLAGS:M-[ID]*}
 LINKFLAGS=   -n -Bstatic -T ${.CURDIR}/../xxboot.ldscript
 LINKFLAGS+=  --defsym=TEXTADDR=$(TEXT)
+LINKFLAGS+=  --defsym=BOOT_TEXTADDR=$(BOOT_TEXT)
 LINKFLAGS+=  --defsym=TEXTDATASIZE=$(TEXTDATASIZE)
 LIBIOCS!= cd $M/stand/libiocs && ${PRINTOBJDIR}
 LIBSA!=	  cd $M/stand/libsa && ${PRINTOBJDIR}

Index: src/sys/arch/x68k/stand/xxboot/xxboot.ldscript
diff -u src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.5 src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.6
--- src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.5	Sat Jan 18 07:09:32 2020
+++ 

CVS commit: src/sys/arch/x68k/stand

2020-01-17 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan 18 07:09:32 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: boot_ufs.ldscript
src/sys/arch/x68k/stand/xxboot: xxboot.ldscript

Log Message:
Make .bss follows .data to detect size restriction easier.
Previously, if text+data exceeds the restricted size, it will conflict
with manually fixed .bss area and ldscript makes it an error.
By this change, ASSERT() can detect it.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x68k/stand/xxboot/xxboot.ldscript

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/x68k/stand/boot_ufs/boot_ufs.ldscript
diff -u src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.5 src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.6
--- src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.5	Sat Jan 18 06:44:23 2020
+++ src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript	Sat Jan 18 07:09:32 2020
@@ -35,7 +35,6 @@ SECTIONS
 edata  =  .;
 _edata  =  .;
   }
-  . = TEXTADDR + 0x2000;
   .bss :
   {
 __bss_start = .;
@@ -48,3 +47,4 @@ SECTIONS
 }
 
 ASSERT(first_kbyte - TEXTADDR <= 1024, "Error: first_kbyte exceeds 1KB");
+ASSERT(_edata - TEXTADDR <= 8192, "Error: text+data is too large to bootarea");

Index: src/sys/arch/x68k/stand/xxboot/xxboot.ldscript
diff -u src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.4 src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.5
--- src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.4	Sat Jan 18 06:44:23 2020
+++ src/sys/arch/x68k/stand/xxboot/xxboot.ldscript	Sat Jan 18 07:09:32 2020
@@ -35,7 +35,6 @@ SECTIONS
 edata  =  .;
 _edata  =  .;
   }
-  . = TEXTADDR + TEXTDATASIZE;
   .bss :
   {
 __bss_start = .;
@@ -48,3 +47,5 @@ SECTIONS
 }
 
 ASSERT(first_kbyte - TEXTADDR <= 1024, "Error: first_kbyte exceeds 1KB");
+ASSERT(_edata - TEXTADDR <= TEXTDATASIZE,
+"Error: text+data is too large to bootarea");



CVS commit: src/sys/arch/x68k/stand

2020-01-17 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan 18 06:44:23 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: Makefile boot_ufs.ldscript
src/sys/arch/x68k/stand/boot_ustar: Makefile boot_ustar.ldscript
src/sys/arch/x68k/stand/xxboot: Makefile.xxboot xxboot.ldscript

Log Message:
Use ASSERT() in ldscript to check first_kbyte (etc) restrictions,
rather than complicated shell expressions in Makefile.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/x68k/stand/boot_ufs/Makefile
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x68k/stand/boot_ustar/Makefile
cvs rdiff -u -r1.4 -r1.5 \
src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x68k/stand/xxboot/xxboot.ldscript

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/x68k/stand/boot_ufs/Makefile
diff -u src/sys/arch/x68k/stand/boot_ufs/Makefile:1.34 src/sys/arch/x68k/stand/boot_ufs/Makefile:1.35
--- src/sys/arch/x68k/stand/boot_ufs/Makefile:1.34	Sat Jan 18 06:34:29 2020
+++ src/sys/arch/x68k/stand/boot_ufs/Makefile	Sat Jan 18 06:44:23 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.34 2020/01/18 06:34:29 isaki Exp $
+#	$NetBSD: Makefile,v 1.35 2020/01/18 06:44:23 isaki Exp $
 
 NOMAN=		# defined
 
@@ -42,29 +42,15 @@ CPPFLAGS+= -DSCSI_ADHOC_BOOTPART
 CPPFLAGS+= -DUSE_FFS -DUSE_LFS -DUSE_UFS1 -DUSE_UFS2
 CPPFLAGS+= -I${COMMONDIR} -I${LIBIOCS} -I${S} -I. -D_STANDALONE
 AFLAGS=	   ${CFLAGS:M-[ID]*}
-LINKFLAGS=   -n -Bstatic -T ${.CURDIR}/${BOOT}.ldscript -M
+LINKFLAGS=   -n -Bstatic -T ${.CURDIR}/${BOOT}.ldscript
 LINKFLAGS+=  --defsym=TEXTADDR=$(TEXT)
 
 .include "${.CURDIR}/../Makefile.booters"
 .include "${S}/../common/lib/libc/Makefile.inc"
 
-CLEANFILES+=	$(PROG).x $(PROG).map
-
 
 $(PROG): $(OBJS)
 	${_MKTARGET_LINK}
-	:
-	: Note:	"relocation truncated to fit: R_68K_16" messages are expected.
-	:	Other errors are fatal.
-	:
-	$(LD) $(LINKFLAGS) -o $(PROG).x $(OBJS) $(LDADD) >$(PROG).map
-	@grep first_kbyte $(PROG).map
-	@if [ `${TOOL_AWK}		   \
-	'/first_kbyte/ {print "eval(eval("$$1")-eval('$(TEXT)'))"}'	   \
-	$(PROG).map | ${TOOL_M4} -` -gt 1024 ];			   \
-	then echo '$(BOOT): first_kbyte exceeds the first killobyte';	   \
-	exit 1;			   \
-	fi
-	mv -f $(PROG).x $(PROG)
+	$(LD) $(LINKFLAGS) -o $(PROG) $(OBJS) $(LDADD)
 
 .include 

Index: src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript
diff -u src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.4 src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.5
--- src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.4	Sat Jan 18 06:03:03 2020
+++ src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript	Sat Jan 18 06:44:23 2020
@@ -46,3 +46,5 @@ SECTIONS
   }
   /DISCARD/ : { *(.ident) *(.stab) *(.stabstr) }
 }
+
+ASSERT(first_kbyte - TEXTADDR <= 1024, "Error: first_kbyte exceeds 1KB");

Index: src/sys/arch/x68k/stand/boot_ustar/Makefile
diff -u src/sys/arch/x68k/stand/boot_ustar/Makefile:1.28 src/sys/arch/x68k/stand/boot_ustar/Makefile:1.29
--- src/sys/arch/x68k/stand/boot_ustar/Makefile:1.28	Sat Jan 18 06:34:30 2020
+++ src/sys/arch/x68k/stand/boot_ustar/Makefile	Sat Jan 18 06:44:23 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.28 2020/01/18 06:34:30 isaki Exp $
+#	$NetBSD: Makefile,v 1.29 2020/01/18 06:44:23 isaki Exp $
 
 NOMAN=		# defined
 
@@ -37,30 +37,15 @@ CPPFLAGS+= -I${COMMONDIR} -I${LIBIOCS} -
 CFLAGS+=   -m68000
 AFLAGS=	   ${CFLAGS:M-[ID]*}
 AFLAGS+=   -Wa,-march=m68000 -Wa,-mcpu=m68000
-LINKFLAGS=   -n -Bstatic -T ${.CURDIR}/${BOOT}.ldscript -M
+LINKFLAGS=   -n -Bstatic -T ${.CURDIR}/${BOOT}.ldscript
 LINKFLAGS+=  --defsym=TEXTADDR=$(TEXT)
 
 .include "${.CURDIR}/../Makefile.booters"
 .include "${S}/../common/lib/libc/Makefile.inc"
 
-CLEANFILES+=	${PROG}.x $(PROG).map
-
 
 ${PROG}: $(OBJS)
 	${_MKTARGET_LINK}
-	$(LD) $(LINKFLAGS) -o ${PROG} $(OBJS) $(LDADD) > $(PROG).map
-	@grep first_kbyte $(PROG).map
-	@if [ `${TOOL_AWK}		   \
-	'/first_kbyte/ {print "eval(eval("$$1")-eval('$(TEXT)'))"}'	   \
-	$(PROG).map | ${TOOL_M4} -` -gt 1024 ];			   \
-	then echo '$(BOOT): first_kbyte exceeds the first killobyte';	   \
-	rm $(PROG) ; exit 1; 	   \
-	fi
-	@if [ `${TOOL_AWK}		   \
-	'/_edata/ {print "eval(eval("$$1")-eval('$(TEXT)'))"}'	   \
-	$(PROG).map | ${TOOL_M4} -` -gt 8192 ];			   \
-	then echo '$(BOOT): text+data is too large';			   \
-	rm $(PROG) ; exit 1; 	   \
-	fi
+	$(LD) $(LINKFLAGS) -o ${PROG} $(OBJS) $(LDADD)
 
 .include 

Index: src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript
diff -u src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript:1.4 src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript:1.5
--- src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript:1.4	Sat Jan 18 

CVS commit: src/sys/arch/x68k/stand

2020-01-17 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan 18 06:34:30 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: Makefile boot.S
src/sys/arch/x68k/stand/boot_ustar: Makefile
src/sys/arch/x68k/stand/xxboot: Makefile.xxboot boot.S

Log Message:
Change primary bootloader's load address from 0x0f to 0x003000.
- Moving addresses closer eliminates bunch of this linker errors:
in function `entry0':
relocation truncated to fit: R_68K_16 against `edata'+8000
:
- By this change, harmful -noinhibit-exec option can also be removed.
  Finally, we can break the builds when assemble error occurs!
- Load address of secondary is 0x6000, so that this change limits
  text+data+bss 12KB or less.  Current actual size is 5~7KB.
  I think it should be fine.
- cd9660 can have up to 30KB text+data in its bootarea.  Even in this
  case, this change limits text+data+bss 12KB or less (currently, it's
  about 6KB).  However, I take breaking the builds on errors rather than
  future size limitation.
There is no user visible changes or interface changes.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/x68k/stand/boot_ufs/Makefile
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/x68k/stand/boot_ufs/boot.S
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/x68k/stand/boot_ustar/Makefile
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot \
src/sys/arch/x68k/stand/xxboot/boot.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/x68k/stand/boot_ufs/Makefile
diff -u src/sys/arch/x68k/stand/boot_ufs/Makefile:1.33 src/sys/arch/x68k/stand/boot_ufs/Makefile:1.34
--- src/sys/arch/x68k/stand/boot_ufs/Makefile:1.33	Sat Jan 18 05:46:26 2020
+++ src/sys/arch/x68k/stand/boot_ufs/Makefile	Sat Jan 18 06:34:29 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.33 2020/01/18 05:46:26 isaki Exp $
+#	$NetBSD: Makefile,v 1.34 2020/01/18 06:34:29 isaki Exp $
 
 NOMAN=		# defined
 
@@ -11,7 +11,7 @@ VERSION!=	${TOOL_AWK} -F: '$$1 ~ /^[0-9.
 NEWVERSWHAT=	"${BOOT}"
 
 # text and bss addresses
-TEXT=		0x0f	# Primary (me)
+TEXT=		0x003000	# Primary (me)
 BOOT_TEXT=	0x006000	# Secondary (/boot)
 
 PROG=		xx$(BOOT)
@@ -44,7 +44,6 @@ CPPFLAGS+= -I${COMMONDIR} -I${LIBIOCS} -
 AFLAGS=	   ${CFLAGS:M-[ID]*}
 LINKFLAGS=   -n -Bstatic -T ${.CURDIR}/${BOOT}.ldscript -M
 LINKFLAGS+=  --defsym=TEXTADDR=$(TEXT)
-LINKFLAGS+=  -noinhibit-exec	# XXX
 
 .include "${.CURDIR}/../Makefile.booters"
 .include "${S}/../common/lib/libc/Makefile.inc"

Index: src/sys/arch/x68k/stand/boot_ufs/boot.S
diff -u src/sys/arch/x68k/stand/boot_ufs/boot.S:1.16 src/sys/arch/x68k/stand/boot_ufs/boot.S:1.17
--- src/sys/arch/x68k/stand/boot_ufs/boot.S:1.16	Sat Jan 18 05:56:51 2020
+++ src/sys/arch/x68k/stand/boot_ufs/boot.S	Sat Jan 18 06:34:29 2020
@@ -2,14 +2,14 @@
 | author: chapuni(webmas...@chapuni.com)
 | ITOH Yasufumi
 |
-| $NetBSD: boot.S,v 1.16 2020/01/18 05:56:51 isaki Exp $
+| $NetBSD: boot.S,v 1.17 2020/01/18 06:34:29 isaki Exp $
 
 |
 | (1) IPL (or previous stage loader) loads first 1KB of this primary
 | bootloader to (*).  (*) is 0x2000 (from FD) or 0x2400 (from SASI/SCSI).
 |
 | (2) The first 1KB loads full primary bootloader (including first 1KB) from
-| the boot partition to 0xf.  And jump to there.
+| the boot partition to 0x3000.  And jump to there.
 |
 | (3) The full primary bootloader loads the secondary bootloader known as
 | /boot from its filesystem to 0x6000.  And jump to there.
@@ -24,26 +24,24 @@
 |  | first 1KB  || first 1KB  || first 1KB  |
 |  ++++++(*)+0x400
 |  ::::::
+|  ::++++0x003000
+|  ::|full primary||full primary|
+|  ::|boot loader ||boot loader |
+|  ::++++
+|  ::::::
 |  ::::++0x006000
 |  ::::| /boot  |
 |  ::::++
 |  ::::::
 |  ~~~~~~
 |  ::::<-SP::<-SP
-|  ::++++0x0f
-|  ::|full primary||full primary|
-|  ::|boot loader ||boot loader |
-|  ::++++
+|  + - - - - - -++ - - - - - -++ - - - - - -+0x10
 |  ::::::
 |
 
 #include 
 #include "iocscall.h"
 
-#define 

CVS commit: src/sys/arch/x68k/stand

2020-01-17 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan 18 06:03:03 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/boot: boot.ldscript
src/sys/arch/x68k/stand/boot_ufs: boot_ufs.ldscript
src/sys/arch/x68k/stand/boot_ustar: boot_ustar.ldscript
src/sys/arch/x68k/stand/xxboot: xxboot.ldscript

Log Message:
Remove commented out ALIGN() operation.
It looks unnecessary and has never been used.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x68k/stand/boot/boot.ldscript
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript
cvs rdiff -u -r1.3 -r1.4 \
src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x68k/stand/xxboot/xxboot.ldscript

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/x68k/stand/boot/boot.ldscript
diff -u src/sys/arch/x68k/stand/boot/boot.ldscript:1.8 src/sys/arch/x68k/stand/boot/boot.ldscript:1.9
--- src/sys/arch/x68k/stand/boot/boot.ldscript:1.8	Sat Jan 18 05:41:48 2020
+++ src/sys/arch/x68k/stand/boot/boot.ldscript	Sat Jan 18 06:03:02 2020
@@ -28,7 +28,6 @@ SECTIONS
 etext = .;
 _etext = .;
   }
-/*  . = ALIGN(0x2000); */
   .data :
   {
 /* The first three sections are for SunOS dynamic linking.  */

Index: src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript
diff -u src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.3 src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.4
--- src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.3	Sat Jan 18 05:41:48 2020
+++ src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript	Sat Jan 18 06:03:03 2020
@@ -23,7 +23,6 @@ SECTIONS
 etext = .;
 _etext = .;
   }
-/*  . = ALIGN(0x2000); */
   .data :
   {
 /* The first three sections are for SunOS dynamic linking.  */

Index: src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript
diff -u src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript:1.3 src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript:1.4
--- src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript:1.3	Sat Jan 18 05:41:48 2020
+++ src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript	Sat Jan 18 06:03:03 2020
@@ -23,7 +23,6 @@ SECTIONS
 etext = .;
 _etext = .;
   }
-/*  . = ALIGN(0x2000); */
   .data :
   {
 /* The first three sections are for SunOS dynamic linking.  */

Index: src/sys/arch/x68k/stand/xxboot/xxboot.ldscript
diff -u src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.2 src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.3
--- src/sys/arch/x68k/stand/xxboot/xxboot.ldscript:1.2	Sat Jan 18 05:41:49 2020
+++ src/sys/arch/x68k/stand/xxboot/xxboot.ldscript	Sat Jan 18 06:03:03 2020
@@ -23,7 +23,6 @@ SECTIONS
 etext = .;
 _etext = .;
   }
-/*  . = ALIGN(0x2000); */
   .data :
   {
 /* The first three sections are for SunOS dynamic linking.  */



CVS commit: src/sys/arch/x68k/stand/boot_ustar

2020-01-17 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan 18 06:00:04 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/boot_ustar: boot_ustar.S

Log Message:
Check whether MPU >= 68020.
Because current secondary bootloader assumes that.
This will display a reasonable error message instead of "Error occurs,
please reset" (IPL message) when you try sysinst*.fs on X68000.

XXX secondary bootloader (/boot) should not assume mpu regardless of
whether primary bootloader has checked mpu. (?)


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x68k/stand/boot_ustar/boot_ustar.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/x68k/stand/boot_ustar/boot_ustar.S
diff -u src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S:1.11 src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S:1.12
--- src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S:1.11	Sat Jan 18 05:07:34 2020
+++ src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S	Sat Jan 18 06:00:04 2020
@@ -3,7 +3,7 @@
 | ITOH Yasufumi
 |	  mino...@netbsd.org
 |
-| $NetBSD: boot_ustar.S,v 1.11 2020/01/18 05:07:34 isaki Exp $
+| $NetBSD: boot_ustar.S,v 1.12 2020/01/18 06:00:04 isaki Exp $
 
 | supports floppy only
 
@@ -56,6 +56,18 @@ ASENTRY_NOPROFILE(entry)
 		moveq	#0x10,%d1
 		IOCS(__CRTMOD)
 
+		| We use 68020 instructions, and check MPU beforehand.
+		| Here "moveql #-1,%d0" = 0x70ff, and subsequent moveb loads
+		|   0xff if MPU <= 010 (chkmpu+2 + %d0.w)
+		|   0x70 if MPU >= 020 (chkmpu+2 + %d0.w*2).
+		| This is a move, not a tst instruction because tst with
+		| pc-relative is not available on 000/010.
+chkmpu:
+		moveql	#-1,%d0
+		.word	0x103b, 0x02fe	| moveb	%pc@(chkmpu+2,%d0:W:2),%d0
+		jpl	mpuok		| MC68020 or later
+		BOOT_ERROR("MPU 68000?");
+mpuok:
 		|
 		| SASI or Floppy
 		|



CVS commit: src/sys/arch/x68k/stand

2020-01-17 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan 18 05:56:51 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: boot.S
src/sys/arch/x68k/stand/xxboot: boot.S

Log Message:
Typo in comment. s/availble/available/


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x68k/stand/boot_ufs/boot.S
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x68k/stand/xxboot/boot.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/x68k/stand/boot_ufs/boot.S
diff -u src/sys/arch/x68k/stand/boot_ufs/boot.S:1.15 src/sys/arch/x68k/stand/boot_ufs/boot.S:1.16
--- src/sys/arch/x68k/stand/boot_ufs/boot.S:1.15	Sat Jan 18 05:48:31 2020
+++ src/sys/arch/x68k/stand/boot_ufs/boot.S	Sat Jan 18 05:56:51 2020
@@ -2,7 +2,7 @@
 | author: chapuni(webmas...@chapuni.com)
 | ITOH Yasufumi
 |
-| $NetBSD: boot.S,v 1.15 2020/01/18 05:48:31 isaki Exp $
+| $NetBSD: boot.S,v 1.16 2020/01/18 05:56:51 isaki Exp $
 
 |
 | (1) IPL (or previous stage loader) loads first 1KB of this primary
@@ -99,7 +99,7 @@ clrbss:		clrb	%a1@+
 		|	if MPU <= 010	loads 0x49,
 		|	if MPU >= 020	loads 0x90.
 		| This is a move, not a tst instruction
-		| because pc-relative tsts are not availble on 000/010.
+		| because pc-relative tsts are not available on 000/010.
 chkmpu:		moveb	%pc@(clrbss-chkmpu-2:B,%d0:W:2),%d0	| 103B 02xx
 		jmi	mpuok		| MC68020 or later
 		BOOT_ERROR("MPU 68000?")

Index: src/sys/arch/x68k/stand/xxboot/boot.S
diff -u src/sys/arch/x68k/stand/xxboot/boot.S:1.7 src/sys/arch/x68k/stand/xxboot/boot.S:1.8
--- src/sys/arch/x68k/stand/xxboot/boot.S:1.7	Sat Jan 18 05:48:31 2020
+++ src/sys/arch/x68k/stand/xxboot/boot.S	Sat Jan 18 05:56:51 2020
@@ -2,7 +2,7 @@
 | author: chapuni(webmas...@chapuni.com)
 | ITOH Yasufumi
 |
-| $NetBSD: boot.S,v 1.7 2020/01/18 05:48:31 isaki Exp $
+| $NetBSD: boot.S,v 1.8 2020/01/18 05:56:51 isaki Exp $
 
 |
 | (1) IPL (or previous stage loader) loads first 1KB of this primary
@@ -101,7 +101,7 @@ clrbss:		clrb	%a1@+
 		|	if MPU <= 010	loads 0x49,
 		|	if MPU >= 020	loads 0x90.
 		| This is a move, not a tst instruction
-		| because pc-relative tsts are not availble on 000/010.
+		| because pc-relative tsts are not available on 000/010.
 chkmpu:		moveb	%pc@(clrbss-chkmpu-2:B,%d0:W:2),%d0	| 103B 02xx
 		jmi	mpuok		| MC68020 or later
 		BOOT_ERROR("MPU 68000?")



CVS commit: src/sys/arch/x68k/stand

2020-01-17 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan 18 05:48:31 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: boot.S
src/sys/arch/x68k/stand/xxboot: boot.S

Log Message:
Add comment and figure of address map.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x68k/stand/boot_ufs/boot.S
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x68k/stand/xxboot/boot.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/x68k/stand/boot_ufs/boot.S
diff -u src/sys/arch/x68k/stand/boot_ufs/boot.S:1.14 src/sys/arch/x68k/stand/boot_ufs/boot.S:1.15
--- src/sys/arch/x68k/stand/boot_ufs/boot.S:1.14	Sat Jan 18 05:07:34 2020
+++ src/sys/arch/x68k/stand/boot_ufs/boot.S	Sat Jan 18 05:48:31 2020
@@ -2,7 +2,40 @@
 | author: chapuni(webmas...@chapuni.com)
 | ITOH Yasufumi
 |
-| $NetBSD: boot.S,v 1.14 2020/01/18 05:07:34 isaki Exp $
+| $NetBSD: boot.S,v 1.15 2020/01/18 05:48:31 isaki Exp $
+
+|
+| (1) IPL (or previous stage loader) loads first 1KB of this primary
+| bootloader to (*).  (*) is 0x2000 (from FD) or 0x2400 (from SASI/SCSI).
+|
+| (2) The first 1KB loads full primary bootloader (including first 1KB) from
+| the boot partition to 0xf.  And jump to there.
+|
+| (3) The full primary bootloader loads the secondary bootloader known as
+| /boot from its filesystem to 0x6000.  And jump to there.
+|
+| Therefore, The first 1KB must be relocatable.
+| The first 1KB must be smaller than or equal to 1024 bytes.
+|
+|   (1) ->(2) ->(3)
+|  ++++++0x00
+|  ::::::
+|  ++++++(*)
+|  | first 1KB  || first 1KB  || first 1KB  |
+|  ++++++(*)+0x400
+|  ::::::
+|  ::::++0x006000
+|  ::::| /boot  |
+|  ::::++
+|  ::::::
+|  ~~~~~~
+|  ::::<-SP::<-SP
+|  ::++++0x0f
+|  ::|full primary||full primary|
+|  ::|boot loader ||boot loader |
+|  ::++++
+|  ::::::
+|
 
 #include 
 #include "iocscall.h"
@@ -28,9 +61,7 @@ ASENTRY_NOPROFILE(top)
 		.word	0x8e9e,0x82c9,0x82cd,0x8cbb
 		.word	0x8ec0,0x93a6,0x94f0,0x8149
 		.word	0
-| 0x2000 (FD), 0x2400 (SASI/SCSI) (¤â¤·¤¯¤Ï 0x0f)
 | d4 ¤Ë¤Ï¤¹¤Ç¤Ë SCSI ID ¤¬Æþ¤Ã¤Æ¤¤¤ë
-| ¤³¤³¤«¤é jmp ¤Þ¤Ç¤Ï¥ê¥í¥±¡¼¥¿¥Ö¥ë¤Ë½ñ¤«¤Í¤Ð¤Ê¤é¤Ê¤¤¡£
 ASENTRY_NOPROFILE(entry0)
 		moveml	%d0-%d7/%a0-%a7,_C_LABEL(startregs)
 		lea	BASEPTR_A:l,%a5		| set base ptr

Index: src/sys/arch/x68k/stand/xxboot/boot.S
diff -u src/sys/arch/x68k/stand/xxboot/boot.S:1.6 src/sys/arch/x68k/stand/xxboot/boot.S:1.7
--- src/sys/arch/x68k/stand/xxboot/boot.S:1.6	Sat Jan 18 05:07:34 2020
+++ src/sys/arch/x68k/stand/xxboot/boot.S	Sat Jan 18 05:48:31 2020
@@ -2,7 +2,40 @@
 | author: chapuni(webmas...@chapuni.com)
 | ITOH Yasufumi
 |
-| $NetBSD: boot.S,v 1.6 2020/01/18 05:07:34 isaki Exp $
+| $NetBSD: boot.S,v 1.7 2020/01/18 05:48:31 isaki Exp $
+
+|
+| (1) IPL (or previous stage loader) loads first 1KB of this primary
+| bootloader to (*).  (*) is 0x2000 (from FD) or 0x2400 (from SASI/SCSI).
+|
+| (2) The first 1KB loads full primary bootloader (including first 1KB) from
+| the boot partition to 0xf.  And jump to there.
+|
+| (3) The full primary bootloader loads the secondary bootloader known as
+| /boot from its filesystem to 0x6000.  And jump to there.
+|
+| Therefore, The first 1KB must be relocatable.
+| The first 1KB must be smaller than or equal to 1024 bytes.
+|
+|   (1) ->(2) ->(3)
+|  ++++++0x00
+|  ::::::
+|  ++++++(*)
+|  | first 1KB  || first 1KB  || first 1KB  |
+|  ++++++(*)+0x400
+|  ::::::
+|  ::::++0x006000
+|  ::::| /boot  |
+|  ::::++
+|  ::::::
+|  ~~~

CVS commit: src/sys/arch/x68k/stand

2020-01-17 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan 18 05:46:26 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/boot: Makefile
src/sys/arch/x68k/stand/boot_ufs: Makefile
src/sys/arch/x68k/stand/boot_ustar: Makefile
src/sys/arch/x68k/stand/xxboot: Makefile.xxboot

Log Message:
Add 0x prefix when defining variables, not when using it.
This was necessary for bc(1) but it's no longer necessary.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/x68k/stand/boot/Makefile
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/x68k/stand/boot_ufs/Makefile
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/x68k/stand/boot_ustar/Makefile
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot

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/x68k/stand/boot/Makefile
diff -u src/sys/arch/x68k/stand/boot/Makefile:1.32 src/sys/arch/x68k/stand/boot/Makefile:1.33
--- src/sys/arch/x68k/stand/boot/Makefile:1.32	Sat Jan 18 05:41:48 2020
+++ src/sys/arch/x68k/stand/boot/Makefile	Sat Jan 18 05:46:25 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2020/01/18 05:41:48 isaki Exp $
+#	$NetBSD: Makefile,v 1.33 2020/01/18 05:46:25 isaki Exp $
 
 NOMAN=		# defined
 
@@ -11,7 +11,7 @@ VERSION!=	${TOOL_AWK} -F: '$$1 ~ /^[0-9.
 NEWVERSWHAT=	"${BOOT}"
 
 # text address
-TEXT=		006000
+TEXT=		0x6000
 
 # RTC offset for netboot (XXX hardcoded for JST-9)
 RTC_OFFSET=	-540
@@ -34,7 +34,7 @@ COMMONDIR=	$M/stand/common
 CPPFLAGS+=	-nostdinc -I$S -I${.OBJDIR} -I$M/stand/libsa
 CPPFLAGS+=	-I$M/stand/libiocs -I${COMMONDIR}
 CPPFLAGS+=	-D_STANDALONE -DHEAP_VARIABLE
-CPPFLAGS+=	-DTEXTADDR="0x${TEXT}" 
+CPPFLAGS+=	-DTEXTADDR="${TEXT}"
 CPPFLAGS+=	-DBOOT=\"${BOOT}\" -DBOOT_VERS=\"${VERSION}\"
 CPPFLAGS+=	-DLIBSA_ENABLE_LS_OP
 CPPFLAGS+=	-DRTC_OFFSET=${RTC_OFFSET}
@@ -42,7 +42,7 @@ CPPFLAGS+=	-DSUPPORT_BOOTP -DSUPPORT_DHC
 #CPPFLAGS+=	-DDEBUG
 CFLAGS=		-Wno-main -Os -m68020-60
 LINKFLAGS=	-N -static -T ${.CURDIR}/../boot/boot.ldscript
-LINKFLAGS+=	--defsym=TEXTADDR=0x$(TEXT)
+LINKFLAGS+=	--defsym=TEXTADDR=$(TEXT)
 ELF2AOUT_OPTS=	-O
 LIBIOCS!=	cd $M/stand/libiocs && ${PRINTOBJDIR}
 LIBSA!=		cd $M/stand/libsa && ${PRINTOBJDIR}

Index: src/sys/arch/x68k/stand/boot_ufs/Makefile
diff -u src/sys/arch/x68k/stand/boot_ufs/Makefile:1.32 src/sys/arch/x68k/stand/boot_ufs/Makefile:1.33
--- src/sys/arch/x68k/stand/boot_ufs/Makefile:1.32	Sat Jan 18 05:41:48 2020
+++ src/sys/arch/x68k/stand/boot_ufs/Makefile	Sat Jan 18 05:46:26 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2020/01/18 05:41:48 isaki Exp $
+#	$NetBSD: Makefile,v 1.33 2020/01/18 05:46:26 isaki Exp $
 
 NOMAN=		# defined
 
@@ -10,9 +10,9 @@ VERSION!=	${TOOL_AWK} -F: '$$1 ~ /^[0-9.
 			END { print it }' ${VERSIONFILE}
 NEWVERSWHAT=	"${BOOT}"
 
-# text and bss addresses in hex
-TEXT=		0f		# Primary (me)
-BOOT_TEXT=	006000		# Secondary (/boot)
+# text and bss addresses
+TEXT=		0x0f	# Primary (me)
+BOOT_TEXT=	0x006000	# Secondary (/boot)
 
 PROG=		xx$(BOOT)
 LINKS=		${BINDIR}/xx$(BOOT) ${BINDIR}/sd$(BOOT)
@@ -35,7 +35,7 @@ SRCS+=	exec_image.S memset.S strcmp.S
 CFLAGS=	-Os -fomit-frame-pointer -fno-unwind-tables
 CFLAGS+= -m68020-60
 CFLAGS+= -W -Wall -Wstrict-prototypes -Wmissing-prototypes
-CPPFLAGS+= -DTEXTADDR="0x$(TEXT)" -DBOOT_TEXTADDR="0x$(BOOT_TEXT)"
+CPPFLAGS+= -DTEXTADDR="$(TEXT)" -DBOOT_TEXTADDR="$(BOOT_TEXT)"
 CPPFLAGS+= -DBOOT=\"$(BOOT)\" -DBOOT_VERS=\"$(VERSION)\"
 CPPFLAGS+= -DSCSI_ADHOC_BOOTPART
 #CPPFLAGS+= -DBOOT_DEBUG
@@ -43,7 +43,7 @@ CPPFLAGS+= -DUSE_FFS -DUSE_LFS -DUSE_UFS
 CPPFLAGS+= -I${COMMONDIR} -I${LIBIOCS} -I${S} -I. -D_STANDALONE
 AFLAGS=	   ${CFLAGS:M-[ID]*}
 LINKFLAGS=   -n -Bstatic -T ${.CURDIR}/${BOOT}.ldscript -M
-LINKFLAGS+=  --defsym=TEXTADDR=0x$(TEXT)
+LINKFLAGS+=  --defsym=TEXTADDR=$(TEXT)
 LINKFLAGS+=  -noinhibit-exec	# XXX
 
 .include "${.CURDIR}/../Makefile.booters"
@@ -61,7 +61,7 @@ $(PROG): $(OBJS)
 	$(LD) $(LINKFLAGS) -o $(PROG).x $(OBJS) $(LDADD) >$(PROG).map
 	@grep first_kbyte $(PROG).map
 	@if [ `${TOOL_AWK}		   \
-	'/first_kbyte/ {print "eval(eval("$$1")-eval(0x'$(TEXT)'))"}'  \
+	'/first_kbyte/ {print "eval(eval("$$1")-eval('$(TEXT)'))"}'	   \
 	$(PROG).map | ${TOOL_M4} -` -gt 1024 ];			   \
 	then echo '$(BOOT): first_kbyte exceeds the first killobyte';	   \
 	exit 1;			   \

Index: src/sys/arch/x68k/stand/boot_ustar/Makefile
diff -u src/sys/arch/x68k/stand/boot_ustar/Makefile:1.26 src/sys/arch/x68k/stand/boot_ustar/Makefile:1.27
--- src/sys/arch/x68k/stand/boot_ustar/Makefile:1.26	Sat Jan 18 05:41:48 2020
+++ src/sys/arch/x68k/stand/boot_ustar/Makefile	Sat Jan 18 05:46:26 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.26 2020/01/18 05:41:48 isaki Exp $
+#	$NetBSD: Makefile,v 1.27 2020/01/18 05:46:26 isaki Exp $
 
 NOMAN=		# defined
 
@@ -10,9 +10,9 @@ VERSION!=	${TOOL_AWK} -F: '$$1 ~ /^[0-9.
 			END { print it }' ${VERSIONFILE}
 NEWVERSWHAT=	"${BOOT}"
 
-# 

CVS commit: src/sys/arch/x68k/stand

2020-01-17 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan 18 05:41:49 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/boot: Makefile boot.ldscript
src/sys/arch/x68k/stand/boot_ufs: Makefile boot_ufs.ldscript
src/sys/arch/x68k/stand/boot_ustar: Makefile boot_ustar.ldscript
src/sys/arch/x68k/stand/xxboot: Makefile.xxboot xxboot.ldscript

Log Message:
Pass address constants from Makefile to ldscript.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/x68k/stand/boot/Makefile
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x68k/stand/boot/boot.ldscript
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/x68k/stand/boot_ufs/Makefile
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/x68k/stand/boot_ustar/Makefile
cvs rdiff -u -r1.2 -r1.3 \
src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x68k/stand/xxboot/xxboot.ldscript

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/x68k/stand/boot/Makefile
diff -u src/sys/arch/x68k/stand/boot/Makefile:1.31 src/sys/arch/x68k/stand/boot/Makefile:1.32
--- src/sys/arch/x68k/stand/boot/Makefile:1.31	Fri Jun 14 14:15:53 2019
+++ src/sys/arch/x68k/stand/boot/Makefile	Sat Jan 18 05:41:48 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.31 2019/06/14 14:15:53 isaki Exp $
+#	$NetBSD: Makefile,v 1.32 2020/01/18 05:41:48 isaki Exp $
 
 NOMAN=		# defined
 
@@ -42,6 +42,7 @@ CPPFLAGS+=	-DSUPPORT_BOOTP -DSUPPORT_DHC
 #CPPFLAGS+=	-DDEBUG
 CFLAGS=		-Wno-main -Os -m68020-60
 LINKFLAGS=	-N -static -T ${.CURDIR}/../boot/boot.ldscript
+LINKFLAGS+=	--defsym=TEXTADDR=0x$(TEXT)
 ELF2AOUT_OPTS=	-O
 LIBIOCS!=	cd $M/stand/libiocs && ${PRINTOBJDIR}
 LIBSA!=		cd $M/stand/libsa && ${PRINTOBJDIR}

Index: src/sys/arch/x68k/stand/boot/boot.ldscript
diff -u src/sys/arch/x68k/stand/boot/boot.ldscript:1.7 src/sys/arch/x68k/stand/boot/boot.ldscript:1.8
--- src/sys/arch/x68k/stand/boot/boot.ldscript:1.7	Mon Dec 31 19:25:46 2018
+++ src/sys/arch/x68k/stand/boot/boot.ldscript	Sat Jan 18 05:41:48 2020
@@ -10,7 +10,7 @@ SEARCH_DIR(/usr/lib);
 PROVIDE (__stack = 0);
 SECTIONS
 {
-  . = 0x6000;
+  . = TEXTADDR;
   .text :
   {
 CREATE_OBJECT_SYMBOLS

Index: src/sys/arch/x68k/stand/boot_ufs/Makefile
diff -u src/sys/arch/x68k/stand/boot_ufs/Makefile:1.31 src/sys/arch/x68k/stand/boot_ufs/Makefile:1.32
--- src/sys/arch/x68k/stand/boot_ufs/Makefile:1.31	Thu Jan 16 13:15:47 2020
+++ src/sys/arch/x68k/stand/boot_ufs/Makefile	Sat Jan 18 05:41:48 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.31 2020/01/16 13:15:47 isaki Exp $
+#	$NetBSD: Makefile,v 1.32 2020/01/18 05:41:48 isaki Exp $
 
 NOMAN=		# defined
 
@@ -43,6 +43,7 @@ CPPFLAGS+= -DUSE_FFS -DUSE_LFS -DUSE_UFS
 CPPFLAGS+= -I${COMMONDIR} -I${LIBIOCS} -I${S} -I. -D_STANDALONE
 AFLAGS=	   ${CFLAGS:M-[ID]*}
 LINKFLAGS=   -n -Bstatic -T ${.CURDIR}/${BOOT}.ldscript -M
+LINKFLAGS+=  --defsym=TEXTADDR=0x$(TEXT)
 LINKFLAGS+=  -noinhibit-exec	# XXX
 
 .include "${.CURDIR}/../Makefile.booters"

Index: src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript
diff -u src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.2 src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.3
--- src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript:1.2	Sat Nov 24 16:18:44 2001
+++ src/sys/arch/x68k/stand/boot_ufs/boot_ufs.ldscript	Sat Jan 18 05:41:48 2020
@@ -6,7 +6,7 @@ SEARCH_DIR(/usr/lib);
 PROVIDE (__stack = 0);
 SECTIONS
 {
-  . = 0x0f;
+  . = TEXTADDR;
   .text :
   {
 CREATE_OBJECT_SYMBOLS
@@ -36,7 +36,7 @@ SECTIONS
 edata  =  .;
 _edata  =  .;
   }
-  . = 0x0f2000;
+  . = TEXTADDR + 0x2000;
   .bss :
   {
 __bss_start = .;

Index: src/sys/arch/x68k/stand/boot_ustar/Makefile
diff -u src/sys/arch/x68k/stand/boot_ustar/Makefile:1.25 src/sys/arch/x68k/stand/boot_ustar/Makefile:1.26
--- src/sys/arch/x68k/stand/boot_ustar/Makefile:1.25	Thu Jan 16 13:15:47 2020
+++ src/sys/arch/x68k/stand/boot_ustar/Makefile	Sat Jan 18 05:41:48 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.25 2020/01/16 13:15:47 isaki Exp $
+#	$NetBSD: Makefile,v 1.26 2020/01/18 05:41:48 isaki Exp $
 
 NOMAN=		# defined
 
@@ -38,6 +38,7 @@ CFLAGS+=   -m68000
 AFLAGS=	   ${CFLAGS:M-[ID]*}
 AFLAGS+=   -Wa,-march=m68000 -Wa,-mcpu=m68000
 LINKFLAGS=   -n -Bstatic -T ${.CURDIR}/${BOOT}.ldscript -M
+LINKFLAGS+=  --defsym=TEXTADDR=0x$(TEXT)
 LINKFLAGS+=  -noinhibit-exec	# XXX
 
 .include "${.CURDIR}/../Makefile.booters"

Index: src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript
diff -u src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript:1.2 src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript:1.3
--- src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript:1.2	Sat Nov 24 16:18:45 2001
+++ src/sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript	Sat Jan 18 05:41:48 2020
@@ -6,7 +6,7 @@ 

CVS commit: src/sys/arch/x68k/stand

2020-01-17 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan 18 05:07:34 UTC 2020

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: boot.S version
src/sys/arch/x68k/stand/boot_ustar: boot_ustar.S version
src/sys/arch/x68k/stand/libiocs: iocscall.h
src/sys/arch/x68k/stand/xxboot: boot.S version

Log Message:
Initialize the screen in all primary bootloaders.
- Some IPL (or boot selector) don't do it, but current secondary bootloader
  expects the screen to be initialized to display logo.
  To keep messages (like version signature) displayed by primary bootloader,
  this initialization should be done early in all primary bootloaders.
- For boot_ustar.S, relocates some registers to save bootinfo (%d0).
- Bumps version.

Confirmed on X68030+060turbo and my X68030.  This problem was found on
X68030+060turbo at NetBSD booth in OSC 2011 Hiroshima (8+ years ago).


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x68k/stand/boot_ufs/boot.S
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/x68k/stand/boot_ufs/version
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x68k/stand/boot_ustar/version
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x68k/stand/libiocs/iocscall.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x68k/stand/xxboot/boot.S
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x68k/stand/xxboot/version

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/x68k/stand/boot_ufs/boot.S
diff -u src/sys/arch/x68k/stand/boot_ufs/boot.S:1.13 src/sys/arch/x68k/stand/boot_ufs/boot.S:1.14
--- src/sys/arch/x68k/stand/boot_ufs/boot.S:1.13	Thu Jan 16 13:37:26 2020
+++ src/sys/arch/x68k/stand/boot_ufs/boot.S	Sat Jan 18 05:07:34 2020
@@ -2,7 +2,7 @@
 | author: chapuni(webmas...@chapuni.com)
 | ITOH Yasufumi
 |
-| $NetBSD: boot.S,v 1.13 2020/01/16 13:37:26 isaki Exp $
+| $NetBSD: boot.S,v 1.14 2020/01/18 05:07:34 isaki Exp $
 
 #include 
 #include "iocscall.h"
@@ -290,6 +290,14 @@ first_kbyte:
 |	The latter text+data part is not accessible at the first boot time.
 |	PC-relative can be used from here.
 |
+		| Initialize the screen here.  Some IPL (060turbo ROM or
+		| genuine boot selector) don't initialize the screen.
+		| Such initialization should be done as early as possible
+		| but it's too severe to place it in first_kbyte area.
+		| Therefore do it here.
+		moveq	#0x10,%d1
+		IOCS(__CRTMOD)
+
 		jmp	_C_LABEL(bootufs)	| 0x0F ¤ËÈô¤ó¤Ç¤æ¤¯
 
 		.word	0

Index: src/sys/arch/x68k/stand/boot_ufs/version
diff -u src/sys/arch/x68k/stand/boot_ufs/version:1.3 src/sys/arch/x68k/stand/boot_ufs/version:1.4
--- src/sys/arch/x68k/stand/boot_ufs/version:1.3	Sun Jan 12 13:51:12 2020
+++ src/sys/arch/x68k/stand/boot_ufs/version	Sat Jan 18 05:07:34 2020
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.3 2020/01/12 13:51:12 isaki Exp $
+$NetBSD: version,v 1.4 2020/01/18 05:07:34 isaki Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -9,3 +9,4 @@ is taken as the current.
 	/boot.
 	Add LFS support (not tested yet).
 1.1:	Add LFSv2 support
+1.2:	Initialize the screen.

Index: src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S
diff -u src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S:1.10 src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S:1.11
--- src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S:1.10	Thu Jan 16 13:37:26 2020
+++ src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S	Sat Jan 18 05:07:34 2020
@@ -3,7 +3,7 @@
 | ITOH Yasufumi
 |	  mino...@netbsd.org
 |
-| $NetBSD: boot_ustar.S,v 1.10 2020/01/16 13:37:26 isaki Exp $
+| $NetBSD: boot_ustar.S,v 1.11 2020/01/18 05:07:34 isaki Exp $
 
 | supports floppy only
 
@@ -36,9 +36,9 @@ ASENTRY_NOPROFILE(entry0)
 		| 0xED...0xED3FFE	SRAM
 		| others		ROM (SCSI?)
 		|
-		movel	%d0,%d1
-		clrb	%d1
-		tstl	%d1
+		movel	%d0,%d6
+		clrb	%d0
+		tstl	%d0
 		jne	boot_dev_unsupported
 
 		bra	_ASM_LABEL(entry)
@@ -51,10 +51,15 @@ disklabel:
 		.space	404
 
 ASENTRY_NOPROFILE(entry)
+		| Initialize the screen first.  Some IPL (060turbo ROM or
+		| genuine boot selector) doesn't initialize the screen.
+		moveq	#0x10,%d1
+		IOCS(__CRTMOD)
+
 		|
 		| SASI or Floppy
 		|
-		movel	%d0,%d6
+		movel	%d6,%d0
 		andib	#0xFC,%d0
 		cmpib	#0x90,%d0
 		jne	boot_dev_unsupported	| boot from SASI?

Index: src/sys/arch/x68k/stand/boot_ustar/version
diff -u src/sys/arch/x68k/stand/boot_ustar/version:1.2 src/sys/arch/x68k/stand/boot_ustar/version:1.3
--- src/sys/arch/x68k/stand/boot_ustar/version:1.2	Sun Jan 12 13:51:12 2020
+++ src/sys/arch/x68k/stand/boot_ustar/version	Sat Jan 18 05:07:34 2020
@@ -1,7 +1,8 @@
-$NetBSD: version,v 1.2 2020/01/12 13:51:12 isaki Exp $
+$NetBSD: version,v 1.3 2020/01/18 05:07:34 isaki Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE.  The format of this
 file is important - make sure the 

CVS commit: src/sys/arch/x68k/stand

2020-01-17 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Jan 18 04:42:29 UTC 2020

Added Files:
src/sys/arch/x68k/stand: README

Log Message:
Add a document about this directory.
Reviewed by tsutsui@ on port-x68k.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/x68k/stand/README

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

Added files:

Index: src/sys/arch/x68k/stand/README
diff -u /dev/null src/sys/arch/x68k/stand/README:1.1
--- /dev/null	Sat Jan 18 04:42:29 2020
+++ src/sys/arch/x68k/stand/README	Sat Jan 18 04:42:29 2020
@@ -0,0 +1,57 @@
+$NetBSD: README,v 1.1 2020/01/18 04:42:29 isaki Exp $
+
+Primary bootloaders:
+	boot_ufs/
+		contains xxboot_ufs.
+		It is placed in ffs's boot area and loads secondary bootloader
+		from its filesystem (ffsv1/v2).
+		This historical primary bootloader uses custom ffs op functions
+		and can recognize Human68k partition table.
+		(See #ifdef SCSI_ADHOC_BOOTPART part for details)
+
+	boot_ustar/
+		is placed in floppy's sector#0 and loads secondary bootloader
+		from subsequent USTARFS.
+
+	xxboot/
+		contains following variants.
+		* cdboot_cd9660
+			is placed in CD and loads secondary bootloader
+			from cd9660 filesystem.
+		* xxboot_ffsv1
+		* xxboot_ffsv2
+		* xxboot_lfsv1
+		* xxboot_lfsv2
+			is placed in each specified filesystem's boot area,
+			and loads secondary bootloader from its filesystem.
+
+		These primary bootloaders use MI ffs/lfs op functions in
+		src/sys/lib/libsa. Currently these don't recognize Human68k
+		partition table.
+
+Secondary bootloaders:
+	boot/
+		boot is placed to / (root directory) and loads the kernel.
+
+	netboot/
+		netboot is the same as /boot except default boot device is
+		nfs using network interface and DHCP.
+		Currently only NE2000 based Neptune-X and Nereid are
+		supported.
+
+Other bootloaders:
+	mboot/
+		mboot is 0-th bootloader.
+		It is placed to sector#0 (as 1024byte/sector) of hard disk
+		as an alternative to genuine boot selector.  And loads
+		active partition's +0 sector (sector size depends media)
+		which should have primary bootloader.
+
+	loadbsd/
+		loadbsd.x is a Human68k executable and loads the kernel from
+		Human68k filesystem.
+
+Utility tools:
+	newdisk/
+		newdisk is a utility to create the "disk mark" for X680x0
+		SCSI IPL using mboot bootloader to make a disk bootable.



CVS commit: src/sys/external/bsd/drm2/include/linux

2020-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 18 03:00:04 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/linux: acpi.h pci.h

Log Message:
Pull in acpica.h on aarch64


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/linux/acpi.h
cvs rdiff -u -r1.37 -r1.38 src/sys/external/bsd/drm2/include/linux/pci.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/external/bsd/drm2/include/linux/acpi.h
diff -u src/sys/external/bsd/drm2/include/linux/acpi.h:1.4 src/sys/external/bsd/drm2/include/linux/acpi.h:1.5
--- src/sys/external/bsd/drm2/include/linux/acpi.h:1.4	Sat Oct 17 21:07:23 2015
+++ src/sys/external/bsd/drm2/include/linux/acpi.h	Sat Jan 18 03:00:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.h,v 1.4 2015/10/17 21:07:23 jmcneill Exp $	*/
+/*	$NetBSD: acpi.h,v 1.5 2020/01/18 03:00:04 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _LINUX_ACPI_H_
 
 #ifdef _KERNEL_OPT
-#if defined(__i386__) || defined(__x86_64__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__)
 #include "acpica.h"
 #else
 #define NACPICA 0

Index: src/sys/external/bsd/drm2/include/linux/pci.h
diff -u src/sys/external/bsd/drm2/include/linux/pci.h:1.37 src/sys/external/bsd/drm2/include/linux/pci.h:1.38
--- src/sys/external/bsd/drm2/include/linux/pci.h:1.37	Mon Aug 27 14:16:38 2018
+++ src/sys/external/bsd/drm2/include/linux/pci.h	Sat Jan 18 03:00:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci.h,v 1.37 2018/08/27 14:16:38 riastradh Exp $	*/
+/*	$NetBSD: pci.h,v 1.38 2020/01/18 03:00:04 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _LINUX_PCI_H_
 
 #ifdef _KERNEL_OPT
-#if defined(i386) || defined(amd64)
+#if defined(i386) || defined(amd64) || defined(__aarch64__)
 #include "acpica.h"
 #else	/* !(i386 || amd64) */
 #define NACPICA	0



CVS commit: src/sys/external/bsd/drm2/linux

2020-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan 18 02:59:42 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/linux: linux_pci.c

Log Message:
Use pci_get_segment if available


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/linux/linux_pci.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/linux/linux_pci.c
diff -u src/sys/external/bsd/drm2/linux/linux_pci.c:1.6 src/sys/external/bsd/drm2/linux/linux_pci.c:1.7
--- src/sys/external/bsd/drm2/linux/linux_pci.c:1.6	Tue Aug 28 03:41:39 2018
+++ src/sys/external/bsd/drm2/linux/linux_pci.c	Sat Jan 18 02:59:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_pci.c,v 1.6 2018/08/28 03:41:39 riastradh Exp $	*/
+/*	$NetBSD: linux_pci.c,v 1.7 2020/01/18 02:59:42 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -29,8 +29,12 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef _KERNEL_OPT
+#include "opt_pci.h"
+#endif
+
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.6 2018/08/28 03:41:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.7 2020/01/18 02:59:42 jmcneill Exp $");
 
 #include 
 
@@ -66,7 +70,12 @@ linux_pci_dev_init(struct pci_dev *pdev,
 	pdev->pd_rom_vaddr = NULL;
 	pdev->pd_dev = dev;
 #if (NACPICA > 0)
-	pdev->pd_ad = acpi_pcidev_find(0 /*XXX segment*/, pa->pa_bus,
+#ifdef __HAVE_PCI_GET_SEGMENT
+	const int seg = pci_get_segment(pa->pa_pc);
+#else
+	const int seg = 0;
+#endif
+	pdev->pd_ad = acpi_pcidev_find(seg, pa->pa_bus,
 	pa->pa_device, pa->pa_function);
 #else
 	pdev->pd_ad = NULL;



CVS commit: [ad-namecache] src/sys/kern

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 21:54:27 UTC 2020

Modified Files:
src/sys/kern [ad-namecache]: vfs_getcwd.c

Log Message:
- Get shared locks on the directories, except for VOP_GETATTR() which
  unfortunately still needs LK_EXCLUSIVE due to itimes handling in UFS.

- vnode locks are not needed to traverse the namecache.


To generate a diff of this commit:
cvs rdiff -u -r1.53.2.1 -r1.53.2.2 src/sys/kern/vfs_getcwd.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_getcwd.c
diff -u src/sys/kern/vfs_getcwd.c:1.53.2.1 src/sys/kern/vfs_getcwd.c:1.53.2.2
--- src/sys/kern/vfs_getcwd.c:1.53.2.1	Fri Jan 17 21:47:35 2020
+++ src/sys/kern/vfs_getcwd.c	Fri Jan 17 21:54:27 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_getcwd.c,v 1.53.2.1 2020/01/17 21:47:35 ad Exp $ */
+/* $NetBSD: vfs_getcwd.c,v 1.53.2.2 2020/01/17 21:54:27 ad Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_getcwd.c,v 1.53.2.1 2020/01/17 21:47:35 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_getcwd.c,v 1.53.2.2 2020/01/17 21:54:27 ad Exp $");
 
 #include 
 #include 
@@ -107,6 +107,9 @@ getcwd_scandir(struct vnode **lvpp, stru
 	int len, reclen;
 	tries = 0;
 
+	/* Upgrade to exclusive for UFS VOP_GETATTR (itimes) & VOP_LOOKUP. */
+	vn_lock(lvp, LK_UPGRADE | LK_RETRY);
+
 	/*
 	 * If we want the filename, get some info we need while the
 	 * current directory is still locked.
@@ -142,7 +145,7 @@ getcwd_scandir(struct vnode **lvpp, stru
 	}
 	uvp = *uvpp;
 	/* Now lvp is unlocked, try to lock uvp */
-	error = vn_lock(uvp, LK_EXCLUSIVE);
+	error = vn_lock(uvp, LK_SHARED);
 	if (error) {
 		*lvpp = NULL;
 		*uvpp = NULL;
@@ -254,7 +257,7 @@ unionread:
 		vput(tvp);
 		vref(uvp);
 		*uvpp = uvp;
-		vn_lock(uvp, LK_EXCLUSIVE | LK_RETRY);
+		vn_lock(uvp, LK_SHARED | LK_RETRY);
 		goto unionread;
 	}
 #endif
@@ -310,7 +313,7 @@ getcwd_getcache(struct vnode **lvpp, str
 	 */
 
 	VOP_UNLOCK(lvp);
-	vn_lock(uvp, LK_EXCLUSIVE | LK_RETRY);
+	vn_lock(uvp, LK_SHARED | LK_RETRY);
 	vrele(lvp);
 	*lvpp = NULL;
 
@@ -349,7 +352,7 @@ getcwd_common(struct vnode *lvp, struct 
 	 *	uvp is either NULL, or locked and held.
 	 */
 
-	vn_lock(lvp, LK_EXCLUSIVE | LK_RETRY);
+	vn_lock(lvp, LK_SHARED | LK_RETRY);
 	if (bufp)
 		bp = *bpp;
 
@@ -396,7 +399,7 @@ getcwd_common(struct vnode *lvp, struct 
 goto out;
 			}
 			vref(lvp);
-			error = vn_lock(lvp, LK_EXCLUSIVE | LK_RETRY);
+			error = vn_lock(lvp, LK_SHARED | LK_RETRY);
 			if (error != 0) {
 vrele(lvp);
 lvp = NULL;
@@ -557,11 +560,7 @@ vnode_to_path(char *path, size_t len, st
 	bp = bend = [len];
 	*(--bp) = '\0';
 
-	error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-	if (error != 0)
-		return error;
 	error = cache_revlookup(vp, , , path);
-	VOP_UNLOCK(vp);
 	if (error != 0)
 		return (error == -1 ? ENOENT : error);
 



CVS commit: [ad-namecache] src/sys/kern

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 21:55:13 UTC 2020

Modified Files:
src/sys/kern [ad-namecache]: vfs_vnode.c

Log Message:
vrelel: don't change the vnode state to VS_BLOCKED for VOP_INACTIVE(), it's
not needed (at least not for the usual case).  Will revist before merge.


To generate a diff of this commit:
cvs rdiff -u -r1.105.2.2 -r1.105.2.3 src/sys/kern/vfs_vnode.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_vnode.c
diff -u src/sys/kern/vfs_vnode.c:1.105.2.2 src/sys/kern/vfs_vnode.c:1.105.2.3
--- src/sys/kern/vfs_vnode.c:1.105.2.2	Fri Jan 17 21:47:35 2020
+++ src/sys/kern/vfs_vnode.c	Fri Jan 17 21:55:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnode.c,v 1.105.2.2 2020/01/17 21:47:35 ad Exp $	*/
+/*	$NetBSD: vfs_vnode.c,v 1.105.2.3 2020/01/17 21:55:13 ad Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011, 2019 The NetBSD Foundation, Inc.
@@ -119,8 +119,7 @@
  *			Vnode finished disassociation from underlying file
  *			system in vcache_reclaim().
  *	LOADED -> BLOCKED
- *			Either vcache_rekey*() is changing the vnode key or
- *			vrelel() is about to call VOP_INACTIVE().
+ *			vcache_rekey*() is changing the vnode key.
  *	BLOCKED -> LOADED
  *			The block condition is over.
  *	LOADING -> RECLAIMED
@@ -146,7 +145,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.105.2.2 2020/01/17 21:47:35 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.105.2.3 2020/01/17 21:55:13 ad Exp $");
 
 #include 
 #include 
@@ -777,24 +776,22 @@ vrelel(vnode_t *vp, int flags, int lktyp
 	if (VSTATE_GET(vp) == VS_RECLAIMED) {
 		VOP_UNLOCK(vp);
 	} else {
-		VSTATE_CHANGE(vp, VS_LOADED, VS_BLOCKED);
-		mutex_exit(vp->v_interlock);
-
 		/*
-		 * The vnode must not gain another reference while being
-		 * deactivated.  If VOP_INACTIVE() indicates that
-		 * the described file has been deleted, then recycle
-		 * the vnode.
+		 * If VOP_INACTIVE() indicates that the described file has
+		 * been deleted, then recycle the vnode.  Note that
+		 * VOP_INACTIVE() will not drop the vnode lock.
 		 *
-		 * Note that VOP_INACTIVE() will not drop the vnode lock.
+		 * If the file has been deleted, this is a lingering
+		 * reference and there is no need to worry about new
+		 * references looking to do real work with the vnode (as it
+		 * will have been purged from directories, caches, etc).
 		 */
 		recycle = false;
+		mutex_exit(vp->v_interlock);
 		VOP_INACTIVE(vp, );
-		if (!recycle)
-			VOP_UNLOCK(vp);
 		mutex_enter(vp->v_interlock);
-		VSTATE_CHANGE(vp, VS_BLOCKED, VS_LOADED);
 		if (!recycle) {
+			VOP_UNLOCK(vp);
 			if (vp->v_usecount > 1) {
 vp->v_usecount--;
 mutex_exit(vp->v_interlock);



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

2020-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 17 21:59:05 UTC 2020

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.264 -r1.265 src/sys/arch/alpha/alpha/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/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.264 src/sys/arch/alpha/alpha/pmap.c:1.265
--- src/sys/arch/alpha/alpha/pmap.c:1.264	Fri Mar 29 03:11:32 2019
+++ src/sys/arch/alpha/alpha/pmap.c	Fri Jan 17 21:59:05 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.264 2019/03/29 03:11:32 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.265 2020/01/17 21:59:05 skrll Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc.
@@ -140,7 +140,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.264 2019/03/29 03:11:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.265 2020/01/17 21:59:05 skrll Exp $");
 
 #include 
 #include 
@@ -1011,7 +1011,7 @@ pmap_steal_memory(vsize_t size, vaddr_t 
 {
 	int npgs;
 	vaddr_t va;
-	paddr_t pa; 
+	paddr_t pa;
 
 	uvm_physseg_t bank;
 
@@ -1851,7 +1851,7 @@ out:
 	PMAP_MAP_TO_HEAD_UNLOCK();
 	if (opv)
 		pmap_pv_free(opv);
-	
+
 	return error;
 }
 



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

2020-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 17 22:03:56 UTC 2020

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

Log Message:
Convert #if 0'ed code to uvm_hotplug api


To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.266 src/sys/arch/alpha/alpha/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/alpha/alpha/pmap.c
diff -u src/sys/arch/alpha/alpha/pmap.c:1.265 src/sys/arch/alpha/alpha/pmap.c:1.266
--- src/sys/arch/alpha/alpha/pmap.c:1.265	Fri Jan 17 21:59:05 2020
+++ src/sys/arch/alpha/alpha/pmap.c	Fri Jan 17 22:03:56 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.265 2020/01/17 21:59:05 skrll Exp $ */
+/* $NetBSD: pmap.c,v 1.266 2020/01/17 22:03:56 skrll Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc.
@@ -140,7 +140,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.265 2020/01/17 21:59:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.266 2020/01/17 22:03:56 skrll Exp $");
 
 #include 
 #include 
@@ -1030,8 +1030,8 @@ pmap_steal_memory(vsize_t size, vaddr_t 
 
 #if 0
 		printf(" bank %d: avail_start 0x%"PRIxPADDR", start 0x%"PRIxPADDR", "
-		"avail_end 0x%"PRIxPADDR"\n", bank, VM_PHYSMEM_PTR(bank)->avail_start,
-		VM_PHYSMEM_PTR(bank)->start, VM_PHYSMEM_PTR(bank)->avail_end);
+		"avail_end 0x%"PRIxPADDR"\n", bank, uvm_physseg_get_avail_start(bank),
+		uvm_physseg_get_start(bank), uvm_physseg_get_avail_end(bank));
 #endif
 
 		if (uvm_physseg_get_avail_start(bank) != uvm_physseg_get_start(bank) ||
@@ -1040,7 +1040,7 @@ pmap_steal_memory(vsize_t size, vaddr_t 
 
 #if 0
 		printf(" avail_end - avail_start = 0x%"PRIxPADDR"\n",
-		VM_PHYSMEM_PTR(bank)->avail_end - VM_PHYSMEM_PTR(bank)->avail_start);
+		uvm_physseg_get_avail_end(bank) - uvm_physseg_get_avail_start(bank));
 #endif
 
 		if (uvm_physseg_get_avail_end(bank) - uvm_physseg_get_avail_start(bank)
@@ -1098,14 +1098,16 @@ pmap_init(void)
 	pmap_initialized = true;
 
 #if 0
-	for (bank = 0; bank < vm_nphysseg; bank++) {
+	for (uvm_physseg_t bank = uvm_physseg_get_first();
+	uvm_physseg_valid_p(bank);
+	bank = uvm_physseg_get_next(bank)) {
 		printf("bank %d\n", bank);
-		printf("\tstart = 0x%x\n", ptoa(VM_PHYSMEM_PTR(bank)->start));
-		printf("\tend = 0x%x\n", ptoa(VM_PHYSMEM_PTR(bank)->end));
-		printf("\tavail_start = 0x%x\n",
-		ptoa(VM_PHYSMEM_PTR(bank)->avail_start));
-		printf("\tavail_end = 0x%x\n",
-		ptoa(VM_PHYSMEM_PTR(bank)->avail_end));
+		printf("\tstart = 0x%lx\n", ptoa(uvm_physseg_get_start(bank)));
+		printf("\tend = 0x%lx\n", ptoa(uvm_physseg_get_end(bank)));
+		printf("\tavail_start = 0x%lx\n",
+		ptoa(uvm_physseg_get_avail_start(bank)));
+		printf("\tavail_end = 0x%lx\n",
+		ptoa(uvm_physseg_get_avail_end(bank)));
 	}
 #endif
 }



CVS commit: [ad-namecache] src/sys/kern

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 21:53:01 UTC 2020

Modified Files:
src/sys/kern [ad-namecache]: exec_script.c

Log Message:
LK_SHARED for VOP_ACCESS().


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.80.2.1 src/sys/kern/exec_script.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/exec_script.c
diff -u src/sys/kern/exec_script.c:1.80 src/sys/kern/exec_script.c:1.80.2.1
--- src/sys/kern/exec_script.c:1.80	Sun Sep 15 20:21:12 2019
+++ src/sys/kern/exec_script.c	Fri Jan 17 21:53:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_script.c,v 1.80 2019/09/15 20:21:12 christos Exp $	*/
+/*	$NetBSD: exec_script.c,v 1.80.2.1 2020/01/17 21:53:01 ad Exp $	*/
 
 /*
  * Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.80 2019/09/15 20:21:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.80.2.1 2020/01/17 21:53:01 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_script.h"
@@ -216,7 +216,7 @@ check_shell:
 	 * close all open fd's when the start.  That kills this
 	 * method of implementing "safe" set-id and x-only scripts.
 	 */
-	vn_lock(epp->ep_vp, LK_EXCLUSIVE | LK_RETRY);
+	vn_lock(epp->ep_vp, LK_SHARED | LK_RETRY);
 	error = VOP_ACCESS(epp->ep_vp, VREAD, l->l_cred);
 	VOP_UNLOCK(epp->ep_vp);
 	if (error == EACCES



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

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 21:14:16 UTC 2020

Modified Files:
src/sys/arch/amd64/include: param.h

Log Message:
Bump UBC_WINSHIFT & UBC_NWINS to more reasonable values for amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/amd64/include/param.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/amd64/include/param.h
diff -u src/sys/arch/amd64/include/param.h:1.33 src/sys/arch/amd64/include/param.h:1.34
--- src/sys/arch/amd64/include/param.h:1.33	Thu Nov 14 16:23:52 2019
+++ src/sys/arch/amd64/include/param.h	Fri Jan 17 21:14:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.33 2019/11/14 16:23:52 maxv Exp $	*/
+/*	$NetBSD: param.h,v 1.34 2020/01/17 21:14:16 ad Exp $	*/
 
 #ifdef __x86_64__
 
@@ -113,6 +113,17 @@
 #define	NKMEMPAGES_MAX_UNLIMITED 1
 
 /*
+ * Defaults for Unified Buffer Cache parameters.
+ */
+
+#ifndef UBC_WINSHIFT
+#define	UBC_WINSHIFT	16	/* 64kB */
+#endif
+#ifndef UBC_NWINS
+#define	UBC_NWINS	4096	/* 256MB */
+#endif
+
+/*
  * XXXfvdl the PD* stuff is different from i386.
  */
 /*



CVS commit: src/sys/external/bsd/drm2/include/asm

2020-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan 17 20:28:59 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/asm: io.h

Log Message:
Don't use memset as memset_io on aarch64. With c=0 it uses the "dc zva"
cache maintenance instruction as an optimization which does not work on
device memory.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/asm/io.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/external/bsd/drm2/include/asm/io.h
diff -u src/sys/external/bsd/drm2/include/asm/io.h:1.4 src/sys/external/bsd/drm2/include/asm/io.h:1.5
--- src/sys/external/bsd/drm2/include/asm/io.h:1.4	Wed Feb 25 14:56:17 2015
+++ src/sys/external/bsd/drm2/include/asm/io.h	Fri Jan 17 20:28:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.h,v 1.4 2015/02/25 14:56:17 riastradh Exp $	*/
+/*	$NetBSD: io.h,v 1.5 2020/01/17 20:28:59 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -46,7 +46,22 @@
 
 #define	memcpy_fromio	memcpy
 #define	memcpy_toio	memcpy
+
+#if defined(__NetBSD__) && defined(__aarch64__)
+static inline void *
+memset_io(void *b, int c, size_t len)
+{
+	uint32_t *ptr = b;
+	while (len >= 4) {
+		*ptr++ = c;
+		len -= 4;
+	}
+	KASSERT(len == 0);
+	return b;
+}
+#else
 #define	memset_io	memset
+#endif
 
 /* XXX wrong place */
 #define	__force



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

2020-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 17 20:28:14 UTC 2020

Modified Files:
src/sys/arch/arm/include: types.h

Log Message:
Sort __HAVE_* defines


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/include/types.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/arm/include/types.h
diff -u src/sys/arch/arm/include/types.h:1.38 src/sys/arch/arm/include/types.h:1.39
--- src/sys/arch/arm/include/types.h:1.38	Sat Apr  6 03:06:25 2019
+++ src/sys/arch/arm/include/types.h	Fri Jan 17 20:28:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.38 2019/04/06 03:06:25 thorpej Exp $	*/
+/*	$NetBSD: types.h,v 1.39 2020/01/17 20:28:14 skrll Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -79,14 +79,14 @@ typedef	int		__register_t;
 #define	__SIMPLELOCK_LOCKED	1
 #define	__SIMPLELOCK_UNLOCKED	0
 
-#define	__HAVE_SYSCALL_INTERN
-#define	__HAVE_NEW_STYLE_BUS_H
-#define	__HAVE_MINIMAL_EMUL
-#define __HAVE_CPU_DATA_FIRST
-#define	__HAVE___LWP_GETPRIVATE_FAST
 #define	__HAVE_COMMON___TLS_GET_ADDR
-#define	__HAVE_TLS_VARIANT_I
+#define	__HAVE_CPU_DATA_FIRST
+#define	__HAVE_MINIMAL_EMUL
+#define	__HAVE_NEW_STYLE_BUS_H
 #define	__HAVE_OLD_DISKLABEL
+#define	__HAVE_SYSCALL_INTERN
+#define	__HAVE_TLS_VARIANT_I
+#define	__HAVE___LWP_GETPRIVATE_FAST
 #if defined(__ARM_EABI__) && defined(_ARM_ARCH_6)
 #define	__HAVE_ATOMIC64_OPS
 #endif



CVS commit: src/sys/kern

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 20:27:28 UTC 2020

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

Log Message:
sched_catchlwp(): fix an inverted test that could have caused performance
degradation.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/kern/kern_runq.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_runq.c
diff -u src/sys/kern/kern_runq.c:1.59 src/sys/kern/kern_runq.c:1.60
--- src/sys/kern/kern_runq.c:1.59	Mon Jan 13 11:53:24 2020
+++ src/sys/kern/kern_runq.c	Fri Jan 17 20:27:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_runq.c,v 1.59 2020/01/13 11:53:24 ad Exp $	*/
+/*	$NetBSD: kern_runq.c,v 1.60 2020/01/17 20:27:28 ad Exp $	*/
 
 /*-
  * Copyright (c) 2019, 2020 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.59 2020/01/13 11:53:24 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.60 2020/01/17 20:27:28 ad Exp $");
 
 #include "opt_dtrace.h"
 
@@ -631,13 +631,13 @@ sched_catchlwp(struct cpu_info *ci)
 	spc = >ci_schedstate;
 
 	/*
-	 * Be more aggressive if this CPU is first class, and the other is
-	 * not.
+	 * Be more aggressive if this CPU is first class, and the other
+	 * is not.
 	 */
-	gentle = ((curspc->spc_flags & SPCF_1STCLASS) != 0 &&
-	(spc->spc_flags & SPCF_1STCLASS) == 0);
+	gentle = ((curspc->spc_flags & SPCF_1STCLASS) == 0 ||
+	(spc->spc_flags & SPCF_1STCLASS) != 0);
 
-	if ((gentle && spc->spc_mcount < min_catch) ||
+	if (spc->spc_mcount < (gentle ? min_catch : 1) ||
 	curspc->spc_psid != spc->spc_psid) {
 		spc_unlock(ci);
 		return NULL;



CVS commit: src/sys/kern

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 20:26:22 UTC 2020

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

Log Message:
kernel_lock:

- Defer setting ci_biglock_wanted for a bit, because if curlwp holds a mutex
  or rwlock, and otherlwp is spinning waiting for the mutex/rwlock, setting
  ci_biglock_wanted causes otherlwp to block to avoid deadlock.  If the spin
  on kernel_lock is short there's no point causing trouble.

- Do exponential backoff.

- Put the spinout check under LOCKDEBUG to match the others.


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/sys/kern/kern_lock.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_lock.c
diff -u src/sys/kern/kern_lock.c:1.164 src/sys/kern/kern_lock.c:1.165
--- src/sys/kern/kern_lock.c:1.164	Tue Dec  3 15:20:59 2019
+++ src/sys/kern/kern_lock.c	Fri Jan 17 20:26:22 2020
@@ -1,7 +1,7 @@
-/*	$NetBSD: kern_lock.c,v 1.164 2019/12/03 15:20:59 riastradh Exp $	*/
+/*	$NetBSD: kern_lock.c,v 1.165 2020/01/17 20:26:22 ad Exp $	*/
 
 /*-
- * Copyright (c) 2002, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2020 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.164 2019/12/03 15:20:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.165 2020/01/17 20:26:22 ad Exp $");
 
 #include 
 #include 
@@ -164,7 +164,10 @@ _kernel_lock(int nlocks)
 	LOCKSTAT_TIMER(spintime);
 	LOCKSTAT_FLAG(lsflag);
 	struct lwp *owant;
-	u_int spins;
+	u_int count;
+#ifdef LOCKDEBUG
+	u_int spins = 0;
+#endif
 	int s;
 	struct lwp *l = curlwp;
 
@@ -184,7 +187,7 @@ _kernel_lock(int nlocks)
 	LOCKDEBUG_WANTLOCK(kernel_lock_dodebug, kernel_lock, RETURN_ADDRESS,
 	0);
 
-	if (__cpu_simple_lock_try(kernel_lock)) {
+	if (__predict_true(__cpu_simple_lock_try(kernel_lock))) {
 		ci->ci_biglock_count = nlocks;
 		l->l_blcnt = nlocks;
 		LOCKDEBUG_LOCKED(kernel_lock_dodebug, kernel_lock, NULL,
@@ -200,10 +203,13 @@ _kernel_lock(int nlocks)
 	 * is required to ensure that the result of any mutex_exit()
 	 * by the current LWP becomes visible on the bus before the set
 	 * of ci->ci_biglock_wanted becomes visible.
+	 *
+	 * However, we won't set ci_biglock_wanted until we've spun for
+	 * a bit, as we don't want to make any lock waiters in rw_oncpu()
+	 * or mutex_oncpu() block prematurely.
 	 */
 	membar_producer();
 	owant = ci->ci_biglock_wanted;
-	ci->ci_biglock_wanted = l;
 
 	/*
 	 * Spin until we acquire the lock.  Once we have it, record the
@@ -212,23 +218,30 @@ _kernel_lock(int nlocks)
 	LOCKSTAT_ENTER(lsflag);
 	LOCKSTAT_START_TIMER(lsflag, spintime);
 
-	spins = 0;
+	count = SPINLOCK_BACKOFF_MIN;
 	do {
 		splx(s);
 		while (__SIMPLELOCK_LOCKED_P(kernel_lock)) {
+#ifdef LOCKDEBUG
 			if (SPINLOCK_SPINOUT(spins)) {
 extern int start_init_exec;
 if (!start_init_exec)
 	_KERNEL_LOCK_ABORT("spinout");
 			}
-			SPINLOCK_BACKOFF_HOOK;
-			SPINLOCK_SPIN_HOOK;
+#endif
+			SPINLOCK_BACKOFF(count);
+			if (count == SPINLOCK_BACKOFF_MAX) {
+/* Ok, waiting for real. */
+ci->ci_biglock_wanted = l;
+			}
 		}
 		s = splvm();
 	} while (!__cpu_simple_lock_try(kernel_lock));
 
 	ci->ci_biglock_count = nlocks;
 	l->l_blcnt = nlocks;
+	splx(s);
+
 	LOCKSTAT_STOP_TIMER(lsflag, spintime);
 	LOCKDEBUG_LOCKED(kernel_lock_dodebug, kernel_lock, NULL,
 	RETURN_ADDRESS, 0);
@@ -237,7 +250,6 @@ _kernel_lock(int nlocks)
 		LB_KERNEL_LOCK | LB_SPIN, 1, spintime, RETURN_ADDRESS);
 	}
 	LOCKSTAT_EXIT(lsflag);
-	splx(s);
 
 	/*
 	 * Now that we have kernel_lock, reset ci_biglock_wanted.  This
@@ -257,7 +269,9 @@ _kernel_lock(int nlocks)
 	 * prevents stores from a following mutex_exit() being reordered
 	 * to occur before our store to ci_biglock_wanted above.
 	 */
+#ifndef __HAVE_ATOMIC_AS_MEMBAR
 	membar_enter();
+#endif
 }
 
 /*



CVS commit: src/distrib/sets/lists/tests

2020-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 17 20:14:39 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
fix names of debug files and missing directories


To generate a diff of this commit:
cvs rdiff -u -r1.826 -r1.827 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.826 src/distrib/sets/lists/tests/mi:1.827
--- src/distrib/sets/lists/tests/mi:1.826	Fri Jan 17 14:44:12 2020
+++ src/distrib/sets/lists/tests/mi	Fri Jan 17 15:14:39 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.826 2020/01/17 19:44:12 christos Exp $
+# $NetBSD: mi,v 1.827 2020/01/17 20:14:39 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -86,7 +86,8 @@
 ./usr/libdata/debug/usr/tests/kyua-testerstests-kyua-tests	compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib	tests-lib-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/csu	tests-lib-debug		compattestfile,atf
-./usr/libdata/debug/usr/tests/lib/libarchive/h_libarchive		tests-lib-debug	compattestfile,atf
+./usr/libdata/debug/usr/tests/lib/libarchivetests-lib-debug	compattestfile,atf
+./usr/libdata/debug/usr/tests/lib/libarchive/h_libarchive.debug		tests-lib-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/libbluetoothtests-lib-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/libbpfjittests-lib-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/libc	tests-lib-debug		compattestfile,atf
@@ -186,10 +187,12 @@
 ./usr/libdata/debug/usr/tests/sys/netinet6tests-sys-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/syscall	tests-obsolete		obsolete
 ./usr/libdata/debug/usr/tests/usr.bin	tests-usr.bin-debug	compattestfile,atf
-./usr/libdata/debug/usr/tests/usr.bin/cpio/h_cpio			tests-usr.bin-debug	compattestfile,atf
+./usr/libdata/debug/usr/tests/usr.bin/cpiotests-usr.bin-debug	compattestfile,atf
+./usr/libdata/debug/usr/tests/usr.bin/cpio/h_cpio.debug			tests-usr.bin-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/usr.bin/idtests-usr.bin-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/usr.bin/netpgpverify			tests-usr.bin-debug	compattestfile,atf
-./usr/libdata/debug/usr/tests/usr.bin/tar/h_tartests-usr.bin-debug	compattestfile,atf
+./usr/libdata/debug/usr/tests/usr.bin/tartests-usr.bin-debug	compattestfile,atf
+./usr/libdata/debug/usr/tests/usr.bin/tar/h_tar.debug			tests-usr.bin-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/usr.sbin	tests-usr.sbin-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/util	tests-obsolete		obsolete
 ./usr/libdata/debug/usr/tests/util/df	tests-obsolete		obsolete



CVS commit: src/sys/sys

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 20:11:03 UTC 2020

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

Log Message:
NetBSD 9.99.39 - VFS changes.


To generate a diff of this commit:
cvs rdiff -u -r1.641 -r1.642 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.641 src/sys/sys/param.h:1.642
--- src/sys/sys/param.h:1.641	Wed Jan 15 18:45:57 2020
+++ src/sys/sys/param.h	Fri Jan 17 20:11:03 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.641 2020/01/15 18:45:57 ad Exp $	*/
+/*	$NetBSD: param.h,v 1.642 2020/01/17 20:11:03 ad Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	999003800	/* NetBSD 9.99.38 */
+#define	__NetBSD_Version__	999003900	/* NetBSD 9.99.39 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/external/bsd/drm2/include/linux

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 20:09:47 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/include/linux: mm.h

Log Message:
set_page_dirty: take the vmobjlock if present


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/drm2/include/linux/mm.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/external/bsd/drm2/include/linux/mm.h
diff -u src/sys/external/bsd/drm2/include/linux/mm.h:1.10 src/sys/external/bsd/drm2/include/linux/mm.h:1.11
--- src/sys/external/bsd/drm2/include/linux/mm.h:1.10	Wed Jan 15 17:55:44 2020
+++ src/sys/external/bsd/drm2/include/linux/mm.h	Fri Jan 17 20:09:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mm.h,v 1.10 2020/01/15 17:55:44 ad Exp $	*/
+/*	$NetBSD: mm.h,v 1.11 2020/01/17 20:09:47 ad Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -95,8 +95,16 @@ kvfree(void *ptr)
 static inline void
 set_page_dirty(struct page *page)
 {
+	struct vm_page *pg = >p_vmp;
 
-	uvm_pagemarkdirty(>p_vmp, UVM_PAGE_STATUS_DIRTY);
+	/* XXX */
+	if (pg->uobject != NULL) {
+		mutex_enter(pg->uobject->vmobjlock);
+		uvm_pagemarkdirty(pg, UVM_PAGE_STATUS_DIRTY);
+		mutex_exit(pg->uobject->vmobjlock);
+	} else {
+		uvm_pagemarkdirty(pg, UVM_PAGE_STATUS_DIRTY);
+	}
 }
 
 #endif  /* _LINUX_MM_H_ */



CVS commit: src

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 20:08:10 UTC 2020

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_ctldir.c
zfs_vfsops.c
src/sys/coda: coda_vfsops.c coda_vfsops.h coda_vnops.c
src/sys/compat/common: vfs_syscalls_20.c vfs_syscalls_30.c
src/sys/compat/netbsd32: netbsd32_compat_30.c
src/sys/fs/adosfs: adlookup.c advfsops.c advnops.c
src/sys/fs/autofs: autofs_vfsops.c autofs_vnops.c
src/sys/fs/cd9660: cd9660_vfsops.c
src/sys/fs/efs: efs_vfsops.c
src/sys/fs/filecorefs: filecore_vfsops.c
src/sys/fs/hfs: hfs_vfsops.c
src/sys/fs/msdosfs: msdosfs_vfsops.c
src/sys/fs/nilfs: nilfs_vfsops.c
src/sys/fs/ntfs: ntfs_subr.c ntfs_vfsops.c
src/sys/fs/ptyfs: ptyfs.h ptyfs_vfsops.c
src/sys/fs/puffs: puffs_vfsops.c
src/sys/fs/smbfs: smbfs_vfsops.c
src/sys/fs/sysvbfs: sysvbfs_vfsops.c sysvbfs_vnops.c
src/sys/fs/tmpfs: tmpfs_vfsops.c
src/sys/fs/udf: udf_rename.c udf_subr.c udf_subr.h udf_vfsops.c
udf_vnops.c
src/sys/fs/union: union_vfsops.c union_vnops.c
src/sys/fs/unionfs: unionfs_vfsops.c
src/sys/fs/v7fs: v7fs_vfsops.c v7fs_vnops.c
src/sys/kern: vfs_lookup.c vfs_mount.c vfs_subr.c vfs_syscalls.c
src/sys/miscfs/fdesc: fdesc.h fdesc_vfsops.c
src/sys/miscfs/genfs: layer_extern.h layer_vfsops.c
src/sys/miscfs/kernfs: kernfs.h kernfs_vfsops.c
src/sys/miscfs/procfs: procfs.h procfs_vfsops.c
src/sys/nfs: nfs_export.c nfs_serv.c nfs_srvsubs.c nfs_vfsops.c
src/sys/rump/librump/rumpvfs: rump_vfs.c rumpfs.c
src/sys/sys: mount.h
src/sys/ufs/chfs: chfs_vfsops.c chfs_vnode.c chfs_vnops.c
src/sys/ufs/ext2fs: ext2fs_vfsops.c
src/sys/ufs/ffs: ffs_quota2.c ffs_snapshot.c ffs_vfsops.c ffs_wapbl.c
src/sys/ufs/lfs: lfs_alloc.c lfs_rfw.c lfs_vfsops.c ulfs_extattr.c
ulfs_extern.h ulfs_quota2.c ulfs_vfsops.c
src/sys/ufs/ufs: ufs_extattr.c ufs_extern.h ufs_vfsops.c

Log Message:
VFS_VGET(), VFS_ROOT(), VFS_FHTOVP(): give them a "int lktype" argument, to
allow us to get shared locks (or no lock) on the returned vnode.  Matches
FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c
cvs rdiff -u -r1.25 -r1.26 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c
cvs rdiff -u -r1.86 -r1.87 src/sys/coda/coda_vfsops.c
cvs rdiff -u -r1.20 -r1.21 src/sys/coda/coda_vfsops.h
cvs rdiff -u -r1.107 -r1.108 src/sys/coda/coda_vnops.c
cvs rdiff -u -r1.44 -r1.45 src/sys/compat/common/vfs_syscalls_20.c
cvs rdiff -u -r1.39 -r1.40 src/sys/compat/common/vfs_syscalls_30.c
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/netbsd32/netbsd32_compat_30.c
cvs rdiff -u -r1.20 -r1.21 src/sys/fs/adosfs/adlookup.c
cvs rdiff -u -r1.77 -r1.78 src/sys/fs/adosfs/advfsops.c
cvs rdiff -u -r1.50 -r1.51 src/sys/fs/adosfs/advnops.c
cvs rdiff -u -r1.8 -r1.9 src/sys/fs/autofs/autofs_vfsops.c
cvs rdiff -u -r1.4 -r1.5 src/sys/fs/autofs/autofs_vnops.c
cvs rdiff -u -r1.93 -r1.94 src/sys/fs/cd9660/cd9660_vfsops.c
cvs rdiff -u -r1.28 -r1.29 src/sys/fs/efs/efs_vfsops.c
cvs rdiff -u -r1.81 -r1.82 src/sys/fs/filecorefs/filecore_vfsops.c
cvs rdiff -u -r1.35 -r1.36 src/sys/fs/hfs/hfs_vfsops.c
cvs rdiff -u -r1.130 -r1.131 src/sys/fs/msdosfs/msdosfs_vfsops.c
cvs rdiff -u -r1.24 -r1.25 src/sys/fs/nilfs/nilfs_vfsops.c
cvs rdiff -u -r1.62 -r1.63 src/sys/fs/ntfs/ntfs_subr.c
cvs rdiff -u -r1.108 -r1.109 src/sys/fs/ntfs/ntfs_vfsops.c
cvs rdiff -u -r1.14 -r1.15 src/sys/fs/ptyfs/ptyfs.h
cvs rdiff -u -r1.56 -r1.57 src/sys/fs/ptyfs/ptyfs_vfsops.c
cvs rdiff -u -r1.123 -r1.124 src/sys/fs/puffs/puffs_vfsops.c
cvs rdiff -u -r1.106 -r1.107 src/sys/fs/smbfs/smbfs_vfsops.c
cvs rdiff -u -r1.46 -r1.47 src/sys/fs/sysvbfs/sysvbfs_vfsops.c
cvs rdiff -u -r1.63 -r1.64 src/sys/fs/sysvbfs/sysvbfs_vnops.c
cvs rdiff -u -r1.75 -r1.76 src/sys/fs/tmpfs/tmpfs_vfsops.c
cvs rdiff -u -r1.12 -r1.13 src/sys/fs/udf/udf_rename.c
cvs rdiff -u -r1.147 -r1.148 src/sys/fs/udf/udf_subr.c
cvs rdiff -u -r1.20 -r1.21 src/sys/fs/udf/udf_subr.h
cvs rdiff -u -r1.76 -r1.77 src/sys/fs/udf/udf_vfsops.c
cvs rdiff -u -r1.107 -r1.108 src/sys/fs/udf/udf_vnops.c
cvs rdiff -u -r1.79 -r1.80 src/sys/fs/union/union_vfsops.c
cvs rdiff -u -r1.70 -r1.71 src/sys/fs/union/union_vnops.c
cvs rdiff -u -r1.13 -r1.14 src/sys/fs/unionfs/unionfs_vfsops.c
cvs rdiff -u -r1.16 -r1.17 src/sys/fs/v7fs/v7fs_vfsops.c
cvs rdiff -u -r1.26 -r1.27 src/sys/fs/v7fs/v7fs_vnops.c
cvs rdiff -u -r1.212 -r1.213 src/sys/kern/vfs_lookup.c
cvs rdiff -u -r1.73 -r1.74 src/sys/kern/vfs_mount.c
cvs rdiff -u -r1.478 -r1.479 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.539 -r1.540 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.22 -r1.23 src/sys/miscfs/fdesc/fdesc.h
cvs rdiff -u -r1.92 -r1.93 src/sys/miscfs/fdesc/fdesc_vfsops.c
cvs rdiff -u -r1.40 -r1.41 

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

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 19:56:50 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_gem.c
src/sys/external/bsd/drm2/dist/drm/i915: i915_gem.c i915_gem_fence.c

Log Message:
Apply patch from kamil@: vmobjlock needs to be held for uvm_pagemarkdirty().


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/drm2/dist/drm/drm_gem.c
cvs rdiff -u -r1.55 -r1.56 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_fence.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/drm_gem.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_gem.c:1.11 src/sys/external/bsd/drm2/dist/drm/drm_gem.c:1.12
--- src/sys/external/bsd/drm2/dist/drm/drm_gem.c:1.11	Wed Jan 15 17:55:43 2020
+++ src/sys/external/bsd/drm2/dist/drm/drm_gem.c	Fri Jan 17 19:56:49 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_gem.c,v 1.11 2020/01/15 17:55:43 ad Exp $	*/
+/*	$NetBSD: drm_gem.c,v 1.12 2020/01/17 19:56:49 ad Exp $	*/
 
 /*
  * Copyright © 2008 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_gem.c,v 1.11 2020/01/15 17:55:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_gem.c,v 1.12 2020/01/17 19:56:49 ad Exp $");
 
 #include 
 #include 
@@ -613,8 +613,10 @@ drm_gem_put_pages(struct drm_gem_object 
 
 	for (i = 0; i < (obj->size >> PAGE_SHIFT); i++) {
 		if (dirty) {
+			mutex_enter(obj->filp->vmobjlock);
 			uvm_pagemarkdirty([i]->p_vmp,
 			UVM_PAGE_STATUS_DIRTY);
+			mutex_exit(obj->filp->vmobjlock);
 		}
 	}
 

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.55 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.56
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.55	Wed Jan 15 17:55:43 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c	Fri Jan 17 19:56:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_gem.c,v 1.55 2020/01/15 17:55:43 ad Exp $	*/
+/*	$NetBSD: i915_gem.c,v 1.56 2020/01/17 19:56:50 ad Exp $	*/
 
 /*
  * Copyright © 2008-2015 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.55 2020/01/15 17:55:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.56 2020/01/17 19:56:50 ad Exp $");
 
 #ifdef __NetBSD__
 #if 0/* XXX uvmhist option?  */
@@ -2643,10 +2643,12 @@ i915_gem_object_put_pages_gtt(struct drm
 		obj->dirty = 0;
 
 	if (obj->dirty) {
+		mutex_enter(obj->base.filp->vmobjlock);
 		TAILQ_FOREACH(page, >pageq, pageq.queue) {
 			uvm_pagemarkdirty(page, UVM_PAGE_STATUS_DIRTY);
 			/* XXX mark page accessed */
 		}
+		mutex_exit(obj->base.filp->vmobjlock);
 	}
 	obj->dirty = 0;
 

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_fence.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_fence.c:1.6 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_fence.c:1.7
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_fence.c:1.6	Wed Jan 15 17:55:43 2020
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem_fence.c	Fri Jan 17 19:56:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: i915_gem_fence.c,v 1.6 2020/01/15 17:55:43 ad Exp $	*/
+/*	$NetBSD: i915_gem_fence.c,v 1.7 2020/01/17 19:56:50 ad Exp $	*/
 
 /*
  * Copyright © 2008-2015 Intel Corporation
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_fence.c,v 1.6 2020/01/15 17:55:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_fence.c,v 1.7 2020/01/17 19:56:50 ad Exp $");
 
 #include 
 #include 
@@ -769,7 +769,9 @@ i915_gem_object_do_bit_17_swizzle(struct
 		(test_bit(i, obj->bit_17) != 0)) {
 			i915_gem_swizzle_page(container_of(page, struct page,
 p_vmp));
+			mutex_enter(obj->base.filp->vmobjlock);
 			uvm_pagemarkdirty(page, UVM_PAGE_STATUS_DIRTY);
+			mutex_exit(obj->base.filp->vmobjlock);
 		}
 		i += 1;
 	}



CVS commit: src/distrib/sets/lists/tests

2020-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 17 19:44:12 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
remove trailing ,


To generate a diff of this commit:
cvs rdiff -u -r1.825 -r1.826 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.825 src/distrib/sets/lists/tests/mi:1.826
--- src/distrib/sets/lists/tests/mi:1.825	Fri Jan 17 11:23:04 2020
+++ src/distrib/sets/lists/tests/mi	Fri Jan 17 14:44:12 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.825 2020/01/17 16:23:04 christos Exp $
+# $NetBSD: mi,v 1.826 2020/01/17 19:44:12 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4232,35 +4232,35 @@
 ./usr/tests/usr.bin/config/support/conf/Makefile.kern.inc	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/config/support/conf/files	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/config/t_config		tests-usr.bin-tests	compattestfile,atf
-./usr/tests/usr.bin/cpio			tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/Atffile 		tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/h_cpio			tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/t_cpio			tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_extract.cpio.Z.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_extract.cpio.bz2.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_extract.cpio.grz.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_extract.cpio.gz.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_extract.cpio.lrz.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_extract.cpio.lz.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_extract.cpio.lz4.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_extract.cpio.lzma.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_extract.cpio.lzo.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_extract.cpio.xz.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_extract.cpio.zst.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_gcpio_compat_ref.bin.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_gcpio_compat_ref.crc.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_gcpio_compat_ref.newc.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_gcpio_compat_ref.ustar.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_gcpio_compat_ref_nosym.bin.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_gcpio_compat_ref_nosym.crc.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_gcpio_compat_ref_nosym.newc.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_gcpio_compat_ref_nosym.ustar.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_option_f.cpio.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_option_m.cpio.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_option_passphrase.zip.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_option_t.cpio.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_option_t.stdout.uu 	tests-usr.bin-tests	compattestfile,atf,
-./usr/tests/usr.bin/cpio/test_option_tv.stdout.uu 	tests-usr.bin-tests	compattestfile,atf,
+./usr/tests/usr.bin/cpio			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cpio/Atffile 		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cpio/h_cpio			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cpio/t_cpio			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cpio/test_extract.cpio.Z.uu 	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cpio/test_extract.cpio.bz2.uu 	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cpio/test_extract.cpio.grz.uu 	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cpio/test_extract.cpio.gz.uu 	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cpio/test_extract.cpio.lrz.uu 	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cpio/test_extract.cpio.lz.uu 	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cpio/test_extract.cpio.lz4.uu 	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cpio/test_extract.cpio.lzma.uu 	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cpio/test_extract.cpio.lzo.uu 	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/cpio/test_extract.cpio.xz.uu 	tests-usr.bin-tests	

CVS commit: src/sys/kern

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 19:33:14 UTC 2020

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

Log Message:
biodone2(): don't acquire kernel_lock for anybody anymore.


To generate a diff of this commit:
cvs rdiff -u -r1.286 -r1.287 src/sys/kern/vfs_bio.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_bio.c
diff -u src/sys/kern/vfs_bio.c:1.286 src/sys/kern/vfs_bio.c:1.287
--- src/sys/kern/vfs_bio.c:1.286	Tue Dec 31 13:07:13 2019
+++ src/sys/kern/vfs_bio.c	Fri Jan 17 19:33:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_bio.c,v 1.286 2019/12/31 13:07:13 ad Exp $	*/
+/*	$NetBSD: vfs_bio.c,v 1.287 2020/01/17 19:33:14 ad Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -123,7 +123,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.286 2019/12/31 13:07:13 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.287 2020/01/17 19:33:14 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bufcache.h"
@@ -1666,11 +1666,9 @@ biodone2(buf_t *bp)
 
 		/* Note callout done, then call out. */
 		KASSERT(!cv_has_waiters(>b_done));
-		KERNEL_LOCK(1, NULL);		/* XXXSMP */
 		bp->b_iodone = NULL;
 		mutex_exit(bp->b_objlock);
 		(*callout)(bp);
-		KERNEL_UNLOCK_ONE(NULL);	/* XXXSMP */
 	} else if (ISSET(bp->b_flags, B_ASYNC)) {
 		/* If async, release. */
 		BIOHIST_LOG(biohist, "async", 0, 0, 0, 0);



CVS commit: src/sys/dev

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 19:31:31 UTC 2020

Modified Files:
src/sys/dev: cgd.c vnd.c
src/sys/dev/ata: ld_ataraid.c

Log Message:
Acquire kernel_lock in the bp->b_iodone callback.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/cgd.c
cvs rdiff -u -r1.272 -r1.273 src/sys/dev/vnd.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/ata/ld_ataraid.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/cgd.c
diff -u src/sys/dev/cgd.c:1.118 src/sys/dev/cgd.c:1.119
--- src/sys/dev/cgd.c:1.118	Sat Dec 14 16:58:38 2019
+++ src/sys/dev/cgd.c	Fri Jan 17 19:31:30 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.118 2019/12/14 16:58:38 riastradh Exp $ */
+/* $NetBSD: cgd.c,v 1.119 2020/01/17 19:31:30 ad Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.118 2019/12/14 16:58:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.119 2020/01/17 19:31:30 ad Exp $");
 
 #include 
 #include 
@@ -591,8 +591,10 @@ cgdiodone(struct buf *nbp)
 	if (obp->b_error != 0)
 		obp->b_resid = obp->b_bcount;
 
+	KERNEL_LOCK(1, NULL);		/* XXXSMP */
 	dk_done(dksc, obp);
 	dk_start(dksc, NULL);
+	KERNEL_UNLOCK_ONE(NULL);	/* XXXSMP */
 }
 
 static int

Index: src/sys/dev/vnd.c
diff -u src/sys/dev/vnd.c:1.272 src/sys/dev/vnd.c:1.273
--- src/sys/dev/vnd.c:1.272	Fri Mar  1 11:06:56 2019
+++ src/sys/dev/vnd.c	Fri Jan 17 19:31:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.272 2019/03/01 11:06:56 pgoyette Exp $	*/
+/*	$NetBSD: vnd.c,v 1.273 2020/01/17 19:31:30 ad Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.272 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.273 2020/01/17 19:31:30 ad Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -968,6 +968,7 @@ vndiodone(struct buf *bp)
 	struct buf *obp = bp->b_private;
 	int s = splbio();
 
+	KERNEL_LOCK(1, NULL);		/* XXXSMP */
 	KASSERT(>vx_buf == bp);
 	KASSERT(vnd->sc_active > 0);
 #ifdef DEBUG
@@ -982,6 +983,7 @@ vndiodone(struct buf *bp)
 	if (vnd->sc_active == 0) {
 		wakeup(>sc_tab);
 	}
+	KERNEL_UNLOCK_ONE(NULL);	/* XXXSMP */
 	splx(s);
 	obp->b_error = bp->b_error;
 	obp->b_resid = bp->b_resid;

Index: src/sys/dev/ata/ld_ataraid.c
diff -u src/sys/dev/ata/ld_ataraid.c:1.49 src/sys/dev/ata/ld_ataraid.c:1.50
--- src/sys/dev/ata/ld_ataraid.c:1.49	Sun Jan 27 02:08:41 2019
+++ src/sys/dev/ata/ld_ataraid.c	Fri Jan 17 19:31:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_ataraid.c,v 1.49 2019/01/27 02:08:41 pgoyette Exp $ */
+/*	$NetBSD: ld_ataraid.c,v 1.50 2020/01/17 19:31:31 ad Exp $ */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.49 2019/01/27 02:08:41 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_ataraid.c,v 1.50 2020/01/17 19:31:31 ad Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "bio.h"
@@ -500,6 +500,7 @@ ld_ataraid_iodone_raid0(struct buf *vbp)
 	int s, iodone;
 
 	s = splbio();
+	KERNEL_LOCK(1, NULL);		/* XXXSMP */
 
 	iodone = cbp->cb_flags & CBUF_IODONE;
 	other_cbp = cbp->cb_other;
@@ -571,6 +572,7 @@ ld_ataraid_iodone_raid0(struct buf *vbp)
 		lddone(>sc_ld, bp);
 
 out:
+	KERNEL_UNLOCK_ONE(NULL);	/* XXXSMP */
 	splx(s);
 }
 



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

2020-01-17 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 17 19:30:51 UTC 2020

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

Log Message:
Acquire kernel_lock in the bp->b_iodone callback.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/xen/xen/xbdback_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.72 src/sys/arch/xen/xen/xbdback_xenbus.c:1.73
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.72	Sun Apr  7 12:21:20 2019
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Fri Jan 17 19:30:51 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbdback_xenbus.c,v 1.72 2019/04/07 12:21:20 bouyer Exp $  */
+/*  $NetBSD: xbdback_xenbus.c,v 1.73 2020/01/17 19:30:51 ad Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.72 2019/04/07 12:21:20 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.73 2020/01/17 19:30:51 ad Exp $");
 
 #include 
 #include 
@@ -1620,6 +1620,8 @@ xbdback_iodone(struct buf *bp)
 	struct xbdback_instance *xbdi;
 	int errp;
 
+	KERNEL_LOCK(1, NULL);		/* XXXSMP */
+
 	xbd_io = bp->b_private;
 	xbdi = xbd_io->xio_xbdi;
 
@@ -1675,6 +1677,7 @@ xbdback_iodone(struct buf *bp)
 	xbdback_pool_put(_io_pool, xbd_io);
 
 	xbdback_wakeup_thread(xbdi);
+	KERNEL_UNLOCK_ONE(NULL);	/* XXXSMP */
 }
 
 /*



CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device

2020-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan 17 19:13:25 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device:
nouveau_nvkm_engine_device_pci.c

Log Message:
Enable the device on NetBSD too (don't rely on firmware to do it for us).


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \

src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.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/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c:1.8 src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c:1.9
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c:1.8	Mon Aug 27 14:17:36 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c	Fri Jan 17 19:13:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_nvkm_engine_device_pci.c,v 1.8 2018/08/27 14:17:36 riastradh Exp $	*/
+/*	$NetBSD: nouveau_nvkm_engine_device_pci.c,v 1.9 2020/01/17 19:13:25 jmcneill Exp $	*/
 
 /*
  * Copyright 2015 Red Hat Inc.
@@ -24,7 +24,7 @@
  * Authors: Ben Skeggs 
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_device_pci.c,v 1.8 2018/08/27 14:17:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_device_pci.c,v 1.9 2020/01/17 19:13:25 jmcneill Exp $");
 
 #include 
 #include "priv.h"
@@ -1673,15 +1673,11 @@ nvkm_device_pci_new(struct pci_dev *pci_
 	const struct nvkm_device_pci_vendor *pciv;
 	const char *name = NULL;
 	struct nvkm_device_pci *pdev;
-#ifndef __NetBSD__
 	int ret;
-#endif
 
-#ifndef __NetBSD__
-	ret = pci_enable_device(pci_dev);
+	ret = linux_pci_enable_device(pci_dev);
 	if (ret)
 		return ret;
-#endif
 
 	switch (pci_dev->vendor) {
 	case 0x10de: pcid = nvkm_device_pci_10de; break;



CVS commit: src/sys

2020-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan 17 17:06:33 UTC 2020

Modified Files:
src/sys/arch/arm/acpi: acpi_pci_machdep.c acpi_pci_machdep.h acpipchb.c
files.acpi
src/sys/arch/arm/fdt: acpi_fdt.c
src/sys/arch/x86/x86: mpacpi.c
src/sys/dev/acpi: acpi.c acpi_pci.c acpi_pci.h acpi_pci_link.c
acpivar.h
src/sys/dev/acpi/acpica: OsdHardware.c
Added Files:
src/sys/arch/arm/acpi: acpi_pci_graviton.c acpi_pci_n1sdp.c

Log Message:
Add support for Arm N1 SDP PCIe host controller.

The N1 SDP has a few bugs that we need to work around:
 - PCIe root port config space lives in a non-standard location.
 - Access to PCIe config space of devices that do not exist results in
   an sync SError. Firmware creates a "known devices" table at a fixed
   physical address that we use to filter PCI conf access to only known
   devices.

This change splits the Arm ACPI PCI quirks into separate files for each
host controller, and allows per-segment quirks to be applied.

These changes exposed some bugs in the MI ACPI layer related to
multi-segment support. The MI ACPI PCI code was using a shared PCI
chipset tag to access devices, and these accesses can happen before our
PCI host bridge drivers are attached! The global chipset tag is now gone,
and an MD callback can provide a custom tag on a per-segment basis.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/acpi/acpi_pci_graviton.c \
src/sys/arch/arm/acpi/acpi_pci_n1sdp.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/acpi/acpi_pci_machdep.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/acpi/acpi_pci_machdep.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/acpi/acpipchb.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/acpi/files.acpi
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/fdt/acpi_fdt.c
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/x86/x86/mpacpi.c
cvs rdiff -u -r1.282 -r1.283 src/sys/dev/acpi/acpi.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/acpi/acpi_pci.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/acpi/acpi_pci.h
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/acpi/acpi_pci_link.c
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/acpi/acpivar.h
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/acpi/acpica/OsdHardware.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/acpi/acpi_pci_machdep.c
diff -u src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.12 src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.13
--- src/sys/arch/arm/acpi/acpi_pci_machdep.c:1.12	Tue Oct 15 13:27:50 2019
+++ src/sys/arch/arm/acpi/acpi_pci_machdep.c	Fri Jan 17 17:06:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci_machdep.c,v 1.12 2019/10/15 13:27:50 jmcneill Exp $ */
+/* $NetBSD: acpi_pci_machdep.c,v 1.13 2020/01/17 17:06:33 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.12 2019/10/15 13:27:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_pci_machdep.c,v 1.13 2020/01/17 17:06:33 jmcneill Exp $");
 
 #include 
 #include 
@@ -70,6 +70,23 @@ struct acpi_pci_prt {
 static TAILQ_HEAD(, acpi_pci_prt) acpi_pci_irq_routes =
 TAILQ_HEAD_INITIALIZER(acpi_pci_irq_routes);
 
+struct acpi_pci_pct {
+	struct acpi_pci_context		pct_ap;
+	TAILQ_ENTRY(acpi_pci_pct)	pct_list;
+};
+
+static TAILQ_HEAD(, acpi_pci_pct) acpi_pci_chipset_tags =
+TAILQ_HEAD_INITIALIZER(acpi_pci_chipset_tags);
+
+static const struct acpi_pci_quirk acpi_pci_quirks[] = {
+	/* OEM ID	OEM Table ID	Revision	Seg	Func */
+	{ "AMAZON",	"GRAVITON",	0,		-1,	acpi_pci_graviton_init },
+	{ "ARMLTD",	"ARMN1SDP",	0x20181101,	0,	acpi_pci_n1sdp_init },
+	{ "ARMLTD",	"ARMN1SDP",	0x20181101,	1,	acpi_pci_n1sdp_init },
+};
+
+pci_chipset_tag_t acpi_pci_md_get_chipset_tag(struct acpi_softc *, int, int);
+
 static void	acpi_pci_md_attach_hook(device_t, device_t,
    struct pcibus_attach_args *);
 static int	acpi_pci_md_bus_maxdevs(void *, int);
@@ -115,7 +132,7 @@ struct arm32_pci_chipset arm_acpi_pci_ch
 };
 
 static ACPI_STATUS
-acpi_pci_md_pci_link(ACPI_HANDLE handle, int bus)
+acpi_pci_md_pci_link(ACPI_HANDLE handle, pci_chipset_tag_t pc, int bus)
 {
 	ACPI_PCI_ROUTING_TABLE *prt;
 	ACPI_HANDLE linksrc;
@@ -144,7 +161,7 @@ acpi_pci_md_pci_link(ACPI_HANDLE handle,
 			}
 
 			linkdev = acpi_pci_link_devbyhandle(linksrc);
-			acpi_pci_link_add_reference(linkdev, 0, bus, dev, prt->Pin & 3);
+			acpi_pci_link_add_reference(linkdev, pc, 0, bus, dev, prt->Pin & 3);
 		} else {
 			aprint_debug("ACPI: %s dev %u INT%c on globint %d\n",
 			acpi_name(handle), dev, 'A' + (prt->Pin & 3), prt->SourceIndex);
@@ -208,7 +225,7 @@ acpi_pci_md_attach_hook(device_t parent,
 		/*
 		 * This is a new ACPI managed bus. Add PCI link references.
 		 */
-		acpi_pci_md_pci_link(ad->ad_handle, pba->pba_bus);
+		acpi_pci_md_pci_link(ad->ad_handle, pba->pba_pc, pba->pba_bus);
 	}
 }
 
@@ 

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

2020-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 17 16:59:07 UTC 2020

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

Log Message:
Fix a bug introduced in 1.271 where pmap_grow_map would no longer map
the allocated page for the uvm.page_init_done == false case when
PMAP_STEAL_MEMORY is not defined.


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

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.377 src/sys/arch/arm/arm32/pmap.c:1.378
--- src/sys/arch/arm/arm32/pmap.c:1.377	Fri Jan 17 12:40:44 2020
+++ src/sys/arch/arm/arm32/pmap.c	Fri Jan 17 16:59:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.377 2020/01/17 12:40:44 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.378 2020/01/17 16:59:07 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -221,7 +221,7 @@
 #include 
 #endif
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.377 2020/01/17 12:40:44 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.378 2020/01/17 16:59:07 skrll Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -5787,6 +5787,9 @@ pmap_grow_map(vaddr_t va, paddr_t *pap)
 #else
 		if (uvm_page_physget() == false)
 			return (1);
+
+		pmap_kenter_pa(va, pa,
+		VM_PROT_READ|VM_PROT_WRITE, PMAP_KMPAGE|PMAP_PTE);
 #endif	/* PMAP_STEAL_MEMORY */
 	} else {
 		struct vm_page *pg;



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

2020-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan 17 16:58:57 UTC 2020

Modified Files:
src/sys/arch/arm/acpi: gicv3_acpi.c

Log Message:
Only attach the first ITS for now


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/acpi/gicv3_acpi.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/acpi/gicv3_acpi.c
diff -u src/sys/arch/arm/acpi/gicv3_acpi.c:1.5 src/sys/arch/arm/acpi/gicv3_acpi.c:1.6
--- src/sys/arch/arm/acpi/gicv3_acpi.c:1.5	Mon Oct 14 11:00:13 2019
+++ src/sys/arch/arm/acpi/gicv3_acpi.c	Fri Jan 17 16:58:57 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_acpi.c,v 1.5 2019/10/14 11:00:13 jmcneill Exp $ */
+/* $NetBSD: gicv3_acpi.c,v 1.6 2020/01/17 16:58:57 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_acpi.c,v 1.5 2019/10/14 11:00:13 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_acpi.c,v 1.6 2020/01/17 16:58:57 jmcneill Exp $");
 
 #include 
 #include 
@@ -288,6 +288,7 @@ gicv3_acpi_map_redist(struct gicv3_acpi_
 static ACPI_STATUS
 gicv3_acpi_map_gits(ACPI_SUBTABLE_HEADER *hdrp, void *aux)
 {
+	static bool its_attached;
 	struct gicv3_acpi_softc * const sc = aux;
 	ACPI_MADT_GENERIC_TRANSLATOR *gits;
 	bus_space_handle_t bsh;
@@ -303,9 +304,13 @@ gicv3_acpi_map_gits(ACPI_SUBTABLE_HEADER
 		return AE_OK;
 	}
 
-	aprint_normal_dev(sc->sc_gic.sc_dev, "ITS #%#x at 0x%" PRIx64 "\n", gits->TranslationId, gits->BaseAddress);
+	aprint_normal_dev(sc->sc_gic.sc_dev, "ITS #%d at 0x%" PRIx64 "%s\n",
+	gits->TranslationId, gits->BaseAddress, its_attached ? " (disabled)" : "");
 
-	gicv3_its_init(>sc_gic, bsh, gits->BaseAddress, gits->TranslationId);
+	if (its_attached == false) {
+		gicv3_its_init(>sc_gic, bsh, gits->BaseAddress, gits->TranslationId);
+		its_attached = true;
+	}
 
 	return AE_OK;
 }



CVS commit: src/tools/pkg_install

2020-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 17 16:50:51 UTC 2020

Modified Files:
src/tools/pkg_install: Makefile.inc

Log Message:
don't try to include the library if we are building it.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tools/pkg_install/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/tools/pkg_install/Makefile.inc
diff -u src/tools/pkg_install/Makefile.inc:1.2 src/tools/pkg_install/Makefile.inc:1.3
--- src/tools/pkg_install/Makefile.inc:1.2	Sun Jan 12 16:27:43 2020
+++ src/tools/pkg_install/Makefile.inc	Fri Jan 17 11:50:51 2020
@@ -1,8 +1,10 @@
-# $NetBSD: Makefile.inc,v 1.2 2020/01/12 21:27:43 christos Exp $
+# $NetBSD: Makefile.inc,v 1.3 2020/01/17 16:50:51 christos Exp $
 
 .include "${NETBSDSRCDIR}/external/bsd/pkg_install/Makefile.inc"
 
+.if !defined(HOSTLIB)
 INSTALL_OBJDIR!= cd ${NETBSDSRCDIR}/tools/pkg_install/lib && ${PRINTOBJDIR}
 LDFLAGS+=-L${INSTALL_OBJDIR}
 LDADD+=-linstall
+.endif
 



CVS commit: src/external/bsd/libarchive/dist/tar/test

2020-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 17 16:50:03 UTC 2020

Modified Files:
src/external/bsd/libarchive/dist/tar/test: test_copy.c

Log Message:
Extract a second time to exercise extracting hardlinks over existing hardlinks.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/external/bsd/libarchive/dist/tar/test/test_copy.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/bsd/libarchive/dist/tar/test/test_copy.c
diff -u src/external/bsd/libarchive/dist/tar/test/test_copy.c:1.1.1.4 src/external/bsd/libarchive/dist/tar/test/test_copy.c:1.2
--- src/external/bsd/libarchive/dist/tar/test/test_copy.c:1.1.1.4	Wed Jul 24 09:50:41 2019
+++ src/external/bsd/libarchive/dist/tar/test/test_copy.c	Fri Jan 17 11:50:03 2020
@@ -316,6 +316,19 @@ copy_basic(void)
 	assertEmptyFile("unpack.out");
 
 	verify_tree(LIMIT_NONE);
+
+	/*
+	 * Unpack a second time to make sure that things are still ok
+	 */
+	r = systemf("%s xf archive >unpack.out 2>unpack.err", testprog);
+	failure("Error invoking %s xf archive", testprog);
+	assertEqualInt(r, 0);
+
+	/* Verify that nothing went to stdout or stderr. */
+	assertEmptyFile("unpack.err");
+	assertEmptyFile("unpack.out");
+
+	verify_tree(LIMIT_NONE);
 	assertEqualInt(0, chdir(".."));
 }
 



CVS commit: src/share/mk

2020-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 17 16:26:12 UTC 2020

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Back to libarchive's bsdtar


To generate a diff of this commit:
cvs rdiff -u -r1.1171 -r1.1172 src/share/mk/bsd.own.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/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1171 src/share/mk/bsd.own.mk:1.1172
--- src/share/mk/bsd.own.mk:1.1171	Tue Jan 14 11:48:18 2020
+++ src/share/mk/bsd.own.mk	Fri Jan 17 11:26:12 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1171 2020/01/14 16:48:18 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.1172 2020/01/17 16:26:12 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1082,6 +1082,7 @@ MKSTATICPIE?=	no
 _MKVARS.yes= \
 	MKATF \
 	MKBINUTILS \
+	MKBSDTAR \
 	MKCOMPLEX MKCVS MKCXX \
 	MKDOC MKDTC \
 	MKDYNAMICROOT \
@@ -1205,7 +1206,6 @@ _MKVARS.no= \
 	MKARGON2 \
 	MKARZERO \
 	MKBSDGREP \
-	MKBSDTAR \
 	MKCATPAGES MKCOMPATTESTS MKCOMPATX11 MKCTF \
 	MKDEBUG MKDEBUGLIB MKDTRACE \
 	MKEXTSRC \



CVS commit: src/tests/usr.bin

2020-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 17 16:25:37 UTC 2020

Modified Files:
src/tests/usr.bin: Makefile
Added Files:
src/tests/usr.bin/cpio: Makefile t_cpio.sh
src/tests/usr.bin/tar: Makefile t_tar.sh

Log Message:
new tests for libarchive


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/tests/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/cpio/Makefile \
src/tests/usr.bin/cpio/t_cpio.sh
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/tar/Makefile \
src/tests/usr.bin/tar/t_tar.sh

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

Modified files:

Index: src/tests/usr.bin/Makefile
diff -u src/tests/usr.bin/Makefile:1.29 src/tests/usr.bin/Makefile:1.30
--- src/tests/usr.bin/Makefile:1.29	Sun Oct 13 23:47:19 2019
+++ src/tests/usr.bin/Makefile	Fri Jan 17 11:25:37 2020
@@ -1,15 +1,15 @@
-#	$NetBSD: Makefile,v 1.29 2019/10/14 03:47:19 jhigh Exp $
+#	$NetBSD: Makefile,v 1.30 2020/01/17 16:25:37 christos Exp $
 #
 
 .include 
 
 TESTSDIR=   ${TESTSBASE}/usr.bin
 
-TESTS_SUBDIRS=	awk basename bzip2 cc cmp config cut \
+TESTS_SUBDIRS=	awk basename bzip2 cc cmp config cpio cut \
 		diff dirname find gdb grep gzip id indent \
 		infocmp jot ld m4 make mixerctl mkdep nbperf netpgpverify \
 		pkill pr printf pwhash rump_server shmif_dumpbus sdiff \
-		sed sort tmux tr unifdef uniq vmstat xlint
+		sed sort tar tmux tr unifdef uniq vmstat xlint
 
 .if ${MKCXX} != "no"
 TESTS_SUBDIRS+=	c++

Added files:

Index: src/tests/usr.bin/cpio/Makefile
diff -u /dev/null src/tests/usr.bin/cpio/Makefile:1.1
--- /dev/null	Fri Jan 17 11:25:37 2020
+++ src/tests/usr.bin/cpio/Makefile	Fri Jan 17 11:25:37 2020
@@ -0,0 +1,115 @@
+# $NetBSD: Makefile,v 1.1 2020/01/17 16:25:37 christos Exp $
+
+NOMAN=
+
+.include 
+LIBARCHIVE=${NETBSDSRCDIR}/external/bsd/libarchive/dist
+
+TESTSDIR=	${TESTSBASE}/usr.bin/cpio
+
+BINDIR= ${TESTSDIR}
+PROGS+=	h_cpio
+TESTS_SH+=	t_cpio
+
+CPPFLAGS+=-I${LIBARCHIVE}/test_utils -I${LIBARCHIVE}/cpio -I.
+CPPFLAGS+=-I${LIBARCHIVE}/cpio/test -I${LIBARCHIVE}/../include
+CPPFLAGS+=-I${LIBARCHIVE}/libarchive -I${LIBARCHIVE}/libarchive_fe
+CPPFLAGS+=-DPLATFORM_CONFIG_H='"config_netbsd.h"'
+
+.PATH:  ${LIBARCHIVE}/cpio/test ${LIBARCHIVE}/test_utils ${LIBARCHIVE}/cpio \
+	${LIBARCHIVE}/libarchive_fe
+
+
+LDADD+=-larchive
+DPADD+=${LIBARCHIVE}
+
+
+SRCS.h_cpio= \
+test_main.c \
+test_utils.c \
+cmdline.c \
+err.c \
+test_0.c \
+test_basic.c \
+test_cmdline.c \
+test_extract_cpio_Z.c \
+test_extract_cpio_bz2.c \
+test_extract_cpio_grz.c \
+test_extract_cpio_gz.c \
+test_extract_cpio_lrz.c \
+test_extract_cpio_lz.c \
+test_extract_cpio_lz4.c \
+test_extract_cpio_lzma.c \
+test_extract_cpio_lzo.c \
+test_extract_cpio_xz.c \
+test_extract_cpio_zstd.c \
+test_format_newc.c \
+test_gcpio_compat.c \
+test_missing_file.c \
+test_option_0.c \
+test_option_B_upper.c \
+test_option_C_upper.c \
+test_option_J_upper.c \
+test_option_L_upper.c \
+test_option_Z_upper.c \
+test_option_a.c \
+test_option_b64encode.c \
+test_option_c.c \
+test_option_d.c \
+test_option_f.c \
+test_option_grzip.c \
+test_option_help.c \
+test_option_l.c \
+test_option_lrzip.c \
+test_option_lz4.c \
+test_option_lzma.c \
+test_option_lzop.c \
+test_option_m.c \
+test_option_passphrase.c \
+test_option_t.c \
+test_option_u.c \
+test_option_version.c \
+test_option_xz.c \
+test_option_y.c \
+test_option_z.c \
+test_option_zstd.c \
+test_owner_parse.c \
+test_passthrough_dotdot.c \
+test_passthrough_reverse.c
+
+FILESDIR=   ${TESTSDIR}
+FILES=\
+test_extract.cpio.Z.uu \
+test_extract.cpio.bz2.uu \
+test_extract.cpio.grz.uu \
+test_extract.cpio.gz.uu \
+test_extract.cpio.lrz.uu \
+test_extract.cpio.lz.uu \
+test_extract.cpio.lz4.uu \
+test_extract.cpio.lzma.uu \
+test_extract.cpio.lzo.uu \
+test_extract.cpio.xz.uu \
+test_extract.cpio.zst.uu \
+test_gcpio_compat_ref.bin.uu \
+test_gcpio_compat_ref.crc.uu \
+test_gcpio_compat_ref.newc.uu \
+test_gcpio_compat_ref.ustar.uu \
+test_gcpio_compat_ref_nosym.bin.uu \
+test_gcpio_compat_ref_nosym.crc.uu \
+test_gcpio_compat_ref_nosym.newc.uu \
+test_gcpio_compat_ref_nosym.ustar.uu \
+test_option_f.cpio.uu \
+test_option_m.cpio.uu \
+test_option_passphrase.zip.uu \
+test_option_t.cpio.uu \
+test_option_t.stdout.uu \
+test_option_tv.stdout.uu
+
+.include 
+
+test_main.o: list.h
+
+CLEANFILES+=list.h
+
+list.h: ${SRCS.h_cpio} Makefile
+	${TOOL_GREP} -h '^DEFINE_TEST(' ${.ALLSRC} > ${.TARGET}
Index: src/tests/usr.bin/cpio/t_cpio.sh
diff -u /dev/null src/tests/usr.bin/cpio/t_cpio.sh:1.1
--- /dev/null	Fri Jan 17 11:25:37 2020
+++ src/tests/usr.bin/cpio/t_cpio.sh	Fri Jan 17 11:25:37 2020
@@ -0,0 +1,49 @@
+#   $NetBSD: t_cpio.sh,v 1.1 2020/01/17 16:25:37 christos Exp $
+#
+# Copyright (c) 2020 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided 

CVS commit: src/tests/lib

2020-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 17 16:24:03 UTC 2020

Modified Files:
src/tests/lib: Makefile
Added Files:
src/tests/lib/libarchive: Makefile t_libarchive.sh

Log Message:
new tests


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/tests/lib/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libarchive/Makefile \
src/tests/lib/libarchive/t_libarchive.sh

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

Modified files:

Index: src/tests/lib/Makefile
diff -u src/tests/lib/Makefile:1.31 src/tests/lib/Makefile:1.32
--- src/tests/lib/Makefile:1.31	Sun Dec 23 08:35:02 2018
+++ src/tests/lib/Makefile	Fri Jan 17 11:24:03 2020
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.31 2018/12/23 13:35:02 maxv Exp $
+# $NetBSD: Makefile,v 1.32 2020/01/17 16:24:03 christos Exp $
 
 .include 
 
-TESTS_SUBDIRS=	csu libbluetooth libc libcrypt libcurses libexecinfo \
-		libm libnvmm libobjc libposix libppath libprop libpthread \
-		librefuse librt libtre libusbhid libutil \
+TESTS_SUBDIRS=	csu libarchive libbluetooth libc libcrypt libcurses \
+		libexecinfo libm libnvmm libobjc libposix libppath libprop \
+		libpthread librefuse librt libtre libusbhid libutil \
 		semaphore
 
 TESTS_SUBDIR_INSTALL_ONLY=	libevent

Added files:

Index: src/tests/lib/libarchive/Makefile
diff -u /dev/null src/tests/lib/libarchive/Makefile:1.1
--- /dev/null	Fri Jan 17 11:24:03 2020
+++ src/tests/lib/libarchive/Makefile	Fri Jan 17 11:24:03 2020
@@ -0,0 +1,612 @@
+# $NetBSD: Makefile,v 1.1 2020/01/17 16:24:03 christos Exp $
+
+NOMAN=
+
+.include 
+LIBARCHIVE=${NETBSDSRCDIR}/external/bsd/libarchive/dist
+
+TESTSDIR=	${TESTSBASE}/lib/libarchive
+
+BINDIR= ${TESTSDIR}
+PROGS+=	h_libarchive
+TESTS_SH+=	t_libarchive
+
+CPPFLAGS+=-I${LIBARCHIVE}/test_utils -I${LIBARCHIVE}/libarchive -I.
+CPPFLAGS+=-I${LIBARCHIVE}/libarchive/test -I${LIBARCHIVE}/../include
+
+.PATH: ${LIBARCHIVE}/libarchive/test ${LIBARCHIVE}/test_utils
+
+LDADD+=-larchive
+DPADD+=${LIBARCHIVE}
+
+
+SRCS.h_libarchive= \
+test_main.c \
+test_utils.c \
+read_open_memory.c \
+test_acl_nfs4.c \
+test_acl_pax.c \
+test_acl_platform_nfs4.c \
+test_acl_platform_posix1e.c \
+test_acl_posix1e.c \
+test_acl_text.c \
+test_archive_api_feature.c \
+test_archive_clear_error.c \
+test_archive_cmdline.c \
+test_archive_digest.c \
+test_archive_getdate.c \
+test_archive_match_owner.c \
+test_archive_match_path.c \
+test_archive_match_time.c \
+test_archive_pathmatch.c \
+test_archive_read_add_passphrase.c \
+test_archive_read_close_twice.c \
+test_archive_read_close_twice_open_fd.c \
+test_archive_read_close_twice_open_filename.c \
+test_archive_read_multiple_data_objects.c \
+test_archive_read_next_header_empty.c \
+test_archive_read_next_header_raw.c \
+test_archive_read_open2.c \
+test_archive_read_set_filter_option.c \
+test_archive_read_set_format_option.c \
+test_archive_read_set_option.c \
+test_archive_read_set_options.c \
+test_archive_read_support.c \
+test_archive_set_error.c \
+test_archive_string.c \
+test_archive_string_conversion.c \
+test_archive_write_add_filter_by_name.c \
+test_archive_write_set_filter_option.c \
+test_archive_write_set_format_by_name.c \
+test_archive_write_set_format_filter_by_ext.c \
+test_archive_write_set_format_option.c \
+test_archive_write_set_option.c \
+test_archive_write_set_options.c \
+test_archive_write_set_passphrase.c \
+test_bad_fd.c \
+test_compat_bzip2.c \
+test_compat_cpio.c \
+test_compat_gtar.c \
+test_compat_gzip.c \
+test_compat_lz4.c \
+test_compat_lzip.c \
+test_compat_lzma.c \
+test_compat_lzop.c \
+test_compat_mac.c \
+test_compat_pax_libarchive_2x.c \
+test_compat_perl_archive_tar.c \
+test_compat_plexus_archiver_tar.c \
+test_compat_solaris_pax_sparse.c \
+test_compat_solaris_tar_acl.c \
+test_compat_star_acl.c \
+test_compat_tar_hardlink.c \
+test_compat_uudecode.c \
+test_compat_uudecode_large.c \
+test_compat_xz.c \
+test_compat_zip.c \
+test_compat_zstd.c \
+test_empty_write.c \
+test_entry.c \
+test_entry_strmode.c \
+test_extattr_freebsd.c \
+test_filter_count.c \
+test_fuzz.c \
+test_gnutar_filename_encoding.c \
+test_link_resolver.c \
+test_open_failure.c \
+test_open_fd.c \
+test_open_file.c \
+test_open_filename.c \
+test_pax_filename_encoding.c \
+test_read_data_large.c \
+test_read_disk.c \
+test_read_disk_directory_traversals.c \
+test_read_disk_entry_from_file.c \
+test_read_extract.c \
+test_read_file_nonexistent.c \
+test_read_filter_compress.c \
+test_read_filter_grzip.c \
+test_read_filter_lrzip.c \
+test_read_filter_lzop.c \
+test_read_filter_lzop_multiple_parts.c \
+test_read_filter_program.c \
+test_read_filter_program_signature.c \
+test_read_filter_uudecode.c \
+test_read_format_7zip.c \
+test_read_format_7zip_encryption_data.c \
+test_read_format_7zip_encryption_header.c \
+test_read_format_7zip_encryption_partially.c \
+test_read_format_7zip_malformed.c \

CVS commit: src/distrib/sets/lists/tests

2020-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 17 16:23:04 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
Add libarchive tests


To generate a diff of this commit:
cvs rdiff -u -r1.824 -r1.825 src/distrib/sets/lists/tests/mi

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.824 src/distrib/sets/lists/tests/mi:1.825
--- src/distrib/sets/lists/tests/mi:1.824	Mon Dec  2 23:20:45 2019
+++ src/distrib/sets/lists/tests/mi	Fri Jan 17 11:23:04 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.824 2019/12/03 04:20:45 hikaru Exp $
+# $NetBSD: mi,v 1.825 2020/01/17 16:23:04 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -86,6 +86,7 @@
 ./usr/libdata/debug/usr/tests/kyua-testerstests-kyua-tests	compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib	tests-lib-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/csu	tests-lib-debug		compattestfile,atf
+./usr/libdata/debug/usr/tests/lib/libarchive/h_libarchive		tests-lib-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/libbluetoothtests-lib-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/libbpfjittests-lib-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/libc	tests-lib-debug		compattestfile,atf
@@ -185,8 +186,10 @@
 ./usr/libdata/debug/usr/tests/sys/netinet6tests-sys-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/syscall	tests-obsolete		obsolete
 ./usr/libdata/debug/usr/tests/usr.bin	tests-usr.bin-debug	compattestfile,atf
+./usr/libdata/debug/usr/tests/usr.bin/cpio/h_cpio			tests-usr.bin-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/usr.bin/idtests-usr.bin-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/usr.bin/netpgpverify			tests-usr.bin-debug	compattestfile,atf
+./usr/libdata/debug/usr/tests/usr.bin/tar/h_tartests-usr.bin-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/usr.sbin	tests-usr.sbin-debug	compattestfile,atf
 ./usr/libdata/debug/usr/tests/util	tests-obsolete		obsolete
 ./usr/libdata/debug/usr/tests/util/df	tests-obsolete		obsolete
@@ -2430,6 +2433,306 @@
 ./usr/tests/lib/csu/h_initfini_array		tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/csu/t_crt0			tests-lib-tests		compattestfile,atf
 ./usr/tests/lib/csu/t_ifunc_static		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libarchive			tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libarchive/Atffile 		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libarchive/h_libarchive		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libarchive/t_libarchive		tests-lib-tests		compattestfile,atf
+./usr/tests/lib/libarchive/test_acl_pax_nfs4.tar.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_acl_pax_posix1e.tar.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_archive_string_conversion.txt.Z.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_bzip2_1.tbz.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_bzip2_2.tbz.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_cpio_1.cpio.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_gtar_1.tar.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_gtar_2.tar.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_gzip_1.tgz.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_gzip_2.tgz.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_lz4_1.tar.lz4.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_lz4_2.tar.lz4.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_lz4_3.tar.lz4.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_lz4_B4.tar.lz4.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_lz4_B4BD.tar.lz4.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_lz4_B4BDBX.tar.lz4.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_lz4_B5.tar.lz4.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_lz4_B5BD.tar.lz4.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_lz4_B6.tar.lz4.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_lz4_B6BD.tar.lz4.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_lz4_B7.tar.lz4.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_lz4_B7BD.tar.lz4.uu 	tests-lib-tests	compattestfile,atf
+./usr/tests/lib/libarchive/test_compat_lzip_1.tlz.uu 	tests-lib-tests	compattestfile,atf

CVS commit: src/etc/mtree

2020-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 17 16:09:11 UTC 2020

Modified Files:
src/etc/mtree: NetBSD.dist.tests

Log Message:
Add more test directories


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/etc/mtree/NetBSD.dist.tests

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.159 src/etc/mtree/NetBSD.dist.tests:1.160
--- src/etc/mtree/NetBSD.dist.tests:1.159	Sat Oct  5 14:06:16 2019
+++ src/etc/mtree/NetBSD.dist.tests	Fri Jan 17 11:09:11 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.tests,v 1.159 2019/10/05 18:06:16 jhigh Exp $
+#	$NetBSD: NetBSD.dist.tests,v 1.160 2020/01/17 16:09:11 christos Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -72,6 +72,7 @@
 ./usr/libdata/debug/usr/tests/kyua-testers
 ./usr/libdata/debug/usr/tests/lib
 ./usr/libdata/debug/usr/tests/lib/csu
+./usr/libdata/debug/usr/tests/lib/libarchive
 ./usr/libdata/debug/usr/tests/lib/libbluetooth
 ./usr/libdata/debug/usr/tests/lib/libbpfjit
 ./usr/libdata/debug/usr/tests/lib/libc
@@ -164,7 +165,9 @@
 ./usr/libdata/debug/usr/tests/sys/netinet
 ./usr/libdata/debug/usr/tests/sys/netinet6
 ./usr/libdata/debug/usr/tests/usr.bin
+./usr/libdata/debug/usr/tests/usr.bin/cpio
 ./usr/libdata/debug/usr/tests/usr.bin/id
+./usr/libdata/debug/usr/tests/usr.bin/tar
 ./usr/libdata/debug/usr/tests/usr.bin/netpgpverify
 ./usr/libdata/debug/usr/tests/usr.sbin
 ./usr/tests
@@ -258,6 +261,7 @@
 ./usr/tests/kyua-testers
 ./usr/tests/lib
 ./usr/tests/lib/csu
+./usr/tests/lib/libarchive
 ./usr/tests/lib/libbluetooth
 ./usr/tests/lib/libc
 ./usr/tests/lib/libc/atomic
@@ -394,6 +398,7 @@
 ./usr/tests/usr.bin/config/support/arch/regress
 ./usr/tests/usr.bin/config/support/arch/regress/conf
 ./usr/tests/usr.bin/config/support/conf
+./usr/tests/usr.bin/cpio
 ./usr/tests/usr.bin/cut
 ./usr/tests/usr.bin/diff
 ./usr/tests/usr.bin/dirname
@@ -422,6 +427,7 @@
 ./usr/tests/usr.bin/sed
 ./usr/tests/usr.bin/shmif_dumpbus
 ./usr/tests/usr.bin/sort
+./usr/tests/usr.bin/tar
 ./usr/tests/usr.bin/tmux
 ./usr/tests/usr.bin/tr
 ./usr/tests/usr.bin/unifdef



CVS commit: src

2020-01-17 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Jan 17 15:00:21 UTC 2020

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile
src/sys/arch/amd64/conf: ALL
src/sys/arch/i386/conf: ALL
src/sys/dev: DEVNAMES
src/sys/dev/usb: TODO.usbmp files.usb
src/usr.sbin/makemandb: nostem.txt
Removed Files:
src/share/man/man4: uyurex.4
src/sys/dev/usb: uyurex.c

Log Message:
Remove uyurex(4).

This is a driver for a "nonsense machine" made by the art group Maywa-Denki
in 2008. It was disabled by default.

Unfortunately even so it draws development attention (flaws found in the
code, MP-ification needs) and it is best not to continue to maintain this
driver.

Proposed without objections on tech-kern.


To generate a diff of this commit:
cvs rdiff -u -r1.1668 -r1.1669 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.693 -r1.694 src/share/man/man4/Makefile
cvs rdiff -u -r1.6 -r0 src/share/man/man4/uyurex.4
cvs rdiff -u -r1.135 -r1.136 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.479 -r1.480 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.325 -r1.326 src/sys/dev/DEVNAMES
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/usb/TODO.usbmp
cvs rdiff -u -r1.168 -r1.169 src/sys/dev/usb/files.usb
cvs rdiff -u -r1.16 -r0 src/sys/dev/usb/uyurex.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/makemandb/nostem.txt

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

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1668 src/distrib/sets/lists/man/mi:1.1669
--- src/distrib/sets/lists/man/mi:1.1668	Wed Jan  1 10:11:21 2020
+++ src/distrib/sets/lists/man/mi	Fri Jan 17 15:00:20 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1668 2020/01/01 10:11:21 ryo Exp $
+# $NetBSD: mi,v 1.1669 2020/01/17 15:00:20 maya Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1928,7 +1928,6 @@
 ./usr/share/man/cat4/uvisor.0			man-sys-catman		.cat
 ./usr/share/man/cat4/uvscom.0			man-sys-catman		.cat
 ./usr/share/man/cat4/uyap.0			man-sys-catman		.cat
-./usr/share/man/cat4/uyurex.0			man-sys-catman		.cat
 ./usr/share/man/cat4/vald.0			man-sys-catman		.cat
 ./usr/share/man/cat4/valz.0			man-sys-catman		.cat
 ./usr/share/man/cat4/vax/acc.0			man-sys-catman		.cat
@@ -5037,7 +5036,6 @@
 ./usr/share/man/html4/uvisor.html		man-sys-htmlman		html
 ./usr/share/man/html4/uvscom.html		man-sys-htmlman		html
 ./usr/share/man/html4/uyap.html			man-sys-htmlman		html
-./usr/share/man/html4/uyurex.html		man-sys-htmlman		html
 ./usr/share/man/html4/vald.html			man-sys-htmlman		html
 ./usr/share/man/html4/valz.html			man-sys-htmlman		html
 ./usr/share/man/html4/vax/acc.html		man-sys-htmlman		html
@@ -8070,7 +8068,6 @@
 ./usr/share/man/man4/uvisor.4			man-sys-man		.man
 ./usr/share/man/man4/uvscom.4			man-sys-man		.man
 ./usr/share/man/man4/uyap.4			man-sys-man		.man
-./usr/share/man/man4/uyurex.4			man-sys-man		.man
 ./usr/share/man/man4/vald.4			man-sys-man		.man
 ./usr/share/man/man4/valz.4			man-sys-man		.man
 ./usr/share/man/man4/vax/acc.4			man-sys-man		.man

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.693 src/share/man/man4/Makefile:1.694
--- src/share/man/man4/Makefile:1.693	Wed Jan  1 10:11:21 2020
+++ src/share/man/man4/Makefile	Fri Jan 17 15:00:20 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.693 2020/01/01 10:11:21 ryo Exp $
+#	$NetBSD: Makefile,v 1.694 2020/01/17 15:00:20 maya Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -88,7 +88,6 @@ MAN+=	atu.4 aubtfwl.4 aue.4 axe.4 axen.4
 	uplcom.4 ure.4 urio.4 url.4 urndis.4 urtw.4 urtwn.4 \
 	usb.4 usbnet.4 uscanner.4 uslsa.4 usmsc.4 usscanner.4 \
 	ustir.4 uthum.4 utoppy.4 uts.4 uvideo.4 uvisor.4 uvscom.4 uyap.4 \
-	uyurex.4 \
 	xhci.4 \
 
 # Ir devices

Index: src/sys/arch/amd64/conf/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.135 src/sys/arch/amd64/conf/ALL:1.136
--- src/sys/arch/amd64/conf/ALL:1.135	Wed Jan  1 10:36:43 2020
+++ src/sys/arch/amd64/conf/ALL	Fri Jan 17 15:00:20 2020
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.135 2020/01/01 10:36:43 ryo Exp $
+# $NetBSD: ALL,v 1.136 2020/01/17 15:00:20 maya 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.135 $"
+#ident		"ALL-$Revision: 1.136 $"
 
 maxusers	64		# estimated number of users
 
@@ -1182,8 +1182,6 @@ wsmouse* at uep? mux 0
 uatp*	at uhidev? reportid ?
 wsmouse* at uatp? mux 0
 
-uyurex* at uhidev? reportid ?
-
 # USB Keyboards
 ukbd*	at uhidev? reportid ?
 wskbd*	at ukbd? console ? mux 1

Index: src/sys/arch/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.479 src/sys/arch/i386/conf/ALL:1.480
--- src/sys/arch/i386/conf/ALL:1.479	Wed Jan  1 10:36:43 2020
+++ 

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

2020-01-17 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan 17 13:54:47 UTC 2020

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c

Log Message:
Set msi_id to its_id


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/arm/cortex/gicv3_its.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/cortex/gicv3_its.c
diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.23 src/sys/arch/arm/cortex/gicv3_its.c:1.24
--- src/sys/arch/arm/cortex/gicv3_its.c:1.23	Tue Dec 24 09:13:22 2019
+++ src/sys/arch/arm/cortex/gicv3_its.c	Fri Jan 17 13:54:47 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.23 2019/12/24 09:13:22 skrll Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.24 2020/01/17 13:54:47 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.23 2019/12/24 09:13:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.24 2020/01/17 13:54:47 jmcneill Exp $");
 
 #include 
 #include 
@@ -873,6 +873,7 @@ gicv3_its_init(struct gicv3_softc *sc, b
 	gicv3_its_cpu_init(its, curcpu());
 
 	msi = >its_msi;
+	msi->msi_id = its_id;
 	msi->msi_dev = sc->sc_dev;
 	msi->msi_priv = its;
 	msi->msi_alloc = gicv3_its_msi_alloc;



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

2020-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 17 12:40:44 UTC 2020

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

Log Message:
Typo in comment


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

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.376 src/sys/arch/arm/arm32/pmap.c:1.377
--- src/sys/arch/arm/arm32/pmap.c:1.376	Fri Jan 17 12:39:00 2020
+++ src/sys/arch/arm/arm32/pmap.c	Fri Jan 17 12:40:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.376 2020/01/17 12:39:00 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.377 2020/01/17 12:40:44 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -221,7 +221,7 @@
 #include 
 #endif
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.376 2020/01/17 12:39:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.377 2020/01/17 12:40:44 skrll Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -7801,7 +7801,7 @@ pmap_boot_pagealloc(psize_t amount, psiz
 		pv_addr_t *newpv;
 		psize_t off;
 		/*
-		 * If this entry is too small to satify the request...
+		 * If this entry is too small to satisfy the request...
 		 */
 		KASSERT(pv->pv_size > 0);
 		if (pv->pv_size < amount)



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

2020-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 17 12:39:00 UTC 2020

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

Log Message:
Update PMAP_STEAL_MEMORY code to uvm_hotplug


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

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.375 src/sys/arch/arm/arm32/pmap.c:1.376
--- src/sys/arch/arm/arm32/pmap.c:1.375	Tue Dec 31 18:09:21 2019
+++ src/sys/arch/arm/arm32/pmap.c	Fri Jan 17 12:39:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.375 2019/12/31 18:09:21 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.376 2020/01/17 12:39:00 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -221,7 +221,7 @@
 #include 
 #endif
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.375 2019/12/31 18:09:21 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.376 2020/01/17 12:39:00 skrll Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -7789,8 +7789,6 @@ pmap_boot_pagealloc(psize_t amount, psiz
 	pv_addr_t *rpv)
 {
 	pv_addr_t *pv, **pvp;
-	struct vm_physseg *ps;
-	size_t i;
 
 	KASSERT(amount & PGOFSET);
 	KASSERT((mask & PGOFSET) == 0);
@@ -7848,7 +7846,7 @@ pmap_boot_pagealloc(psize_t amount, psiz
 		return;
 	}
 
-	if (vm_nphysseg == 0)
+	if (!uvm_physseg_valid_p(uvm_physseg_get_first()))
 		panic("pmap_boot_pagealloc: couldn't allocate memory");
 
 	for (pvp = _FIRST(_boot_freeq);
@@ -7858,28 +7856,27 @@ pmap_boot_pagealloc(psize_t amount, psiz
 			break;
 	}
 	KASSERT(mask == 0);
-	for (i = 0; i < vm_nphysseg; i++) {
-		ps = VM_PHYSMEM_PTR(i);
-		if (ps->avail_start == atop(pv->pv_pa + pv->pv_size)
-		&& pv->pv_va + pv->pv_size <= ptoa(ps->avail_end)) {
+
+	for (uvm_physseg_t ups = uvm_physseg_get_first();
+	uvm_physseg_valid_p(ups);
+	ups = uvm_physseg_get_next(ups)) {
+
+		paddr_t spn = uvm_physseg_get_start(ups);
+		paddr_t epn = uvm_physseg_get_end(ups);
+		if (spn == atop(pv->pv_pa + pv->pv_size)
+		&& pv->pv_va + pv->pv_size <= ptoa(epn)) {
 			rpv->pv_va = pv->pv_va;
 			rpv->pv_pa = pv->pv_pa;
 			rpv->pv_size = amount;
 			*pvp = NULL;
 			pmap_map_chunk(kernel_l1pt.pv_va,
-			 ptoa(ps->avail_start) + (pv->pv_va - pv->pv_pa),
-			 ptoa(ps->avail_start),
+			 ptoa(spn) + (pv->pv_va - pv->pv_pa),
+			 ptoa(spn),
 			 amount - pv->pv_size,
 			 VM_PROT_READ|VM_PROT_WRITE,
 			 PTE_CACHE);
-			ps->avail_start += atop(amount - pv->pv_size);
-			/*
-			 * If we consumed the entire physseg, remove it.
-			 */
-			if (ps->avail_start == ps->avail_end) {
-for (--vm_nphysseg; i < vm_nphysseg; i++)
-	VM_PHYSMEM_PTR_SWAP(i, i + 1);
-			}
+
+			uvm_physseg_unplug(spn, atop(amount - pv->pv_size));
 			memset((void *)rpv->pv_va, 0, rpv->pv_size);
 			return;
 		}



CVS commit: src/share/man/man9

2020-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 17 12:34:55 UTC 2020

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

Log Message:
Add '_p' to uvm_physseg_valid to match the function.  Bump date.


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

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

Modified files:

Index: src/share/man/man9/uvm_hotplug.9
diff -u src/share/man/man9/uvm_hotplug.9:1.5 src/share/man/man9/uvm_hotplug.9:1.6
--- src/share/man/man9/uvm_hotplug.9:1.5	Sat Nov 30 02:47:14 2019
+++ src/share/man/man9/uvm_hotplug.9	Fri Jan 17 12:34:55 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: uvm_hotplug.9,v 1.5 2019/11/30 02:47:14 riastradh Exp $
+.\"	$NetBSD: uvm_hotplug.9,v 1.6 2020/01/17 12:34:55 skrll Exp $
 .\"
 .\" Copyright (c) 2016 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,12 +27,12 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 20, 2016
+.Dd January 17, 2020
 .Dt UVM_HOTPLUG 9
 .Os
 .Sh NAME
 .Nm uvm_physseg_init ,
-.Nm uvm_physseg_valid ,
+.Nm uvm_physseg_valid_p ,
 .Nm uvm_physseg_get_start ,
 .Nm uvm_physseg_get_end ,
 .Nm uvm_physseg_get_avail_start ,
@@ -280,7 +280,7 @@ depending on success or failure respecti
 .Sh UTILITY FUNCTIONS
 .Bl -ohang
 .It Ft bool
-.Fn uvm_physseg_valid "uvm_physseg_t upm"
+.Fn uvm_physseg_valid_p "uvm_physseg_t upm"
 .It Ft paddr_t
 .Fn uvm_physseg_get_start "uvm_physseg_t upm"
 .It Ft paddr_t
@@ -317,7 +317,7 @@ depending on success or failure respecti
 .Fn uvm_physseg_set_avail_end "uvm_physseg_t upm" "paddr_t avail_end"
 .El
 .Pp
-.Fn uvm_physseg_valid
+.Fn uvm_physseg_valid_p
 validates a handle that is passed in, returns
 .Fa true
 if the given handle is valid,



CVS commit: src/sys/dev/pci

2020-01-17 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Jan 17 09:42:05 UTC 2020

Modified Files:
src/sys/dev/pci: if_ixl.c if_ixlvar.h

Log Message:
Print nvm version of ixl(4) when attaching

reviewed by msaitoh


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/pci/if_ixl.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/if_ixlvar.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_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.25 src/sys/dev/pci/if_ixl.c:1.26
--- src/sys/dev/pci/if_ixl.c:1.25	Fri Jan 17 09:37:42 2020
+++ src/sys/dev/pci/if_ixl.c	Fri Jan 17 09:42:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.25 2020/01/17 09:37:42 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.26 2020/01/17 09:42:05 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -198,6 +198,8 @@ struct ixl_softc; /* defined */
 
 #define IXL_ATQ_EXEC_TIMEOUT		(10 * hz)
 
+#define IXL_SRRD_SRCTL_ATTEMPTS		10
+
 struct ixl_aq_regs {
 	bus_size_t		atq_tail;
 	bus_size_t		atq_head;
@@ -653,11 +655,14 @@ struct ixl_softc {
 	unsigned int		 sc_msix_vector_queue;
 
 	struct ixl_dmamem	 sc_scratch;
+	struct ixl_dmamem	 sc_aqbuf;
 
 	const struct ixl_aq_regs *
  sc_aq_regs;
 	uint32_t		 sc_aq_flags;
 #define IXL_SC_AQ_FLAG_RXCTL	__BIT(0)
+#define IXL_SC_AQ_FLAG_NVMLOCK	__BIT(1)
+#define IXL_SC_AQ_FLAG_NVMREAD	__BIT(2)
 
 	kmutex_t		 sc_atq_lock;
 	kcondvar_t		 sc_atq_cv;
@@ -753,6 +758,7 @@ static int	ixl_atq_post_locked(struct ix
 static void	ixl_atq_done(struct ixl_softc *);
 static int	ixl_atq_exec(struct ixl_softc *, struct ixl_atq *);
 static int	ixl_get_version(struct ixl_softc *);
+static int	ixl_get_nvm_version(struct ixl_softc *);
 static int	ixl_get_hw_capabilities(struct ixl_softc *);
 static int	ixl_pxe_clear(struct ixl_softc *);
 static int	ixl_lldp_shut(struct ixl_softc *);
@@ -780,6 +786,7 @@ static void	ixl_hmc_pack(void *, const v
 		const struct ixl_hmc_pack *, unsigned int);
 static uint32_t	ixl_rd_rx_csr(struct ixl_softc *, uint32_t);
 static void	ixl_wr_rx_csr(struct ixl_softc *, uint32_t, uint32_t);
+static int	ixl_rd16_nvm(struct ixl_softc *, uint16_t, uint16_t *);
 
 static int	ixl_match(device_t, cfdata_t, void *);
 static void	ixl_attach(device_t, device_t, void *);
@@ -1176,6 +1183,13 @@ ixl_attach(device_t parent, device_t sel
 
 	ixl_wr(sc, sc->sc_aq_regs->arq_tail, sc->sc_arq_prod);
 
+	if (ixl_dmamem_alloc(sc, >sc_aqbuf, IXL_AQ_BUFLEN, 0) != 0) {
+		aprint_error_dev(self, ", unable to allocate nvm buffer\n");
+		goto shutdown;
+	}
+
+	ixl_get_nvm_version(sc);
+
 	if (sc->sc_mac_type == I40E_MAC_X722)
 		sc->sc_nqueue_pairs_device = 128;
 	else
@@ -1185,7 +1199,7 @@ ixl_attach(device_t parent, device_t sel
 	if (rv != 0) {
 		aprint_error(", GET HW CAPABILITIES %s\n",
 		rv == ETIMEDOUT ? "timeout" : "error");
-		goto shutdown;
+		goto free_aqbuf;
 	}
 
 	sc->sc_nqueue_pairs_max = MIN((int)sc->sc_nqueue_pairs_device, ncpu);
@@ -1203,7 +1217,7 @@ ixl_attach(device_t parent, device_t sel
 
 	if (ixl_get_mac(sc) != 0) {
 		/* error printed by ixl_get_mac */
-		goto shutdown;
+		goto free_aqbuf;
 	}
 
 	aprint_normal("\n");
@@ -1222,7 +1236,7 @@ ixl_attach(device_t parent, device_t sel
 
 	if (ixl_hmc(sc) != 0) {
 		/* error printed by ixl_hmc */
-		goto shutdown;
+		goto free_aqbuf;
 	}
 
 	if (ixl_lldp_shut(sc) != 0) {
@@ -1408,6 +1422,8 @@ free_scratch:
 	ixl_dmamem_free(sc, >sc_scratch);
 free_hmc:
 	ixl_hmc_free(sc);
+free_aqbuf:
+	ixl_dmamem_free(sc, >sc_aqbuf);
 shutdown:
 	ixl_wr(sc, sc->sc_aq_regs->atq_head, 0);
 	ixl_wr(sc, sc->sc_aq_regs->arq_head, 0);
@@ -1514,6 +1530,7 @@ ixl_detach(device_t self, int flags)
 
 	ixl_dmamem_free(sc, >sc_arq);
 	ixl_dmamem_free(sc, >sc_atq);
+	ixl_dmamem_free(sc, >sc_aqbuf);
 
 	cv_destroy(>sc_atq_cv);
 	mutex_destroy(>sc_atq_lock);
@@ -3789,11 +3806,17 @@ ixl_get_version(struct ixl_softc *sc)
 	aprint_normal(", FW %hu.%hu.%05u API %hu.%hu", (uint16_t)fwver,
 	(uint16_t)(fwver >> 16), fwbuild, api_maj_ver, api_min_ver);
 
+	if (sc->sc_mac_type == I40E_MAC_X722) {
+		SET(sc->sc_aq_flags, IXL_SC_AQ_FLAG_NVMLOCK |
+		IXL_SC_AQ_FLAG_NVMREAD);
+	}
+
 #define IXL_API_VER(maj, min)	(((uint32_t)(maj) << 16) | (min))
 	if (IXL_API_VER(api_maj_ver, api_min_ver) >= IXL_API_VER(1, 5)) {
 		if (sc->sc_mac_type == I40E_MAC_X722) {
 			SET(sc->sc_aq_flags, IXL_SC_AQ_FLAG_RXCTL);
 		}
+		SET(sc->sc_aq_flags, IXL_SC_AQ_FLAG_NVMLOCK);
 	}
 #undef IXL_API_VER
 
@@ -3801,6 +3824,37 @@ ixl_get_version(struct ixl_softc *sc)
 }
 
 static int
+ixl_get_nvm_version(struct ixl_softc *sc)
+{
+	uint16_t nvmver, cfg_ptr, eetrack_hi, eetrack_lo, oem_hi, oem_lo;
+	uint32_t eetrack, oem;
+	uint16_t nvm_maj_ver, nvm_min_ver, oem_build;
+	uint8_t oem_ver, oem_patch;
+
+	nvmver = cfg_ptr = eetrack_hi = eetrack_lo = oem_hi = oem_lo = 0;
+	ixl_rd16_nvm(sc, I40E_SR_NVM_DEV_STARTER_VERSION, );
+	ixl_rd16_nvm(sc, 

CVS commit: src/sys/dev/pci

2020-01-17 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Jan 17 09:37:42 UTC 2020

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

Log Message:
Use flags instead of bool that changes behavior related to
adminq command of ixl(4)


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/if_ixl.c

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

Modified files:

Index: src/sys/dev/pci/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.24 src/sys/dev/pci/if_ixl.c:1.25
--- src/sys/dev/pci/if_ixl.c:1.24	Fri Jan 17 09:04:04 2020
+++ src/sys/dev/pci/if_ixl.c	Fri Jan 17 09:37:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.24 2020/01/17 09:04:04 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.25 2020/01/17 09:37:42 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -606,7 +606,6 @@ struct ixl_softc {
 	struct ethercom		 sc_ec;
 	bool			 sc_attached;
 	bool			 sc_dead;
-	bool			 sc_rxctl_atq;
 	uint32_t		 sc_port;
 	struct sysctllog	*sc_sysctllog;
 	struct workqueue	*sc_workq;
@@ -657,6 +656,8 @@ struct ixl_softc {
 
 	const struct ixl_aq_regs *
  sc_aq_regs;
+	uint32_t		 sc_aq_flags;
+#define IXL_SC_AQ_FLAG_RXCTL	__BIT(0)
 
 	kmutex_t		 sc_atq_lock;
 	kcondvar_t		 sc_atq_cv;
@@ -3788,12 +3789,13 @@ ixl_get_version(struct ixl_softc *sc)
 	aprint_normal(", FW %hu.%hu.%05u API %hu.%hu", (uint16_t)fwver,
 	(uint16_t)(fwver >> 16), fwbuild, api_maj_ver, api_min_ver);
 
-	sc->sc_rxctl_atq = true;
-	if (sc->sc_mac_type == I40E_MAC_X722) {
-		if (api_maj_ver == 1 && api_min_ver < 5) {
-			sc->sc_rxctl_atq = false;
+#define IXL_API_VER(maj, min)	(((uint32_t)(maj) << 16) | (min))
+	if (IXL_API_VER(api_maj_ver, api_min_ver) >= IXL_API_VER(1, 5)) {
+		if (sc->sc_mac_type == I40E_MAC_X722) {
+			SET(sc->sc_aq_flags, IXL_SC_AQ_FLAG_RXCTL);
 		}
 	}
+#undef IXL_API_VER
 
 	return 0;
 }
@@ -6269,7 +6271,11 @@ ixl_rd_rx_csr(struct ixl_softc *sc, uint
 	uint32_t val;
 	int rv, retry, retry_limit;
 
-	retry_limit = sc->sc_rxctl_atq ? 5 : 0;
+	if (ISSET(sc->sc_aq_flags, IXL_SC_AQ_FLAG_RXCTL)) {
+		retry_limit = 5;
+	} else {
+		retry_limit = 0;
+	}
 
 	for (retry = 0; retry < retry_limit; retry++) {
 		rv = ixl_rx_ctl_read(sc, reg, );
@@ -6319,7 +6325,11 @@ ixl_wr_rx_csr(struct ixl_softc *sc, uint
 {
 	int rv, retry, retry_limit;
 
-	retry_limit = sc->sc_rxctl_atq ? 5 : 0;
+	if (ISSET(sc->sc_aq_flags, IXL_SC_AQ_FLAG_RXCTL)) {
+		retry_limit = 5;
+	} else {
+		retry_limit = 0;
+	}
 
 	for (retry = 0; retry < retry_limit; retry++) {
 		rv = ixl_rx_ctl_write(sc, reg, value);



CVS commit: src/sys/dev/pci

2020-01-17 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Fri Jan 17 09:04:04 UTC 2020

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

Log Message:
Fix the wrong expression in ixl(4)

Closes PR/54860.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pci/if_ixl.c

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

Modified files:

Index: src/sys/dev/pci/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.23 src/sys/dev/pci/if_ixl.c:1.24
--- src/sys/dev/pci/if_ixl.c:1.23	Thu Jan 16 07:19:47 2020
+++ src/sys/dev/pci/if_ixl.c	Fri Jan 17 09:04:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.23 2020/01/16 07:19:47 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.24 2020/01/17 09:04:04 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -6361,7 +6361,7 @@ ixl_parse_modprop(prop_dictionary_t dict
 		val = prop_number_integer_value((prop_number_t)obj);
 
 		/* the range has no reason */
-		if (100 < val || val < 18) {
+		if (100 < val && val < 18) {
 			ixl_param_stats_interval = val;
 		}
 	}