CVS commit: src/sbin/ifconfig

2023-03-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Mar 26 01:04:16 UTC 2023

Modified Files:
src/sbin/ifconfig: carp.c ifconfig.8

Log Message:
Fix parser for carp state.
The state values are uppercase words INIT, BACKUP and MASTER.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sbin/ifconfig/carp.c
cvs rdiff -u -r1.124 -r1.125 src/sbin/ifconfig/ifconfig.8

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

Modified files:

Index: src/sbin/ifconfig/carp.c
diff -u src/sbin/ifconfig/carp.c:1.14 src/sbin/ifconfig/carp.c:1.15
--- src/sbin/ifconfig/carp.c:1.14	Sun Jun  7 06:02:58 2020
+++ src/sbin/ifconfig/carp.c	Sun Mar 26 01:04:16 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: carp.c,v 1.14 2020/06/07 06:02:58 thorpej Exp $ */
+/* $NetBSD: carp.c,v 1.15 2023/03/26 01:04:16 mlelstv Exp $ */
 
 /*
  * Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: carp.c,v 1.14 2020/06/07 06:02:58 thorpej Exp $");
+__RCSID("$NetBSD: carp.c,v 1.15 2023/03/26 01:04:16 mlelstv Exp $");
 #endif /* not lint */
 
 #include 
@@ -67,10 +67,16 @@ static int setcarpdev(prop_dictionary_t,
 
 static const char *carp_states[] = { CARP_STATES };
 
+/* from if_carp.c */
+enum carpstateval { INIT = 0, BACKUP, MASTER };
+
 struct kwinst carpstatekw[] = {
-	  {.k_word = "INIT", .k_nextparser = _root.pb_parser}
-	, {.k_word = "BACKUP", .k_nextparser = _root.pb_parser}
-	, {.k_word = "MASTER", .k_nextparser = _root.pb_parser}
+	  {.k_word = "INIT", .k_type = KW_T_INT, .k_int = INIT,
+	   .k_nextparser = _root.pb_parser}
+	, {.k_word = "BACKUP", .k_type = KW_T_INT, .k_int = BACKUP,
+	   .k_nextparser = _root.pb_parser}
+	, {.k_word = "MASTER", .k_type = KW_T_INT, .k_int = MASTER,
+	   .k_nextparser = _root.pb_parser}
 };
 
 struct pinteger parse_advbase = PINTEGER_INITIALIZER1(_advbase, "advbase",

Index: src/sbin/ifconfig/ifconfig.8
diff -u src/sbin/ifconfig/ifconfig.8:1.124 src/sbin/ifconfig/ifconfig.8:1.125
--- src/sbin/ifconfig/ifconfig.8:1.124	Fri Nov 25 08:41:05 2022
+++ src/sbin/ifconfig/ifconfig.8	Sun Mar 26 01:04:16 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ifconfig.8,v 1.124 2022/11/25 08:41:05 knakahara Exp $
+.\"	$NetBSD: ifconfig.8,v 1.125 2023/03/26 01:04:16 mlelstv Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -315,10 +315,10 @@ Explicitly force the
 .Xr carp 4
 pseudo-device to enter this state.
 Valid states are
-.Ar init ,
-.Ar backup ,
+.Ar INIT ,
+.Ar BACKUP ,
 and
-.Ar master .
+.Ar MASTER .
 .It Cm frag Ar threshold
 .Pq IEEE 802.11 devices only
 Configure the fragmentation threshold for IEEE 802.11-based wireless



CVS commit: src/sbin/ifconfig

2023-03-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Mar 26 01:04:16 UTC 2023

Modified Files:
src/sbin/ifconfig: carp.c ifconfig.8

Log Message:
Fix parser for carp state.
The state values are uppercase words INIT, BACKUP and MASTER.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sbin/ifconfig/carp.c
cvs rdiff -u -r1.124 -r1.125 src/sbin/ifconfig/ifconfig.8

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



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

2023-03-25 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 25 21:51:12 UTC 2023

Modified Files:
src/sys/arch/atari/include: video.h

Log Message:
s/resultion/resolution/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/atari/include/video.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/atari/include

2023-03-25 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 25 21:51:12 UTC 2023

Modified Files:
src/sys/arch/atari/include: video.h

Log Message:
s/resultion/resolution/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/atari/include/video.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/atari/include/video.h
diff -u src/sys/arch/atari/include/video.h:1.9 src/sys/arch/atari/include/video.h:1.10
--- src/sys/arch/atari/include/video.h:1.9	Sat Mar 25 21:47:10 2023
+++ src/sys/arch/atari/include/video.h	Sat Mar 25 21:51:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: video.h,v 1.9 2023/03/25 21:47:10 andvar Exp $	*/
+/*	$NetBSD: video.h,v 1.10 2023/03/25 21:51:12 andvar Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -41,7 +41,7 @@ struct video {
 volatile	u_short	vd_st_rgb[16];	/* RGB for simultaneous colors	(ST)*/
 volatile	u_char	vd_st_res;	/* ST resolution		*/
 volatile	char	vd_fill1;	/* filler			*/
-volatile	u_short	vd_tt_res;	/* TT-resultion mode		*/
+volatile	u_short	vd_tt_res;	/* TT-resolution mode		*/
 volatile	u_char  vd_ste_hscroll;	/* MEGA STe hor bitwise scroll	*/
 volatile	u_short vd_fal_res;	/* Falcon resolution		*/
 volatile	charvd_fill2[23];



CVS commit: src/sys/arch

2023-03-25 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 25 21:47:10 UTC 2023

Modified Files:
src/sys/arch/atari/include: video.h
src/sys/arch/x86/include: specialreg.h

Log Message:
s/Predective/Predictive/ and s/dedected/detected/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/atari/include/video.h
cvs rdiff -u -r1.203 -r1.204 src/sys/arch/x86/include/specialreg.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/atari/include/video.h
diff -u src/sys/arch/atari/include/video.h:1.8 src/sys/arch/atari/include/video.h:1.9
--- src/sys/arch/atari/include/video.h:1.8	Sun Jul  3 11:30:48 2022
+++ src/sys/arch/atari/include/video.h	Sat Mar 25 21:47:10 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: video.h,v 1.8 2022/07/03 11:30:48 andvar Exp $	*/
+/*	$NetBSD: video.h,v 1.9 2023/03/25 21:47:10 andvar Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -117,7 +117,7 @@ struct video {
 #define	TT_SHOLD	0x1000	/* Sample/hold mode			*/
 
 /* The falcon video modes */
-#define RES_FALAUTO	0	/* Falcon resolution dedected at boot	*/
+#define RES_FALAUTO	0	/* Falcon resolution detected at boot	*/
 #define RES_VGA2	1	/* 640x480,   2 colors			*/
 #define RES_VGA4	2	/* 640x480,   4 colors			*/
 #define RES_VGA16	3	/* 640x480,  16 colors			*/

Index: src/sys/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.203 src/sys/arch/x86/include/specialreg.h:1.204
--- src/sys/arch/x86/include/specialreg.h:1.203	Fri Feb 17 09:53:24 2023
+++ src/sys/arch/x86/include/specialreg.h	Sat Mar 25 21:47:10 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.203 2023/02/17 09:53:24 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.204 2023/03/25 21:47:10 andvar Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -1065,7 +1065,7 @@
 #define CPUID_AMDEXT2_FSRC	  __BIT(11) /* Fast Short Rep Cmpsb */
 #define CPUID_AMDEXT2_PREFETCHCTL __BIT(13) /* Prefetch control MSR */
 #define CPUID_AMDEXT2_CPUIDUSRDIS __BIT(17) /* CPUID dis. for non-priv. soft */
-#define CPUID_AMDEXT2_EPSF	  __BIT(18) /* Enhanced Predective Store Fwd */
+#define CPUID_AMDEXT2_EPSF	  __BIT(18) /* Enhanced Predictive Store Fwd */
 
 #define CPUID_AMDEXT2_FLAGS	 "\20"	  \
 	"\1NoNestedDataBp" "\2FsGsKernelGsBaseNonSerializing"		  \



CVS commit: src/sys/arch

2023-03-25 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 25 21:47:10 UTC 2023

Modified Files:
src/sys/arch/atari/include: video.h
src/sys/arch/x86/include: specialreg.h

Log Message:
s/Predective/Predictive/ and s/dedected/detected/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/atari/include/video.h
cvs rdiff -u -r1.203 -r1.204 src/sys/arch/x86/include/specialreg.h

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



CVS commit: src/sys/net

2023-03-25 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 25 21:35:49 UTC 2023

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

Log Message:
s/deteted/detected/ in log message.


To generate a diff of this commit:
cvs rdiff -u -r1.266 -r1.267 src/sys/net/if_spppsubr.c

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

Modified files:

Index: src/sys/net/if_spppsubr.c
diff -u src/sys/net/if_spppsubr.c:1.266 src/sys/net/if_spppsubr.c:1.267
--- src/sys/net/if_spppsubr.c:1.266	Sat Sep  3 02:47:59 2022
+++ src/sys/net/if_spppsubr.c	Sat Mar 25 21:35:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_spppsubr.c,v 1.266 2022/09/03 02:47:59 thorpej Exp $	 */
+/*	$NetBSD: if_spppsubr.c,v 1.267 2023/03/25 21:35:49 andvar Exp $	 */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.266 2022/09/03 02:47:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.267 2023/03/25 21:35:49 andvar Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -3132,7 +3132,7 @@ sppp_lcp_tlu(struct sppp *sp)
 		if ((sp->pp_flags & PP_LOOPBACK) == 0) {
 			SPPP_LOG(sp, LOG_DEBUG,
 			"interface is going up, "
-			"but no loopback packet is deteted\n");
+			"but no loopback packet is detected\n");
 		}
 		sp->pp_flags &= ~PP_LOOPBACK;
 	}



CVS commit: src/sys/net

2023-03-25 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 25 21:35:49 UTC 2023

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

Log Message:
s/deteted/detected/ in log message.


To generate a diff of this commit:
cvs rdiff -u -r1.266 -r1.267 src/sys/net/if_spppsubr.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/ic

2023-03-25 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 25 21:33:46 UTC 2023

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

Log Message:
s/deteced/detected/ and s/couner/counter/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/ic/dm9000reg.h

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

Modified files:

Index: src/sys/dev/ic/dm9000reg.h
diff -u src/sys/dev/ic/dm9000reg.h:1.10 src/sys/dev/ic/dm9000reg.h:1.11
--- src/sys/dev/ic/dm9000reg.h:1.10	Tue May 31 12:59:00 2022
+++ src/sys/dev/ic/dm9000reg.h	Sat Mar 25 21:33:46 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: dm9000reg.h,v 1.10 2022/05/31 12:59:00 andvar Exp $	*/
+/*	$NetBSD: dm9000reg.h,v 1.11 2023/03/25 21:33:46 andvar Exp $	*/
 
 /*
  * Copyright (c) 2009 Paul Fleischer
@@ -59,7 +59,7 @@
 #define  DM9000_NCR_WAKEEN	(1<<6)	/* wakeup event enable */
 #define  DM9000_NCR_EXY_PHY	(1<<7)	/* select ext. PHY, immune SW reset */
 #define DM9000_NSR		0x01	/* "network" status */
-#define  DM9000_NSR_RXOV	(1<<1)	/* receive overflow deteced */
+#define  DM9000_NSR_RXOV	(1<<1)	/* receive overflow detected */
 #define  DM9000_NSR_TX1END	(1<<2)	/* transmit 1 completed, W1C */
 #define  DM9000_NSR_TX2END	(1<<3) 	/* transmit 2 completed, W1C */
 #define  DM9000_NSR_WAKEST	(1<<5)	/* wakeup event, W1C */
@@ -99,7 +99,7 @@
 #define  DM9000_RSR_MF		(1<<6)	/* mcast/bcast frame received */
 #define  DM9000_RSR_RF		(1<<7)	/* damaged runt frame received <64 */
 #define DM9000_ROCR		0x07	/* receive overflow counter */
-/* 7: OVF detected, 6:0 statistic couner */
+/* 7: OVF detected, 6:0 statistic counter */
 #define DM9000_BPTR		0x08	/* back pressure threshold */
 /* 7:4 back pressure high watermark (3 def), 3:0 jam pattern time (7 def) */
 #define DM9000_FCTR		0x09	/* flow control threshold */



CVS commit: src/sys/dev/ic

2023-03-25 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 25 21:33:46 UTC 2023

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

Log Message:
s/deteced/detected/ and s/couner/counter/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/ic/dm9000reg.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/amiga/stand/bootblock/boot

2023-03-25 Thread David Brownlee
Module Name:src
Committed By:   abs
Date:   Sat Mar 25 20:14:26 UTC 2023

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: console.c libstubs.h
libstubs.s version

Log Message:
Fix NetBSD/amiga bootblocks for Kickstart 3.2 - from Karoly Balogh

Kickstart 3.2 changed to not initialize console.device before
bootstrap, so the previous NetBSD bootblocks would crash when they
tried to initialise console output.

With this change if the call to the OpenDevice() stub fails, the
code now calls FindResident() and InitResident() before retrying
the OpenDevice().

Many thanks to Karoly Balogh for tracking this down (and also for
knowing just who to poke to get insight into the 3.2 changes :)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/amiga/stand/bootblock/boot/console.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amiga/stand/bootblock/boot/libstubs.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amiga/stand/bootblock/boot/libstubs.s
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amiga/stand/bootblock/boot/version

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

Modified files:

Index: src/sys/arch/amiga/stand/bootblock/boot/console.c
diff -u src/sys/arch/amiga/stand/bootblock/boot/console.c:1.15 src/sys/arch/amiga/stand/bootblock/boot/console.c:1.16
--- src/sys/arch/amiga/stand/bootblock/boot/console.c:1.15	Sun Dec 18 12:02:37 2016
+++ src/sys/arch/amiga/stand/bootblock/boot/console.c	Sat Mar 25 20:14:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: console.c,v 1.15 2016/12/18 12:02:37 mlelstv Exp $ */
+/* $NetBSD: console.c,v 1.16 2023/03/25 20:14:26 abs Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -138,8 +138,20 @@ consinit(void *consptr) {
 		goto err;
 
 	mc->cnior->buf = (void *)mc->w;
-	if (OpenDevice("console.device", 0, mc->cnior, 0))
-		goto err;
+	mc->cnior->length = 136; /* sizeof(struct Window) */
+	if (OpenDevice("console.device", 0, mc->cnior, 0)) {
+		/* Kickstart 3.2 decided not to initialize console.device
+before bootstrap, so we have to do it ourselves. */
+		void *res = FindResident("console.device");
+		if (!res)
+			goto err;
+
+		if (!InitResident(res, 0))
+			goto err;
+
+		if (OpenDevice("console.device", 0, mc->cnior, 0))
+			goto err;
+	}
 
 	mc->tmior = (struct TimerIO *)CreateIORequest(mc->cnmp, sizeof(struct TimerIO));
 	if (!mc->tmior)

Index: src/sys/arch/amiga/stand/bootblock/boot/libstubs.h
diff -u src/sys/arch/amiga/stand/bootblock/boot/libstubs.h:1.7 src/sys/arch/amiga/stand/bootblock/boot/libstubs.h:1.8
--- src/sys/arch/amiga/stand/bootblock/boot/libstubs.h:1.7	Sat Oct 17 11:18:18 2009
+++ src/sys/arch/amiga/stand/bootblock/boot/libstubs.h	Sat Mar 25 20:14:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: libstubs.h,v 1.7 2009/10/17 11:18:18 mlelstv Exp $ */
+/* $NetBSD: libstubs.h,v 1.8 2023/03/25 20:14:26 abs Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -65,6 +65,7 @@ void CloseDevice(struct AmigaIO *);
 #endif
 
 void *FindResident(const char *);
+void *InitResident(const char *, u_int32_t);
 void *OpenResource(const char *);
 
 u_int32_t CachePreDMA(u_int32_t, u_int32_t *, int);

Index: src/sys/arch/amiga/stand/bootblock/boot/libstubs.s
diff -u src/sys/arch/amiga/stand/bootblock/boot/libstubs.s:1.10 src/sys/arch/amiga/stand/bootblock/boot/libstubs.s:1.11
--- src/sys/arch/amiga/stand/bootblock/boot/libstubs.s:1.10	Sat Oct 17 11:18:18 2009
+++ src/sys/arch/amiga/stand/bootblock/boot/libstubs.s	Sat Mar 25 20:14:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: libstubs.s,v 1.10 2009/10/17 11:18:18 mlelstv Exp $ */
+/* $NetBSD: libstubs.s,v 1.11 2023/03/25 20:14:26 abs Exp $ */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -208,6 +208,16 @@ ENTRY_NOPROFILE(FindResident)
 	movl	%d0,%a0			| Comply with ELF ABI
 	rts
 
+ENTRY_NOPROFILE(InitResident)
+	movl	%a6,%sp@-
+	movl	%pc@(_C_LABEL(SysBase):w),%a6
+	movl	%sp@(8),%a1
+	movl	%sp@(12),%d1
+	jsr	%a6@(-0x66)
+	movl	%sp@+,%a6
+	movl	%d0,%a0			| Comply with ELF ABI
+	rts
+
 ENTRY_NOPROFILE(OpenResource)
 	movl	%a6,%sp@-
 	movl	%pc@(_C_LABEL(SysBase):w),%a6

Index: src/sys/arch/amiga/stand/bootblock/boot/version
diff -u src/sys/arch/amiga/stand/bootblock/boot/version:1.2 src/sys/arch/amiga/stand/bootblock/boot/version:1.3
--- src/sys/arch/amiga/stand/bootblock/boot/version:1.2	Thu Feb 25 03:42:14 2021
+++ src/sys/arch/amiga/stand/bootblock/boot/version	Sat Mar 25 20:14:26 2023
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.2 2021/02/25 03:42:14 rin Exp $
+$NetBSD: version,v 1.3 2023/03/25 20:14:26 abs Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -12,3 +12,4 @@ is taken as the current.
 2.4:	Moved default command into fixed location for easy patching
 3.0:	Initial 2 stage amiga bootblocks
 3.1:	Add support for FFSv2
+3.2:	Fix booting with some "modern" Kickstart versions



CVS commit: src/sys/arch/amiga/stand/bootblock/boot

2023-03-25 Thread David Brownlee
Module Name:src
Committed By:   abs
Date:   Sat Mar 25 20:14:26 UTC 2023

Modified Files:
src/sys/arch/amiga/stand/bootblock/boot: console.c libstubs.h
libstubs.s version

Log Message:
Fix NetBSD/amiga bootblocks for Kickstart 3.2 - from Karoly Balogh

Kickstart 3.2 changed to not initialize console.device before
bootstrap, so the previous NetBSD bootblocks would crash when they
tried to initialise console output.

With this change if the call to the OpenDevice() stub fails, the
code now calls FindResident() and InitResident() before retrying
the OpenDevice().

Many thanks to Karoly Balogh for tracking this down (and also for
knowing just who to poke to get insight into the 3.2 changes :)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/amiga/stand/bootblock/boot/console.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amiga/stand/bootblock/boot/libstubs.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amiga/stand/bootblock/boot/libstubs.s
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/amiga/stand/bootblock/boot/version

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

2023-03-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar 25 11:04:34 UTC 2023

Modified Files:
src/sys/dev/pci: viomb.c viornd.c vioscsi.c

Log Message:
Mark as MPSAFE.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/viomb.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/viornd.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/vioscsi.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/viomb.c
diff -u src/sys/dev/pci/viomb.c:1.16 src/sys/dev/pci/viomb.c:1.17
--- src/sys/dev/pci/viomb.c:1.16	Sat Mar 25 11:00:35 2023
+++ src/sys/dev/pci/viomb.c	Sat Mar 25 11:04:34 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: viomb.c,v 1.16 2023/03/25 11:00:35 mlelstv Exp $	*/
+/*	$NetBSD: viomb.c,v 1.17 2023/03/25 11:04:34 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: viomb.c,v 1.16 2023/03/25 11:00:35 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viomb.c,v 1.17 2023/03/25 11:04:34 mlelstv Exp $");
 
 #include 
 #include 
@@ -192,7 +192,7 @@ viomb_attach(device_t parent, device_t s
 	}
 
 	if (virtio_child_attach_finish(vsc, sc->sc_vq, __arraycount(sc->sc_vq),
-	viomb_config_change, 0) != 0)
+	viomb_config_change, VIRTIO_F_INTR_MPSAFE) != 0)
 		goto err_out;
 
 	if (kthread_create(PRI_IDLE, KTHREAD_MPSAFE, NULL,

Index: src/sys/dev/pci/viornd.c
diff -u src/sys/dev/pci/viornd.c:1.20 src/sys/dev/pci/viornd.c:1.21
--- src/sys/dev/pci/viornd.c:1.20	Thu Mar 23 03:55:11 2023
+++ src/sys/dev/pci/viornd.c	Sat Mar 25 11:04:34 2023
@@ -1,4 +1,4 @@
-/* 	$NetBSD: viornd.c,v 1.20 2023/03/23 03:55:11 yamaguchi Exp $ */
+/* 	$NetBSD: viornd.c,v 1.21 2023/03/25 11:04:34 mlelstv Exp $ */
 /*	$OpenBSD: viornd.c,v 1.1 2014/01/21 21:14:58 sf Exp $	*/
 
 /*
@@ -191,7 +191,7 @@ viornd_attach(device_t parent, device_t 
 	sc->sc_vq.vq_done = viornd_vq_done;
 
 	error = virtio_child_attach_finish(vsc, >sc_vq, 1,
-	NULL, 0);
+	NULL, VIRTIO_F_INTR_MPSAFE);
 	if (error) {
 		virtio_free_vq(vsc, >sc_vq);
 		goto vio_failed;

Index: src/sys/dev/pci/vioscsi.c
diff -u src/sys/dev/pci/vioscsi.c:1.35 src/sys/dev/pci/vioscsi.c:1.36
--- src/sys/dev/pci/vioscsi.c:1.35	Sat Mar 25 09:03:47 2023
+++ src/sys/dev/pci/vioscsi.c	Sat Mar 25 11:04:34 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vioscsi.c,v 1.35 2023/03/25 09:03:47 mlelstv Exp $	*/
+/*	$NetBSD: vioscsi.c,v 1.36 2023/03/25 11:04:34 mlelstv Exp $	*/
 /*	$OpenBSD: vioscsi.c,v 1.3 2015/03/14 03:38:49 jsg Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vioscsi.c,v 1.35 2023/03/25 09:03:47 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vioscsi.c,v 1.36 2023/03/25 11:04:34 mlelstv Exp $");
 
 #include 
 #include 
@@ -173,7 +173,8 @@ vioscsi_attach(device_t parent, device_t
 	cmd_per_lun, qsize, seg_max, max_target, max_lun);
 
 	if (virtio_child_attach_finish(vsc, sc->sc_vqs,
-	__arraycount(sc->sc_vqs), NULL, VIRTIO_F_INTR_MSIX) != 0)
+	__arraycount(sc->sc_vqs), NULL,
+	VIRTIO_F_INTR_MSIX | VIRTIO_F_INTR_MPSAFE) != 0)
 		goto err;
 
 	/*
@@ -186,6 +187,7 @@ vioscsi_attach(device_t parent, device_t
 	adapt->adapt_max_periph = adapt->adapt_openings;
 	adapt->adapt_request = vioscsi_scsipi_request;
 	adapt->adapt_minphys = minphys;
+	adapt->adapt_flags = SCSIPI_ADAPT_MPSAFE;
 
 	/*
 	 * Fill in the scsipi_channel.



CVS commit: src/sys/dev/pci

2023-03-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar 25 11:04:34 UTC 2023

Modified Files:
src/sys/dev/pci: viomb.c viornd.c vioscsi.c

Log Message:
Mark as MPSAFE.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/viomb.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/pci/viornd.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/pci/vioscsi.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

2023-03-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar 25 11:00:35 UTC 2023

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

Log Message:
Fix 32bit overflow when calculating balloon size.
Don't make uvm_pglistalloc wait, it will wait forever. Instead rely on
the retries by this driver. This also allows to cancel the request.
Increase inflate speed by factor 10 (same as deflate).


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/viomb.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/viomb.c
diff -u src/sys/dev/pci/viomb.c:1.15 src/sys/dev/pci/viomb.c:1.16
--- src/sys/dev/pci/viomb.c:1.15	Thu Mar 23 03:55:11 2023
+++ src/sys/dev/pci/viomb.c	Sat Mar 25 11:00:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: viomb.c,v 1.15 2023/03/23 03:55:11 yamaguchi Exp $	*/
+/*	$NetBSD: viomb.c,v 1.16 2023/03/25 11:00:35 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: viomb.c,v 1.15 2023/03/23 03:55:11 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viomb.c,v 1.16 2023/03/25 11:00:35 mlelstv Exp $");
 
 #include 
 #include 
@@ -286,8 +286,8 @@ inflate(struct viomb_softc *sc)
 	nhpages = nvpages * VIRTIO_PAGE_SIZE / PAGE_SIZE;
 
 	b = >sc_req;
-	if (uvm_pglistalloc(nhpages*PAGE_SIZE, 0, UINT32_MAX*PAGE_SIZE,
-			0, 0, >bl_pglist, nhpages, 1)) {
+	if (uvm_pglistalloc(nhpages*PAGE_SIZE, 0, UINT32_MAX*(paddr_t)PAGE_SIZE,
+			0, 0, >bl_pglist, nhpages, 0)) {
 		printf("%s: %" PRIu64 " pages of physical memory "
 		   "could not be allocated, retrying...\n",
 		   device_xname(sc->sc_dev), nhpages);
@@ -507,9 +507,9 @@ viomb_thread(void *arg)
 if (r != 0)
 	sleeptime = 1;
 else
-	sleeptime = 1000;
+	sleeptime = 100;
 			} else
-sleeptime = 100;
+sleeptime = 20;
 		} else if (sc->sc_npages < sc->sc_actual + sc->sc_inflight) {
 			if (sc->sc_inflight == 0)
 r = deflate(sc);



CVS commit: src/sys/dev/pci

2023-03-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar 25 11:00:35 UTC 2023

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

Log Message:
Fix 32bit overflow when calculating balloon size.
Don't make uvm_pglistalloc wait, it will wait forever. Instead rely on
the retries by this driver. This also allows to cancel the request.
Increase inflate speed by factor 10 (same as deflate).


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/viomb.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

2023-03-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar 25 09:03:47 UTC 2023

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

Log Message:
A single SCSI request may require multiple slots in the virtio queue
but the queue isn't sized for the theoretical maximum. So just use
XS_BUSY to pace the scsipi layer.


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

2023-03-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar 25 09:03:47 UTC 2023

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

Log Message:
A single SCSI request may require multiple slots in the virtio queue
but the queue isn't sized for the theoretical maximum. So just use
XS_BUSY to pace the scsipi layer.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/vioscsi.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/vioscsi.c
diff -u src/sys/dev/pci/vioscsi.c:1.34 src/sys/dev/pci/vioscsi.c:1.35
--- src/sys/dev/pci/vioscsi.c:1.34	Sat Mar 25 08:14:00 2023
+++ src/sys/dev/pci/vioscsi.c	Sat Mar 25 09:03:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vioscsi.c,v 1.34 2023/03/25 08:14:00 mlelstv Exp $	*/
+/*	$NetBSD: vioscsi.c,v 1.35 2023/03/25 09:03:47 mlelstv Exp $	*/
 /*	$OpenBSD: vioscsi.c,v 1.3 2015/03/14 03:38:49 jsg Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vioscsi.c,v 1.34 2023/03/25 08:14:00 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vioscsi.c,v 1.35 2023/03/25 09:03:47 mlelstv Exp $");
 
 #include 
 #include 
@@ -300,7 +300,7 @@ vioscsi_scsipi_request(struct scsipi_cha
 	 */
 	vr = vioscsi_req_get(sc);
 	if (vr == NULL) {
-		xs->error = XS_RESOURCE_SHORTAGE;
+		xs->error = XS_BUSY;
 		scsipi_done(xs);
 		return;
 	}
@@ -387,11 +387,9 @@ stuffup:
 
 	error = virtio_enqueue_reserve(vsc, vq, slot, nsegs);
 	if (error) {
-		aprint_error_dev(sc->sc_dev, "error reserving %d (nsegs %d)\n",
-		error, nsegs);
 		bus_dmamap_unload(virtio_dmat(vsc), vr->vr_data);
 		/* slot already freed by virtio_enqueue_reserve() */
-		xs->error = XS_RESOURCE_SHORTAGE;
+		xs->error = XS_BUSY;
 		scsipi_done(xs);
 		return;
 	}



CVS commit: src/sys/dev/pci

2023-03-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar 25 08:14:00 UTC 2023

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

Log Message:
restore fetch of qsize.


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

2023-03-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Mar 25 08:14:00 UTC 2023

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

Log Message:
restore fetch of qsize.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/pci/vioscsi.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/vioscsi.c
diff -u src/sys/dev/pci/vioscsi.c:1.33 src/sys/dev/pci/vioscsi.c:1.34
--- src/sys/dev/pci/vioscsi.c:1.33	Fri Mar 24 13:32:19 2023
+++ src/sys/dev/pci/vioscsi.c	Sat Mar 25 08:14:00 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vioscsi.c,v 1.33 2023/03/24 13:32:19 yamaguchi Exp $	*/
+/*	$NetBSD: vioscsi.c,v 1.34 2023/03/25 08:14:00 mlelstv Exp $	*/
 /*	$OpenBSD: vioscsi.c,v 1.3 2015/03/14 03:38:49 jsg Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vioscsi.c,v 1.33 2023/03/24 13:32:19 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vioscsi.c,v 1.34 2023/03/25 08:14:00 mlelstv Exp $");
 
 #include 
 #include 
@@ -163,6 +163,7 @@ vioscsi_attach(device_t parent, device_t
 			sc->sc_vqs[i].vq_done = vioscsi_vq_done;
 	}
 
+	qsize = sc->sc_vqs[VIOSCSI_VQ_REQUEST].vq_num;
 	if (vioscsi_alloc_reqs(sc, vsc, qsize))
 		goto err;