CVS commit: src/sys

2024-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 18 07:48:57 UTC 2024

Modified Files:
src/sys/arch/riscv/conf: GENERIC64
src/sys/arch/riscv/starfive: files.starfive
src/sys/dev/fdt: files.fdt
Added Files:
src/sys/arch/riscv/starfive: jh71x0_usb.c
src/sys/dev/fdt: cdns3_fdt.c

Log Message:
risc-v: attach the Cadence XHCI usb controller on the JH7100 SoC


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/conf/GENERIC64
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/starfive/files.starfive
cvs rdiff -u -r0 -r1.1 src/sys/arch/riscv/starfive/jh71x0_usb.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/cdns3_fdt.c
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/fdt/files.fdt

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

Modified files:

Index: src/sys/arch/riscv/conf/GENERIC64
diff -u src/sys/arch/riscv/conf/GENERIC64:1.3 src/sys/arch/riscv/conf/GENERIC64:1.4
--- src/sys/arch/riscv/conf/GENERIC64:1.3	Tue Jan 16 09:06:46 2024
+++ src/sys/arch/riscv/conf/GENERIC64	Thu Jan 18 07:48:56 2024
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC64,v 1.3 2024/01/16 09:06:46 skrll Exp $
+# $NetBSD: GENERIC64,v 1.4 2024/01/18 07:48:56 skrll Exp $
 #
 # GENERIC machine description file
 #
@@ -52,5 +52,14 @@ ccache* 	at fdt?			# SiFive FU[57]40 L2 
 # Clock controller
 jh7100clkc* 	at fdt?	pass 2		# StarFive JH7100 clock controller
 
+# USB
+jh71x0usb* 	at fdt?			# StarFive JH71x0 usb
+
+# USB
+xhci* 		at fdt?			# XHCI
+usb* 		at usbus?
+include "dev/usb/usbdevices.config"
+midi*		at midibus?
+
 # Pull in optional local configuration - always at end
 cinclude 	"arch/riscv/conf/GENERIC64.local"

Index: src/sys/arch/riscv/starfive/files.starfive
diff -u src/sys/arch/riscv/starfive/files.starfive:1.1 src/sys/arch/riscv/starfive/files.starfive:1.2
--- src/sys/arch/riscv/starfive/files.starfive:1.1	Tue Jan 16 09:06:46 2024
+++ src/sys/arch/riscv/starfive/files.starfive	Thu Jan 18 07:48:57 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.starfive,v 1.1 2024/01/16 09:06:46 skrll Exp $
+#	$NetBSD: files.starfive,v 1.2 2024/01/18 07:48:57 skrll Exp $
 #
 # Configuration info for StarFive SoCs
 #
@@ -8,3 +8,7 @@ device	jh7100clkc
 attach	jh7100clkc at fdt with jh7100_clkc
 file	arch/riscv/starfive/jh7100_clkc.c		jh7100_clkc
 
+# JH71x0 USB
+device	jh71x0usb
+attach	jh71x0usb at fdt with jh71x0_usb
+file	arch/riscv/starfive/jh71x0_usb.c		jh71x0_usb

Index: src/sys/dev/fdt/files.fdt
diff -u src/sys/dev/fdt/files.fdt:1.71 src/sys/dev/fdt/files.fdt:1.72
--- src/sys/dev/fdt/files.fdt:1.71	Fri Dec 29 23:31:44 2023
+++ src/sys/dev/fdt/files.fdt	Thu Jan 18 07:48:57 2024
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.71 2023/12/29 23:31:44 thorpej Exp $
+# $NetBSD: files.fdt,v 1.72 2024/01/18 07:48:57 skrll Exp $
 
 include	"external/bsd/libfdt/conf/files.libfdt"
 
@@ -150,6 +150,10 @@ file	dev/fdt/ehci_fdt.c			ehci_fdt
 attach	ohci at fdt with ohci_fdt
 file	dev/fdt/ohci_fdt.c			ohci_fdt
 
+# Cadence USB3 XHCI
+attach	xhci at fdt with cdns3_fdt
+file	dev/fdt/cdns3_fdt.c			cdns3_fdt
+
 # Designware USB2 OTG
 attach	dwctwo at fdt with dwc2_fdt
 file	dev/fdt/dwc2_fdt.c			dwc2_fdt

Added files:

Index: src/sys/arch/riscv/starfive/jh71x0_usb.c
diff -u /dev/null src/sys/arch/riscv/starfive/jh71x0_usb.c:1.1
--- /dev/null	Thu Jan 18 07:48:57 2024
+++ src/sys/arch/riscv/starfive/jh71x0_usb.c	Thu Jan 18 07:48:57 2024
@@ -0,0 +1,247 @@
+/* $NetBSD: jh71x0_usb.c,v 1.1 2024/01/18 07:48:57 skrll Exp $ */
+
+/*-
+ * Copyright (c) 2023 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Nick Hudson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE

CVS commit: src/sys

2024-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 18 07:48:57 UTC 2024

Modified Files:
src/sys/arch/riscv/conf: GENERIC64
src/sys/arch/riscv/starfive: files.starfive
src/sys/dev/fdt: files.fdt
Added Files:
src/sys/arch/riscv/starfive: jh71x0_usb.c
src/sys/dev/fdt: cdns3_fdt.c

Log Message:
risc-v: attach the Cadence XHCI usb controller on the JH7100 SoC


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/riscv/conf/GENERIC64
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/starfive/files.starfive
cvs rdiff -u -r0 -r1.1 src/sys/arch/riscv/starfive/jh71x0_usb.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/cdns3_fdt.c
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/fdt/files.fdt

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



CVS commit: src/sys/arch/riscv/riscv

2024-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 18 07:41:50 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: clock_machdep.c riscv_machdep.c

Log Message:
Provide a working delay(9)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/riscv/riscv/clock_machdep.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/riscv/riscv/riscv_machdep.c

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

Modified files:

Index: src/sys/arch/riscv/riscv/clock_machdep.c
diff -u src/sys/arch/riscv/riscv/clock_machdep.c:1.6 src/sys/arch/riscv/riscv/clock_machdep.c:1.7
--- src/sys/arch/riscv/riscv/clock_machdep.c:1.6	Wed Jul 26 06:13:44 2023
+++ src/sys/arch/riscv/riscv/clock_machdep.c	Thu Jan 18 07:41:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock_machdep.c,v 1.6 2023/07/26 06:13:44 skrll Exp $	*/
+/*	$NetBSD: clock_machdep.c,v 1.7 2024/01/18 07:41:50 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__RCSID("$NetBSD: clock_machdep.c,v 1.6 2023/07/26 06:13:44 skrll Exp $");
+__RCSID("$NetBSD: clock_machdep.c,v 1.7 2024/01/18 07:41:50 skrll Exp $");
 
 #include 
 #include 
@@ -47,6 +47,7 @@ static void (*_riscv_timer_init)(void) =
 
 static uint32_t timer_frequency;
 static uint32_t	timer_ticks_per_hz;
+static uint32_t timer_ticks_per_usec;
 
 static u_int
 timer_get_timecount(struct timecounter *tc)
@@ -67,6 +68,7 @@ riscv_timer_frequency_set(uint32_t freq)
 {
 	timer_frequency = freq;
 	timer_ticks_per_hz = freq / hz;
+	timer_ticks_per_usec = freq / 100;
 }
 
 uint32_t
@@ -143,3 +145,14 @@ void
 setstatclockrate(int newhz)
 {
 }
+
+void
+delay(unsigned long us)
+{
+const uint64_t ticks = (uint64_t)us * timer_ticks_per_usec;
+const uint64_t finish = csr_time_read() + ticks;
+
+while (csr_time_read() < finish) {
+/* spin, baby spin */
+}
+}

Index: src/sys/arch/riscv/riscv/riscv_machdep.c
diff -u src/sys/arch/riscv/riscv/riscv_machdep.c:1.35 src/sys/arch/riscv/riscv/riscv_machdep.c:1.36
--- src/sys/arch/riscv/riscv/riscv_machdep.c:1.35	Fri Dec 22 08:41:59 2023
+++ src/sys/arch/riscv/riscv/riscv_machdep.c	Thu Jan 18 07:41:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: riscv_machdep.c,v 1.35 2023/12/22 08:41:59 skrll Exp $	*/
+/*	$NetBSD: riscv_machdep.c,v 1.36 2024/01/18 07:41:50 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2014, 2019, 2022 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "opt_riscv_debug.h"
 
 #include 
-__RCSID("$NetBSD: riscv_machdep.c,v 1.35 2023/12/22 08:41:59 skrll Exp $");
+__RCSID("$NetBSD: riscv_machdep.c,v 1.36 2024/01/18 07:41:50 skrll Exp $");
 
 #include 
 
@@ -136,18 +136,6 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysc
 	CTL_MACHDEP, CTL_EOL);
 }
 
-void
-delay(unsigned long us)
-{
-	const uint32_t cycles_per_us = curcpu()->ci_data.cpu_cc_freq / 100;
-	const uint64_t cycles = (uint64_t)us * cycles_per_us;
-	const uint64_t finish = csr_cycle_read() + cycles;
-
-	while (csr_cycle_read() < finish) {
-		/* spin, baby spin */
-	}
-}
-
 #ifdef MODULAR
 /*
  * Push any modules loaded by the boot loader.



CVS commit: src/sys/arch/riscv/riscv

2024-01-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 18 07:41:50 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: clock_machdep.c riscv_machdep.c

Log Message:
Provide a working delay(9)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/riscv/riscv/clock_machdep.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/riscv/riscv/riscv_machdep.c

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



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

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 05:42:29 UTC 2024

Modified Files:
src/sys/arch/m68k/conf: files.m68k

Log Message:
Bump required version (mkflagvar).


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/m68k/conf/files.m68k

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



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

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 05:42:29 UTC 2024

Modified Files:
src/sys/arch/m68k/conf: files.m68k

Log Message:
Bump required version (mkflagvar).


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/m68k/conf/files.m68k

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/m68k/conf/files.m68k
diff -u src/sys/arch/m68k/conf/files.m68k:1.55 src/sys/arch/m68k/conf/files.m68k:1.56
--- src/sys/arch/m68k/conf/files.m68k:1.55	Thu Jan 18 05:04:13 2024
+++ src/sys/arch/m68k/conf/files.m68k	Thu Jan 18 05:42:29 2024
@@ -1,6 +1,8 @@
-#	$NetBSD: files.m68k,v 1.55 2024/01/18 05:04:13 thorpej Exp $
+#	$NetBSD: files.m68k,v 1.56 2024/01/18 05:42:29 thorpej Exp $
 #
 
+version	20240118		# mkflagvar
+
 defflag	opt_fpsp.h		FPSP
 defflag	opt_m68k_arch.h		M68010
 defflag	opt_m68k_arch.h		M68020



CVS commit: src/usr.bin/config

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 05:41:38 UTC 2024

Modified Files:
src/usr.bin/config: defs.h

Log Message:
Bump version.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/usr.bin/config/defs.h

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

Modified files:

Index: src/usr.bin/config/defs.h
diff -u src/usr.bin/config/defs.h:1.107 src/usr.bin/config/defs.h:1.108
--- src/usr.bin/config/defs.h:1.107	Thu Jan 18 04:41:37 2024
+++ src/usr.bin/config/defs.h	Thu Jan 18 05:41:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.107 2024/01/18 04:41:37 thorpej Exp $	*/
+/*	$NetBSD: defs.h,v 1.108 2024/01/18 05:41:38 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -107,7 +107,7 @@ extern const char *progname;
  * The next two lines define the current version of the config(1) binary,
  * and the minimum version of the configuration files it supports.
  */
-#define CONFIG_VERSION		20180827
+#define CONFIG_VERSION		20240118
 #define CONFIG_MINVERSION	0
 
 struct where {



CVS commit: src/usr.bin/config

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 05:41:38 UTC 2024

Modified Files:
src/usr.bin/config: defs.h

Log Message:
Bump version.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/usr.bin/config/defs.h

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



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

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 05:13:48 UTC 2024

Modified Files:
src/sys/arch/sun2/conf: std.sun2

Log Message:
Add "options M68010" for completeness.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sun2/conf/std.sun2

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/sun2/conf/std.sun2
diff -u src/sys/arch/sun2/conf/std.sun2:1.7 src/sys/arch/sun2/conf/std.sun2:1.8
--- src/sys/arch/sun2/conf/std.sun2:1.7	Sun Sep 19 02:09:29 2010
+++ src/sys/arch/sun2/conf/std.sun2	Thu Jan 18 05:13:48 2024
@@ -1,9 +1,12 @@
-# $NetBSD: std.sun2,v 1.7 2010/09/19 02:09:29 tsutsui Exp $
+# $NetBSD: std.sun2,v 1.8 2024/01/18 05:13:48 thorpej Exp $
 
 # Standard information for Sun2 machines.
 machine	sun2 m68k sun68k
 include		"conf/std"			# MI standard options
 include		"arch/m68k/conf/std.m68k"	# m68k standard options
 
+# All sun2 systems have a 68010.
+options 	M68010
+
 # XXX temporary option until sun3 port migrates to all sun68k stuff
 options 	_SUN2_



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

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 05:13:48 UTC 2024

Modified Files:
src/sys/arch/sun2/conf: std.sun2

Log Message:
Add "options M68010" for completeness.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sun2/conf/std.sun2

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



CVS commit: src/sys/arch/mvme68k

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 05:12:30 UTC 2024

Modified Files:
src/sys/arch/mvme68k/conf: Makefile.mvme68k files.mvme68k
src/sys/arch/mvme68k/dev: mainbus.c zs.c
src/sys/arch/mvme68k/include: cpu.h
src/sys/arch/mvme68k/mvme68k: autoconf.c locore.s machdep.c

Log Message:
Don't put the MVME1xx model defines into IDENT, make them defflag options and
put them in opt_mvmeconf.h.  Make these options depend on the appropriate
M680x0 option (MVME147 -> M68030, MVME16[27] -> M68040, MVME17[27] -> M68060)
so that the CPU option appears correctly in opt_m68k_arch.h.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/mvme68k/conf/Makefile.mvme68k \
src/sys/arch/mvme68k/conf/files.mvme68k
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mvme68k/dev/mainbus.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/mvme68k/dev/zs.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/mvme68k/include/cpu.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/mvme68k/mvme68k/autoconf.c
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.163 -r1.164 src/sys/arch/mvme68k/mvme68k/machdep.c

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

Modified files:

Index: src/sys/arch/mvme68k/conf/Makefile.mvme68k
diff -u src/sys/arch/mvme68k/conf/Makefile.mvme68k:1.68 src/sys/arch/mvme68k/conf/Makefile.mvme68k:1.69
--- src/sys/arch/mvme68k/conf/Makefile.mvme68k:1.68	Sat Sep 22 12:24:02 2018
+++ src/sys/arch/mvme68k/conf/Makefile.mvme68k	Thu Jan 18 05:12:29 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mvme68k,v 1.68 2018/09/22 12:24:02 rin Exp $
+#	$NetBSD: Makefile.mvme68k,v 1.69 2024/01/18 05:12:29 thorpej Exp $
 
 # Makefile for NetBSD
 #
@@ -32,19 +32,19 @@ GENASSYM_CONF=	${MVME68K}/mvme68k/genass
 ## (2) compile settings
 ##
 CPPFLAGS+=	-Dmvme68k
-.if empty(IDENT:M-DMVME172) && empty(IDENT:M-DMVME177)
-.if empty(IDENT:M-DMVME147)
+.if empty(KERNEL_OPT_M68060)
+.if empty(KERNEL_OPT_M68030)
 CMACHFLAGS=	-m68040
 .else
 CMACHFLAGS=	-m68030
 .endif
-.else
-.if empty(IDENT:M-DMVME147) && empty(IDENT:M-DMVME162) && empty(IDENT:M-DMVME167)
+.else		# M68060
+.if empty(KERNEL_OPT_M68030) && empty(KERNEL_OPT_M68040)
 CMACHFLAGS=	-m68060 -Wa,-march=68030 -Wa,-m68030 -Wa,-mcpu=68030 -Wa,-m68851
 .else
 CMACHFLAGS=	-m68020-60 -Wa,-m68030 -Wa,-mcpu=68030 -Wa,-m68851
 .endif
-.endif
+.endif		# M68060
 CFLAGS+=	${CMACHFLAGS} -msoft-float
 AFLAGS+=	-x assembler-with-cpp
 
Index: src/sys/arch/mvme68k/conf/files.mvme68k
diff -u src/sys/arch/mvme68k/conf/files.mvme68k:1.68 src/sys/arch/mvme68k/conf/files.mvme68k:1.69
--- src/sys/arch/mvme68k/conf/files.mvme68k:1.68	Tue Jan 16 01:26:34 2024
+++ src/sys/arch/mvme68k/conf/files.mvme68k	Thu Jan 18 05:12:29 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mvme68k,v 1.68 2024/01/16 01:26:34 thorpej Exp $
+#	$NetBSD: files.mvme68k,v 1.69 2024/01/18 05:12:29 thorpej Exp $
 
 # config file for mvme68k
 
@@ -8,6 +8,13 @@ defflagPANICBUTTON	# panic on ABORT 
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 8
 
+# System configuration options.
+defflag	opt_mvmeconf.h	MVME147: M68030
+defflag	opt_mvmeconf.h	MVME162: M68040
+defflag	opt_mvmeconf.h	MVME167: M68040
+defflag	opt_mvmeconf.h	MVME172: M68060
+defflag	opt_mvmeconf.h	MVME177: M68060
+
 device mainbus { }
 attach mainbus at root
 file arch/mvme68k/dev/mainbus.c		mainbus

Index: src/sys/arch/mvme68k/dev/mainbus.c
diff -u src/sys/arch/mvme68k/dev/mainbus.c:1.23 src/sys/arch/mvme68k/dev/mainbus.c:1.24
--- src/sys/arch/mvme68k/dev/mainbus.c:1.23	Sat Aug  7 16:19:00 2021
+++ src/sys/arch/mvme68k/dev/mainbus.c	Thu Jan 18 05:12:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.23 2021/08/07 16:19:00 thorpej Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.24 2024/01/18 05:12:29 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -34,8 +34,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.23 2021/08/07 16:19:00 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.24 2024/01/18 05:12:29 thorpej Exp $");
 
+#include "opt_mvmeconf.h"
 #include "vmetwo.h"
 
 #include 

Index: src/sys/arch/mvme68k/dev/zs.c
diff -u src/sys/arch/mvme68k/dev/zs.c:1.45 src/sys/arch/mvme68k/dev/zs.c:1.46
--- src/sys/arch/mvme68k/dev/zs.c:1.45	Sat Sep 11 20:28:04 2021
+++ src/sys/arch/mvme68k/dev/zs.c	Thu Jan 18 05:12:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.45 2021/09/11 20:28:04 andvar Exp $	*/
+/*	$NetBSD: zs.c,v 1.46 2024/01/18 05:12:29 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -39,7 +39,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.45 2021/09/11 20:28:04 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.46 2024/01/18 05:12:29 thorpej Exp $");
+
+#include "opt_mvmeconf.h"
 
 #include 
 #include 

Index: src/sys/arch/mvme68k/include/cpu.h
diff -u src/sys/arch/mvme68k/include/cpu.h:1.53 src/sys/arch/mvme68k/include/cpu.h:1.54

CVS commit: src/sys/arch/mvme68k

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 05:12:30 UTC 2024

Modified Files:
src/sys/arch/mvme68k/conf: Makefile.mvme68k files.mvme68k
src/sys/arch/mvme68k/dev: mainbus.c zs.c
src/sys/arch/mvme68k/include: cpu.h
src/sys/arch/mvme68k/mvme68k: autoconf.c locore.s machdep.c

Log Message:
Don't put the MVME1xx model defines into IDENT, make them defflag options and
put them in opt_mvmeconf.h.  Make these options depend on the appropriate
M680x0 option (MVME147 -> M68030, MVME16[27] -> M68040, MVME17[27] -> M68060)
so that the CPU option appears correctly in opt_m68k_arch.h.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/mvme68k/conf/Makefile.mvme68k \
src/sys/arch/mvme68k/conf/files.mvme68k
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mvme68k/dev/mainbus.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/mvme68k/dev/zs.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/mvme68k/include/cpu.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/mvme68k/mvme68k/autoconf.c
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.163 -r1.164 src/sys/arch/mvme68k/mvme68k/machdep.c

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



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

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 05:04:13 UTC 2024

Modified Files:
src/sys/arch/m68k/conf: files.m68k

Log Message:
mkflagvar M68010 M68020 M68030 M68040 M68060


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/m68k/conf/files.m68k

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



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

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 05:04:13 UTC 2024

Modified Files:
src/sys/arch/m68k/conf: files.m68k

Log Message:
mkflagvar M68010 M68020 M68030 M68040 M68060


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/m68k/conf/files.m68k

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/m68k/conf/files.m68k
diff -u src/sys/arch/m68k/conf/files.m68k:1.54 src/sys/arch/m68k/conf/files.m68k:1.55
--- src/sys/arch/m68k/conf/files.m68k:1.54	Wed Jan 17 12:33:51 2024
+++ src/sys/arch/m68k/conf/files.m68k	Thu Jan 18 05:04:13 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.m68k,v 1.54 2024/01/17 12:33:51 thorpej Exp $
+#	$NetBSD: files.m68k,v 1.55 2024/01/18 05:04:13 thorpej Exp $
 #
 
 defflag	opt_fpsp.h		FPSP
@@ -7,6 +7,11 @@ defflag	opt_m68k_arch.h		M68020
 defflag	opt_m68k_arch.h		M68030
 defflag	opt_m68k_arch.h		M68040
 defflag	opt_m68k_arch.h		M68060
+
+# Emit Makefile vars for these kernel options so that compiler flags
+# can be tuned for CPU support.
+mkflagvar M68010 M68020 M68030 M68040 M68060
+
 defflagFPU_EMULATE
 defflagPMAP_DEBUG
 



CVS commit: src/usr.bin/config

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 04:41:38 UTC 2024

Modified Files:
src/usr.bin/config: config.5 defs.h gram.y main.c mkmakefile.c scan.l
util.c

Log Message:
With config(1) as it exists today, a kernel Makefile is able to implement
logic on kernel options so long as those options are not defflag'd or
defparam'd.  This works because such options are automatally added to the
IDENT var in the kernel Makefile as a preprocessor define, and the Makefile
can then do an operation like:

.if !empty(IDENT:M-DSOMECOOLCPUOPTION)
CFLAGS+= -mcpu=somecoolcpu
.endif

Unfortunately, this precludes making it possible to generate a compile-time
dependency on SOMECOOLCPUOPTION, or having SOMECOOLCPUOPTION imply another
kernel config option using the normal config(1) option dependency function.

Fix this by introducing a new option description keyword: mkflagvar.  This
keyword marks an already defflag'd option as wanting a kernel Makefile var
defined if that option is selected in the kernel config file.  So:

defflag opt_coolcpu.h SOMECOOLCPUOPTION ANOTHERCOOLCPUOPTION
mkflagvar SOMECOOLCPUOPTION ANOTHERCOOLCPUOPTION

will cause:

KERNEL_OPT_SOMECOOLCPUOPTION="1"
KERNEL_OPT_ANOTHERCOOLCPUOPTION="1"

...to be emitted into the kernel Makefile if those options are, in fact,
selected with "options ..." in the kernel config file, thus allowing for
a compile-time dependency on the option to be generated in addition to
Makefile logic, which now looks like:

.if !empty(KERNEL_OPT_SOMECOOLCPUOPTION)
CFLAGS+= -mcpu=somecoolcpu
.endif


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/config/config.5
cvs rdiff -u -r1.106 -r1.107 src/usr.bin/config/defs.h
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/config/gram.y
cvs rdiff -u -r1.100 -r1.101 src/usr.bin/config/main.c
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/config/mkmakefile.c
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/config/scan.l
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/config/util.c

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

Modified files:

Index: src/usr.bin/config/config.5
diff -u src/usr.bin/config/config.5:1.47 src/usr.bin/config/config.5:1.48
--- src/usr.bin/config/config.5:1.47	Mon Oct  4 14:35:20 2021
+++ src/usr.bin/config/config.5	Thu Jan 18 04:41:37 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: config.5,v 1.47 2021/10/04 14:35:20 andvar Exp $
+.\" $NetBSD: config.5,v 1.48 2024/01/18 04:41:37 thorpej Exp $
 .\"
 .\"  Copyright (c) 2006, 2007 The NetBSD Foundation.
 .\"  All rights reserved.
@@ -24,7 +24,7 @@
 .\"  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\"  POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd July 19, 2016
+.Dd January 17, 2024
 .Dt CONFIG 5
 .Os
 .Sh NAME
@@ -459,6 +459,24 @@ The optional
 argument should match the original definition of the option.
 .\"
 .Pp
+.It Ic mkflagvar \
+Ar option ...
+Specifes that an option previously defined with
+.Ic defflag
+should have a variable created in the kernel Makefile if the option
+is selection with an
+.Ic options
+statement.
+No variable is created if the option is not selected.
+The Makefile variable will have the name
+.Li KERNEL_OPT_ Ns Aq Ar option
+and, because options defined with
+.Ic defflag
+are boolean, 
+the variable will have the value
+.Dq 1 .
+.\"
+.Pp
 .It Ic define \
 Ar attribute \
 Oo Ic \&{ Ar locators Ic \&} Oc \

Index: src/usr.bin/config/defs.h
diff -u src/usr.bin/config/defs.h:1.106 src/usr.bin/config/defs.h:1.107
--- src/usr.bin/config/defs.h:1.106	Fri Apr  3 19:53:41 2020
+++ src/usr.bin/config/defs.h	Thu Jan 18 04:41:37 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.106 2020/04/03 19:53:41 joerg Exp $	*/
+/*	$NetBSD: defs.h,v 1.107 2024/01/18 04:41:37 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -151,6 +151,7 @@ struct defoptlist {
 	const char *dl_value;
 	const char *dl_lintvalue;
 	int dl_obsolete;
+	int dl_mkvar;
 	struct nvlist *dl_depends;
 	struct where	dl_where;
 };
@@ -591,10 +592,12 @@ void	delfsoption(const char *, int);
 void	delmkoption(const char *, int);
 int	devbase_has_instances(struct devbase *, int);
 struct where *find_declared_option(const char *);
+struct defoptlist *find_declared_option_option(const char *name);
 int	deva_has_instances(struct deva *, int);
 void	setupdirs(void);
 void	fixmaxusers(void);
 void	fixmkoption(void);
+void	mkflagvar(struct defoptlist *);
 const char *strtolower(const char *);
 
 /* tests on option types */

Index: src/usr.bin/config/gram.y
diff -u src/usr.bin/config/gram.y:1.56 src/usr.bin/config/gram.y:1.57
--- src/usr.bin/config/gram.y:1.56	Sun Jul 26 22:40:52 2020
+++ src/usr.bin/config/gram.y	Thu Jan 18 04:41:37 2024
@@ -1,5 +1,5 @@
 %{
-/*	$NetBSD: gram.y,v 1.56 2020/07/26 22:40:52 uwe Exp $	*/
+/*	$NetBSD: gram.y,v 1.57 2024/01/18 04:41:37 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: gram.y,v 1.56 

CVS commit: src/usr.bin/config

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 04:41:38 UTC 2024

Modified Files:
src/usr.bin/config: config.5 defs.h gram.y main.c mkmakefile.c scan.l
util.c

Log Message:
With config(1) as it exists today, a kernel Makefile is able to implement
logic on kernel options so long as those options are not defflag'd or
defparam'd.  This works because such options are automatally added to the
IDENT var in the kernel Makefile as a preprocessor define, and the Makefile
can then do an operation like:

.if !empty(IDENT:M-DSOMECOOLCPUOPTION)
CFLAGS+= -mcpu=somecoolcpu
.endif

Unfortunately, this precludes making it possible to generate a compile-time
dependency on SOMECOOLCPUOPTION, or having SOMECOOLCPUOPTION imply another
kernel config option using the normal config(1) option dependency function.

Fix this by introducing a new option description keyword: mkflagvar.  This
keyword marks an already defflag'd option as wanting a kernel Makefile var
defined if that option is selected in the kernel config file.  So:

defflag opt_coolcpu.h SOMECOOLCPUOPTION ANOTHERCOOLCPUOPTION
mkflagvar SOMECOOLCPUOPTION ANOTHERCOOLCPUOPTION

will cause:

KERNEL_OPT_SOMECOOLCPUOPTION="1"
KERNEL_OPT_ANOTHERCOOLCPUOPTION="1"

...to be emitted into the kernel Makefile if those options are, in fact,
selected with "options ..." in the kernel config file, thus allowing for
a compile-time dependency on the option to be generated in addition to
Makefile logic, which now looks like:

.if !empty(KERNEL_OPT_SOMECOOLCPUOPTION)
CFLAGS+= -mcpu=somecoolcpu
.endif


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/config/config.5
cvs rdiff -u -r1.106 -r1.107 src/usr.bin/config/defs.h
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/config/gram.y
cvs rdiff -u -r1.100 -r1.101 src/usr.bin/config/main.c
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/config/mkmakefile.c
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/config/scan.l
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/config/util.c

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



CVS commit: src/doc

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 04:08:44 UTC 2024

Modified Files:
src/doc: CHANGES

Log Message:
doc: wm(4): Add some Meteor Lake devices (I219 V20-V21 and LM 20-21)


To generate a diff of this commit:
cvs rdiff -u -r1.3027 -r1.3028 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.3027 src/doc/CHANGES:1.3028
--- src/doc/CHANGES:1.3027	Sat Dec 23 20:49:22 2023
+++ src/doc/CHANGES	Thu Jan 18 04:08:44 2024
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3027 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.3028 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -246,3 +246,5 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 	tzdata: Updated to 2023d (via 2023dgtz) [kre 20231223]
 	postfix(1): Import version 3.8.4. [christos 20231223]
 	tzcode: Updated to 2023d. [christos 20231223]
+	wm(4): Add some Meteor Lake devices (I219 V20-V21 and LM 20-21).
+		[msaitoh 20240118]



CVS commit: src/doc

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 04:08:44 UTC 2024

Modified Files:
src/doc: CHANGES

Log Message:
doc: wm(4): Add some Meteor Lake devices (I219 V20-V21 and LM 20-21)


To generate a diff of this commit:
cvs rdiff -u -r1.3027 -r1.3028 src/doc/CHANGES

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



CVS commit: src/sys/arch/news68k

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 04:07:38 UTC 2024

Modified Files:
src/sys/arch/news68k/conf: files.news68k
src/sys/arch/news68k/include: cpu.h
src/sys/arch/news68k/news68k: machdep.c machid.h pmap_bootstrap.c

Log Message:
Don't put the news1[27]00 model defines into INDENT, make them
defflag options and put them in opt_newsconf.h.  Make these
options depend on the appropriate M680x0 option (M68030 for each)
so that the CPU option appears correctly in opt_m68k_arch.h.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/news68k/conf/files.news68k
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/news68k/include/cpu.h
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/news68k/news68k/machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/news68k/news68k/machid.h
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/news68k/news68k/pmap_bootstrap.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/news68k/conf/files.news68k
diff -u src/sys/arch/news68k/conf/files.news68k:1.39 src/sys/arch/news68k/conf/files.news68k:1.40
--- src/sys/arch/news68k/conf/files.news68k:1.39	Mon Jan 15 00:35:23 2024
+++ src/sys/arch/news68k/conf/files.news68k	Thu Jan 18 04:07:37 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.news68k,v 1.39 2024/01/15 00:35:23 thorpej Exp $
+#	$NetBSD: files.news68k,v 1.40 2024/01/18 04:07:37 thorpej Exp $
 
 #	NEWS68K-specific configuration info
 
@@ -7,6 +7,10 @@ maxpartitions 8
 
 maxusers 2 8 64
 
+# System configuration options.
+defflag	opt_newsconf.h	news1200: M68030
+defflag	opt_newsconf.h	news1700: M68030
+
 device mainbus { [systype = -1] }
 attach mainbus at root
 

Index: src/sys/arch/news68k/include/cpu.h
diff -u src/sys/arch/news68k/include/cpu.h:1.51 src/sys/arch/news68k/include/cpu.h:1.52
--- src/sys/arch/news68k/include/cpu.h:1.51	Mon Jan 15 20:21:50 2024
+++ src/sys/arch/news68k/include/cpu.h	Thu Jan 18 04:07:37 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.51 2024/01/15 20:21:50 thorpej Exp $	*/
+/*	$NetBSD: cpu.h,v 1.52 2024/01/18 04:07:37 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -44,6 +44,7 @@
 #if defined(_KERNEL_OPT)
 #include "opt_lockdebug.h"
 #include "opt_m68k_arch.h"
+#include "opt_newsconf.h"
 #endif
 
 /*
@@ -130,9 +131,6 @@ extern volatile u_char *ctrl_ast;
 	do { astpending++; *ctrl_ast = 0xff; } while (/* CONSTCOND */0)
 
 #if defined(news1700) || defined(news1200)
-#ifndef M68030
-#define M68030
-#endif
 #define M68K_MMU_MOTOROLA
 #endif
 

Index: src/sys/arch/news68k/news68k/machdep.c
diff -u src/sys/arch/news68k/news68k/machdep.c:1.113 src/sys/arch/news68k/news68k/machdep.c:1.114
--- src/sys/arch/news68k/news68k/machdep.c:1.113	Mon Jan 15 20:21:51 2024
+++ src/sys/arch/news68k/news68k/machdep.c	Thu Jan 18 04:07:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.113 2024/01/15 20:21:51 thorpej Exp $	*/
+/*	$NetBSD: machdep.c,v 1.114 2024/01/18 04:07:38 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,11 +39,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.113 2024/01/15 20:21:51 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.114 2024/01/18 04:07:38 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
 #include "opt_modular.h"
+#include "opt_newsconf.h"
 
 #include 
 #include 

Index: src/sys/arch/news68k/news68k/machid.h
diff -u src/sys/arch/news68k/news68k/machid.h:1.4 src/sys/arch/news68k/news68k/machid.h:1.5
--- src/sys/arch/news68k/news68k/machid.h:1.4	Sun Dec 11 12:18:23 2005
+++ src/sys/arch/news68k/news68k/machid.h	Thu Jan 18 04:07:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: machid.h,v 1.4 2005/12/11 12:18:23 christos Exp $	*/
+/*	$NetBSD: machid.h,v 1.5 2024/01/18 04:07:38 thorpej Exp $	*/
 /*
  * Copyright (c) 1992, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -86,6 +86,8 @@
 #define	NWB235A	236
 #define	NWXRES	255
 
+#include "opt_newsconf.h"
+
 #if defined(news700) || defined(news800) || defined(news1700) || defined(news1800)
 struct oidrom {
 /*00*/	unsigned char	id_model;

Index: src/sys/arch/news68k/news68k/pmap_bootstrap.c
diff -u src/sys/arch/news68k/news68k/pmap_bootstrap.c:1.42 src/sys/arch/news68k/news68k/pmap_bootstrap.c:1.43
--- src/sys/arch/news68k/news68k/pmap_bootstrap.c:1.42	Sun Oct  8 03:57:47 2023
+++ src/sys/arch/news68k/news68k/pmap_bootstrap.c	Thu Jan 18 04:07:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.42 2023/10/08 03:57:47 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.43 2024/01/18 04:07:38 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -39,9 +39,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.42 2023/10/08 03:57:47 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.43 2024/01/18 04:07:38 thorpej Exp $");
 
 #include "opt_m68k_arch.h"
+#include "opt_newsconf.h"
 
 #include 
 #include 



CVS commit: src/sys/arch/news68k

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 04:07:38 UTC 2024

Modified Files:
src/sys/arch/news68k/conf: files.news68k
src/sys/arch/news68k/include: cpu.h
src/sys/arch/news68k/news68k: machdep.c machid.h pmap_bootstrap.c

Log Message:
Don't put the news1[27]00 model defines into INDENT, make them
defflag options and put them in opt_newsconf.h.  Make these
options depend on the appropriate M680x0 option (M68030 for each)
so that the CPU option appears correctly in opt_m68k_arch.h.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/news68k/conf/files.news68k
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/news68k/include/cpu.h
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/news68k/news68k/machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/news68k/news68k/machid.h
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/news68k/news68k/pmap_bootstrap.c

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



CVS commit: src/doc

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 04:02:16 UTC 2024

Modified Files:
src/doc: CHANGES.prev

Log Message:
arm: Add entry for ARM big.LITTLE done by ryo@.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/doc/CHANGES.prev

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

Modified files:

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.177 src/doc/CHANGES.prev:1.178
--- src/doc/CHANGES.prev:1.177	Thu Jan 18 03:59:37 2024
+++ src/doc/CHANGES.prev	Thu Jan 18 04:02:16 2024
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.177 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.178 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -12440,6 +12440,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	mue(4): Add driver for Microchip LAN75xx/LAN78xx (Raspberry Pi 3 B+)
 		from OpenBSD. [rin 20180825]
 	OpenSSH: Imported 7.8. [christos 20180826]
+	arm: Add support multiple cpu clusters(big.LITTLE) [ryo 20180826]
 	rkpmic(4): Add driver for Rockchip RK808 Power Management IC.
 		[jmcneill 20180901]
 	nsd: Import 4.1.24. [christos 20180903]



CVS commit: src/doc

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 04:02:16 UTC 2024

Modified Files:
src/doc: CHANGES.prev

Log Message:
arm: Add entry for ARM big.LITTLE done by ryo@.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/doc/CHANGES.prev

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



CVS commit: src/doc

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:59:37 UTC 2024

Modified Files:
src/doc: CHANGES.prev

Log Message:
wm(4): It's not for V9 but for V19.


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/doc/CHANGES.prev

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



CVS commit: src/doc

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:59:37 UTC 2024

Modified Files:
src/doc: CHANGES.prev

Log Message:
wm(4): It's not for V9 but for V19.


To generate a diff of this commit:
cvs rdiff -u -r1.176 -r1.177 src/doc/CHANGES.prev

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

Modified files:

Index: src/doc/CHANGES.prev
diff -u src/doc/CHANGES.prev:1.176 src/doc/CHANGES.prev:1.177
--- src/doc/CHANGES.prev:1.176	Fri Nov 17 22:46:19 2023
+++ src/doc/CHANGES.prev	Thu Jan 18 03:59:37 2024
@@ -1,4 +1,4 @@
-LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.176 $>
+LIST OF CHANGES FROM PREVIOUS RELEASES:			<$Revision: 1.177 $>
 
 
 Changes from 386bsd 0.1 + patchkit 0.2.2 to NetBSD 0.8:
@@ -13146,7 +13146,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		and humidity sensor [brad 20211003]
 	network: Make pktq_rps_hash() pluggable for each interface type.
 		[knakahara 20211011]
-	wm(4): Add Tiger Lake and newer devices (I219V 15-V9 and LM 16-19).
+	wm(4): Add Tiger Lake and newer devices (I219V 15-V19 and LM 16-19).
 		[msaitoh 20211013]
 	sgp40mox(4): Driver for the Sensirion SGP40 MOx gas sensor for air
 		quality [brad 20211014]



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:47:26 UTC 2024

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

Log Message:
rge(4): Print HW revision.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/if_rge.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_rge.c
diff -u src/sys/dev/pci/if_rge.c:1.30 src/sys/dev/pci/if_rge.c:1.31
--- src/sys/dev/pci/if_rge.c:1.30	Thu Dec 21 08:50:22 2023
+++ src/sys/dev/pci/if_rge.c	Thu Jan 18 03:47:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rge.c,v 1.30 2023/12/21 08:50:22 skrll Exp $	*/
+/*	$NetBSD: if_rge.c,v 1.31 2024/01/18 03:47:26 msaitoh Exp $	*/
 /*	$OpenBSD: if_rge.c,v 1.9 2020/12/12 11:48:53 jan Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.30 2023/12/21 08:50:22 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rge.c,v 1.31 2024/01/18 03:47:26 msaitoh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_net_mpsafe.h"
@@ -198,6 +198,7 @@ rge_attach(device_t parent, device_t sel
 	uint8_t eaddr[ETHER_ADDR_LEN];
 	int offset;
 	pcireg_t command;
+	const char *revstr;
 
 	pci_set_powerstate(pa->pa_pc, pa->pa_tag, PCI_PMCSR_STATE_D0);
 
@@ -269,21 +270,26 @@ rge_attach(device_t parent, device_t sel
 	switch (hwrev) {
 	case 0x6080:
 		sc->rge_type = MAC_CFG2;
+		revstr = "Z1";
 		break;
 	case 0x6090:
 		sc->rge_type = MAC_CFG3;
+		revstr = "Z2";
 		break;
 	case 0x6400:
 		sc->rge_type = MAC_CFG4;
+		revstr = "A";
 		break;
 	case 0x6410:
 		sc->rge_type = MAC_CFG5;
+		revstr = "B";
 		break;
 	default:
 		aprint_error(": unknown version 0x%08x\n", hwrev);
 		return;
 	}
 
+	aprint_normal_dev(sc->sc_dev, "HW rev. %s\n", revstr);
 	rge_config_imtype(sc, RGE_IMTYPE_SIM);
 
 	/*



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:47:26 UTC 2024

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

Log Message:
rge(4): Print HW revision.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/pci/if_rge.c

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



CVS commit: src/sys/arch/hp300

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 03:40:48 UTC 2024

Modified Files:
src/sys/arch/hp300/conf: files.hp300
src/sys/arch/hp300/include: hp300spu.h

Log Message:
Rather than testing for and defining the M680x0 CPU option in
hp300spu.h, make the individual model options (e.g. HP320, HP425,
etc.) declare a dependency on the correponding M680x0 options.
This makes them appear correctly in opt_m68k_arch.h rather than
having to pull in all of .


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/hp300/conf/files.hp300
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp300/include/hp300spu.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/hp300/conf/files.hp300
diff -u src/sys/arch/hp300/conf/files.hp300:1.95 src/sys/arch/hp300/conf/files.hp300:1.96
--- src/sys/arch/hp300/conf/files.hp300:1.95	Tue Jan 16 03:44:43 2024
+++ src/sys/arch/hp300/conf/files.hp300	Thu Jan 18 03:40:48 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.hp300,v 1.95 2024/01/16 03:44:43 thorpej Exp $
+#	$NetBSD: files.hp300,v 1.96 2024/01/18 03:40:48 thorpej Exp $
 #
 # hp300-specific configuration info
 
@@ -8,8 +8,23 @@ maxpartitions 8
 maxusers 2 8 64
 
 # SPU configuration options.
-defflag	opt_spuconf.h	HP320 HP330 HP340 HP345 HP350 HP360 HP362 HP370
-			HP375 HP380 HP382 HP385 HP400 HP425 HP433
+defflag	opt_spuconf.h	HP320: M68020
+defflag	opt_spuconf.h	HP330: M68020
+defflag	opt_spuconf.h	HP350: M68020
+
+defflag	opt_spuconf.h	HP340: M68030
+defflag	opt_spuconf.h	HP345: M68030
+defflag	opt_spuconf.h	HP360: M68030
+defflag	opt_spuconf.h	HP362: M68030
+defflag	opt_spuconf.h	HP370: M68030
+defflag	opt_spuconf.h	HP375: M68030
+defflag	opt_spuconf.h	HP400: M68030
+
+defflag	opt_spuconf.h	HP380: M68040
+defflag	opt_spuconf.h	HP382: M68040
+defflag	opt_spuconf.h	HP385: M68040
+defflag	opt_spuconf.h	HP425: M68040
+defflag	opt_spuconf.h	HP433: M68040
 
 # Misc. options.
 defflag			USELEDS		# make the lights twinkle

Index: src/sys/arch/hp300/include/hp300spu.h
diff -u src/sys/arch/hp300/include/hp300spu.h:1.14 src/sys/arch/hp300/include/hp300spu.h:1.15
--- src/sys/arch/hp300/include/hp300spu.h:1.14	Sun Jun  6 04:50:06 2010
+++ src/sys/arch/hp300/include/hp300spu.h	Thu Jan 18 03:40:48 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: hp300spu.h,v 1.14 2010/06/06 04:50:06 mrg Exp $	*/
+/*	$NetBSD: hp300spu.h,v 1.15 2024/01/18 03:40:48 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -90,23 +90,6 @@ extern	int mmuid;		/* MMU id */
 #endif
 
 /*
- * CPU configuration.
- */
-#if defined(HP320) || defined(HP330) || defined(HP350)
-#define M68020
-#endif
-
-#if defined(HP340) || defined(HP345) || defined(HP360) || defined(HP362) || \
-defined(HP370) || defined(HP375) || defined(HP400)
-#define M68030
-#endif
-
-#if defined(HP380) || defined(HP382) || defined(HP385) || defined(HP425) || \
-defined(HP433)
-#define M68040
-#endif
-
-/*
  * MMU configuration.
  */
 #if defined(HP320) || defined(HP350)



CVS commit: src/sys/arch/hp300

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 03:40:48 UTC 2024

Modified Files:
src/sys/arch/hp300/conf: files.hp300
src/sys/arch/hp300/include: hp300spu.h

Log Message:
Rather than testing for and defining the M680x0 CPU option in
hp300spu.h, make the individual model options (e.g. HP320, HP425,
etc.) declare a dependency on the correponding M680x0 options.
This makes them appear correctly in opt_m68k_arch.h rather than
having to pull in all of .


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/hp300/conf/files.hp300
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp300/include/hp300spu.h

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



CVS commit: src/sys/arch/riscv/riscv

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:36:24 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: kobj_machdep.c

Log Message:
s/FALLTHOUGH/FALLTHROUGH/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/riscv/kobj_machdep.c

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

Modified files:

Index: src/sys/arch/riscv/riscv/kobj_machdep.c
diff -u src/sys/arch/riscv/riscv/kobj_machdep.c:1.5 src/sys/arch/riscv/riscv/kobj_machdep.c:1.6
--- src/sys/arch/riscv/riscv/kobj_machdep.c:1.5	Sun May  7 12:41:49 2023
+++ src/sys/arch/riscv/riscv/kobj_machdep.c	Thu Jan 18 03:36:24 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kobj_machdep.c,v 1.5 2023/05/07 12:41:49 skrll Exp $	*/
+/*	$NetBSD: kobj_machdep.c,v 1.6 2024/01/18 03:36:24 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2014,2023 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__RCSID("$NetBSD: kobj_machdep.c,v 1.5 2023/05/07 12:41:49 skrll Exp $");
+__RCSID("$NetBSD: kobj_machdep.c,v 1.6 2024/01/18 03:36:24 msaitoh Exp $");
 
 #include 
 #include 
@@ -168,7 +168,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 		// XXXNH eh? what's with the symidx test?'
 		if (symidx == 0)
 			break;
-		/* FALLTHOUGH */
+		/* FALLTHROUGH */
 
 	case R_RISCV_CALL_PLT:
 	case R_RISCV_CALL:
@@ -177,7 +177,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 	case R_RISCV_RVC_JUMP:
 	case R_RISCV_32_PCREL:
 		addend -= (intptr_t)where;		/* A -= P */
-		/* FALLTHOUGH */
+		/* FALLTHROUGH */
 
 #ifdef _LP64
 	case R_RISCV_64:	/* doubleword64 S + A */



CVS commit: src/sys/arch/riscv/riscv

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:36:24 UTC 2024

Modified Files:
src/sys/arch/riscv/riscv: kobj_machdep.c

Log Message:
s/FALLTHOUGH/FALLTHROUGH/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/riscv/riscv/kobj_machdep.c

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



CVS commit: src/share/misc

2024-01-17 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Thu Jan 18 03:33:08 UTC 2024

Modified Files:
src/share/misc: acronyms.comp

Log Message:
+IKM  input keying material


To generate a diff of this commit:
cvs rdiff -u -r1.385 -r1.386 src/share/misc/acronyms.comp

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



CVS commit: src/share/misc

2024-01-17 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Thu Jan 18 03:33:08 UTC 2024

Modified Files:
src/share/misc: acronyms.comp

Log Message:
+IKM  input keying material


To generate a diff of this commit:
cvs rdiff -u -r1.385 -r1.386 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.385 src/share/misc/acronyms.comp:1.386
--- src/share/misc/acronyms.comp:1.385	Tue Jan  2 17:44:00 2024
+++ src/share/misc/acronyms.comp	Thu Jan 18 03:33:08 2024
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.385 2024/01/02 17:44:00 jschauma Exp $
+$NetBSD: acronyms.comp,v 1.386 2024/01/18 03:33:08 jschauma Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -788,6 +788,7 @@ IGMP	Internet Group Management Protocol
 IGP	interior gateway protocol
 IHV	independent hardware vendor
 IKE	Internet key exchange
+IKM	input keying material
 ILM	internal loopback mode
 ILOM	integrated lights-out management
 ILP	instruction level parallelism



CVS commit: src/usr.sbin/cpuctl/arch

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:19:27 UTC 2024

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
Add Meteor Lake and Emerald Rapids.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/usr.sbin/cpuctl/arch/i386.c

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.141 src/usr.sbin/cpuctl/arch/i386.c:1.142
--- src/usr.sbin/cpuctl/arch/i386.c:1.141	Wed Sep 13 06:53:23 2023
+++ src/usr.sbin/cpuctl/arch/i386.c	Thu Jan 18 03:19:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.141 2023/09/13 06:53:23 wiz Exp $	*/
+/*	$NetBSD: i386.c,v 1.142 2024/01/18 03:19:26 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.141 2023/09/13 06:53:23 wiz Exp $");
+__RCSID("$NetBSD: i386.c,v 1.142 2024/01/18 03:19:26 msaitoh Exp $");
 #endif /* not lint */
 
 #include 
@@ -361,10 +361,12 @@ const struct cpu_cpuid_nameclass i386_cp
 [0xa6] = "10th gen Core (Comet Lake)",
 [0xa7] = "11th gen Core (Rocket Lake)",
 [0xa8] = "11th gen Core (Rocket Lake)",
+[0xaa] = "Core Ultra 7 (Meteor Lake)",
 [0xb7] = "13th gen Core (Raptor Lake)",
 [0xba] = "13th gen Core (Raptor Lake)",
 [0xbe] = "Core i3-N3xx N[12]xx Nxx Atom x7xxxE (Alder Lake-N)",
 [0xbf] = "13th gen Core (Raptor Lake)",
+[0xcf] = "5th gen Xeon Scalable (Emerald Rapids)",
 			},
 			"Pentium Pro, II or III",	/* Default */
 			NULL,



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:16:44 UTC 2024

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

Log Message:
Add Intel I219-{LM,V}(20,21) support.


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

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



CVS commit: src/usr.sbin/cpuctl/arch

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:19:27 UTC 2024

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
Add Meteor Lake and Emerald Rapids.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/usr.sbin/cpuctl/arch/i386.c

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



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:16:44 UTC 2024

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

Log Message:
Add Intel I219-{LM,V}(20,21) support.


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

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.792 src/sys/dev/pci/if_wm.c:1.793
--- src/sys/dev/pci/if_wm.c:1.792	Tue Nov 21 23:09:40 2023
+++ src/sys/dev/pci/if_wm.c	Thu Jan 18 03:16:44 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.792 2023/11/21 23:09:40 gutteridge Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.793 2024/01/18 03:16:44 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.792 2023/11/21 23:09:40 gutteridge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.793 2024/01/18 03:16:44 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_wm.h"
@@ -1752,6 +1752,12 @@ static const struct wm_product {
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM19,
 	  "I219 LM (19) Ethernet Connection",
 	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM20,
+	  "I219 LM (20) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM21,
+	  "I219 LM (21) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM22,
 	  "I219 LM (22) Ethernet Connection",
 	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP(RPL) */
@@ -1812,6 +1818,12 @@ static const struct wm_product {
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V19,
 	  "I219 V (19) Ethernet Connection",
 	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V20,
+	  "I219 V (20) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V21,
+	  "I219 V (21) Ethernet Connection",
+	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* MTP */
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V22,
 	  "I219 V (22) Ethernet Connection",
 	  WM_T_PCH_TGP,		WMP_F_COPPER }, /* ADP(RPL) */



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:15:54 UTC 2024

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

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1481 -r1.1482 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1480 -r1.1481 src/sys/dev/pci/pcidevs_data.h

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



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:15:27 UTC 2024

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

Log Message:
Add Intel I219-{LM,V}(20,21)


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

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1501 src/sys/dev/pci/pcidevs:1.1502
--- src/sys/dev/pci/pcidevs:1.1501	Thu Dec 28 09:43:57 2023
+++ src/sys/dev/pci/pcidevs	Thu Jan 18 03:15:26 2024
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1501 2023/12/28 09:43:57 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1502 2024/01/18 03:15:26 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -6307,6 +6307,10 @@ product INTEL I219_LM18		0x550a	I219-LM 
 product INTEL I219_V18		0x550b	I219-V (18) Ethernet Connection
 product INTEL I219_LM19		0x550c	I219-LM (19) Ethernet Connection
 product INTEL I219_V19		0x550d	I219-V (19) Ethernet Connection
+product INTEL I219_LM20		0x550e	I219-LM (20) Ethernet Connection
+product INTEL I219_V20		0x550f	I219-V (20) Ethernet Connection
+product INTEL I219_LM21		0x5510	I219-LM (21) Ethernet Connection
+product INTEL I219_V21		0x5511	I219-V (21) Ethernet Connection
 product INTEL CORE7G_H_M_D_HOST_DRAM 0x5900 Core 7G (H, Mobile, Dual) Host Bridge, DRAM
 product INTEL CORE7G_PCIE_X16	0x5901	Core 7G PCIe x16
 product INTEL CORE7G_S_GT1	0x5902	HD Graphics 610 (GT1)



CVS commit: src/sys/dev/pci

2024-01-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 18 03:15:27 UTC 2024

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

Log Message:
Add Intel I219-{LM,V}(20,21)


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

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



Re: CVS commit: src/sys/arch/macppc/conf

2024-01-17 Thread Valery Ushakov
On Thu, Jan 18, 2024 at 06:43:21 +1100, matthew green wrote:

> > Log Message:
> > macppc: enable FFS_EI in GENERIC
> >
> > I'd say it should be enabled for anything with USB.
> >
> > ok macallan
> 
> yay.  i think we should enable it basically everywhere that it
> is not a space issue.

I think the size impact should be trivial (though I didn't measure).
The option basically guards just a couple dozens of "bit test plus
bswap call" snippets.


> USB is just one common way, but i can also modify or create my own
> images anyway, and maybe copy them over the network to my machine
> with USB...or maybe i'll setup the disk on this machine's scsi for
> that machine ;)

Yeah.  I just didn't want to open that can of yaks to shave... :)


-uwe


re: CVS commit: src/sys/arch/macppc/conf

2024-01-17 Thread matthew green
> Log Message:
> macppc: enable FFS_EI in GENERIC
>
> I'd say it should be enabled for anything with USB.
>
> ok macallan

yay.  i think we should enable it basically everywhere that it
is not a space issue.  USB is just one common way, but i can
also modify or create my own images anyway, and maybe copy them
over the network to my machine with USB...or maybe i'll setup
the disk on this machine's scsi for that machine ;)


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

2024-01-17 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Jan 17 16:33:56 UTC 2024

Modified Files:
src/sys/arch/vax/conf: files.vax

Log Message:
Add missed "rasops1" attribute to smg(4) rasops'fied a year ago.

This fixes silent boot failure on VS3100 with smg(4) framebuffer console.
Should be pulled up to netbsd-10.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/vax/conf/files.vax

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/vax/conf/files.vax
diff -u src/sys/arch/vax/conf/files.vax:1.126 src/sys/arch/vax/conf/files.vax:1.127
--- src/sys/arch/vax/conf/files.vax:1.126	Mon Feb  6 13:13:05 2023
+++ src/sys/arch/vax/conf/files.vax	Wed Jan 17 16:33:56 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.vax,v 1.126 2023/02/06 13:13:05 tsutsui Exp $
+#	$NetBSD: files.vax,v 1.127 2024/01/17 16:33:56 tsutsui Exp $
 #
 # new style config file for vax architecture
 #
@@ -186,7 +186,7 @@ file	arch/vax/vsa/ncr.c		si_vsbus
 include "dev/ata/files.ata"
 
 # Monochrome framebuffer on VS3100.
-device	smg: displaydev, wsemuldisplaydev
+device	smg: displaydev, wsemuldisplaydev, rasops1
 attach	smg at vsbus
 file	arch/vax/vsa/smg.c		smg needs-flag
 



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

2024-01-17 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Jan 17 16:33:56 UTC 2024

Modified Files:
src/sys/arch/vax/conf: files.vax

Log Message:
Add missed "rasops1" attribute to smg(4) rasops'fied a year ago.

This fixes silent boot failure on VS3100 with smg(4) framebuffer console.
Should be pulled up to netbsd-10.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/vax/conf/files.vax

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



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

2024-01-17 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jan 17 13:23:30 UTC 2024

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

Log Message:
macppc: enable FFS_EI in GENERIC

I'd say it should be enabled for anything with USB.

ok macallan


To generate a diff of this commit:
cvs rdiff -u -r1.377 -r1.378 src/sys/arch/macppc/conf/GENERIC

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

Modified files:

Index: src/sys/arch/macppc/conf/GENERIC
diff -u src/sys/arch/macppc/conf/GENERIC:1.377 src/sys/arch/macppc/conf/GENERIC:1.378
--- src/sys/arch/macppc/conf/GENERIC:1.377	Thu Feb  9 14:09:49 2023
+++ src/sys/arch/macppc/conf/GENERIC	Wed Jan 17 13:23:30 2024
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.377 2023/02/09 14:09:49 abs Exp $
+# $NetBSD: GENERIC,v 1.378 2024/01/17 13:23:30 uwe Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include		"arch/macppc/conf/std.macppc"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.377 $"
+#ident 		"GENERIC-$Revision: 1.378 $"
 
 maxusers	32
 
@@ -84,7 +84,7 @@ include "conf/filesystems.config"
 
 # File system options
 options 	APPLE_UFS	# Apple UFS support in FFS
-#options 	FFS_EI		# FFS Endian Independent support
+options 	FFS_EI		# FFS Endian Independent support
 #options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 options 	QUOTA		# legacy UFS quotas
 options 	QUOTA2		# new, in-filesystem UFS quotas



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

2024-01-17 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Jan 17 13:23:30 UTC 2024

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

Log Message:
macppc: enable FFS_EI in GENERIC

I'd say it should be enabled for anything with USB.

ok macallan


To generate a diff of this commit:
cvs rdiff -u -r1.377 -r1.378 src/sys/arch/macppc/conf/GENERIC

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



CVS commit: src/sys/arch

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan 17 12:33:51 UTC 2024

Modified Files:
src/sys/arch/amiga/amiga: locore.s
src/sys/arch/atari/atari: locore.s
src/sys/arch/cesfic/cesfic: locore.s
src/sys/arch/hp300/hp300: locore.s
src/sys/arch/luna68k/luna68k: locore.s
src/sys/arch/m68k/conf: files.m68k
src/sys/arch/m68k/m68k: sigcode.s sunos_sigcode.s
src/sys/arch/mac68k/mac68k: locore.s
src/sys/arch/mvme68k/mvme68k: locore.s
src/sys/arch/news68k/news68k: locore.s
src/sys/arch/next68k/next68k: locore.s
src/sys/arch/sun2/sun2: locore.s
src/sys/arch/sun3/sun3: locore.s
src/sys/arch/sun3/sun3x: locore.s
src/sys/arch/virt68k/virt68k: locore.s
src/sys/arch/x68k/x68k: locore.s

Log Message:
Make sigcode.s and sunos_sigcode.s build as their own stand-alone files.


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/arch/amiga/amiga/locore.s
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/atari/atari/locore.s
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/cesfic/cesfic/locore.s
cvs rdiff -u -r1.183 -r1.184 src/sys/arch/hp300/hp300/locore.s
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/luna68k/luna68k/locore.s
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/m68k/conf/files.m68k
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/m68k/m68k/sigcode.s
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/m68k/sunos_sigcode.s
cvs rdiff -u -r1.182 -r1.183 src/sys/arch/mac68k/mac68k/locore.s
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/news68k/news68k/locore.s
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/next68k/next68k/locore.s
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/sun2/sun2/locore.s
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/sun3/sun3/locore.s
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/sun3/sun3x/locore.s
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/virt68k/virt68k/locore.s
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/x68k/x68k/locore.s

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

Modified files:

Index: src/sys/arch/amiga/amiga/locore.s
diff -u src/sys/arch/amiga/amiga/locore.s:1.169 src/sys/arch/amiga/amiga/locore.s:1.170
--- src/sys/arch/amiga/amiga/locore.s:1.169	Wed Jan 17 12:19:05 2024
+++ src/sys/arch/amiga/amiga/locore.s	Wed Jan 17 12:33:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.169 2024/01/17 12:19:05 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.170 2024/01/17 12:33:49 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -1048,14 +1048,6 @@ Lnoflush:
   	rte
 
 /*
- * Use common m68k sigcode.
- */
-#include 
-#ifdef COMPAT_SUNOS
-#include 
-#endif
-
-/*
  * Primitives
  */
 

Index: src/sys/arch/atari/atari/locore.s
diff -u src/sys/arch/atari/atari/locore.s:1.125 src/sys/arch/atari/atari/locore.s:1.126
--- src/sys/arch/atari/atari/locore.s:1.125	Wed Jan 17 12:19:05 2024
+++ src/sys/arch/atari/atari/locore.s	Wed Jan 17 12:33:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.125 2024/01/17 12:19:05 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.126 2024/01/17 12:33:49 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -1037,14 +1037,6 @@ Lnoflush:
 	rte
 
 /*
- * Use common m68k sigcode.
- */
-#include 
-#ifdef COMPAT_SUNOS
-#include 
-#endif
-
-/*
  * Primitives
  */
 

Index: src/sys/arch/cesfic/cesfic/locore.s
diff -u src/sys/arch/cesfic/cesfic/locore.s:1.45 src/sys/arch/cesfic/cesfic/locore.s:1.46
--- src/sys/arch/cesfic/cesfic/locore.s:1.45	Wed Jan 17 12:19:06 2024
+++ src/sys/arch/cesfic/cesfic/locore.s	Wed Jan 17 12:33:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.45 2024/01/17 12:19:06 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.46 2024/01/17 12:33:49 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -720,14 +720,6 @@ Ldorte:
 	rte| real return
 
 /*
- * Use common m68k sigcode.
- */
-#include 
-#ifdef COMPAT_SUNOS
-#include 
-#endif
-
-/*
  * Primitives
  */ 
 

Index: src/sys/arch/hp300/hp300/locore.s
diff -u src/sys/arch/hp300/hp300/locore.s:1.183 src/sys/arch/hp300/hp300/locore.s:1.184
--- src/sys/arch/hp300/hp300/locore.s:1.183	Wed Jan 17 12:19:06 2024
+++ src/sys/arch/hp300/hp300/locore.s	Wed Jan 17 12:33:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.183 2024/01/17 12:19:06 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.184 2024/01/17 12:33:49 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -942,14 +942,6 @@ Laststkadj:
 	rte| and do real RTE
 
 /*
- * Use common m68k sigcode.
- */
-#include 
-#ifdef COMPAT_SUNOS
-#include 
-#endif
-
-/*
  * Primitives
  */
 

Index: src/sys/arch/luna68k/luna68k/locore.s
diff -u src/sys/arch/luna68k/luna68k/locore.s:1.81 src/sys/arch/luna68k/luna68k/locore.s:1.82
--- src/sys/arch/luna68k/luna68k/locore.s:1.81	Wed Jan 17 12:19:06 2024
+++ src/sys/arch/luna68k/luna68k/locore.s	Wed Jan 17 12:33:49 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.81 2024/01/17 12:19:06 

CVS commit: src/sys/arch

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan 17 12:33:51 UTC 2024

Modified Files:
src/sys/arch/amiga/amiga: locore.s
src/sys/arch/atari/atari: locore.s
src/sys/arch/cesfic/cesfic: locore.s
src/sys/arch/hp300/hp300: locore.s
src/sys/arch/luna68k/luna68k: locore.s
src/sys/arch/m68k/conf: files.m68k
src/sys/arch/m68k/m68k: sigcode.s sunos_sigcode.s
src/sys/arch/mac68k/mac68k: locore.s
src/sys/arch/mvme68k/mvme68k: locore.s
src/sys/arch/news68k/news68k: locore.s
src/sys/arch/next68k/next68k: locore.s
src/sys/arch/sun2/sun2: locore.s
src/sys/arch/sun3/sun3: locore.s
src/sys/arch/sun3/sun3x: locore.s
src/sys/arch/virt68k/virt68k: locore.s
src/sys/arch/x68k/x68k: locore.s

Log Message:
Make sigcode.s and sunos_sigcode.s build as their own stand-alone files.


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/arch/amiga/amiga/locore.s
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/atari/atari/locore.s
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/cesfic/cesfic/locore.s
cvs rdiff -u -r1.183 -r1.184 src/sys/arch/hp300/hp300/locore.s
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/luna68k/luna68k/locore.s
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/m68k/conf/files.m68k
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/m68k/m68k/sigcode.s
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/m68k/sunos_sigcode.s
cvs rdiff -u -r1.182 -r1.183 src/sys/arch/mac68k/mac68k/locore.s
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/news68k/news68k/locore.s
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/next68k/next68k/locore.s
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/sun2/sun2/locore.s
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/sun3/sun3/locore.s
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/sun3/sun3x/locore.s
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/virt68k/virt68k/locore.s
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/x68k/x68k/locore.s

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



CVS commit: src/sys/arch

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan 17 12:19:07 UTC 2024

Modified Files:
src/sys/arch/amiga/amiga: locore.s
src/sys/arch/atari/atari: locore.s
src/sys/arch/cesfic/cesfic: locore.s
src/sys/arch/hp300/hp300: locore.s
src/sys/arch/luna68k/luna68k: locore.s
src/sys/arch/m68k/conf: files.m68k
src/sys/arch/m68k/m68k: compat_13_sigreturn13.s compat_16_sigreturn14.s
src/sys/arch/mac68k/mac68k: locore.s
src/sys/arch/mvme68k/mvme68k: locore.s
src/sys/arch/news68k/news68k: locore.s
src/sys/arch/next68k/next68k: locore.s
src/sys/arch/sun2/sun2: locore.s
src/sys/arch/sun3/sun3: locore.s
src/sys/arch/sun3/sun3x: locore.s
src/sys/arch/virt68k/virt68k: locore.s
src/sys/arch/x68k/x68k: locore.s
Removed Files:
src/sys/arch/m68k/m68k: sigreturn.s

Log Message:
Make compat_13_sigreturn13.s and compat_16_sigreturn14.s build as their
own stand-alone files and G/C the now-empty sigreturn.s.


To generate a diff of this commit:
cvs rdiff -u -r1.168 -r1.169 src/sys/arch/amiga/amiga/locore.s
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/atari/atari/locore.s
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/cesfic/cesfic/locore.s
cvs rdiff -u -r1.182 -r1.183 src/sys/arch/hp300/hp300/locore.s
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/luna68k/luna68k/locore.s
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/m68k/conf/files.m68k
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/m68k/compat_13_sigreturn13.s
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/m68k/compat_16_sigreturn14.s
cvs rdiff -u -r1.11 -r0 src/sys/arch/m68k/m68k/sigreturn.s
cvs rdiff -u -r1.181 -r1.182 src/sys/arch/mac68k/mac68k/locore.s
cvs rdiff -u -r1.128 -r1.129 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/news68k/news68k/locore.s
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/next68k/next68k/locore.s
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/sun2/sun2/locore.s
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/sun3/sun3/locore.s
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/sun3/sun3x/locore.s
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/virt68k/virt68k/locore.s
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/x68k/x68k/locore.s

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

Modified files:

Index: src/sys/arch/amiga/amiga/locore.s
diff -u src/sys/arch/amiga/amiga/locore.s:1.168 src/sys/arch/amiga/amiga/locore.s:1.169
--- src/sys/arch/amiga/amiga/locore.s:1.168	Tue Jan 16 15:38:57 2024
+++ src/sys/arch/amiga/amiga/locore.s	Wed Jan 17 12:19:05 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.168 2024/01/16 15:38:57 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.169 2024/01/17 12:19:05 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -423,9 +423,6 @@ ENTRY_NOPROFILE(trace)
 	moveq	#T_TRACE,%d0
 	jra	_ASM_LABEL(fault)
 
-/* Use common m68k sigreturn */
-#include 
-
 /*
  * Interrupt handlers.
  *

Index: src/sys/arch/atari/atari/locore.s
diff -u src/sys/arch/atari/atari/locore.s:1.124 src/sys/arch/atari/atari/locore.s:1.125
--- src/sys/arch/atari/atari/locore.s:1.124	Tue Jan 16 15:38:57 2024
+++ src/sys/arch/atari/atari/locore.s	Wed Jan 17 12:19:05 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.124 2024/01/16 15:38:57 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.125 2024/01/17 12:19:05 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -618,9 +618,6 @@ Lbrkpt3:
 	movl	%sp@,%sp		| ... and sp
 	rte| all done
 
-/* Use common m68k sigreturn */
-#include 
-
 /*
  * Interrupt handlers.
  *

Index: src/sys/arch/cesfic/cesfic/locore.s
diff -u src/sys/arch/cesfic/cesfic/locore.s:1.44 src/sys/arch/cesfic/cesfic/locore.s:1.45
--- src/sys/arch/cesfic/cesfic/locore.s:1.44	Tue Jan 16 15:38:57 2024
+++ src/sys/arch/cesfic/cesfic/locore.s	Wed Jan 17 12:19:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.44 2024/01/16 15:38:57 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.45 2024/01/17 12:19:06 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -596,9 +596,6 @@ Lbrkpt2:
 	movl	%sp@,%sp			| ... and %sp
 	rte| all done
 
-/* Use common m68k sigreturn */
-#include 
-
 /*
  * Interrupt handlers.
  */

Index: src/sys/arch/hp300/hp300/locore.s
diff -u src/sys/arch/hp300/hp300/locore.s:1.182 src/sys/arch/hp300/hp300/locore.s:1.183
--- src/sys/arch/hp300/hp300/locore.s:1.182	Tue Jan 16 15:38:57 2024
+++ src/sys/arch/hp300/hp300/locore.s	Wed Jan 17 12:19:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.182 2024/01/16 15:38:57 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.183 2024/01/17 12:19:06 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -786,9 +786,6 @@ Lbrkpt3:
 	movl	%sp@,%sp		| ... and %sp
 	rte| all done
 
-/* Use common m68k sigreturn */
-#include 
-
 /*
  * Interrupt handlers.
  * All device interrupts are auto-vectored.  The CPU provides

Index: src/sys/arch/luna68k/luna68k/locore.s
diff -u 

CVS commit: src/sys/arch

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan 17 12:19:07 UTC 2024

Modified Files:
src/sys/arch/amiga/amiga: locore.s
src/sys/arch/atari/atari: locore.s
src/sys/arch/cesfic/cesfic: locore.s
src/sys/arch/hp300/hp300: locore.s
src/sys/arch/luna68k/luna68k: locore.s
src/sys/arch/m68k/conf: files.m68k
src/sys/arch/m68k/m68k: compat_13_sigreturn13.s compat_16_sigreturn14.s
src/sys/arch/mac68k/mac68k: locore.s
src/sys/arch/mvme68k/mvme68k: locore.s
src/sys/arch/news68k/news68k: locore.s
src/sys/arch/next68k/next68k: locore.s
src/sys/arch/sun2/sun2: locore.s
src/sys/arch/sun3/sun3: locore.s
src/sys/arch/sun3/sun3x: locore.s
src/sys/arch/virt68k/virt68k: locore.s
src/sys/arch/x68k/x68k: locore.s
Removed Files:
src/sys/arch/m68k/m68k: sigreturn.s

Log Message:
Make compat_13_sigreturn13.s and compat_16_sigreturn14.s build as their
own stand-alone files and G/C the now-empty sigreturn.s.


To generate a diff of this commit:
cvs rdiff -u -r1.168 -r1.169 src/sys/arch/amiga/amiga/locore.s
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/atari/atari/locore.s
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/cesfic/cesfic/locore.s
cvs rdiff -u -r1.182 -r1.183 src/sys/arch/hp300/hp300/locore.s
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/luna68k/luna68k/locore.s
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/m68k/conf/files.m68k
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/m68k/m68k/compat_13_sigreturn13.s
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/m68k/compat_16_sigreturn14.s
cvs rdiff -u -r1.11 -r0 src/sys/arch/m68k/m68k/sigreturn.s
cvs rdiff -u -r1.181 -r1.182 src/sys/arch/mac68k/mac68k/locore.s
cvs rdiff -u -r1.128 -r1.129 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/news68k/news68k/locore.s
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/next68k/next68k/locore.s
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/sun2/sun2/locore.s
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/sun3/sun3/locore.s
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/sun3/sun3x/locore.s
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/virt68k/virt68k/locore.s
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/x68k/x68k/locore.s

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



CVS commit: src/sys/miscfs/procfs

2024-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jan 17 10:21:01 UTC 2024

Modified Files:
src/sys/miscfs/procfs: procfs_vfsops.c

Log Message:
Remove all procfs nodes for this process on process exit.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/miscfs/procfs/procfs_vfsops.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/miscfs/procfs/procfs_vfsops.c
diff -u src/sys/miscfs/procfs/procfs_vfsops.c:1.113 src/sys/miscfs/procfs/procfs_vfsops.c:1.114
--- src/sys/miscfs/procfs/procfs_vfsops.c:1.113	Wed Jan 17 10:20:12 2024
+++ src/sys/miscfs/procfs/procfs_vfsops.c	Wed Jan 17 10:21:01 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_vfsops.c,v 1.113 2024/01/17 10:20:12 hannken Exp $	*/
+/*	$NetBSD: procfs_vfsops.c,v 1.114 2024/01/17 10:21:01 hannken Exp $	*/
 
 /*
  * Copyright (c) 1993
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.113 2024/01/17 10:20:12 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.114 2024/01/17 10:21:01 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -112,9 +112,12 @@ MODULE(MODULE_CLASS_VFS, procfs, "ptrace
 VFS_PROTOS(procfs);
 
 #define PROCFS_HASHSIZE	256
+#define PROCFS_EXEC_HOOK ((void *)1)
+#define PROCFS_EXIT_HOOK ((void *)2)
 
 static kauth_listener_t procfs_listener;
 static void *procfs_exechook;
+static void *procfs_exithook;
 LIST_HEAD(hashhead, pfsnode);
 static u_long procfs_hashmask;
 static struct hashhead *procfs_hashtab;
@@ -522,7 +525,7 @@ procfs_exechook_cb(struct proc *p, void 
 	struct vnode *vp;
 	int error;
 
-	if (!(p->p_flag & PK_SUGID))
+	if (arg == PROCFS_EXEC_HOOK && !(p->p_flag & PK_SUGID))
 		return;
 
 	head = procfs_hashhead(p->p_pid);
@@ -616,7 +619,10 @@ procfs_modcmd(modcmd_t cmd, void *arg)
 		procfs_listener = kauth_listen_scope(KAUTH_SCOPE_PROCESS,
 		procfs_listener_cb, NULL);
 
-		procfs_exechook = exechook_establish(procfs_exechook_cb, NULL);
+		procfs_exechook = exechook_establish(procfs_exechook_cb,
+		PROCFS_EXEC_HOOK);
+		procfs_exithook = exithook_establish(procfs_exechook_cb,
+		PROCFS_EXIT_HOOK);
 
 		mutex_init(_hashlock, MUTEX_DEFAULT, IPL_NONE);
 		procfs_hashtab = hashinit(PROCFS_HASHSIZE, HASH_LIST, true,
@@ -629,6 +635,7 @@ procfs_modcmd(modcmd_t cmd, void *arg)
 			break;
 		kauth_unlisten_scope(procfs_listener);
 		exechook_disestablish(procfs_exechook);
+		exithook_disestablish(procfs_exithook);
 		mutex_destroy(_hashlock);
 		hashdone(procfs_hashtab, HASH_LIST, procfs_hashmask);
 		break;



CVS commit: src/sys/miscfs/procfs

2024-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jan 17 10:21:01 UTC 2024

Modified Files:
src/sys/miscfs/procfs: procfs_vfsops.c

Log Message:
Remove all procfs nodes for this process on process exit.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/miscfs/procfs/procfs_vfsops.c

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



CVS commit: src/sys/miscfs/procfs

2024-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jan 17 10:20:12 UTC 2024

Modified Files:
src/sys/miscfs/procfs: procfs.h procfs_subr.c procfs_vfsops.c

Log Message:
Using the exechook to revoke procfs nodes is racy and may deadlock:

one thread runs doexechooks() -> procfs_revoke_vnodes() and wants to suspend
the file system for vgone(), while another thread runs a forced unmount,
has the file system suspended, tries to disestablish the exechook and
waits for doexechooks() to complete.

Establish/disestablish the exechook on module load/unload instead
mount/unmount and use the hashmap to access all procfs nodes for this pid.

May fix PR kern/57775 ""panic: unmount: dangling vnode" while umounting procfs"


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/miscfs/procfs/procfs.h
cvs rdiff -u -r1.116 -r1.117 src/sys/miscfs/procfs/procfs_subr.c
cvs rdiff -u -r1.112 -r1.113 src/sys/miscfs/procfs/procfs_vfsops.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/miscfs/procfs/procfs.h
diff -u src/sys/miscfs/procfs/procfs.h:1.83 src/sys/miscfs/procfs/procfs.h:1.84
--- src/sys/miscfs/procfs/procfs.h:1.83	Wed Jan 17 10:19:21 2024
+++ src/sys/miscfs/procfs/procfs.h	Wed Jan 17 10:20:12 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs.h,v 1.83 2024/01/17 10:19:21 hannken Exp $	*/
+/*	$NetBSD: procfs.h,v 1.84 2024/01/17 10:20:12 hannken Exp $	*/
 
 /*
  * Copyright (c) 1993
@@ -192,7 +192,6 @@ procfs_fileno(pid_t _pid, pfstype _type,
 #define PROCFS_TYPE(type)	((type) % PFSlast)
 
 struct procfsmount {
-	void *pmnt_exechook;
 	int pmnt_flags;
 };
 
@@ -272,7 +271,6 @@ int procfs_dolimit(struct lwp *, struct 
 struct uio *);
 
 void procfs_hashrem(struct pfsnode *);
-void procfs_revoke_vnodes(struct proc *, void *);
 int procfs_getfp(struct pfsnode *, struct proc *, struct file **);
 
 /* functions to check whether or not files should be displayed */

Index: src/sys/miscfs/procfs/procfs_subr.c
diff -u src/sys/miscfs/procfs/procfs_subr.c:1.116 src/sys/miscfs/procfs/procfs_subr.c:1.117
--- src/sys/miscfs/procfs/procfs_subr.c:1.116	Sat May 23 23:42:43 2020
+++ src/sys/miscfs/procfs/procfs_subr.c	Wed Jan 17 10:20:12 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_subr.c,v 1.116 2020/05/23 23:42:43 ad Exp $	*/
+/*	$NetBSD: procfs_subr.c,v 1.117 2024/01/17 10:20:12 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_subr.c,v 1.116 2020/05/23 23:42:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_subr.c,v 1.117 2024/01/17 10:20:12 hannken Exp $");
 
 #include 
 #include 
@@ -358,57 +358,6 @@ vfs_findname(const vfs_namemap_t *nm, co
 	return (0);
 }
 
-static bool
-procfs_revoke_selector(void *arg, struct vnode *vp)
-{
-	struct proc *p = arg;
-	struct pfsnode *pfs;
-
-	KASSERT(mutex_owned(vp->v_interlock));
-
-	pfs = VTOPFS(vp);
-
-	return (pfs != NULL && pfs->pfs_pid == p->p_pid);
-}
-
-void
-procfs_revoke_vnodes(struct proc *p, void *arg)
-{
-	int error;
-	bool suspended;
-	struct vnode *vp;
-	struct vnode_iterator *marker;
-	struct mount *mp = (struct mount *)arg;
-
-	if (!(p->p_flag & PK_SUGID))
-		return;
-
-	suspended = false;
-	vfs_vnode_iterator_init(mp, );
-
-	while ((vp = vfs_vnode_iterator_next(marker,
-	procfs_revoke_selector, p)) != NULL) {
-		if (vrecycle(vp))
-			continue;
-		/* Vnode is busy, we have to suspend the mount for vgone(). */
-		while (! suspended) {
-			error = vfs_suspend(mp, 0);
-			if (error == 0) {
-suspended = true;
-			} else if (error != EINTR && error != ERESTART) {
-KASSERT(error == EOPNOTSUPP);
-break;
-			}
-		}
-		vgone(vp);
-	}
-
-	if (suspended)
-		vfs_resume(mp);
-
-	vfs_vnode_iterator_destroy(marker);
-}
-
 bool
 procfs_use_linux_compat(struct mount *mp)
 {

Index: src/sys/miscfs/procfs/procfs_vfsops.c
diff -u src/sys/miscfs/procfs/procfs_vfsops.c:1.112 src/sys/miscfs/procfs/procfs_vfsops.c:1.113
--- src/sys/miscfs/procfs/procfs_vfsops.c:1.112	Wed Jan 17 10:19:21 2024
+++ src/sys/miscfs/procfs/procfs_vfsops.c	Wed Jan 17 10:20:12 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_vfsops.c,v 1.112 2024/01/17 10:19:21 hannken Exp $	*/
+/*	$NetBSD: procfs_vfsops.c,v 1.113 2024/01/17 10:20:12 hannken Exp $	*/
 
 /*
  * Copyright (c) 1993
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.112 2024/01/17 10:19:21 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.113 2024/01/17 10:20:12 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -88,6 +88,7 @@ __KERNEL_RCSID(0, "$NetBSD: procfs_vfsop
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -113,6 +114,7 @@ VFS_PROTOS(procfs);
 #define PROCFS_HASHSIZE	256
 
 static kauth_listener_t procfs_listener;
+static void *procfs_exechook;
 LIST_HEAD(hashhead, pfsnode);
 static u_long procfs_hashmask;
 

CVS commit: src/sys/miscfs/procfs

2024-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jan 17 10:20:12 UTC 2024

Modified Files:
src/sys/miscfs/procfs: procfs.h procfs_subr.c procfs_vfsops.c

Log Message:
Using the exechook to revoke procfs nodes is racy and may deadlock:

one thread runs doexechooks() -> procfs_revoke_vnodes() and wants to suspend
the file system for vgone(), while another thread runs a forced unmount,
has the file system suspended, tries to disestablish the exechook and
waits for doexechooks() to complete.

Establish/disestablish the exechook on module load/unload instead
mount/unmount and use the hashmap to access all procfs nodes for this pid.

May fix PR kern/57775 ""panic: unmount: dangling vnode" while umounting procfs"


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/miscfs/procfs/procfs.h
cvs rdiff -u -r1.116 -r1.117 src/sys/miscfs/procfs/procfs_subr.c
cvs rdiff -u -r1.112 -r1.113 src/sys/miscfs/procfs/procfs_vfsops.c

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



CVS commit: src/sys/miscfs/procfs

2024-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jan 17 10:19:21 UTC 2024

Modified Files:
src/sys/miscfs/procfs: procfs.h procfs_vfsops.c procfs_vnops.c

Log Message:
Add a hashmap to access all procfs nodes by pid.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/miscfs/procfs/procfs.h
cvs rdiff -u -r1.111 -r1.112 src/sys/miscfs/procfs/procfs_vfsops.c
cvs rdiff -u -r1.229 -r1.230 src/sys/miscfs/procfs/procfs_vnops.c

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

Modified files:

Index: src/sys/miscfs/procfs/procfs.h
diff -u src/sys/miscfs/procfs/procfs.h:1.82 src/sys/miscfs/procfs/procfs.h:1.83
--- src/sys/miscfs/procfs/procfs.h:1.82	Wed Jan 19 10:23:00 2022
+++ src/sys/miscfs/procfs/procfs.h	Wed Jan 17 10:19:21 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs.h,v 1.82 2022/01/19 10:23:00 martin Exp $	*/
+/*	$NetBSD: procfs.h,v 1.83 2024/01/17 10:19:21 hannken Exp $	*/
 
 /*
  * Copyright (c) 1993
@@ -129,7 +129,9 @@ struct pfskey {
 	int		pk_fd;		/* associated fd if not -1 */
 };
 struct pfsnode {
+	LIST_ENTRY(pfsnode) pfs_hash;	/* per pid hash list */
 	struct vnode	*pfs_vnode;	/* vnode associated with this pfsnode */
+	struct mount	*pfs_mount;	/* mount associated with this pfsnode */
 	struct pfskey	pfs_key;
 #define pfs_type pfs_key.pk_type
 #define pfs_pid pfs_key.pk_pid
@@ -269,6 +271,7 @@ int procfs_doauxv(struct lwp *, struct p
 int procfs_dolimit(struct lwp *, struct proc *, struct pfsnode *,
 struct uio *);
 
+void procfs_hashrem(struct pfsnode *);
 void procfs_revoke_vnodes(struct proc *, void *);
 int procfs_getfp(struct pfsnode *, struct proc *, struct file **);
 

Index: src/sys/miscfs/procfs/procfs_vfsops.c
diff -u src/sys/miscfs/procfs/procfs_vfsops.c:1.111 src/sys/miscfs/procfs/procfs_vfsops.c:1.112
--- src/sys/miscfs/procfs/procfs_vfsops.c:1.111	Mon Jan 17 11:20:00 2022
+++ src/sys/miscfs/procfs/procfs_vfsops.c	Wed Jan 17 10:19:21 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_vfsops.c,v 1.111 2022/01/17 11:20:00 bouyer Exp $	*/
+/*	$NetBSD: procfs_vfsops.c,v 1.112 2024/01/17 10:19:21 hannken Exp $	*/
 
 /*
  * Copyright (c) 1993
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.111 2022/01/17 11:20:00 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.112 2024/01/17 10:19:21 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -110,7 +110,29 @@ MODULE(MODULE_CLASS_VFS, procfs, "ptrace
 
 VFS_PROTOS(procfs);
 
+#define PROCFS_HASHSIZE	256
+
 static kauth_listener_t procfs_listener;
+LIST_HEAD(hashhead, pfsnode);
+static u_long procfs_hashmask;
+static struct hashhead *procfs_hashtab;
+static kmutex_t procfs_hashlock;
+
+static struct hashhead *
+procfs_hashhead(pid_t pid)
+{
+
+	return _hashtab[pid & procfs_hashmask];
+}
+
+void
+procfs_hashrem(struct pfsnode *pfs)
+{
+
+	mutex_enter(_hashlock);
+	LIST_REMOVE(pfs, pfs_hash);
+	mutex_exit(_hashlock);
+}
 
 /*
  * VFS Operations.
@@ -279,6 +301,7 @@ procfs_loadvnode(struct mount *mp, struc
 	pfs->pfs_type = pfskey.pk_type;
 	pfs->pfs_fd = pfskey.pk_fd;
 	pfs->pfs_vnode = vp;
+	pfs->pfs_mount = mp;
 	pfs->pfs_flags = 0;
 	pfs->pfs_fileno =
 	PROCFS_FILENO(pfs->pfs_pid, pfs->pfs_type, pfs->pfs_fd);
@@ -421,6 +444,10 @@ procfs_loadvnode(struct mount *mp, struc
 		panic("procfs_allocvp");
 	}
 
+	mutex_enter(_hashlock);
+	LIST_INSERT_HEAD(procfs_hashhead(pfs->pfs_pid), pfs, pfs_hash);
+	mutex_exit(_hashlock);
+
 	uvm_vnp_setsize(vp, 0);
 	*new_key = >pfs_key;
 

Index: src/sys/miscfs/procfs/procfs_vnops.c
diff -u src/sys/miscfs/procfs/procfs_vnops.c:1.229 src/sys/miscfs/procfs/procfs_vnops.c:1.230
--- src/sys/miscfs/procfs/procfs_vnops.c:1.229	Fri Jun 17 14:30:37 2022
+++ src/sys/miscfs/procfs/procfs_vnops.c	Wed Jan 17 10:19:21 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_vnops.c,v 1.229 2022/06/17 14:30:37 shm Exp $	*/
+/*	$NetBSD: procfs_vnops.c,v 1.230 2024/01/17 10:19:21 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.229 2022/06/17 14:30:37 shm Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.230 2024/01/17 10:19:21 hannken Exp $");
 
 #include 
 #include 
@@ -437,6 +437,7 @@ procfs_reclaim(void *v)
 	mutex_enter(vp->v_interlock);
 	vp->v_data = NULL;
 	mutex_exit(vp->v_interlock);
+	procfs_hashrem(pfs);
 	kmem_free(pfs, sizeof(*pfs));
 	return 0;
 }



CVS commit: src/sys/miscfs/procfs

2024-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jan 17 10:19:21 UTC 2024

Modified Files:
src/sys/miscfs/procfs: procfs.h procfs_vfsops.c procfs_vnops.c

Log Message:
Add a hashmap to access all procfs nodes by pid.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/miscfs/procfs/procfs.h
cvs rdiff -u -r1.111 -r1.112 src/sys/miscfs/procfs/procfs_vfsops.c
cvs rdiff -u -r1.229 -r1.230 src/sys/miscfs/procfs/procfs_vnops.c

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



CVS commit: src/sys/kern

2024-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jan 17 10:18:41 UTC 2024

Modified Files:
src/sys/kern: init_main.c kern_hook.c

Log Message:
Protect kernel hooks exechook, exithook and forkhook with rwlock.
Lock as writer on establish/disestablish and as reader on list traverse.

For exechook ride "exec_lock" as it is already take as reader when
traversing the list.  Add local locks for exithook and forkhook.

Move exec_init before signal_init as signal_init calls exechook_establish()
that needs "exec_lock".

PR kern/39913 "exec, fork, exit hooks need locking"


To generate a diff of this commit:
cvs rdiff -u -r1.546 -r1.547 src/sys/kern/init_main.c
cvs rdiff -u -r1.14 -r1.15 src/sys/kern/kern_hook.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/init_main.c
diff -u src/sys/kern/init_main.c:1.546 src/sys/kern/init_main.c:1.547
--- src/sys/kern/init_main.c:1.546	Sat Sep 23 18:21:11 2023
+++ src/sys/kern/init_main.c	Wed Jan 17 10:18:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.546 2023/09/23 18:21:11 ad Exp $	*/
+/*	$NetBSD: init_main.c,v 1.547 2024/01/17 10:18:41 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009, 2019, 2023 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.546 2023/09/23 18:21:11 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.547 2024/01/17 10:18:41 hannken Exp $");
 
 #include "opt_cnmagic.h"
 #include "opt_ddb.h"
@@ -407,6 +407,9 @@ main(void)
 	/* Must be called after lwpinit (lwpinit_specificdata) */
 	psref_init();
 
+	/* Initialize exec structures */
+	exec_init(1);		/* signal_init calls exechook_establish() */
+
 	/* Initialize signal-related data structures. */
 	signal_init();
 
@@ -579,9 +582,6 @@ main(void)
 
 	vmem_rehash_start();	/* must be before exec_init */
 
-	/* Initialize exec structures */
-	exec_init(1);		/* seminit calls exithook_establish() */
-
 #if NVERIEXEC > 0
 	/*
 	 * Initialise the Veriexec subsystem.

Index: src/sys/kern/kern_hook.c
diff -u src/sys/kern/kern_hook.c:1.14 src/sys/kern/kern_hook.c:1.15
--- src/sys/kern/kern_hook.c:1.14	Wed Oct 26 23:21:06 2022
+++ src/sys/kern/kern_hook.c	Wed Jan 17 10:18:41 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_hook.c,v 1.14 2022/10/26 23:21:06 riastradh Exp $	*/
+/*	$NetBSD: kern_hook.c,v 1.15 2024/01/17 10:18:41 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_hook.c,v 1.14 2022/10/26 23:21:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_hook.c,v 1.15 2024/01/17 10:18:41 hannken Exp $");
 
 #include 
 
@@ -42,6 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_hook.c,
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -74,25 +75,48 @@ struct khook_list {
 
 int	powerhook_debug = 0;
 
+static ONCE_DECL(hook_control);
+static krwlock_t exithook_lock;
+static krwlock_t forkhook_lock;
+
+static int
+hook_init(void)
+{
+
+	rw_init(_lock);
+	rw_init(_lock);
+
+	return 0;
+}
+
 static void *
-hook_establish(hook_list_t *list, void (*fn)(void *), void *arg)
+hook_establish(hook_list_t *list, krwlock_t *lock,
+void (*fn)(void *), void *arg)
 {
 	struct hook_desc *hd;
 
-	hd = malloc(sizeof(*hd), M_DEVBUF, M_NOWAIT);
-	if (hd == NULL)
-		return (NULL);
+	RUN_ONCE(_control, hook_init);
 
-	hd->hk_fn = fn;
-	hd->hk_arg = arg;
-	LIST_INSERT_HEAD(list, hd, hk_list);
+	hd = malloc(sizeof(*hd), M_DEVBUF, M_NOWAIT);
+	if (hd != NULL) {
+		if (lock)
+			rw_enter(lock, RW_WRITER);
+		hd->hk_fn = fn;
+		hd->hk_arg = arg;
+		LIST_INSERT_HEAD(list, hd, hk_list);
+		if (lock)
+			rw_exit(lock);
+	}
 
 	return (hd);
 }
 
 static void
-hook_disestablish(hook_list_t *list, void *vhook)
+hook_disestablish(hook_list_t *list, krwlock_t *lock, void *vhook)
 {
+
+	if (lock)
+		rw_enter(lock, RW_WRITER);
 #ifdef DIAGNOSTIC
 	struct hook_desc *hd;
 
@@ -106,6 +130,8 @@ hook_disestablish(hook_list_t *list, voi
 #endif
 	LIST_REMOVE((struct hook_desc *)vhook, hk_list);
 	free(vhook, M_DEVBUF);
+	if (lock)
+		rw_exit(lock);
 }
 
 static void
@@ -120,14 +146,20 @@ hook_destroy(hook_list_t *list)
 }
 
 static void
-hook_proc_run(hook_list_t *list, struct proc *p)
+hook_proc_run(hook_list_t *list, krwlock_t *lock, struct proc *p)
 {
 	struct hook_desc *hd;
 
+	RUN_ONCE(_control, hook_init);
+
+	if (lock)
+		rw_enter(lock, RW_READER);
 	LIST_FOREACH(hd, list, hk_list) {
 		__FPTRCAST(void (*)(struct proc *, void *), *hd->hk_fn)(p,
 		hd->hk_arg);
 	}
+	if (lock)
+		rw_exit(lock);
 }
 
 /*
@@ -146,13 +178,13 @@ static hook_list_t shutdownhook_list = L
 void *
 shutdownhook_establish(void (*fn)(void *), void *arg)
 {
-	return hook_establish(_list, fn, arg);
+	return hook_establish(_list, NULL, fn, arg);
 }
 
 void
 shutdownhook_disestablish(void *vhook)
 {
-	hook_disestablish(_list, vhook);
+	

CVS commit: src/sys/kern

2024-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jan 17 10:18:41 UTC 2024

Modified Files:
src/sys/kern: init_main.c kern_hook.c

Log Message:
Protect kernel hooks exechook, exithook and forkhook with rwlock.
Lock as writer on establish/disestablish and as reader on list traverse.

For exechook ride "exec_lock" as it is already take as reader when
traversing the list.  Add local locks for exithook and forkhook.

Move exec_init before signal_init as signal_init calls exechook_establish()
that needs "exec_lock".

PR kern/39913 "exec, fork, exit hooks need locking"


To generate a diff of this commit:
cvs rdiff -u -r1.546 -r1.547 src/sys/kern/init_main.c
cvs rdiff -u -r1.14 -r1.15 src/sys/kern/kern_hook.c

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



CVS commit: src/sys/kern

2024-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jan 17 10:17:29 UTC 2024

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

Log Message:
Print dangling vnode before panic() to help debug.

PR kern/57775 ""panic: unmount: dangling vnode" while umounting procfs"


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/kern/vfs_mount.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_mount.c
diff -u src/sys/kern/vfs_mount.c:1.103 src/sys/kern/vfs_mount.c:1.104
--- src/sys/kern/vfs_mount.c:1.103	Thu Dec 28 12:48:08 2023
+++ src/sys/kern/vfs_mount.c	Wed Jan 17 10:17:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_mount.c,v 1.103 2023/12/28 12:48:08 hannken Exp $	*/
+/*	$NetBSD: vfs_mount.c,v 1.104 2024/01/17 10:17:29 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1997-2020 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.103 2023/12/28 12:48:08 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.104 2024/01/17 10:17:29 hannken Exp $");
 
 #include "veriexec.h"
 
@@ -936,7 +936,7 @@ err_mounted:
 int
 dounmount(struct mount *mp, int flags, struct lwp *l)
 {
-	vnode_t *coveredvp;
+	vnode_t *coveredvp, *vp;
 	int error, async, used_syncer, used_extattr;
 	const bool was_suspended = fstrans_is_owner(mp);
 
@@ -1003,8 +1003,10 @@ dounmount(struct mount *mp, int flags, s
 		vfs_resume(mp);
 
 	mountlist_remove(mp);
-	if (TAILQ_FIRST(>mnt_vnodelist) != NULL)
+	if ((vp = VIMPL_TO_VNODE(TAILQ_FIRST(>mnt_vnodelist))) != NULL) {
+		vprint("dangling", vp);
 		panic("unmount: dangling vnode");
+	}
 	vfs_hooks_unmount(mp);
 
 	vfs_set_lowermount(mp, NULL);



CVS commit: src/sys/kern

2024-01-17 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Jan 17 10:17:29 UTC 2024

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

Log Message:
Print dangling vnode before panic() to help debug.

PR kern/57775 ""panic: unmount: dangling vnode" while umounting procfs"


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/kern/vfs_mount.c

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