CVS commit: [netbsd-10] src/doc

2024-03-24 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar 24 20:27:33 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
ticket 643-645


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.212 -r1.1.2.213 src/doc/CHANGES-10.0

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

Modified files:

Index: src/doc/CHANGES-10.0
diff -u src/doc/CHANGES-10.0:1.1.2.212 src/doc/CHANGES-10.0:1.1.2.213
--- src/doc/CHANGES-10.0:1.1.2.212	Tue Mar 12 10:19:02 2024
+++ src/doc/CHANGES-10.0	Sun Mar 24 20:27:33 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.0,v 1.1.2.212 2024/03/12 10:19:02 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.213 2024/03/24 20:27:33 bouyer Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -21446,3 +21446,70 @@ sys/sys/param.h (manually edited)
 
 	Welcome to 10.0_RC6
 
+distrib/notes/acorn32/contents			1.8
+distrib/notes/alpha/contents			1.26
+distrib/notes/amd64/contents			1.14
+distrib/notes/amiga/contents			1.26
+distrib/notes/arc/contents			1.8
+distrib/notes/atari/contents			1.26
+distrib/notes/bebox/contents			1.8
+distrib/notes/cats/contents			1.8
+distrib/notes/common/contents			1.187
+distrib/notes/common/main			1.573, 1.574
+distrib/notes/common/sysinst			1.113
+distrib/notes/emips/contents			1.8
+distrib/notes/evbarm/contents			1.16
+distrib/notes/evbppc/contents			1.10
+distrib/notes/ews4800mips/contents		1.8
+distrib/notes/hp300/contents			1.23
+distrib/notes/hpcarm/contents			1.9
+distrib/notes/hpcmips/contents			1.16
+distrib/notes/hpcsh/contents			1.9
+distrib/notes/hppa/contents			1.8
+distrib/notes/i386/contents			1.36
+distrib/notes/landisk/contents			1.9
+distrib/notes/mac68k/contents			1.26
+distrib/notes/macppc/contents			1.20
+distrib/notes/mmeye/contents			1.9
+distrib/notes/mvme68k/contents			1.19
+distrib/notes/news68k/contents			1.12
+distrib/notes/newsmips/contents			1.8
+distrib/notes/next68k/contents			1.13
+distrib/notes/ofppc/contents			1.9
+distrib/notes/pmax/contents			1.23
+distrib/notes/prep/contents			1.8
+distrib/notes/rs6000/contents			1.8
+distrib/notes/sandpoint/contents		1.8
+distrib/notes/sgimips/contents			1.8
+distrib/notes/shark/contents			1.8
+distrib/notes/sparc/contents			1.30
+distrib/notes/sparc64/contents			1.13
+distrib/notes/sun2/contents			1.8
+distrib/notes/sun3/contents			1.22
+distrib/notes/vax/contents			1.17
+distrib/notes/vax/xfer1.16
+distrib/notes/x68k/contents			1.23
+
+	Various style fixes (and some of VAX related errors and copy),
+	from Mouse on tech-install.
+
+
+	Use single-arg "Lk" macro for a link so we can get reasonable results
+	both in .more and .html output (still a bit odd, but better than
+	before IMHO).
+	[martin, ticket #643]
+
+usr.sbin/sysinst/configmenu.c			1.19
+
+	PR 58062: fix a bug I introduced with the https support: update
+	the pkgsrc/binary pkgs download URL not only when https transport
+	is selected.
+	[martin, ticket #644]
+
+usr.sbin/sysinst/gpt.c1.32
+
+	PR 58061: fix bug in the GPT backend: when inserting a partition
+	(i.e. not adding it at the end) a bogus ID was returned for the new
+	partition.
+	[martin, ticket #645]
+



CVS commit: [netbsd-10] src/doc

2024-03-24 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar 24 20:27:33 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
ticket 643-645


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.212 -r1.1.2.213 src/doc/CHANGES-10.0

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



CVS commit: [netbsd-10] src/usr.sbin/sysinst

2024-03-24 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar 24 20:27:04 UTC 2024

Modified Files:
src/usr.sbin/sysinst [netbsd-10]: gpt.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #645):
usr.sbin/sysinst/gpt.c: revision 1.32
PR 58061: fix bug in the GPT backend: when inserting a partition
(i.e. not adding it at the end) a bogus ID was returned for the new
partition.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.2.1 src/usr.sbin/sysinst/gpt.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/sysinst/gpt.c
diff -u src/usr.sbin/sysinst/gpt.c:1.30 src/usr.sbin/sysinst/gpt.c:1.30.2.1
--- src/usr.sbin/sysinst/gpt.c:1.30	Thu Dec 15 14:54:27 2022
+++ src/usr.sbin/sysinst/gpt.c	Sun Mar 24 20:27:04 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: gpt.c,v 1.30 2022/12/15 14:54:27 martin Exp $	*/
+/*	$NetBSD: gpt.c,v 1.30.2.1 2024/03/24 20:27:04 bouyer Exp $	*/
 
 /*
  * Copyright 2018 The NetBSD Foundation, Inc.
@@ -569,12 +569,14 @@ gpt_get_part_attr_str(const struct disk_
 static bool
 gpt_insert_part_into_list(struct gpt_disk_partitions *parts,
 struct gpt_part_entry **list,
-struct gpt_part_entry *entry, const char **err_msg)
+struct gpt_part_entry *entry, const char **err_msg, part_id *new_id)
 {
 	struct gpt_part_entry *p, *last;
+	part_id pno;
 
 	/* find the first entry past the new one (if any) */
-	for (last = NULL, p = *list; p != NULL; last = p, p = p->gp_next) {
+	for (pno = 0, last = NULL, p = *list; p != NULL;
+	last = p, p = p->gp_next, pno++) {
 		if (p->gp_start > entry->gp_start)
 			break;
 	}
@@ -609,7 +611,8 @@ gpt_insert_part_into_list(struct gpt_dis
 	}
 	if (*list == NULL)
 		*list = entry;
-
+	if (new_id != NULL)
+		*new_id = pno;
 	return true;
 }
 
@@ -651,7 +654,7 @@ gpt_set_part_info(struct disk_partitions
 			*n = *p;
 			p->gp_flags &= ~GPEF_ON_DISK;
 			if (!gpt_insert_part_into_list(parts, >obsolete,
-			n, err_msg))
+			n, err_msg, NULL))
 return false;
 		} else if (info->size != p->gp_size) {
 			p->gp_flags |= GPEF_RESIZED;
@@ -1076,6 +1079,7 @@ gpt_add_part(struct disk_partitions *arg
 	struct disk_part_free_space space;
 	struct disk_part_info data = *info;
 	struct gpt_part_entry *p, *n;
+	part_id pno;
 	bool ok;
 
 	if (err_msg != NULL)
@@ -1107,7 +,8 @@ gpt_add_part(struct disk_partitions *arg
 		return NO_PART;
 	}
 	p->gp_flags |= GPEF_MODIFIED;
-	ok = gpt_insert_part_into_list(parts, >partitions, p, err_msg);
+	ok = gpt_insert_part_into_list(parts, >partitions, p,
+	err_msg, );
 	if (ok) {
 		if (info->flags & PTI_INSTALL_TARGET) {
 			/* update target mark - we can only have one */
@@ -1119,7 +1124,7 @@ gpt_add_part(struct disk_partitions *arg
 
 		parts->dp.num_part++;
 		parts->dp.free_space -= p->gp_size;
-		return parts->dp.num_part-1;
+		return pno;
 	} else {
 		free(p);
 		return NO_PART;
@@ -1157,7 +1162,7 @@ gpt_delete_partition(struct disk_partiti
 	res = true;
 	if (p->gp_flags & GPEF_ON_DISK) {
 		if (!gpt_insert_part_into_list(parts, >obsolete,
-		p, err_msg))
+		p, err_msg, NULL))
 			res = false;
 	} else {
 		free(p);



CVS commit: [netbsd-10] src/usr.sbin/sysinst

2024-03-24 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar 24 20:27:04 UTC 2024

Modified Files:
src/usr.sbin/sysinst [netbsd-10]: gpt.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #645):
usr.sbin/sysinst/gpt.c: revision 1.32
PR 58061: fix bug in the GPT backend: when inserting a partition
(i.e. not adding it at the end) a bogus ID was returned for the new
partition.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.2.1 src/usr.sbin/sysinst/gpt.c

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



CVS commit: [netbsd-10] src/usr.sbin/sysinst

2024-03-24 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar 24 20:26:14 UTC 2024

Modified Files:
src/usr.sbin/sysinst [netbsd-10]: configmenu.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #644):
usr.sbin/sysinst/configmenu.c: revision 1.19
PR 58062: fix a bug I introduced with the https support: update
the pkgsrc/binary pkgs download URL not only when https transport
is selected.


To generate a diff of this commit:
cvs rdiff -u -r1.17.2.1 -r1.17.2.2 src/usr.sbin/sysinst/configmenu.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/sysinst/configmenu.c
diff -u src/usr.sbin/sysinst/configmenu.c:1.17.2.1 src/usr.sbin/sysinst/configmenu.c:1.17.2.2
--- src/usr.sbin/sysinst/configmenu.c:1.17.2.1	Tue Dec 26 05:54:15 2023
+++ src/usr.sbin/sysinst/configmenu.c	Sun Mar 24 20:26:14 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: configmenu.c,v 1.17.2.1 2023/12/26 05:54:15 snj Exp $ */
+/* $NetBSD: configmenu.c,v 1.17.2.2 2024/03/24 20:26:14 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -340,12 +340,11 @@ set_binpkg(struct menudesc *menu, void *
 		 * Make sure we have the TLS certs in a usable state
 		 * (if target is a new installation)
 		 */
-		if (pkg.xfer == XFER_HTTPS) {
+		if (pkg.xfer == XFER_HTTPS)
 			run_program(RUN_CHROOT | RUN_SILENT,
 			"/bin/sh /etc/rc.d/certctl_init onestart");
-			make_url(pkgpath, , pkg_dir);
-		}
 
+		make_url(pkgpath, , pkg_dir);
 		if (run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_CHROOT,
 			"pkg_add %s/pkgin", pkgpath) == 0) {
 			allok = 1;



CVS commit: [netbsd-10] src/usr.sbin/sysinst

2024-03-24 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar 24 20:26:14 UTC 2024

Modified Files:
src/usr.sbin/sysinst [netbsd-10]: configmenu.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #644):
usr.sbin/sysinst/configmenu.c: revision 1.19
PR 58062: fix a bug I introduced with the https support: update
the pkgsrc/binary pkgs download URL not only when https transport
is selected.


To generate a diff of this commit:
cvs rdiff -u -r1.17.2.1 -r1.17.2.2 src/usr.sbin/sysinst/configmenu.c

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



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

2024-03-24 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar 24 20:24:29 UTC 2024

Modified Files:
src/distrib/notes/acorn32 [netbsd-10]: contents
src/distrib/notes/alpha [netbsd-10]: contents
src/distrib/notes/amd64 [netbsd-10]: contents
src/distrib/notes/amiga [netbsd-10]: contents
src/distrib/notes/arc [netbsd-10]: contents
src/distrib/notes/atari [netbsd-10]: contents
src/distrib/notes/bebox [netbsd-10]: contents
src/distrib/notes/cats [netbsd-10]: contents
src/distrib/notes/common [netbsd-10]: contents main sysinst
src/distrib/notes/emips [netbsd-10]: contents
src/distrib/notes/evbarm [netbsd-10]: contents
src/distrib/notes/evbppc [netbsd-10]: contents
src/distrib/notes/ews4800mips [netbsd-10]: contents
src/distrib/notes/hp300 [netbsd-10]: contents
src/distrib/notes/hpcarm [netbsd-10]: contents
src/distrib/notes/hpcmips [netbsd-10]: contents
src/distrib/notes/hpcsh [netbsd-10]: contents
src/distrib/notes/hppa [netbsd-10]: contents
src/distrib/notes/i386 [netbsd-10]: contents
src/distrib/notes/landisk [netbsd-10]: contents
src/distrib/notes/mac68k [netbsd-10]: contents
src/distrib/notes/macppc [netbsd-10]: contents
src/distrib/notes/mmeye [netbsd-10]: contents
src/distrib/notes/mvme68k [netbsd-10]: contents
src/distrib/notes/news68k [netbsd-10]: contents
src/distrib/notes/newsmips [netbsd-10]: contents
src/distrib/notes/next68k [netbsd-10]: contents
src/distrib/notes/ofppc [netbsd-10]: contents
src/distrib/notes/pmax [netbsd-10]: contents
src/distrib/notes/prep [netbsd-10]: contents
src/distrib/notes/rs6000 [netbsd-10]: contents
src/distrib/notes/sandpoint [netbsd-10]: contents
src/distrib/notes/sgimips [netbsd-10]: contents
src/distrib/notes/shark [netbsd-10]: contents
src/distrib/notes/sparc [netbsd-10]: contents
src/distrib/notes/sparc64 [netbsd-10]: contents
src/distrib/notes/sun2 [netbsd-10]: contents
src/distrib/notes/sun3 [netbsd-10]: contents
src/distrib/notes/vax [netbsd-10]: contents xfer
src/distrib/notes/x68k [netbsd-10]: contents

Log Message:
Pull up following revision(s) (requested by martin in ticket #643):
distrib/notes/prep/contents: revision 1.8
distrib/notes/hpcsh/contents: revision 1.9
distrib/notes/ews4800mips/contents: revision 1.8
distrib/notes/evbarm/contents: revision 1.16
distrib/notes/newsmips/contents: revision 1.8
distrib/notes/landisk/contents: revision 1.9
distrib/notes/arc/contents: revision 1.8
distrib/notes/sun2/contents: revision 1.8
distrib/notes/vax/contents: revision 1.17
distrib/notes/mac68k/contents: revision 1.26
distrib/notes/cats/contents: revision 1.8
distrib/notes/mvme68k/contents: revision 1.19
distrib/notes/rs6000/contents: revision 1.8
distrib/notes/i386/contents: revision 1.36
distrib/notes/alpha/contents: revision 1.26
distrib/notes/hpcmips/contents: revision 1.16
distrib/notes/sparc64/contents: revision 1.13
distrib/notes/hpcarm/contents: revision 1.9
distrib/notes/emips/contents: revision 1.8
distrib/notes/sun3/contents: revision 1.22
distrib/notes/common/main: revision 1.573
distrib/notes/x68k/contents: revision 1.23
distrib/notes/sgimips/contents: revision 1.8
distrib/notes/sandpoint/contents: revision 1.8
distrib/notes/mmeye/contents: revision 1.9
distrib/notes/common/main: revision 1.574
distrib/notes/pmax/contents: revision 1.23
distrib/notes/shark/contents: revision 1.8
distrib/notes/sparc/contents: revision 1.30
distrib/notes/vax/xfer: revision 1.16
distrib/notes/news68k/contents: revision 1.12
distrib/notes/common/sysinst: revision 1.113
distrib/notes/hp300/contents: revision 1.23
distrib/notes/next68k/contents: revision 1.13
distrib/notes/amiga/contents: revision 1.26
distrib/notes/hppa/contents: revision 1.8
distrib/notes/acorn32/contents: revision 1.8
distrib/notes/ofppc/contents: revision 1.9
distrib/notes/common/contents: revision 1.187
distrib/notes/macppc/contents: revision 1.20
distrib/notes/evbppc/contents: revision 1.10
distrib/notes/atari/contents: revision 1.26
distrib/notes/amd64/contents: revision 1.14
distrib/notes/bebox/contents: revision 1.8
Various style fixes (and some of VAX related errors and copy),
from Mouse on tech-install.
Use single-arg "Lk" macro for a link so we can get reasonable results
both in .more and .html output (still a bit odd, but better than before IMHO).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.6.1 

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

2024-03-24 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Mar 24 20:24:29 UTC 2024

Modified Files:
src/distrib/notes/acorn32 [netbsd-10]: contents
src/distrib/notes/alpha [netbsd-10]: contents
src/distrib/notes/amd64 [netbsd-10]: contents
src/distrib/notes/amiga [netbsd-10]: contents
src/distrib/notes/arc [netbsd-10]: contents
src/distrib/notes/atari [netbsd-10]: contents
src/distrib/notes/bebox [netbsd-10]: contents
src/distrib/notes/cats [netbsd-10]: contents
src/distrib/notes/common [netbsd-10]: contents main sysinst
src/distrib/notes/emips [netbsd-10]: contents
src/distrib/notes/evbarm [netbsd-10]: contents
src/distrib/notes/evbppc [netbsd-10]: contents
src/distrib/notes/ews4800mips [netbsd-10]: contents
src/distrib/notes/hp300 [netbsd-10]: contents
src/distrib/notes/hpcarm [netbsd-10]: contents
src/distrib/notes/hpcmips [netbsd-10]: contents
src/distrib/notes/hpcsh [netbsd-10]: contents
src/distrib/notes/hppa [netbsd-10]: contents
src/distrib/notes/i386 [netbsd-10]: contents
src/distrib/notes/landisk [netbsd-10]: contents
src/distrib/notes/mac68k [netbsd-10]: contents
src/distrib/notes/macppc [netbsd-10]: contents
src/distrib/notes/mmeye [netbsd-10]: contents
src/distrib/notes/mvme68k [netbsd-10]: contents
src/distrib/notes/news68k [netbsd-10]: contents
src/distrib/notes/newsmips [netbsd-10]: contents
src/distrib/notes/next68k [netbsd-10]: contents
src/distrib/notes/ofppc [netbsd-10]: contents
src/distrib/notes/pmax [netbsd-10]: contents
src/distrib/notes/prep [netbsd-10]: contents
src/distrib/notes/rs6000 [netbsd-10]: contents
src/distrib/notes/sandpoint [netbsd-10]: contents
src/distrib/notes/sgimips [netbsd-10]: contents
src/distrib/notes/shark [netbsd-10]: contents
src/distrib/notes/sparc [netbsd-10]: contents
src/distrib/notes/sparc64 [netbsd-10]: contents
src/distrib/notes/sun2 [netbsd-10]: contents
src/distrib/notes/sun3 [netbsd-10]: contents
src/distrib/notes/vax [netbsd-10]: contents xfer
src/distrib/notes/x68k [netbsd-10]: contents

Log Message:
Pull up following revision(s) (requested by martin in ticket #643):
distrib/notes/prep/contents: revision 1.8
distrib/notes/hpcsh/contents: revision 1.9
distrib/notes/ews4800mips/contents: revision 1.8
distrib/notes/evbarm/contents: revision 1.16
distrib/notes/newsmips/contents: revision 1.8
distrib/notes/landisk/contents: revision 1.9
distrib/notes/arc/contents: revision 1.8
distrib/notes/sun2/contents: revision 1.8
distrib/notes/vax/contents: revision 1.17
distrib/notes/mac68k/contents: revision 1.26
distrib/notes/cats/contents: revision 1.8
distrib/notes/mvme68k/contents: revision 1.19
distrib/notes/rs6000/contents: revision 1.8
distrib/notes/i386/contents: revision 1.36
distrib/notes/alpha/contents: revision 1.26
distrib/notes/hpcmips/contents: revision 1.16
distrib/notes/sparc64/contents: revision 1.13
distrib/notes/hpcarm/contents: revision 1.9
distrib/notes/emips/contents: revision 1.8
distrib/notes/sun3/contents: revision 1.22
distrib/notes/common/main: revision 1.573
distrib/notes/x68k/contents: revision 1.23
distrib/notes/sgimips/contents: revision 1.8
distrib/notes/sandpoint/contents: revision 1.8
distrib/notes/mmeye/contents: revision 1.9
distrib/notes/common/main: revision 1.574
distrib/notes/pmax/contents: revision 1.23
distrib/notes/shark/contents: revision 1.8
distrib/notes/sparc/contents: revision 1.30
distrib/notes/vax/xfer: revision 1.16
distrib/notes/news68k/contents: revision 1.12
distrib/notes/common/sysinst: revision 1.113
distrib/notes/hp300/contents: revision 1.23
distrib/notes/next68k/contents: revision 1.13
distrib/notes/amiga/contents: revision 1.26
distrib/notes/hppa/contents: revision 1.8
distrib/notes/acorn32/contents: revision 1.8
distrib/notes/ofppc/contents: revision 1.9
distrib/notes/common/contents: revision 1.187
distrib/notes/macppc/contents: revision 1.20
distrib/notes/evbppc/contents: revision 1.10
distrib/notes/atari/contents: revision 1.26
distrib/notes/amd64/contents: revision 1.14
distrib/notes/bebox/contents: revision 1.8
Various style fixes (and some of VAX related errors and copy),
from Mouse on tech-install.
Use single-arg "Lk" macro for a link so we can get reasonable results
both in .more and .html output (still a bit odd, but better than before IMHO).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.6.1 

CVS commit: [netbsd-10] src/doc

2024-03-09 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Mar  9 18:27:00 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Ticket 623


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.207 -r1.1.2.208 src/doc/CHANGES-10.0

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

Modified files:

Index: src/doc/CHANGES-10.0
diff -u src/doc/CHANGES-10.0:1.1.2.207 src/doc/CHANGES-10.0:1.1.2.208
--- src/doc/CHANGES-10.0:1.1.2.207	Tue Feb 27 05:27:39 2024
+++ src/doc/CHANGES-10.0	Sat Mar  9 18:26:59 2024
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.0,v 1.1.2.207 2024/02/27 05:27:39 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.208 2024/03/09 18:26:59 bouyer Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -21256,3 +21256,11 @@ sys/sys/param.h (manually edited)
 
 	Welcome to 10.0_RC5
 
+external/bsd/tcpdump/dist/print-ppp.c		patch
+
+	tcpdump(8): apply upstream fix for CVE-2020-8037:
+	the ppp decapsulator in tcpdump 4.9.3 can be convinced
+	to allocate a large amount of memory.
+	fixes PR 57586
+	[martin, ticket #623]
+



CVS commit: [netbsd-10] src/doc

2024-03-09 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Mar  9 18:27:00 UTC 2024

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Ticket 623


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.207 -r1.1.2.208 src/doc/CHANGES-10.0

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



CVS commit: [netbsd-10] src/external/bsd/tcpdump/dist

2024-03-09 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Mar  9 18:25:30 UTC 2024

Modified Files:
src/external/bsd/tcpdump/dist [netbsd-10]: print-ppp.c

Log Message:
Apply patch, requested by martin in ticket #623:
external/bsd/tcpdump/dist/print-ppp.c   patch

Apply upstream commit 32027e199368dad9508965aae8cd8de5b6ab5231
to fix CVE-2020-803:

   PPP: When un-escaping, don't allocate a too-large buffer.

   The buffer should be big enough to hold the captured data, but it
   doesn't need to be big enough to hold the entire on-the-network packet,
   if we haven't captured all of it.

fixes PR 57586


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.14.1 src/external/bsd/tcpdump/dist/print-ppp.c

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



CVS commit: [netbsd-10] src/external/bsd/tcpdump/dist

2024-03-09 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Mar  9 18:25:30 UTC 2024

Modified Files:
src/external/bsd/tcpdump/dist [netbsd-10]: print-ppp.c

Log Message:
Apply patch, requested by martin in ticket #623:
external/bsd/tcpdump/dist/print-ppp.c   patch

Apply upstream commit 32027e199368dad9508965aae8cd8de5b6ab5231
to fix CVE-2020-803:

   PPP: When un-escaping, don't allocate a too-large buffer.

   The buffer should be big enough to hold the captured data, but it
   doesn't need to be big enough to hold the entire on-the-network packet,
   if we haven't captured all of it.

fixes PR 57586


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.14.1 src/external/bsd/tcpdump/dist/print-ppp.c

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

Modified files:

Index: src/external/bsd/tcpdump/dist/print-ppp.c
diff -u src/external/bsd/tcpdump/dist/print-ppp.c:1.9 src/external/bsd/tcpdump/dist/print-ppp.c:1.9.14.1
--- src/external/bsd/tcpdump/dist/print-ppp.c:1.9	Fri Sep  8 14:01:13 2017
+++ src/external/bsd/tcpdump/dist/print-ppp.c	Sat Mar  9 18:25:30 2024
@@ -33,7 +33,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: print-ppp.c,v 1.9 2017/09/08 14:01:13 christos Exp $");
+__RCSID("$NetBSD: print-ppp.c,v 1.9.14.1 2024/03/09 18:25:30 bouyer Exp $");
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -1372,19 +1372,29 @@ trunc:
 	return 0;
 }
 
+/*
+ * Un-escape RFC 1662 PPP in HDLC-like framing, with octet escapes.
+ * The length argument is the on-the-wire length, not the captured
+ * length; we can only un-escape the captured part.
+ */
 static void
 ppp_hdlc(netdissect_options *ndo,
  const u_char *p, int length)
 {
+	u_int caplen = ndo->ndo_snapend - p;
 	u_char *b, *t, c;
 	const u_char *s;
-	int i, proto;
+	u_int i;
+	int proto;
 	const void *se;
 
+	if (caplen == 0)
+		return;
+
 if (length <= 0)
 return;
 
-	b = (u_char *)malloc(length);
+	b = (u_char *)malloc(caplen);
 	if (b == NULL)
 		return;
 
@@ -1393,10 +1403,10 @@ ppp_hdlc(netdissect_options *ndo,
 	 * Do this so that we dont overwrite the original packet
 	 * contents.
 	 */
-	for (s = p, t = b, i = length; i > 0 && ND_TTEST(*s); i--) {
+	for (s = p, t = b, i = caplen; i != 0; i--) {
 		c = *s++;
 		if (c == 0x7d) {
-			if (i <= 1 || !ND_TTEST(*s))
+			if (i <= 1)
 break;
 			i--;
 			c = *s++ ^ 0x20;



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

2023-12-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Dec 22 10:22:00 UTC 2023

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

Log Message:
sanity check the fragments we get from the guest and reject the whole packet
if it fails. Make sure we don't KASSERT() on data we get from the frontend.


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/xen/xen/xennetback_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.123 src/sys/arch/xen/xen/xennetback_xenbus.c:1.124
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.123	Wed Aug  9 08:38:57 2023
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Fri Dec 22 10:22:00 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.123 2023/08/09 08:38:57 riastradh Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.124 2023/12/22 10:22:00 bouyer Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.123 2023/08/09 08:38:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.124 2023/12/22 10:22:00 bouyer Exp $");
 
 #include 
 #include 
@@ -613,7 +613,7 @@ xennetback_tx_response(struct xnetback_i
 }
 
 static const char *
-xennetback_tx_check_packet(const netif_tx_request_t *txreq)
+xennetback_tx_check_packet(const netif_tx_request_t *txreq, bool first)
 {
 	if (__predict_false((txreq->flags & NETTXF_more_data) == 0 &&
 	txreq->offset + txreq->size > PAGE_SIZE))
@@ -622,6 +622,10 @@ xennetback_tx_check_packet(const netif_t
 	if (__predict_false(txreq->size > ETHER_MAX_LEN_JUMBO))
 		return "bigger then jumbo";
 
+	if (first &&
+	__predict_false(txreq->size < ETHER_HDR_LEN))
+		return "too short";
+
 	return NULL;
 }
 
@@ -786,7 +790,11 @@ xennetback_tx_m0len_fragment(struct xnet
 	*cntp = 1;
 	do {
 		txreq = RING_GET_REQUEST(>xni_txring, req_cons);
-		KASSERT(m0_len > txreq->size);
+		if (m0_len <= txreq->size || *cntp > XEN_NETIF_NR_SLOTS_MIN)
+			return -1;
+		if (RING_REQUEST_CONS_OVERFLOW(>xni_txring, req_cons))
+			return -1;
+			
 		m0_len -= txreq->size;
 		req_cons++;
 		(*cntp)++;
@@ -805,8 +813,9 @@ xennetback_evthandler(void *arg)
 	int receive_pending;
 	int queued = 0, m0_len = 0;
 	struct xnetback_xstate *xst;
-	const bool discard = ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) !=
+	const bool nupnrun = ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) !=
 	(IFF_UP | IFF_RUNNING));
+	bool discard = 0;
 
 	XENPRINTF(("xennetback_evthandler "));
 again:
@@ -824,9 +833,10 @@ again:
 		XENPRINTF(("%s pkt size %d\n", xneti->xni_if.if_xname,
 		txreq.size));
 		xneti->xni_txring.req_cons++;
-		if (__predict_false(discard)) {
+		if (__predict_false(nupnrun || discard)) {
 			/* interface not up, drop all requests */
 			if_statinc(ifp, if_iqdrops);
+			discard = (txreq.flags & NETTXF_more_data) != 0;
 			xennetback_tx_response(xneti, txreq.id,
 			NETIF_RSP_DROPPED);
 			continue;
@@ -835,10 +845,12 @@ again:
 		/*
 		 * Do some sanity checks, and queue copy of the data.
 		 */
-		const char *msg = xennetback_tx_check_packet();
+		const char *msg = xennetback_tx_check_packet(,
+		m0 == NULL);
 		if (__predict_false(msg != NULL)) {
 			printf("%s: packet with size %d is %s\n",
 			ifp->if_xname, txreq.size, msg);
+			discard = (txreq.flags & NETTXF_more_data) != 0;
 			xennetback_tx_response(xneti, txreq.id,
 			NETIF_RSP_ERROR);
 			if_statinc(ifp, if_ierrors);
@@ -856,6 +868,7 @@ mbuf_fail:
 			xennetback_tx_copy_abort(ifp, xneti, queued);
 			queued = 0;
 			m0 = NULL;
+			discard = (txreq.flags & NETTXF_more_data) != 0;
 			xennetback_tx_response(xneti, txreq.id,
 			NETIF_RSP_DROPPED);
 			if_statinc(ifp, if_ierrors);
@@ -873,6 +886,14 @@ mbuf_fail:
 			int cnt;
 			m0_len = xennetback_tx_m0len_fragment(xneti,
 			txreq.size, xneti->xni_txring.req_cons, );
+			if (m0_len < 0) {
+m_freem(m);
+discard = 1;
+xennetback_tx_response(xneti, txreq.id,
+NETIF_RSP_DROPPED);
+if_statinc(ifp, if_ierrors);
+continue;
+			}
 			m->m_len = m0_len;
 			KASSERT(cnt <= XEN_NETIF_NR_SLOTS_MIN);
 
@@ -881,7 +902,6 @@ mbuf_fail:
  * Flush queue if too full to fit this
  * new packet whole.
  */
-KASSERT(m0 == NULL);
 xennetback_tx_copy_process(ifp, xneti, queued);
 queued = 0;
 			}



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

2023-12-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Dec 22 10:22:00 UTC 2023

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

Log Message:
sanity check the fragments we get from the guest and reject the whole packet
if it fails. Make sure we don't KASSERT() on data we get from the frontend.


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/xen/xen/xennetback_xenbus.c

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



CVS import: src/external/nvidia-firmware/nouveau/dist

2023-11-28 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Nov 28 15:01:55 UTC 2023

Update of /cvsroot/src/external/nvidia-firmware/nouveau/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv792

Log Message:
Import nvidia firmware from linux-firmware repository at commit:
commit 2e92a49f90f73c8edc44b25c6e669d5e70893c90
Author: Gourav Samaiya 
Date:   Mon Apr 3 16:13:19 2023 +0530

nvidia: update Tu10x and Tu11x signed firmware to support newer Turing HW

Signed-off-by: Gourav Samaiya 
Tested-by: Karol Herbst 
Signed-off-by: Josh Boyer 

Difference from previous import:
Import nvidia firmware from linux-firmware repository at commit:
commit 2e92a49f90f73c8edc44b25c6e669d5e70893c90
Author: Gourav Samaiya 
Date:   Mon Apr 3 16:13:19 2023 +0530

nvidia: update Tu10x and Tu11x signed firmware to support newer Turing HW


commit 2c2be4215fe29870dcd9a059ff8778e73269ddc1
Author: Gourav Samaiya 
Date:   Wed Apr 6 14:44:32 2022 +0530

nvidia: add GA102/GA103/GA104/GA106/GA107 signed firmware

These NVIDIA-signed firmwares are required to enable the graphics engine
on Ampere GA10{2/3/4/6/7} Gpus.

Note that our drm2 driver won't use the GA10{2/3/4/6/7} firmware yet.
The updated Tu10x and Tu11x signed firmware are needed for at last the
nvidia T400 graphic card.

Status:

Vendor Tag: LINUX-FIRMWARE
Release Tags:   linux-firmware-2023-04-03-2e92a49f

N src/external/nvidia-firmware/nouveau/dist/ga102/acr/ucode_ahesasc.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/acr/ucode_asb.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/acr/ucode_unload.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/gr/NET_img.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/gr/fecs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/gr/fecs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/gr/gpccs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/gr/gpccs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/nvdec/scrubber.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/sec2/desc.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/sec2/hs_bl_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/sec2/image.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/sec2/sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga103/gr/NET_img.bin
N src/external/nvidia-firmware/nouveau/dist/ga103/gr/fecs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga103/gr/fecs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga103/gr/gpccs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga103/gr/gpccs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga104/gr/NET_img.bin
N src/external/nvidia-firmware/nouveau/dist/ga104/gr/fecs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga104/gr/fecs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga104/gr/gpccs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga104/gr/gpccs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga106/gr/NET_img.bin
N src/external/nvidia-firmware/nouveau/dist/ga106/gr/fecs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga106/gr/fecs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga106/gr/gpccs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga106/gr/gpccs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga107/gr/NET_img.bin
N src/external/nvidia-firmware/nouveau/dist/ga107/gr/fecs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga107/gr/fecs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga107/gr/gpccs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga107/gr/gpccs_sig.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/fecs_data.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/fecs_inst.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/gpccs_data.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/gpccs_inst.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/sw_bundle_init.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/sw_ctx.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/sw_method_init.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/sw_nonctx.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/acr/bl.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/acr/ucode_load.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/acr/ucode_unload.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/fecs_bl.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/fecs_data.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/fecs_inst.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/fecs_sig.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/gpccs_bl.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/gpccs_data.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/gpccs_inst.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/gpccs_sig.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/sw_bundle_init.bin
U 

CVS import: src/external/nvidia-firmware/nouveau/dist

2023-11-28 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Nov 28 15:01:55 UTC 2023

Update of /cvsroot/src/external/nvidia-firmware/nouveau/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv792

Log Message:
Import nvidia firmware from linux-firmware repository at commit:
commit 2e92a49f90f73c8edc44b25c6e669d5e70893c90
Author: Gourav Samaiya 
Date:   Mon Apr 3 16:13:19 2023 +0530

nvidia: update Tu10x and Tu11x signed firmware to support newer Turing HW

Signed-off-by: Gourav Samaiya 
Tested-by: Karol Herbst 
Signed-off-by: Josh Boyer 

Difference from previous import:
Import nvidia firmware from linux-firmware repository at commit:
commit 2e92a49f90f73c8edc44b25c6e669d5e70893c90
Author: Gourav Samaiya 
Date:   Mon Apr 3 16:13:19 2023 +0530

nvidia: update Tu10x and Tu11x signed firmware to support newer Turing HW


commit 2c2be4215fe29870dcd9a059ff8778e73269ddc1
Author: Gourav Samaiya 
Date:   Wed Apr 6 14:44:32 2022 +0530

nvidia: add GA102/GA103/GA104/GA106/GA107 signed firmware

These NVIDIA-signed firmwares are required to enable the graphics engine
on Ampere GA10{2/3/4/6/7} Gpus.

Note that our drm2 driver won't use the GA10{2/3/4/6/7} firmware yet.
The updated Tu10x and Tu11x signed firmware are needed for at last the
nvidia T400 graphic card.

Status:

Vendor Tag: LINUX-FIRMWARE
Release Tags:   linux-firmware-2023-04-03-2e92a49f

N src/external/nvidia-firmware/nouveau/dist/ga102/acr/ucode_ahesasc.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/acr/ucode_asb.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/acr/ucode_unload.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/gr/NET_img.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/gr/fecs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/gr/fecs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/gr/gpccs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/gr/gpccs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/nvdec/scrubber.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/sec2/desc.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/sec2/hs_bl_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/sec2/image.bin
N src/external/nvidia-firmware/nouveau/dist/ga102/sec2/sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga103/gr/NET_img.bin
N src/external/nvidia-firmware/nouveau/dist/ga103/gr/fecs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga103/gr/fecs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga103/gr/gpccs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga103/gr/gpccs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga104/gr/NET_img.bin
N src/external/nvidia-firmware/nouveau/dist/ga104/gr/fecs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga104/gr/fecs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga104/gr/gpccs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga104/gr/gpccs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga106/gr/NET_img.bin
N src/external/nvidia-firmware/nouveau/dist/ga106/gr/fecs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga106/gr/fecs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga106/gr/gpccs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga106/gr/gpccs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga107/gr/NET_img.bin
N src/external/nvidia-firmware/nouveau/dist/ga107/gr/fecs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga107/gr/fecs_sig.bin
N src/external/nvidia-firmware/nouveau/dist/ga107/gr/gpccs_bl.bin
N src/external/nvidia-firmware/nouveau/dist/ga107/gr/gpccs_sig.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/fecs_data.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/fecs_inst.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/gpccs_data.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/gpccs_inst.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/sw_bundle_init.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/sw_ctx.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/sw_method_init.bin
U src/external/nvidia-firmware/nouveau/dist/gk20a/sw_nonctx.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/acr/bl.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/acr/ucode_load.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/acr/ucode_unload.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/fecs_bl.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/fecs_data.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/fecs_inst.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/fecs_sig.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/gpccs_bl.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/gpccs_data.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/gpccs_inst.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/gpccs_sig.bin
U src/external/nvidia-firmware/nouveau/dist/gm200/gr/sw_bundle_init.bin
U 

CVS commit: [netbsd-10] src/doc

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:55:27 UTC 2023

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Tickets 460-471, 473, 474


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.159 -r1.1.2.160 src/doc/CHANGES-10.0

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

Modified files:

Index: src/doc/CHANGES-10.0
diff -u src/doc/CHANGES-10.0:1.1.2.159 src/doc/CHANGES-10.0:1.1.2.160
--- src/doc/CHANGES-10.0:1.1.2.159	Wed Nov  8 10:37:54 2023
+++ src/doc/CHANGES-10.0	Sun Nov 26 12:55:26 2023
@@ -1,5 +1,5 @@
 
-# $NetBSD: CHANGES-10.0,v 1.1.2.159 2023/11/08 10:37:54 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.160 2023/11/26 12:55:26 bouyer Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -14086,3 +14086,104 @@ sys/sys/param.h	(manually edited)
 doc/3RDPARTY	(manually edited)
 
 	Adjust libfido2 entry for ticket #345.
+
+sys/dev/pci/if_ena.c1.35-1.40
+sys/dev/pci/if_enavar.h1.9
+sys/external/bsd/ena-com/ena_com.c		1.2-1.4
+sys/external/bsd/ena-com/ena_com.h		1.2
+sys/external/bsd/ena-com/ena_plat.h		1.10
+
+	ena(4): MP-enable always, add RSS support, and reliability fixes.
+	[jdolecek, ticket #460]
+
+etc/MAKEDEV.tmpl1.234
+share/man/man4/gpioirq.4			1.4 via patch
+sys/conf/majors	1.103
+sys/dev/gpio/gpio.c1.73
+sys/dev/gpio/gpioirq.c1.2
+sys/dev/gpio/gpiovar.h1.19
+
+	gpioirq(4): allow multiple pins per gpioirq instance, add the ability
+	to use a /dev/gpioirqN device to get pin interrupts into userland.
+	[brad, ticket #461]
+
+sys/arch/newsmips/dev/dmac_0448.h		1.7
+sys/arch/newsmips/dev/scsi_1185.c		1.25
+
+	Use DELAY(9), not empty for() loop that could be optimized out.
+	[tsutsui, ticket #462]
+
+share/man/man4/gpiosim.4			1.7
+sys/dev/gpio/gpiosim.c1.25
+
+	Simple simulated interrupts for the simulated GPIO device gpiosim(4)
+	[brad, ticket #463]
+
+sys/dev/gpio/gpioirq.c1.3
+
+	Support async I/O against gpioirq(4): O_NONBLOCK reads, and
+	poll(2)/select(2)
+	[brad, ticket #464]
+
+xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c 1.5, 1.6
+
+	Revert r1.4.
+	The changes are minimal and they cause redraw problems (as reported by
+	Maxim Devaev on port-sparc).
+	[jdc, ticket #465]
+
+xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c 1.22
+xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.h 1.5
+xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c	1.9
+xsrc/external/mit/xf86-input-keyboard/dist/src/ws_KbdMap.c 1.1
+src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile 1.23
+
+	xf86-input-keyboard: add suppport to get keymap via
+	WSKBDIO_GETMAP ioctl(2).
+	[tsutsui, ticket #466]
+
+common/lib/libprop/prop_string.c		1.18
+
+	Fix PR lib/57699: Memory leak in libprop
+	[thorpej, ticket #467]
+
+sys/kern/sys_eventfd.c1.10
+
+	eventfd(2): Fix kernel crash on close after read or write is
+	interrupted by signal, PR kern/57703.
+	[riastradh, ticket #468]
+
+external/gpl3/binutils.old/dist/gas/config/tc-mips.c 1.8
+external/gpl3/binutils/dist/gas/config/tc-mips.c 1.25
+
+	binutils, binutils.old: fix gas that doesn't handle MIPS1 FPR load
+	hazard correctly.  Fixes PR/57680.
+	[tsutsui, ticket #469]
+
+sys/dev/pci/pciide_common.c			1.70
+
+	pciide_dma_dmamap_setup(): If we end up with a DMA segment with an odd
+	length or odd starting address, unload the map and return EINVAL, which
+	should  cause the upper layers in the ATA code to re-try the I/O using
+	PIO.  Fixes PR port-alpha/56434
+	[thorpej, ticket #470]
+
+usr.sbin/sysinst/label.c			1.50
+usr.sbin/sysinst/util.c1.74
+
+	Force alignment of disk buffers to at least 8 byte.
+	Fixes PR 56434.
+	[martin, ticket #471]
+
+crypto/external/bsd/libsaslc/lib/Makefile	1.11
+
+	move line to avoid deprecated declaration errors outside of the
+	kerberos block.
+	[kre, ticket #473]
+
+usr.sbin/sysinst/partman.c			1.57
+
+	PR 57698: avoid installer crashes in restricted (miniroot)
+	environments.
+	[martin, ticket #474]
+



CVS commit: [netbsd-10] src/doc

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:55:27 UTC 2023

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Tickets 460-471, 473, 474


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.159 -r1.1.2.160 src/doc/CHANGES-10.0

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



CVS commit: [netbsd-10] src/usr.sbin/sysinst

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:53:08 UTC 2023

Modified Files:
src/usr.sbin/sysinst [netbsd-10]: partman.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #474):
usr.sbin/sysinst/partman.c: revision 1.57
PR 57698: avoid a few potential sysinst crashes in environments where
not all binaries are available - e.g. w/o cgdconfig(8) the "cgds" pointer
would be NULL (as there can't be any) and we crashed when naively
dereferencing it.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.56.2.1 src/usr.sbin/sysinst/partman.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/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.56 src/usr.sbin/sysinst/partman.c:1.56.2.1
--- src/usr.sbin/sysinst/partman.c:1.56	Sun Jul 10 10:52:41 2022
+++ src/usr.sbin/sysinst/partman.c	Sun Nov 26 12:53:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: partman.c,v 1.56 2022/07/10 10:52:41 martin Exp $ */
+/*	$NetBSD: partman.c,v 1.56.2.1 2023/11/26 12:53:07 bouyer Exp $ */
 
 /*
  * Copyright 2012 Eugene Lozovoy
@@ -817,6 +817,8 @@ pm_raid_commit(void)
 	FILE *f;
 	char f_name[STRSIZE], devname[STRSIZE];
 
+	if (!have_raid)
+		return 0;
 	for (i = 0; i < MAX_RAID; i++) {
 		if (! pm_raid_check([i]))
 			continue;
@@ -1163,6 +1165,8 @@ pm_vnd_commit(void)
 	part_id id, part_suit = NO_PART;
 	struct disk_part_info info;
 
+	if (!have_vnd)
+		return 0;
 	for (i = 0; i < MAX_VND; i++) {
 		error = 0;
 		if (! pm_vnd_check([i]))
@@ -1454,6 +1458,8 @@ pm_cgd_commit(void)
 	char devname[STRSIZE];
 	int i, error = 0;
 
+	if (!have_cgd)
+		return 0;
 	for (i = 0; i < MAX_CGD; i++) {
 		if (! pm_cgd_check([i]))
 			continue;
@@ -1979,6 +1985,8 @@ pm_lvm_commit(void)
 	uint used_size = 0;
 	char params[STRSIZE*3], devs[STRSIZE*3], arg[STRSIZE];
 
+	if (!have_lvm)
+		return 0;
 	for (i = 0; i < MAX_LVM_VG; i++) {
 		/* Stage 0: checks */
 		if (! pm_lvm_check([i]))
@@ -2118,7 +2126,7 @@ pm_getrefdev(struct pm_devs *pm_cur)
 	char descr[MENUSTRSIZE], dev[MENUSTRSIZE] = "";
 
 	pm_cur->refdev = NULL;
-	if (! strncmp(pm_cur->diskdev, "cgd", 3)) {
+	if (have_cgd && strncmp(pm_cur->diskdev, "cgd", 3) == 0) {
 		dev_num = pm_cur->diskdev[3] - '0';
 		for (i = 0; i < MAX_CGD; i++)
 			if (cgds[i].blocked && cgds[i].node == dev_num) {
@@ -2130,7 +2138,7 @@ pm_getrefdev(struct pm_devs *pm_cur)
 sizeof(pm_cur->diskdev_descr));
 break;
 			}
- 	} else if (! strncmp(pm_cur->diskdev, "vnd", 3)) {
+ 	} else if (have_vnd && strncmp(pm_cur->diskdev, "vnd", 3) == 0) {
  		dev_num = pm_cur->diskdev[3] - '0';
  		for (i = 0; i < MAX_VND; i++)
 			if (vnds[i].blocked && vnds[i].node == dev_num) {
@@ -2145,7 +2153,7 @@ pm_getrefdev(struct pm_devs *pm_cur)
 sizeof(pm_cur->diskdev_descr));
 break;
 			}
-	} else if (! strncmp(pm_cur->diskdev, "raid", 4)) {
+	} else if (have_raid && strncmp(pm_cur->diskdev, "raid", 4) == 0) {
 		dev_num = pm_cur->diskdev[4] - '0';
  		for (i = 0; i < MAX_RAID; i++)
 			if (raids[i].blocked && raids[i].node == dev_num) {
@@ -2237,7 +2245,7 @@ pm_partusage(struct pm_devs *pm_cur, int
 	if (id >= pm_cur->parts->num_part)
 		return 0;
 
-	for (i = 0; i < MAX_CGD; i++)
+	for (i = 0; have_cgd && i < MAX_CGD; i++)
 		if (cgds[i].enabled &&
 			cgds[i].pm == pm_cur &&
 			cgds[i].pm_part == id) {
@@ -2247,7 +2255,7 @@ pm_partusage(struct pm_devs *pm_cur, int
 			}
 			return 1;
 		}
-	for (i = 0; i < MAX_RAID; i++)
+	for (i = 0; have_raid && i < MAX_RAID; i++)
 		for (ii = 0; ii < MAX_IN_RAID; ii++)
 			if (raids[i].enabled &&
 raids[i].comp[ii].parts == pm_cur->parts &&
@@ -2256,7 +2264,7 @@ pm_partusage(struct pm_devs *pm_cur, int
 		raids[i].comp[ii].parts = NULL;
 	return 1;
 			}
-	for (i = 0; i < MAX_LVM_VG; i++)
+	for (i = 0; have_lvm && i < MAX_LVM_VG; i++)
 		for (ii = 0; ii < MAX_LVM_PV; ii++)
 			if (lvms[i].enabled &&
 lvms[i].pv[ii].pm == pm_cur &&



CVS commit: [netbsd-10] src/usr.sbin/sysinst

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:53:08 UTC 2023

Modified Files:
src/usr.sbin/sysinst [netbsd-10]: partman.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #474):
usr.sbin/sysinst/partman.c: revision 1.57
PR 57698: avoid a few potential sysinst crashes in environments where
not all binaries are available - e.g. w/o cgdconfig(8) the "cgds" pointer
would be NULL (as there can't be any) and we crashed when naively
dereferencing it.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.56.2.1 src/usr.sbin/sysinst/partman.c

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



CVS commit: [netbsd-10] src/crypto/external/bsd/libsaslc/lib

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:51:24 UTC 2023

Modified Files:
src/crypto/external/bsd/libsaslc/lib [netbsd-10]: Makefile

Log Message:
Pull up following revision(s) (requested by kre in ticket #473):
crypto/external/bsd/libsaslc/lib/Makefile: revision 1.11
move line to avoid deprecated declaration errors outside of the kerberos b=
lock.


To generate a diff of this commit:
cvs rdiff -u -r1.9.14.1 -r1.9.14.2 \
src/crypto/external/bsd/libsaslc/lib/Makefile

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

Modified files:

Index: src/crypto/external/bsd/libsaslc/lib/Makefile
diff -u src/crypto/external/bsd/libsaslc/lib/Makefile:1.9.14.1 src/crypto/external/bsd/libsaslc/lib/Makefile:1.9.14.2
--- src/crypto/external/bsd/libsaslc/lib/Makefile:1.9.14.1	Fri Aug 11 13:40:10 2023
+++ src/crypto/external/bsd/libsaslc/lib/Makefile	Sun Nov 26 12:51:24 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9.14.1 2023/08/11 13:40:10 martin Exp $
+# $NetBSD: Makefile,v 1.9.14.2 2023/11/26 12:51:24 bouyer Exp $
 
 .include 
 
@@ -59,7 +59,8 @@ LIBDPLIBS+= ssl ${NETBSDSRCDIR}/crypto/e
 .if (${MKKERBEROS} != "no")
 LIBDPLIBS+= gssapi ${NETBSDSRCDIR}/crypto/external/bsd/heimdal/lib/libgssapi
 
-COPTS.crypto.c+=-Wno-error=deprecated-declarations
 .endif
 
+COPTS.crypto.c+=-Wno-error=deprecated-declarations
+
 .include 



CVS commit: [netbsd-10] src/crypto/external/bsd/libsaslc/lib

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:51:24 UTC 2023

Modified Files:
src/crypto/external/bsd/libsaslc/lib [netbsd-10]: Makefile

Log Message:
Pull up following revision(s) (requested by kre in ticket #473):
crypto/external/bsd/libsaslc/lib/Makefile: revision 1.11
move line to avoid deprecated declaration errors outside of the kerberos b=
lock.


To generate a diff of this commit:
cvs rdiff -u -r1.9.14.1 -r1.9.14.2 \
src/crypto/external/bsd/libsaslc/lib/Makefile

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



CVS commit: [netbsd-10] src/usr.sbin/sysinst

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:40:50 UTC 2023

Modified Files:
src/usr.sbin/sysinst [netbsd-10]: label.c util.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #471):
usr.sbin/sysinst/label.c: revision 1.50
usr.sbin/sysinst/util.c: revision 1.74
Force alignment of disk buffers to at least 8 byte.
Fixes PR 56434.


To generate a diff of this commit:
cvs rdiff -u -r1.46.2.1 -r1.46.2.2 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.71.2.1 -r1.71.2.2 src/usr.sbin/sysinst/util.c

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



CVS commit: [netbsd-10] src/usr.sbin/sysinst

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:40:50 UTC 2023

Modified Files:
src/usr.sbin/sysinst [netbsd-10]: label.c util.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #471):
usr.sbin/sysinst/label.c: revision 1.50
usr.sbin/sysinst/util.c: revision 1.74
Force alignment of disk buffers to at least 8 byte.
Fixes PR 56434.


To generate a diff of this commit:
cvs rdiff -u -r1.46.2.1 -r1.46.2.2 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.71.2.1 -r1.71.2.2 src/usr.sbin/sysinst/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.sbin/sysinst/label.c
diff -u src/usr.sbin/sysinst/label.c:1.46.2.1 src/usr.sbin/sysinst/label.c:1.46.2.2
--- src/usr.sbin/sysinst/label.c:1.46.2.1	Thu Nov  2 14:08:17 2023
+++ src/usr.sbin/sysinst/label.c	Sun Nov 26 12:40:50 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: label.c,v 1.46.2.1 2023/11/02 14:08:17 sborrill Exp $	*/
+/*	$NetBSD: label.c,v 1.46.2.2 2023/11/26 12:40:50 bouyer Exp $	*/
 
 /*
  * Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.46.2.1 2023/11/02 14:08:17 sborrill Exp $");
+__RCSID("$NetBSD: label.c,v 1.46.2.2 2023/11/26 12:40:50 bouyer Exp $");
 #endif
 
 #include 
@@ -1965,7 +1965,7 @@ const char *
 get_last_mounted(int fd, daddr_t partstart, uint *fs_type, uint *fs_sub_type,
 uint flags)
 {
-	static char sblk[SBLOCKSIZE];		/* is this enough? */
+	static char sblk[SBLOCKSIZE] __aligned(8);	/* is this enough? */
 	struct fs *SB = (struct fs *)sblk;
 	static const off_t sblocks[] = SBLOCKSEARCH;
 	const off_t *sbp;

Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.71.2.1 src/usr.sbin/sysinst/util.c:1.71.2.2
--- src/usr.sbin/sysinst/util.c:1.71.2.1	Sat Sep  9 14:50:15 2023
+++ src/usr.sbin/sysinst/util.c	Sun Nov 26 12:40:50 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.71.2.1 2023/09/09 14:50:15 martin Exp $	*/
+/*	$NetBSD: util.c,v 1.71.2.2 2023/11/26 12:40:50 bouyer Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -398,7 +398,7 @@ static int
 get_iso9660_volname(int dev, int sess, char *volname, size_t volnamelen)
 {
 	int blkno, error, last;
-	char buf[ISO_BLKSIZE];
+	static char buf[ISO_BLKSIZE] __aligned(8);
 	struct iso_volume_descriptor *vd = NULL;
 	struct iso_primary_descriptor *pd = NULL;
 



CVS commit: [netbsd-10] src/sys/dev/pci

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:38:56 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-10]: pciide_common.c

Log Message:
Pull up following revision(s) (requested by thorpej in ticket #470):
sys/dev/pci/pciide_common.c: revision 1.70
pciide_dma_dmamap_setup(): If we end up with a DMA segment with an odd
length or odd starting address, unload the map and return EINVAL.  Some
controllers get really upset if a DMA segment has an odd address or length.
This can happen if a physio user performs a virtually-contiguous I/O that
starts at an odd address and spans a page boundary where the resulting
physical pages are discontiguous.  The EINVAL return will cause the upper
layers in the ATA code to re-try the I/O using PIO, which should (will
in all of my tests) succeed.
PR port-alpha/56434


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.67.20.1 src/sys/dev/pci/pciide_common.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/pciide_common.c
diff -u src/sys/dev/pci/pciide_common.c:1.67 src/sys/dev/pci/pciide_common.c:1.67.20.1
--- src/sys/dev/pci/pciide_common.c:1.67	Mon Aug 24 05:37:41 2020
+++ src/sys/dev/pci/pciide_common.c	Sun Nov 26 12:38:56 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pciide_common.c,v 1.67 2020/08/24 05:37:41 msaitoh Exp $	*/
+/*	$NetBSD: pciide_common.c,v 1.67.20.1 2023/11/26 12:38:56 bouyer Exp $	*/
 
 
 /*
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pciide_common.c,v 1.67 2020/08/24 05:37:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciide_common.c,v 1.67.20.1 2023/11/26 12:38:56 bouyer Exp $");
 
 #include 
 
@@ -721,25 +721,51 @@ pciide_dma_dmamap_setup(struct pciide_so
 	BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
 
 	for (seg = 0; seg < dma_maps->dmamap_xfer->dm_nsegs; seg++) {
+		bus_addr_t phys = dma_maps->dmamap_xfer->dm_segs[seg].ds_addr;
+		bus_size_t len = dma_maps->dmamap_xfer->dm_segs[seg].ds_len;
+
 #ifdef DIAGNOSTIC
 		/* A segment must not cross a 64k boundary */
 		{
-		u_long phys = dma_maps->dmamap_xfer->dm_segs[seg].ds_addr;
-		u_long len = dma_maps->dmamap_xfer->dm_segs[seg].ds_len;
 		if ((phys & ~IDEDMA_BYTE_COUNT_MASK) !=
 		((phys + len - 1) & ~IDEDMA_BYTE_COUNT_MASK)) {
-			printf("pciide_dma: segment %d physical addr 0x%lx"
-			" len 0x%lx not properly aligned\n",
-			seg, phys, len);
+			printf("pciide_dma: seg %d addr 0x%" PRIx64
+			" len 0x%" PRIx64 " not properly aligned\n",
+			seg, (uint64_t)phys, (uint64_t)len);
 			panic("pciide_dma: buf align");
 		}
 		}
 #endif
-		dma_maps->dma_table[seg].base_addr =
-		htole32(dma_maps->dmamap_xfer->dm_segs[seg].ds_addr);
+		/*
+		 * Some controllers get really upset if the length
+		 * of any DMA segment is odd.  This isn't something
+		 * that's going to happen in normal steady-state
+		 * operation (reading VM pages, etc.), but physio users
+		 * don't have as many guard rails.
+		 *
+		 * Consider an 8K read request that starts at an odd
+		 * offset within a page.  At first blush, all of the
+		 * checks pass because it's a sector-rounded size, but
+		 * unless the buffer spans 2 physically contiguous pages,
+		 * it's going to result in 2 odd-length DMA segments.
+		 *
+		 * Odd start addresses are also frowned upon, so we
+		 * catch those here, too.
+		 *
+		 * Returning EINVAL here will cause the upper layers to
+		 * fall back onto PIO.
+		 */
+		if ((phys & 1) != 0 || (len & 1) != 0) {
+			aprint_verbose_dev(sc->sc_wdcdev.sc_atac.atac_dev,
+			"Invalid DMA segment: "
+			"seg %d addr 0x%" PRIx64 " len 0x%" PRIx64 "\n",
+			seg, (uint64_t)phys, (uint64_t)len);
+			bus_dmamap_unload(sc->sc_dmat, dma_maps->dmamap_xfer);
+			return EINVAL;
+		}
+		dma_maps->dma_table[seg].base_addr = htole32(phys);
 		dma_maps->dma_table[seg].byte_count =
-		htole32(dma_maps->dmamap_xfer->dm_segs[seg].ds_len &
-		IDEDMA_BYTE_COUNT_MASK);
+		htole32(len & IDEDMA_BYTE_COUNT_MASK);
 		ATADEBUG_PRINT(("\t seg %d len %d addr 0x%x\n",
 		   seg, le32toh(dma_maps->dma_table[seg].byte_count),
 		   le32toh(dma_maps->dma_table[seg].base_addr)), DEBUG_DMA);



CVS commit: [netbsd-10] src/sys/dev/pci

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:38:56 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-10]: pciide_common.c

Log Message:
Pull up following revision(s) (requested by thorpej in ticket #470):
sys/dev/pci/pciide_common.c: revision 1.70
pciide_dma_dmamap_setup(): If we end up with a DMA segment with an odd
length or odd starting address, unload the map and return EINVAL.  Some
controllers get really upset if a DMA segment has an odd address or length.
This can happen if a physio user performs a virtually-contiguous I/O that
starts at an odd address and spans a page boundary where the resulting
physical pages are discontiguous.  The EINVAL return will cause the upper
layers in the ATA code to re-try the I/O using PIO, which should (will
in all of my tests) succeed.
PR port-alpha/56434


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.67.20.1 src/sys/dev/pci/pciide_common.c

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



CVS commit: [netbsd-10] src/external/gpl3

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:35:26 UTC 2023

Modified Files:
src/external/gpl3/binutils.old/dist/gas/config [netbsd-10]: tc-mips.c
src/external/gpl3/binutils/dist/gas/config [netbsd-10]: tc-mips.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #469):
external/gpl3/binutils/dist/gas/config/tc-mips.c: revision 1.25
external/gpl3/binutils.old/dist/gas/config/tc-mips.c: revision 1.8
binutils: fix gas that doesn't handle MIPS1 FPR load hazard correctly.
Fixes PR/57680.
Should be pulled up to netbsd-10, netbsd-9, and netbsd-8.
binutils.old: apply the same fix for mips gas from binutils.
binutils: fix gas that doesn't handle MIPS1 FPR load hazard correctly.
Fixes PR/57680.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.6.1 \
src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c
cvs rdiff -u -r1.22 -r1.22.6.1 \
src/external/gpl3/binutils/dist/gas/config/tc-mips.c

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

Modified files:

Index: src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c
diff -u src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c:1.6 src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c:1.6.6.1
--- src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c:1.6	Fri Apr  3 17:51:09 2020
+++ src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c	Sun Nov 26 12:35:26 2023
@@ -6440,8 +6440,8 @@ insns_between (const struct mips_cl_insn
   /* Itbl support may require additional care here. FIXME!
 	 Need to modify this to include knowledge about
 	 user specified delays!  */
-  else if ((!cop_interlocks && (pinfo1 & INSN_COPROC_MOVE))
-	   || (!cop_mem_interlocks && (pinfo1 & INSN_COPROC_MEMORY_DELAY)))
+  if ((!cop_interlocks && (pinfo1 & INSN_COPROC_MOVE))
+	 || (!cop_mem_interlocks && (pinfo1 & INSN_COPROC_MEMORY_DELAY)))
 	{
 	  /* Handle cases where INSN1 writes to a known general coprocessor
 	 register.  There must be a one instruction delay before INSN2

Index: src/external/gpl3/binutils/dist/gas/config/tc-mips.c
diff -u src/external/gpl3/binutils/dist/gas/config/tc-mips.c:1.22 src/external/gpl3/binutils/dist/gas/config/tc-mips.c:1.22.6.1
--- src/external/gpl3/binutils/dist/gas/config/tc-mips.c:1.22	Fri Apr  3 23:48:47 2020
+++ src/external/gpl3/binutils/dist/gas/config/tc-mips.c	Sun Nov 26 12:35:26 2023
@@ -6529,8 +6529,8 @@ insns_between (const struct mips_cl_insn
   /* Itbl support may require additional care here. FIXME!
 	 Need to modify this to include knowledge about
 	 user specified delays!  */
-  else if ((!cop_interlocks && (pinfo1 & INSN_COPROC_MOVE))
-	   || (!cop_mem_interlocks && (pinfo1 & INSN_COPROC_MEMORY_DELAY)))
+  if ((!cop_interlocks && (pinfo1 & INSN_COPROC_MOVE))
+	 || (!cop_mem_interlocks && (pinfo1 & INSN_COPROC_MEMORY_DELAY)))
 	{
 	  /* Handle cases where INSN1 writes to a known general coprocessor
 	 register.  There must be a one instruction delay before INSN2



CVS commit: [netbsd-10] src/external/gpl3

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:35:26 UTC 2023

Modified Files:
src/external/gpl3/binutils.old/dist/gas/config [netbsd-10]: tc-mips.c
src/external/gpl3/binutils/dist/gas/config [netbsd-10]: tc-mips.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #469):
external/gpl3/binutils/dist/gas/config/tc-mips.c: revision 1.25
external/gpl3/binutils.old/dist/gas/config/tc-mips.c: revision 1.8
binutils: fix gas that doesn't handle MIPS1 FPR load hazard correctly.
Fixes PR/57680.
Should be pulled up to netbsd-10, netbsd-9, and netbsd-8.
binutils.old: apply the same fix for mips gas from binutils.
binutils: fix gas that doesn't handle MIPS1 FPR load hazard correctly.
Fixes PR/57680.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.6.1 \
src/external/gpl3/binutils.old/dist/gas/config/tc-mips.c
cvs rdiff -u -r1.22 -r1.22.6.1 \
src/external/gpl3/binutils/dist/gas/config/tc-mips.c

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



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

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:33:19 UTC 2023

Modified Files:
src/sys/kern [netbsd-10]: sys_eventfd.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #468):
sys/kern/sys_eventfd.c: revision 1.10
eventfd(2): Omit needless micro-optimization causing PR kern/57703.
Unfortunately, owing to PR kern/57705 and PR misc/57706, it isn't
convenient to flip the xfail switch on a test for this bug.  So we'll
do that separately.  (But I did verify that a rumpified version of
the test postd to PR kern/57703 failed without this change, and
passed with this change.)
PR kern/57703
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/kern/sys_eventfd.c

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



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

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:33:19 UTC 2023

Modified Files:
src/sys/kern [netbsd-10]: sys_eventfd.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #468):
sys/kern/sys_eventfd.c: revision 1.10
eventfd(2): Omit needless micro-optimization causing PR kern/57703.
Unfortunately, owing to PR kern/57705 and PR misc/57706, it isn't
convenient to flip the xfail switch on a test for this bug.  So we'll
do that separately.  (But I did verify that a rumpified version of
the test postd to PR kern/57703 failed without this change, and
passed with this change.)
PR kern/57703
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/kern/sys_eventfd.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/sys_eventfd.c
diff -u src/sys/kern/sys_eventfd.c:1.9 src/sys/kern/sys_eventfd.c:1.9.4.1
--- src/sys/kern/sys_eventfd.c:1.9	Thu Feb 17 16:28:29 2022
+++ src/sys/kern/sys_eventfd.c	Sun Nov 26 12:33:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_eventfd.c,v 1.9 2022/02/17 16:28:29 thorpej Exp $	*/
+/*	$NetBSD: sys_eventfd.c,v 1.9.4.1 2023/11/26 12:33:19 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_eventfd.c,v 1.9 2022/02/17 16:28:29 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_eventfd.c,v 1.9.4.1 2023/11/26 12:33:19 bouyer Exp $");
 
 /*
  * eventfd
@@ -69,8 +69,6 @@ struct eventfd {
 	eventfd_t	efd_val;
 	int64_t		efd_nwaiters;
 	bool		efd_restarting;
-	bool		efd_has_read_waiters;
-	bool		efd_has_write_waiters;
 	bool		efd_is_semaphore;
 
 	/*
@@ -117,8 +115,6 @@ eventfd_destroy(struct eventfd * const e
 {
 
 	KASSERT(efd->efd_nwaiters == 0);
-	KASSERT(efd->efd_has_read_waiters == false);
-	KASSERT(efd->efd_has_write_waiters == false);
 
 	cv_destroy(>efd_read_wait);
 	cv_destroy(>efd_write_wait);
@@ -155,10 +151,8 @@ eventfd_wait(struct eventfd * const efd,
 	}
 
 	if (is_write) {
-		efd->efd_has_write_waiters = true;
 		waitcv = >efd_write_wait;
 	} else {
-		efd->efd_has_read_waiters = true;
 		waitcv = >efd_read_wait;
 	}
 
@@ -194,17 +188,11 @@ eventfd_wake(struct eventfd * const efd,
 	int pollev;
 
 	if (is_write) {
-		if (efd->efd_has_read_waiters) {
-			waitcv = >efd_read_wait;
-			efd->efd_has_read_waiters = false;
-		}
+		waitcv = >efd_read_wait;
 		sel = >efd_read_sel;
 		pollev = POLLIN | POLLRDNORM;
 	} else {
-		if (efd->efd_has_write_waiters) {
-			waitcv = >efd_write_wait;
-			efd->efd_has_write_waiters = false;
-		}
+		waitcv = >efd_write_wait;
 		sel = >efd_write_sel;
 		pollev = POLLOUT | POLLWRNORM;
 	}
@@ -537,14 +525,8 @@ eventfd_fop_restart(file_t * const fp)
 
 	if (efd->efd_nwaiters != 0) {
 		efd->efd_restarting = true;
-		if (efd->efd_has_read_waiters) {
-			cv_broadcast(>efd_read_wait);
-			efd->efd_has_read_waiters = false;
-		}
-		if (efd->efd_has_write_waiters) {
-			cv_broadcast(>efd_write_wait);
-			efd->efd_has_write_waiters = false;
-		}
+		cv_broadcast(>efd_read_wait);
+		cv_broadcast(>efd_write_wait);
 	}
 
 	mutex_exit(>efd_lock);



CVS commit: [netbsd-10] src/common/lib/libprop

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:29:49 UTC 2023

Modified Files:
src/common/lib/libprop [netbsd-10]: prop_string.c

Log Message:
Pull up following revision(s) (requested by thorpej in ticket #467):
common/lib/libprop/prop_string.c: revision 1.18
In _prop_string_instantiate(), when we de-dup a non-MUTABLE string, make
sure we free the provided string buffer if NOCOPY is not set.  Fixes
a memory leak reported by M. Boerschig.
While we're at it, also change _prop_string_instantiate() to free the
provided string buffer in the not-NOCOPY case when string object allocation
fails (this was previously handled by _prop_string_instantiate()'s
callers).
PR lib/57699


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.2.1 src/common/lib/libprop/prop_string.c

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

Modified files:

Index: src/common/lib/libprop/prop_string.c
diff -u src/common/lib/libprop/prop_string.c:1.17 src/common/lib/libprop/prop_string.c:1.17.2.1
--- src/common/lib/libprop/prop_string.c:1.17	Wed Aug  3 21:13:46 2022
+++ src/common/lib/libprop/prop_string.c	Sun Nov 26 12:29:49 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: prop_string.c,v 1.17 2022/08/03 21:13:46 riastradh Exp $	*/
+/*	$NetBSD: prop_string.c,v 1.17.2.1 2023/11/26 12:29:49 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2020 The NetBSD Foundation, Inc.
@@ -247,12 +247,18 @@ _prop_string_instantiate(int const flags
  */
 prop_object_retain(ops);
 _PROP_MUTEX_UNLOCK(_prop_string_tree_mutex);
+if ((flags & PS_F_NOCOPY) == 0) {
+	_PROP_FREE(ps->ps_mutable,
+	M_PROP_STRING);
+}
 _PROP_POOL_PUT(_prop_string_pool, ps);
 ps = ops;
 			} else {
 _PROP_MUTEX_UNLOCK(_prop_string_tree_mutex);
 			}
 		}
+	} else if ((flags & PS_F_NOCOPY) == 0) {
+		_PROP_FREE(__UNCONST(str), M_PROP_STRING);
 	}
 
 	return (ps);
@@ -311,7 +317,6 @@ prop_string_create_cstring_nocopy(const 
 prop_string_t __printflike(1, 2)
 prop_string_create_format(const char *fmt, ...)
 {
-	prop_string_t ps;
 	char *str = NULL;
 	int len;
 	size_t nlen;
@@ -335,11 +340,7 @@ prop_string_create_format(const char *fm
 	vsnprintf(str, nlen, fmt, ap);
 	va_end(ap);
 
-	ps = _prop_string_instantiate(0, str, (size_t)len);
-	if (ps == NULL)
-		_PROP_FREE(str, M_PROP_STRING);
-
-	return (ps);
+	return _prop_string_instantiate(0, str, (size_t)len);
 }
 
 /*
@@ -374,7 +375,6 @@ prop_string_create_nocopy(const char *st
 prop_string_t
 prop_string_copy(prop_string_t ops)
 {
-	prop_string_t ps;
 	char *cp;
 
 	if (! prop_object_is_string(ops))
@@ -391,11 +391,7 @@ prop_string_copy(prop_string_t ops)
 
 	strcpy(cp, prop_string_contents(ops));
 
-	ps = _prop_string_instantiate(PS_F_MUTABLE, cp, ops->ps_size);
-	if (ps == NULL)
-		_PROP_FREE(cp, M_PROP_STRING);
-
-	return (ps);
+	return _prop_string_instantiate(PS_F_MUTABLE, cp, ops->ps_size);
 }
 
 _PROP_DEPRECATED(prop_string_copy_mutable,
@@ -404,7 +400,6 @@ _PROP_DEPRECATED(prop_string_copy_mutabl
 prop_string_t
 prop_string_copy_mutable(prop_string_t ops)
 {
-	prop_string_t ps;
 	char *cp;
 
 	if (! prop_object_is_string(ops))
@@ -416,11 +411,7 @@ prop_string_copy_mutable(prop_string_t o
 
 	strcpy(cp, prop_string_contents(ops));
 
-	ps = _prop_string_instantiate(PS_F_MUTABLE, cp, ops->ps_size);
-	if (ps == NULL)
-		_PROP_FREE(cp, M_PROP_STRING);
-
-	return (ps);
+	return _prop_string_instantiate(PS_F_MUTABLE, cp, ops->ps_size);
 }
 
 /*
@@ -655,7 +646,6 @@ bool
 _prop_string_internalize(prop_stack_t stack, prop_object_t *obj,
 struct _prop_object_internalize_context *ctx)
 {
-	prop_string_t string;
 	char *str;
 	size_t len, alen;
 
@@ -691,10 +681,6 @@ _prop_string_internalize(prop_stack_t st
 		return (true);
 	}
 
-	string = _prop_string_instantiate(0, str, len);
-	if (string == NULL)
-		_PROP_FREE(str, M_PROP_STRING);
-
-	*obj = string;
+	*obj = _prop_string_instantiate(0, str, len);
 	return (true);
 }



CVS commit: [netbsd-10] src/common/lib/libprop

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:29:49 UTC 2023

Modified Files:
src/common/lib/libprop [netbsd-10]: prop_string.c

Log Message:
Pull up following revision(s) (requested by thorpej in ticket #467):
common/lib/libprop/prop_string.c: revision 1.18
In _prop_string_instantiate(), when we de-dup a non-MUTABLE string, make
sure we free the provided string buffer if NOCOPY is not set.  Fixes
a memory leak reported by M. Boerschig.
While we're at it, also change _prop_string_instantiate() to free the
provided string buffer in the not-NOCOPY case when string object allocation
fails (this was previously handled by _prop_string_instantiate()'s
callers).
PR lib/57699


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.2.1 src/common/lib/libprop/prop_string.c

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



CVS commit: [netbsd-10]

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:26:23 UTC 2023

Modified Files:
src/external/mit/xorg/server/drivers/xf86-input-keyboard [netbsd-10]:
Makefile
xsrc/external/mit/xf86-input-keyboard/dist/src [netbsd-10]: bsd_kbd.c
bsd_kbd.h kbd.c
Added Files:
xsrc/external/mit/xf86-input-keyboard/dist/src [netbsd-10]: ws_KbdMap.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #466):
xsrc/external/mit/xf86-input-keyboard/dist/src/ws_KbdMap.c: revision 1.1
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.h: revision 1.5
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c: revision 1.22
xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c: revision 1.9
src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile: 
revision 1.23
xf86-input-keyboard: add suppport to get keymap via WSKBDIO_GETMAP ioctl(2).
No particular comment on tech-x11@:
 https://mail-index.netbsd.org/tech-x11/2023/10/31/msg002415.html
 https://mail-index.netbsd.org/tech-x11/2023/11/04/msg002416.html
Tested on NWS-3260 and NWS-3470 with Xorg 1.10 server in netbsd-9.
Worth to pullup to netbsd-10 and netbsd-9.
xf86-input-keyboard: add build glue to enable USE_WSKBD_GETMAP.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.2.1 \
src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile
cvs rdiff -u -r1.21 -r1.21.6.1 \
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c
cvs rdiff -u -r1.4 -r1.4.14.1 \
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.h
cvs rdiff -u -r1.8 -r1.8.2.1 \
xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c
cvs rdiff -u -r0 -r1.1.2.2 \
xsrc/external/mit/xf86-input-keyboard/dist/src/ws_KbdMap.c

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

Modified files:

Index: src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile
diff -u src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile:1.22 src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile:1.22.2.1
--- src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile:1.22	Wed Dec 15 15:27:30 2021
+++ src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile	Sun Nov 26 12:26:23 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.22 2021/12/15 15:27:30 christos Exp $
+#	$NetBSD: Makefile,v 1.22.2.1 2023/11/26 12:26:23 bouyer Exp $
 
 DRIVER=		xf86-input-keyboard
 DRIVER_NAME=	kbd_drv
@@ -16,7 +16,9 @@ CPPFLAGS+=	-DPCVT_SUPPORT
 .if ${MACHINE_ARCH} == "powerpc" || \
 ${MACHINE} == "amiga" || \
 ${MACHINE} == "evbarm" || \
+${MACHINE} == "ews4800mips" || \
 ${MACHINE} == "mac68k" || \
+${MACHINE} == "newsmips" || \
 ${MACHINE} == "pmax" || \
 ${MACHINE} == "sgimips" || \
 ${MACHINE} == "shark" || \
@@ -30,6 +32,14 @@ CPPFLAGS+=	-DWSCONS_SUPPORT
 CPPFLAGS+=	-DXKB
 CPPFLAGS.kbd.c=	-D__XKBDEFRULES__=${__XKBDEFRULES__}
 
+.if \
+${MACHINE} == "ews4800mips"	|| \
+${MACHINE} == "newsmips"	|| \
+0
+CPPFLAGS+=	-DUSE_WSKBD_GETMAP
+SRCS+=		ws_KbdMap.c
+.endif
+
 X11EXTRAMANDEFS+=	-e 's,__xkb_path__,${X11LIBDIR}/xkb,g'
 
 COPTS.kbd.c=		-Wno-error	# XXX deprecated

Index: xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c
diff -u xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c:1.21 xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c:1.21.6.1
--- xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c:1.21	Thu Nov 12 12:03:58 2015
+++ xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c	Sun Nov 26 12:26:22 2023
@@ -445,12 +445,14 @@ OpenKeyboard(InputInfoPtr pInfo)
case WSKBD_TYPE_PC_AT:
printWsType("AT", pInfo->name);
break;
+#ifndef USE_WSKBD_GETMAP
case 0:
/* If wsKbdType==0, no keyboard attached to the mux. Assume USB. */
xf86Msg(X_WARNING, "%s: No keyboard attached, assuming USB\n",
   pInfo->name);
pKbd->wsKbdType = WSKBD_TYPE_USB;
/* FALLTHROUGH */
+#endif
case WSKBD_TYPE_USB:
printWsType("USB", pInfo->name);
break;
@@ -484,6 +486,9 @@ OpenKeyboard(InputInfoPtr pInfo)
printWsType("Sun5", pInfo->name);
break;
 #endif
+#ifdef USE_WSKBD_GETMAP
+   case 0:
+#endif
default:
xf86Msg(X_WARNING, "%s: Unsupported wskbd type \"%d\"\n",
   pInfo->name, pKbd->wsKbdType);
@@ -506,7 +511,11 @@ xf86OSKbdPreInit(InputInfoPtr pInfo)
 pKbd->Bell		= SoundBell;
 pKbd->SetLeds	= SetKbdLeds;
 pKbd->GetLeds	= GetKbdLeds;
+#ifdef USE_WSKBD_GETMAP
+pKbd->KbdGetMapping	= KbdGetMappingFromWsksym;
+#else
 pKbd->KbdGetMapping	= KbdGetMapping;
+#endif
 
 pKbd->RemapScanCode = NULL;
 

Index: 

CVS commit: [netbsd-10]

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:26:23 UTC 2023

Modified Files:
src/external/mit/xorg/server/drivers/xf86-input-keyboard [netbsd-10]:
Makefile
xsrc/external/mit/xf86-input-keyboard/dist/src [netbsd-10]: bsd_kbd.c
bsd_kbd.h kbd.c
Added Files:
xsrc/external/mit/xf86-input-keyboard/dist/src [netbsd-10]: ws_KbdMap.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #466):
xsrc/external/mit/xf86-input-keyboard/dist/src/ws_KbdMap.c: revision 1.1
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.h: revision 1.5
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c: revision 1.22
xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c: revision 1.9
src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile: 
revision 1.23
xf86-input-keyboard: add suppport to get keymap via WSKBDIO_GETMAP ioctl(2).
No particular comment on tech-x11@:
 https://mail-index.netbsd.org/tech-x11/2023/10/31/msg002415.html
 https://mail-index.netbsd.org/tech-x11/2023/11/04/msg002416.html
Tested on NWS-3260 and NWS-3470 with Xorg 1.10 server in netbsd-9.
Worth to pullup to netbsd-10 and netbsd-9.
xf86-input-keyboard: add build glue to enable USE_WSKBD_GETMAP.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.2.1 \
src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile
cvs rdiff -u -r1.21 -r1.21.6.1 \
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.c
cvs rdiff -u -r1.4 -r1.4.14.1 \
xsrc/external/mit/xf86-input-keyboard/dist/src/bsd_kbd.h
cvs rdiff -u -r1.8 -r1.8.2.1 \
xsrc/external/mit/xf86-input-keyboard/dist/src/kbd.c
cvs rdiff -u -r0 -r1.1.2.2 \
xsrc/external/mit/xf86-input-keyboard/dist/src/ws_KbdMap.c

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



CVS commit: [netbsd-10] xsrc/external/mit/xf86-video-pnozz/dist/src

2023-11-26 Thread Manuel Bouyer
Module Name:xsrc
Committed By:   bouyer
Date:   Sun Nov 26 12:19:22 UTC 2023

Modified Files:
xsrc/external/mit/xf86-video-pnozz/dist/src [netbsd-10]: pnozz_exa.c

Log Message:
Pull up following revision(s) (requested by jdc in ticket #465):
external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c: revision 1.5
external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c: revision 1.6
Revert r1.4.
The changes are minimal and they cause redraw problems (as reported by
Maxim Devaev on port-sparc).
Add NetBSD keyword.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.2.1 \
xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c
diff -u xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c:1.4 xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c:1.4.2.1
--- xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c:1.4	Wed Jun  9 07:25:57 2021
+++ xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c	Sun Nov 26 12:19:22 2023
@@ -1,6 +1,7 @@
 /*
  * SBus Weitek P9100 EXA support
- *
+ */
+/*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
@@ -28,6 +29,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+/* $NetBSD: pnozz_exa.c,v 1.4.2.1 2023/11/26 12:19:22 bouyer Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -78,9 +80,11 @@ static CARD32 PnozzDrawROP[] = {
 #define waitReady(pPnozz) while((pnozz_read_4(pPnozz, ENGINE_STATUS) & \
 (ENGINE_BUSY | BLITTER_BUSY)) !=0 )
 
-/* From pnozz_accel.c */
+void PnozzInitEngine(PnozzPtr);
 void pnozz_write_colour(PnozzPtr pPnozz, int reg, CARD32 colour);
 
+extern CARD32 MaxClip, junk;
+
 static void
 PnozzWaitMarker(ScreenPtr pScreen, int Marker)
 {
@@ -107,10 +111,8 @@ PnozzPrepareCopy
 waitReady(pPnozz);
 pnozz_write_4(pPnozz, RASTER_OP, (PnozzCopyROP[alu] & 0xff));
 pnozz_write_4(pPnozz, PLANE_MASK, planemask);
-pPnozz->srcoff = exaGetPixmapOffset(pSrcPixmap);
+pPnozz->srcoff = exaGetPixmapOffset(pSrcPixmap) / pPnozz->width;
 
-if (exaGetPixmapPitch(pSrcPixmap) != exaGetPixmapPitch(pDstPixmap))
-	return FALSE;
 return TRUE;
 }
 
@@ -129,25 +131,24 @@ PnozzCopy
 ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
 PnozzPtr pPnozz = GET_PNOZZ_FROM_SCRN(pScrn);
 CARD32 src, dst, srcw, dstw;
-int soff = pPnozz->srcoff / exaGetPixmapPitch(pDstPixmap);
-int doff = exaGetPixmapOffset(pDstPixmap) / exaGetPixmapPitch(pDstPixmap);
+int doff = exaGetPixmapOffset(pDstPixmap) / pPnozz->width;
 
 src = (((xSrc << pPnozz->depthshift) & 0x1fff) << 16) |
-	((ySrc + soff) & 0x1fff);
+	((ySrc + pPnozz->srcoff) & 0x1fff);
 dst = (((xDst << pPnozz->depthshift) & 0x1fff) << 16) |
 	((yDst + doff) & 0x1fff);
-srcw = xSrc + w) << pPnozz->depthshift) - 1) << 16) |
-	((ySrc + soff + h) & 0x1fff);
+srcw = xSrc + w) << pPnozz->depthshift) - 1) << 16) | 
+((ySrc + pPnozz->srcoff + h - 1) & 0x1fff);
 dstw = xDst + w) << pPnozz->depthshift) - 1) << 16) |
-	((yDst + doff + h) & 0x1fff);
+((yDst + doff + h - 1) & 0x1fff);
 
 waitReady(pPnozz);
+
 pnozz_write_4(pPnozz, ABS_XY0, src);
 pnozz_write_4(pPnozz, ABS_XY1, srcw);
 pnozz_write_4(pPnozz, ABS_XY2, dst);
 pnozz_write_4(pPnozz, ABS_XY3, dstw);
-pnozz_read_4(pPnozz, COMMAND_BLIT);
-
+junk = pnozz_read_4(pPnozz, COMMAND_BLIT);
 exaMarkSync(pDstPixmap->drawable.pScreen);
 }
 
@@ -172,8 +173,7 @@ PnozzPrepareSolid(
 
 waitReady(pPnozz);
 pnozz_write_colour(pPnozz, FOREGROUND_COLOR, fg);
-pnozz_write_colour(pPnozz, BACKGROUND_COLOR, fg);
-pnozz_write_4(pPnozz, RASTER_OP, ROP_PAT);
+pnozz_write_4(pPnozz, RASTER_OP, PnozzDrawROP[alu] & 0xff);
 pnozz_write_4(pPnozz, PLANE_MASK, planemask);
 pnozz_write_4(pPnozz, COORD_INDEX, 0);
 
@@ -190,18 +190,15 @@ PnozzSolid(
 {
 ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
 PnozzPtr pPnozz = GET_PNOZZ_FROM_SCRN(pScrn);
-int doff = exaGetPixmapOffset(pPixmap);
+int w = x2 - x - 1;
+int h = y2 - y - 1;
 
 waitReady(pPnozz);
-pnozz_write_4(pPnozz, ABS_XY0, (((x + doff) & 0x1fff) << 16) |
-	(y & 0x1fff));
-pnozz_write_4(pPnozz, ABS_XY1, (((x + doff) & 0x1fff) << 16) |
-	(y2 & 0x1fff));
-pnozz_write_4(pPnozz, ABS_XY2, (((x2 + doff) & 0x1fff) << 16) |
-	(y2 & 0x1fff));
-pnozz_write_4(pPnozz, ABS_XY3, (((x2 + doff) & 0x1fff) << 16) |
-	(y & 0x1fff));
-pnozz_read_4(pPnozz, COMMAND_QUAD);
+pnozz_write_4(pPnozz, RECT_RTW_XY, ((x & 0x1fff) << 16) | 
+(y & 0x1fff));
+pnozz_write_4(pPnozz, RECT_RTP_XY, (((w & 0x1fff) << 16) | 
+(h & 0x1fff)));
+junk = pnozz_read_4(pPnozz, COMMAND_QUAD);
 

CVS commit: [netbsd-10] xsrc/external/mit/xf86-video-pnozz/dist/src

2023-11-26 Thread Manuel Bouyer
Module Name:xsrc
Committed By:   bouyer
Date:   Sun Nov 26 12:19:22 UTC 2023

Modified Files:
xsrc/external/mit/xf86-video-pnozz/dist/src [netbsd-10]: pnozz_exa.c

Log Message:
Pull up following revision(s) (requested by jdc in ticket #465):
external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c: revision 1.5
external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c: revision 1.6
Revert r1.4.
The changes are minimal and they cause redraw problems (as reported by
Maxim Devaev on port-sparc).
Add NetBSD keyword.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.2.1 \
xsrc/external/mit/xf86-video-pnozz/dist/src/pnozz_exa.c

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



CVS commit: [netbsd-10] src/sys/dev/gpio

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:16:31 UTC 2023

Modified Files:
src/sys/dev/gpio [netbsd-10]: gpioirq.c

Log Message:
Pull up following revision(s) (requested by brad in ticket #464):
sys/dev/gpio/gpioirq.c: revision 1.3
For /dev/ reads against gpioirq(4) implement the following:
o O_NONBLOCK on reads
o Add a d_poll function and associated sel[init|notify|record|destroy]
  calls to the driver so that select(2) and poll(2) work as expected.
With these in place async use cases work against /dev/gpioirqN


To generate a diff of this commit:
cvs rdiff -u -r1.1.36.1 -r1.1.36.2 src/sys/dev/gpio/gpioirq.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/gpio/gpioirq.c
diff -u src/sys/dev/gpio/gpioirq.c:1.1.36.1 src/sys/dev/gpio/gpioirq.c:1.1.36.2
--- src/sys/dev/gpio/gpioirq.c:1.1.36.1	Sun Nov 26 11:45:16 2023
+++ src/sys/dev/gpio/gpioirq.c	Sun Nov 26 12:16:31 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: gpioirq.c,v 1.1.36.1 2023/11/26 11:45:16 bouyer Exp $ */
+/* $NetBSD: gpioirq.c,v 1.1.36.2 2023/11/26 12:16:31 bouyer Exp $ */
 
 /*
  * Copyright (c) 2016, 2023 Brad Spencer 
@@ -17,7 +17,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gpioirq.c,v 1.1.36.1 2023/11/26 11:45:16 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpioirq.c,v 1.1.36.2 2023/11/26 12:16:31 bouyer Exp $");
 
 /*
  * GPIO driver that uses interrupts and can send that fact to userland.
@@ -34,6 +34,9 @@ __KERNEL_RCSID(0, "$NetBSD: gpioirq.c,v 
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -67,6 +70,7 @@ struct gpioirq_softc {
 	kcondvar_t		sc_cond_dying;
 	pool_cache_tsc_readpool;
 	char*sc_readpoolname;
+	struct  selinfo 	sc_rsel;
 	SIMPLEQ_HEAD(,gpioirq_read_q)  sc_read_queue;
 };
 
@@ -97,6 +101,7 @@ extern struct cfdriver gpioirq_cd;
 static dev_type_open(gpioirq_open);
 static dev_type_read(gpioirq_read);
 static dev_type_close(gpioirq_close);
+static dev_type_poll(gpioirq_poll);
 const struct cdevsw gpioirq_cdevsw = {
 	.d_open = gpioirq_open,
 	.d_close = gpioirq_close,
@@ -105,7 +110,7 @@ const struct cdevsw gpioirq_cdevsw = {
 	.d_ioctl = noioctl,
 	.d_stop = nostop,
 	.d_tty = notty,
-	.d_poll = nopoll,
+	.d_poll = gpioirq_poll,
 	.d_mmap = nommap,
 	.d_kqfilter = nokqfilter,
 	.d_discard = nodiscard,
@@ -189,6 +194,7 @@ gpioirq_attach(device_t parent, device_t
 	sc->sc_readpool = pool_cache_init(sizeof(struct gpioirq_read_q),0,0,0,sc->sc_readpoolname,NULL,IPL_VM,NULL,NULL,NULL);
 	pool_cache_sethiwat(sc->sc_readpool,100);
 	SIMPLEQ_INIT(>sc_read_queue);
+	selinit(>sc_rsel);
 
 	for(int apin = 0; apin < sc->sc_npins; apin++) {
 		if (!gpio_intr_str(sc->sc_gpio, >sc_map, apin, irqmode,
@@ -263,6 +269,7 @@ gpioirq_intr(void *arg)
 			q->parentunit = is->i_parentunit;
 			q->theval = val;
 			SIMPLEQ_INSERT_TAIL(>sc_read_queue,q,read_q);
+			selnotify(>sc_rsel, POLLIN|POLLRDNORM, NOTE_SUBMIT);
 			cv_signal(>sc_condreadready);
 		} else {
 			aprint_error("Could not allocate memory for read pool\n");
@@ -304,6 +311,10 @@ gpioirq_read(dev_t dev, struct uio *uio,
 	if (!sc)
 		return (ENXIO);
 
+	if (sc->sc_dying) {
+		return EIO;
+	}
+
 	while (uio->uio_resid > 0) {
 		any = 0;
 		error = 0;
@@ -316,7 +327,11 @@ gpioirq_read(dev_t dev, struct uio *uio,
 any = 1;
 break;
 			} else {
-error = cv_wait_sig(>sc_condreadready,>sc_read_mutex);
+if (flags & IO_NDELAY) {
+	error = EWOULDBLOCK;
+} else {
+	error = cv_wait_sig(>sc_condreadready,>sc_read_mutex);
+}
 if (sc->sc_dying)
 	error = EIO;
 if (error == 0)
@@ -358,6 +373,10 @@ gpioirq_close(dev_t dev, int flags, int 
 
 	sc = device_lookup_private(_cd, minor(dev));
 
+	if (sc->sc_dying) {
+		return(0);
+	}
+
 	mutex_enter(>sc_lock);
 	while ((q = SIMPLEQ_FIRST(>sc_read_queue)) != NULL) {
 		SIMPLEQ_REMOVE_HEAD(>sc_read_queue, read_q);
@@ -369,6 +388,31 @@ gpioirq_close(dev_t dev, int flags, int 
 	return(0);
 }
 
+static int
+gpioirq_poll(dev_t dev, int events, struct lwp *l)
+{
+struct gpioirq_softc *sc;
+int revents = 0;
+
+sc = device_lookup_private(_cd, minor(dev));
+
+	mutex_enter(>sc_read_mutex);
+	if (sc->sc_dying) {
+mutex_exit(>sc_read_mutex);
+return POLLHUP;
+}
+
+	if ((events & (POLLIN | POLLRDNORM)) != 0) {
+if (!SIMPLEQ_EMPTY(>sc_read_queue))
+revents |= events & (POLLIN | POLLRDNORM);
+else
+selrecord(l, >sc_rsel);
+}
+
+	mutex_exit(>sc_read_mutex);
+return revents;
+}
+
 int
 gpioirq_detach(device_t self, int flags)
 {
@@ -413,6 +457,7 @@ gpioirq_detach(device_t self, int flags)
 
 	mutex_destroy(>sc_read_mutex);
 	mutex_destroy(>sc_lock);
+	seldestroy(>sc_rsel);
 
 	return (0);
 }



CVS commit: [netbsd-10] src/sys/dev/gpio

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:16:31 UTC 2023

Modified Files:
src/sys/dev/gpio [netbsd-10]: gpioirq.c

Log Message:
Pull up following revision(s) (requested by brad in ticket #464):
sys/dev/gpio/gpioirq.c: revision 1.3
For /dev/ reads against gpioirq(4) implement the following:
o O_NONBLOCK on reads
o Add a d_poll function and associated sel[init|notify|record|destroy]
  calls to the driver so that select(2) and poll(2) work as expected.
With these in place async use cases work against /dev/gpioirqN


To generate a diff of this commit:
cvs rdiff -u -r1.1.36.1 -r1.1.36.2 src/sys/dev/gpio/gpioirq.c

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



CVS commit: [netbsd-10] src

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:13:19 UTC 2023

Modified Files:
src/share/man/man4 [netbsd-10]: gpiosim.4
src/sys/dev/gpio [netbsd-10]: gpiosim.c

Log Message:
Pull up following revision(s) (requested by brad in ticket #463):
share/man/man4/gpiosim.4: revision 1.7
sys/dev/gpio/gpiosim.c: revision 1.25
Simple simulated interrupts for the simulated GPIO device gpiosim(4)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.16.1 src/share/man/man4/gpiosim.4
cvs rdiff -u -r1.23 -r1.23.6.1 src/sys/dev/gpio/gpiosim.c

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

Modified files:

Index: src/share/man/man4/gpiosim.4
diff -u src/share/man/man4/gpiosim.4:1.6 src/share/man/man4/gpiosim.4:1.6.16.1
--- src/share/man/man4/gpiosim.4:1.6	Mon Jul  3 21:30:58 2017
+++ src/share/man/man4/gpiosim.4	Sun Nov 26 12:13:19 2023
@@ -1,4 +1,4 @@
-.\" $NetBSD: gpiosim.4,v 1.6 2017/07/03 21:30:58 wiz Exp $
+.\" $NetBSD: gpiosim.4,v 1.6.16.1 2023/11/26 12:13:19 bouyer Exp $
 .\"
 .\" Copyright (c) 2009, 2013 Marc Balmer 
 .\" All rights reserved.
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd May 20, 2013
+.Dd November 8, 2013
 .Dt GPIOSIM 4
 .Os
 .Sh NAME
@@ -37,12 +37,21 @@ For this purpose, access the "hw.gpiosim
 variable, where "" denotes the number of the
 .Nm
 instance.
+.Pp
+Both edge and level interrupts are simulated.  The "hw.gpiosim.ms"
+.Xr sysctl 8
+variable will change the amount of time between
+.Xr callout 9
+ticks for simulated level interrupts.
 .Sh SEE ALSO
 .Xr gpio 4 ,
+.Xr gpioirq 4 ,
 .Xr sysctl 8
 .Sh AUTHORS
 .An -nosplit
 The
 .Nm
 driver was written by
-.An Marc Balmer Aq Mt m...@msys.ch .
+.An Marc Balmer Aq Mt m...@msys.ch
+Simulated interrupts added by
+.An Brad Spencer Aq Mt b...@anduin.eldar.org .

Index: src/sys/dev/gpio/gpiosim.c
diff -u src/sys/dev/gpio/gpiosim.c:1.23 src/sys/dev/gpio/gpiosim.c:1.23.6.1
--- src/sys/dev/gpio/gpiosim.c:1.23	Sat Aug  7 16:19:10 2021
+++ src/sys/dev/gpio/gpiosim.c	Sun Nov 26 12:13:19 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: gpiosim.c,v 1.23 2021/08/07 16:19:10 thorpej Exp $ */
+/* $NetBSD: gpiosim.c,v 1.23.6.1 2023/11/26 12:13:19 bouyer Exp $ */
 /*  $OpenBSD: gpiosim.c,v 1.1 2008/11/23 18:46:49 mbalmer Exp $	*/
 
 /*
@@ -29,34 +29,65 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "gpiosim.h"
 #include "ioconf.h"
 
 #define	GPIOSIM_NPINS	64
 
+struct gpiosim_irq {
+	int (*sc_gpio_irqfunc)(void *);
+	void *sc_gpio_irqarg;
+	int sc_gpio_irqmode;
+	bool sc_gpio_irqtriggered;
+};
+
 struct gpiosim_softc {
 	device_t		sc_dev;
 	device_t		sc_gdev;	/* gpio that attaches here */
 	uint64_t		sc_state;
 	struct gpio_chipset_tag	sc_gpio_gc;
 	gpio_pin_t		sc_gpio_pins[GPIOSIM_NPINS];
+struct gpiosim_irq  sc_gpio_irqs[GPIOSIM_NPINS];
 
 	struct sysctllog	*sc_log;
+struct workqueue*sc_wq;
+callout_t   sc_co;
+boolsc_co_init;
+	bool			sc_co_running;
+int sc_ms;
+kmutex_t 		sc_intr_mutex;
 };
 
 static int	gpiosim_match(device_t, cfdata_t, void *);
 static void	gpiosim_attach(device_t, device_t, void *);
 static int	gpiosim_detach(device_t, int);
 static int	gpiosim_sysctl(SYSCTLFN_PROTO);
+static int	gpiosim_ms_sysctl(SYSCTLFN_PROTO);
 
 static int	gpiosim_pin_read(void *, int);
 static void	gpiosim_pin_write(void *, int, int);
 static void	gpiosim_pin_ctl(void *, int, int);
 
+static void *   gpiosim_intr_establish(void *, int, int, int,
+int (*)(void *), void *);
+static void gpiosim_intr_disestablish(void *, void *);
+static bool gpiosim_gpio_intrstr(void *, int, int, char *, size_t);
+
+voidgpiosim_wq(struct work *,void *);
+voidgpiosim_co(void *);
+
 CFATTACH_DECL_NEW(gpiosim, sizeof(struct gpiosim_softc), gpiosim_match,
 gpiosim_attach, gpiosim_detach, NULL);
 
+int gpiosim_work;
+
+#ifndef GPIOSIM_MS
+#define GPIOSIM_MS 1000
+#endif
+
 static int
 gpiosim_match(device_t parent, cfdata_t match, void *aux)
 {
@@ -90,6 +121,7 @@ gpiosim_attach(device_t parent, device_t
 	struct gpiobus_attach_args gba;
 	const struct sysctlnode *node;
 	int i;
+	int error = 0;
 
 	sc->sc_dev = self;
 
@@ -103,16 +135,36 @@ gpiosim_attach(device_t parent, device_t
 		GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN |
 		GPIO_PIN_INVIN | GPIO_PIN_INVOUT;
 
+		/* Set up what interrupt types are allowed */
+		sc->sc_gpio_pins[i].pin_intrcaps =
+		GPIO_INTR_POS_EDGE |
+		GPIO_INTR_NEG_EDGE |
+		GPIO_INTR_DOUBLE_EDGE |
+		GPIO_INTR_HIGH_LEVEL |
+		GPIO_INTR_LOW_LEVEL |
+		GPIO_INTR_MPSAFE;
+		sc->sc_gpio_irqs[i].sc_gpio_irqfunc = NULL;
+		sc->sc_gpio_irqs[i].sc_gpio_irqarg = NULL;
+		sc->sc_gpio_irqs[i].sc_gpio_irqmode = 0;
+		

CVS commit: [netbsd-10] src

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 12:13:19 UTC 2023

Modified Files:
src/share/man/man4 [netbsd-10]: gpiosim.4
src/sys/dev/gpio [netbsd-10]: gpiosim.c

Log Message:
Pull up following revision(s) (requested by brad in ticket #463):
share/man/man4/gpiosim.4: revision 1.7
sys/dev/gpio/gpiosim.c: revision 1.25
Simple simulated interrupts for the simulated GPIO device gpiosim(4)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.16.1 src/share/man/man4/gpiosim.4
cvs rdiff -u -r1.23 -r1.23.6.1 src/sys/dev/gpio/gpiosim.c

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



CVS commit: [netbsd-10] src/sys/arch/newsmips/dev

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 11:54:31 UTC 2023

Modified Files:
src/sys/arch/newsmips/dev [netbsd-10]: dmac_0448.h scsi_1185.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #462):
sys/arch/newsmips/dev/dmac_0448.h: revision 1.7
sys/arch/newsmips/dev/scsi_1185.c: revision 1.25
Use DELAY(9), not empty for() loop that could be optimized out.
No visible regression on NWS-3260 and NWS-3470.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.122.1 src/sys/arch/newsmips/dev/dmac_0448.h
cvs rdiff -u -r1.23 -r1.23.46.1 src/sys/arch/newsmips/dev/scsi_1185.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/newsmips/dev/dmac_0448.h
diff -u src/sys/arch/newsmips/dev/dmac_0448.h:1.6 src/sys/arch/newsmips/dev/dmac_0448.h:1.6.122.1
--- src/sys/arch/newsmips/dev/dmac_0448.h:1.6	Wed Apr  9 15:40:30 2008
+++ src/sys/arch/newsmips/dev/dmac_0448.h	Sun Nov 26 11:54:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmac_0448.h,v 1.6 2008/04/09 15:40:30 tsutsui Exp $	*/
+/*	$NetBSD: dmac_0448.h,v 1.6.122.1 2023/11/26 11:54:31 bouyer Exp $	*/
 /*
  * Copyright (c) 1992, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -120,7 +120,7 @@ struct	dm_stat {
 	unsigned int dm_width;
 };
 
-#define	DMAC_WAIT	nops(10)
+#define	DMAC_WAIT	DELAY(1)
 
 #define PINTEN		0xbfc80001
 # define	DMA_INTEN	0x10

Index: src/sys/arch/newsmips/dev/scsi_1185.c
diff -u src/sys/arch/newsmips/dev/scsi_1185.c:1.23 src/sys/arch/newsmips/dev/scsi_1185.c:1.23.46.1
--- src/sys/arch/newsmips/dev/scsi_1185.c:1.23	Thu Jul 21 19:49:58 2016
+++ src/sys/arch/newsmips/dev/scsi_1185.c	Sun Nov 26 11:54:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsi_1185.c,v 1.23 2016/07/21 19:49:58 christos Exp $	*/
+/*	$NetBSD: scsi_1185.c,v 1.23.46.1 2023/11/26 11:54:31 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsi_1185.c,v 1.23 2016/07/21 19:49:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsi_1185.c,v 1.23.46.1 2023/11/26 11:54:31 bouyer Exp $");
 
 #define	__INTR_PRIVATE
 #include 
@@ -116,10 +116,9 @@ __KERNEL_RCSID(0, "$NetBSD: scsi_1185.c,
 #define	splscsi splsc
 
 #if defined(__mips__) && defined(CPU_SINGLE)
-#define nops(x)		{ int __i; for (__i = 0; __i < (x); __i++) ; }
-#define	DMAC_WAIT0	;
+#define	DMAC_WAIT0	__nothing
 #else
-#define	DMAC_WAIT0	DMAC_WAIT
+#define	DMAC_WAIT0	DMAC_WAIT	/* see MODIFY HISTORY comment above */
 #endif
 
 #ifdef DMAC_MAP_INIT



CVS commit: [netbsd-10] src/sys/arch/newsmips/dev

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 11:54:31 UTC 2023

Modified Files:
src/sys/arch/newsmips/dev [netbsd-10]: dmac_0448.h scsi_1185.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #462):
sys/arch/newsmips/dev/dmac_0448.h: revision 1.7
sys/arch/newsmips/dev/scsi_1185.c: revision 1.25
Use DELAY(9), not empty for() loop that could be optimized out.
No visible regression on NWS-3260 and NWS-3470.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.122.1 src/sys/arch/newsmips/dev/dmac_0448.h
cvs rdiff -u -r1.23 -r1.23.46.1 src/sys/arch/newsmips/dev/scsi_1185.c

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



CVS commit: [netbsd-10] src

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 11:45:16 UTC 2023

Modified Files:
src/etc [netbsd-10]: MAKEDEV.tmpl
src/share/man/man4 [netbsd-10]: gpioirq.4
src/sys/conf [netbsd-10]: majors
src/sys/dev/gpio [netbsd-10]: gpio.c gpioirq.c gpiovar.h

Log Message:
Pull up following revision(s) (requested by brad in ticket #461):
sys/dev/gpio/gpiovar.h: revision 1.19
share/man/man4/gpioirq.4: revision 1.4 via patch
sys/dev/gpio/gpio.c: revision 1.73
etc/MAKEDEV.tmpl: revision 1.234
sys/conf/majors: revision 1.103
sys/dev/gpio/gpioirq.c: revision 1.2
gpioirq(4) version 2
This update makes this driver more than just an example and allows for:
o More than one pin to be attached to a gpioirq instance.  That is,
  the mask parameter can be greater than 0x01 now.
o A /dev/gpioirqN device that allows GPIO pin interrupts to be
  transported into userland.  This is a device that can be opened for
  reading with a simple fixed output indicating the device unit, pin
  number and current pin state.
This update was used as part of a physical intrusion detection system
where multiple switches (i.e. window magnetic reed switches and etc.)
are tied to a bunch of GPIO inputs with userland software that reacts
to the pins changing state.


To generate a diff of this commit:
cvs rdiff -u -r1.232.2.1 -r1.232.2.2 src/etc/MAKEDEV.tmpl
cvs rdiff -u -r1.2 -r1.2.14.1 src/share/man/man4/gpioirq.4
cvs rdiff -u -r1.102 -r1.102.4.1 src/sys/conf/majors
cvs rdiff -u -r1.72 -r1.72.2.1 src/sys/dev/gpio/gpio.c
cvs rdiff -u -r1.1 -r1.1.36.1 src/sys/dev/gpio/gpioirq.c
cvs rdiff -u -r1.18 -r1.18.34.1 src/sys/dev/gpio/gpiovar.h

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



CVS commit: [netbsd-10] src

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 11:45:16 UTC 2023

Modified Files:
src/etc [netbsd-10]: MAKEDEV.tmpl
src/share/man/man4 [netbsd-10]: gpioirq.4
src/sys/conf [netbsd-10]: majors
src/sys/dev/gpio [netbsd-10]: gpio.c gpioirq.c gpiovar.h

Log Message:
Pull up following revision(s) (requested by brad in ticket #461):
sys/dev/gpio/gpiovar.h: revision 1.19
share/man/man4/gpioirq.4: revision 1.4 via patch
sys/dev/gpio/gpio.c: revision 1.73
etc/MAKEDEV.tmpl: revision 1.234
sys/conf/majors: revision 1.103
sys/dev/gpio/gpioirq.c: revision 1.2
gpioirq(4) version 2
This update makes this driver more than just an example and allows for:
o More than one pin to be attached to a gpioirq instance.  That is,
  the mask parameter can be greater than 0x01 now.
o A /dev/gpioirqN device that allows GPIO pin interrupts to be
  transported into userland.  This is a device that can be opened for
  reading with a simple fixed output indicating the device unit, pin
  number and current pin state.
This update was used as part of a physical intrusion detection system
where multiple switches (i.e. window magnetic reed switches and etc.)
are tied to a bunch of GPIO inputs with userland software that reacts
to the pins changing state.


To generate a diff of this commit:
cvs rdiff -u -r1.232.2.1 -r1.232.2.2 src/etc/MAKEDEV.tmpl
cvs rdiff -u -r1.2 -r1.2.14.1 src/share/man/man4/gpioirq.4
cvs rdiff -u -r1.102 -r1.102.4.1 src/sys/conf/majors
cvs rdiff -u -r1.72 -r1.72.2.1 src/sys/dev/gpio/gpio.c
cvs rdiff -u -r1.1 -r1.1.36.1 src/sys/dev/gpio/gpioirq.c
cvs rdiff -u -r1.18 -r1.18.34.1 src/sys/dev/gpio/gpiovar.h

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

Modified files:

Index: src/etc/MAKEDEV.tmpl
diff -u src/etc/MAKEDEV.tmpl:1.232.2.1 src/etc/MAKEDEV.tmpl:1.232.2.2
--- src/etc/MAKEDEV.tmpl:1.232.2.1	Fri Jan 13 19:08:30 2023
+++ src/etc/MAKEDEV.tmpl	Sun Nov 26 11:45:16 2023
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: MAKEDEV.tmpl,v 1.232.2.1 2023/01/13 19:08:30 martin Exp $
+#	$NetBSD: MAKEDEV.tmpl,v 1.232.2.2 2023/11/26 11:45:16 bouyer Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -232,6 +232,7 @@
 #	dtv*	Digital TV interface
 #	fb*	PMAX generic framebuffer pseudo-device
 #	fd	file descriptors
+#	gpioirq* Interrupts on GPIO pins
 #	gpiopps* 1PPS signals on GPIO pins
 #	grf*	graphics frame buffer device
 #	hdaudio* High Definition audio control device
@@ -830,7 +831,7 @@ all)
 	makedev srt0 srt1 srt2 srt3
 	makedev tap tap0 tap1 tap2 tap3
 	makedev gpio gpio0 gpio1 gpio2 gpio3 gpio4 gpio5 gpio6 gpio7
-	makedev gpiopps0
+	makedev gpioirq0 gpiopps0
 	makedev pad pad0 pad1 pad2 pad3
 	makedev bthub
 	makedev putter
@@ -873,6 +874,10 @@ gpio)
 	lndev gpio0 gpio
 	;;
 
+gpioirq)
+	makedev gpioirq0
+	;;
+
 gpiopps)
 	makedev gpiopps0
 	lndev gpiopps0 gpiopps
@@ -1547,6 +1552,11 @@ gpio[0-9]*)
 	mkdev gpio$unit c %gpio_chr% $unit 664 $g_gpio
 	;;
 
+gpioirq[0-9]*)
+	unit=${i#gpioirq}
+	mkdev gpioirq$unit c %gpioirq_chr% $unit 444 $g_gpio
+	;;
+
 gpiopps[0-9]*)
 	unit=${i#gpiopps}
 	mkdev gpiopps$unit c %gpiopps_chr% $unit 664 $g_gpio

Index: src/share/man/man4/gpioirq.4
diff -u src/share/man/man4/gpioirq.4:1.2 src/share/man/man4/gpioirq.4:1.2.14.1
--- src/share/man/man4/gpioirq.4:1.2	Sun May 20 12:08:46 2018
+++ src/share/man/man4/gpioirq.4	Sun Nov 26 11:45:16 2023
@@ -1,6 +1,6 @@
-.\" $NetBSD: gpioirq.4,v 1.2 2018/05/20 12:08:46 wiz Exp $
+.\" $NetBSD: gpioirq.4,v 1.2.14.1 2023/11/26 11:45:16 bouyer Exp $
 .\"
-.\" Copyright (c) 2016 Brad Spencer 
+.\" Copyright (c) 2016, 2023 Brad Spencer 
 .\"
 .\" Permission to use, copy, modify, and distribute this software for any
 .\" purpose with or without fee is hereby granted, provided that the above
@@ -14,25 +14,26 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd May 11, 2018
+.Dd November 5, 2023
 .Dt GPIOIRQ 4
 .Os
 .Sh NAME
 .Nm gpioirq
-.Nd Install an interrupt handler on a GPIO pin
+.Nd Install an interrupt handler on GPIO pins
 .Sh SYNOPSIS
 .Cd "gpioirq* at gpio? offset 0 mask 0x1 flag 0x00"
 .Sh DESCRIPTION
 The
 .Nm
-driver attaches an interrupt handler to a single GPIO pin.
+driver attaches an interrupt handler to a one or more GPIO pins.
 .Pp
-The pin number is specified in the kernel configuration file with the
+The base pin number is specified in the kernel configuration file with the
 .Ar offset
 locator.
 The
 .Ar mask
-locator should always be 0x1.
+locator can be 0x01 or greater to indicate that more pins should have an
+interrupt handler attached to them.
 .Pp
 The
 .Ar flag
@@ -49,7 +50,7 @@ edge of the pin.
 .It Dv 0x04
 Interrupt on both edges of the pin.
 .It Dv 0x08
-Assert the intrerrupt as long as the pin is high.
+Assert the interrupt as long 

CVS commit: [netbsd-10] src/sys

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 11:37:03 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-10]: if_ena.c if_enavar.h
src/sys/external/bsd/ena-com [netbsd-10]: ena_com.c ena_com.h
ena_plat.h

Log Message:
Pull up following revision(s) (requested by jdolecek in ticket #460):
sys/dev/pci/if_ena.c: revision 1.35
sys/dev/pci/if_ena.c: revision 1.36
sys/dev/pci/if_ena.c: revision 1.37
sys/dev/pci/if_ena.c: revision 1.38
sys/dev/pci/if_ena.c: revision 1.39
sys/external/bsd/ena-com/ena_plat.h: revision 1.10
sys/dev/pci/if_enavar.h: revision 1.9
sys/external/bsd/ena-com/ena_com.c: revision 1.2
sys/external/bsd/ena-com/ena_com.c: revision 1.3
sys/external/bsd/ena-com/ena_com.c: revision 1.4
sys/dev/pci/if_ena.c: revision 1.40
sys/external/bsd/ena-com/ena_com.h: revision 1.2
ena(4): replace malloc(9) to kmem(9)
Code contributed by KUSABA Takeshi 
ena(4): prevent AENQ handler from use-after-free
Code contributed by KUSABA Takeshi 
ena(4): destroy all wait_event
Code contributed by KUSABA Takeshi 
ena(4): support RSS and delete FreeBSD-specified code
Code contributed by KUSABA Takeshi 
ena(4) is MP-ready, always use MPSAFE
Code contributed by KUSABA Takeshi 
ena(4): establish interrupt after setting up resources
Code contributed by KUSABA Takeshi 
ena(4): stop management first when detaching
Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.4.1 src/sys/dev/pci/if_ena.c
cvs rdiff -u -r1.8 -r1.8.10.1 src/sys/dev/pci/if_enavar.h
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.34.1 src/sys/external/bsd/ena-com/ena_com.c \
src/sys/external/bsd/ena-com/ena_com.h
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/external/bsd/ena-com/ena_plat.h

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

Modified files:

Index: src/sys/dev/pci/if_ena.c
diff -u src/sys/dev/pci/if_ena.c:1.33 src/sys/dev/pci/if_ena.c:1.33.4.1
--- src/sys/dev/pci/if_ena.c:1.33	Mon May 23 13:53:37 2022
+++ src/sys/dev/pci/if_ena.c	Sun Nov 26 11:37:02 2023
@@ -36,15 +36,15 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.33 2022/05/23 13:53:37 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.33.4.1 2023/11/26 11:37:02 bouyer Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -61,14 +61,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1
 
 #include 
 
-#ifdef NET_MPSAFE
-#define	WQ_FLAGS	WQ_MPSAFE
-#define	CALLOUT_FLAGS	CALLOUT_MPSAFE
-#else
-#define	WQ_FLAGS	0
-#define	CALLOUT_FLAGS	0
-#endif
-
 /*
  *  Function prototypes
  */
@@ -106,6 +98,7 @@ static void	ena_free_all_io_rings_resour
 static int	ena_get_dev_offloads(struct ena_com_dev_get_features_ctx *);
 static int	ena_setup_ifnet(device_t, struct ena_adapter *,
 		struct ena_com_dev_get_features_ctx *);
+static void	ena_rss_init_default(device_t);
 
 static inline void	ena_alloc_counters_rx(struct ena_adapter *,
 			struct ena_stats_rx *, int);
@@ -217,8 +210,6 @@ static void	ena_rx_hash_mbuf(struct ena_
 struct mbuf *);
 static uint64_t	ena_get_counter(struct ifnet *, ift_counter);
 static void	ena_qflush(struct ifnet *);
-static int	ena_rss_init_default(struct ena_adapter *);
-static void	ena_rss_init_default_deferred(void *);
 #endif
 
 static const char ena_version[] =
@@ -693,15 +684,12 @@ ena_setup_tx_resources(struct ena_adapte
 	struct ena_que *que = >que[qid];
 	struct ena_ring *tx_ring = que->tx_ring;
 	int size, i, err;
-#ifdef	RSS
-	cpuset_t cpu_mask;
-#endif
 
 	size = sizeof(struct ena_tx_buffer) * tx_ring->ring_size;
-	tx_ring->tx_buffer_info = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO);
+	tx_ring->tx_buffer_info = kmem_zalloc(size, KM_SLEEP);
 
 	size = sizeof(uint16_t) * tx_ring->ring_size;
-	tx_ring->free_tx_ids = malloc(size, M_DEVBUF, M_WAITOK | M_ZERO);
+	tx_ring->free_tx_ids = kmem_zalloc(size, KM_SLEEP);
 
 	/* Req id stack for TX OOO completions */
 	for (i = 0; i < tx_ring->ring_size; i++)
@@ -732,27 +720,13 @@ ena_setup_tx_resources(struct ena_adapte
 
 	/* Allocate workqueues */
 	int rc = workqueue_create(_ring->enqueue_tq, "ena_tx_enq",
-	ena_deferred_mq_start, tx_ring, 0, IPL_NET, WQ_PERCPU | WQ_FLAGS);
+	ena_deferred_mq_start, tx_ring, 0, IPL_NET, WQ_PERCPU | WQ_MPSAFE);
 	if (unlikely(rc != 0)) {
 		ena_trace(ENA_ALERT,
 		"Unable to create workqueue for enqueue task\n");
 		i = tx_ring->ring_size;
 		goto err_buf_info_unmap;
 	}
-
-#if 0
-	/* RSS set cpu for thread */
-#ifdef RSS
-	CPU_SETOF(que->cpu, _mask);
-	taskqueue_start_threads_cpuset(_ring->enqueue_tq, 1, IPL_NET,
-	_mask, "%s tx_ring enq (bucket %d)",
-	

CVS commit: [netbsd-10] src/sys

2023-11-26 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Nov 26 11:37:03 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-10]: if_ena.c if_enavar.h
src/sys/external/bsd/ena-com [netbsd-10]: ena_com.c ena_com.h
ena_plat.h

Log Message:
Pull up following revision(s) (requested by jdolecek in ticket #460):
sys/dev/pci/if_ena.c: revision 1.35
sys/dev/pci/if_ena.c: revision 1.36
sys/dev/pci/if_ena.c: revision 1.37
sys/dev/pci/if_ena.c: revision 1.38
sys/dev/pci/if_ena.c: revision 1.39
sys/external/bsd/ena-com/ena_plat.h: revision 1.10
sys/dev/pci/if_enavar.h: revision 1.9
sys/external/bsd/ena-com/ena_com.c: revision 1.2
sys/external/bsd/ena-com/ena_com.c: revision 1.3
sys/external/bsd/ena-com/ena_com.c: revision 1.4
sys/dev/pci/if_ena.c: revision 1.40
sys/external/bsd/ena-com/ena_com.h: revision 1.2
ena(4): replace malloc(9) to kmem(9)
Code contributed by KUSABA Takeshi 
ena(4): prevent AENQ handler from use-after-free
Code contributed by KUSABA Takeshi 
ena(4): destroy all wait_event
Code contributed by KUSABA Takeshi 
ena(4): support RSS and delete FreeBSD-specified code
Code contributed by KUSABA Takeshi 
ena(4) is MP-ready, always use MPSAFE
Code contributed by KUSABA Takeshi 
ena(4): establish interrupt after setting up resources
Code contributed by KUSABA Takeshi 
ena(4): stop management first when detaching
Code contributed by KUSABA Takeshi 


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.4.1 src/sys/dev/pci/if_ena.c
cvs rdiff -u -r1.8 -r1.8.10.1 src/sys/dev/pci/if_enavar.h
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.34.1 src/sys/external/bsd/ena-com/ena_com.c \
src/sys/external/bsd/ena-com/ena_com.h
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/external/bsd/ena-com/ena_plat.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/x86

2023-10-19 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Oct 19 14:59:46 UTC 2023

Modified Files:
src/sys/arch/x86/acpi: acpi_wakeup.c
src/sys/arch/x86/x86: genfb_machdep.c

Log Message:
Move definition of acpi_md_vesa_modenum to acpi_wakeup.c; allows building
kernels without framebuffer devices.
Problem reported by John D. Baker on current-users@


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/x86/acpi/acpi_wakeup.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/x86/x86/genfb_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/x86/acpi/acpi_wakeup.c
diff -u src/sys/arch/x86/acpi/acpi_wakeup.c:1.56 src/sys/arch/x86/acpi/acpi_wakeup.c:1.57
--- src/sys/arch/x86/acpi/acpi_wakeup.c:1.56	Mon Oct 16 17:27:02 2023
+++ src/sys/arch/x86/acpi/acpi_wakeup.c	Thu Oct 19 14:59:46 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_wakeup.c,v 1.56 2023/10/16 17:27:02 bouyer Exp $	*/
+/*	$NetBSD: acpi_wakeup.c,v 1.57 2023/10/19 14:59:46 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2011 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.56 2023/10/16 17:27:02 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.57 2023/10/19 14:59:46 bouyer Exp $");
 
 #include 
 #include 
@@ -106,6 +106,8 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.
 
 #ifdef XENPV
 #error acpi_wakeup.c (acpi_md_vesa_modenum) users must be adapted for Xen
+#else
+int acpi_md_vesa_modenum = 0;
 #endif
 
 /* Address is also hard-coded in acpi_wakecode.S */

Index: src/sys/arch/x86/x86/genfb_machdep.c
diff -u src/sys/arch/x86/x86/genfb_machdep.c:1.22 src/sys/arch/x86/x86/genfb_machdep.c:1.23
--- src/sys/arch/x86/x86/genfb_machdep.c:1.22	Tue Oct 17 12:07:42 2023
+++ src/sys/arch/x86/x86/genfb_machdep.c	Thu Oct 19 14:59:46 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_machdep.c,v 1.22 2023/10/17 12:07:42 bouyer Exp $ */
+/* $NetBSD: genfb_machdep.c,v 1.23 2023/10/19 14:59:46 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill 
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.22 2023/10/17 12:07:42 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.23 2023/10/19 14:59:46 bouyer Exp $");
 
 #include 
 #include 
@@ -64,10 +64,6 @@ __KERNEL_RCSID(0, "$NetBSD: genfb_machde
 struct vcons_screen x86_genfb_console_screen;
 bool x86_genfb_use_shadowfb = true;
 
-#if NACPICA > 0 && !defined(XENPV)
-int acpi_md_vesa_modenum = 0;
-#endif
-
 static device_t x86_genfb_console_dev = NULL;
 
 static struct wsscreen_descr x86_genfb_stdscreen = {



CVS commit: src/sys/arch/x86

2023-10-19 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Oct 19 14:59:46 UTC 2023

Modified Files:
src/sys/arch/x86/acpi: acpi_wakeup.c
src/sys/arch/x86/x86: genfb_machdep.c

Log Message:
Move definition of acpi_md_vesa_modenum to acpi_wakeup.c; allows building
kernels without framebuffer devices.
Problem reported by John D. Baker on current-users@


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/x86/acpi/acpi_wakeup.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/x86/x86/genfb_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/xen/xen

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 16:09:12 UTC 2023

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

Log Message:
for a dom0 PVH, the dom0_vga_console_info structure has to be retrieved
using a platform hypercall; do so in the XENPVHVM case.
Now genfb works in a PVH dom0 running on Xen 4.18 (Xen 4.15 doesn't support
this platoform op, so no way to make it work here).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/xen/xen/genfb_xen.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/xen/xen

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 16:09:12 UTC 2023

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

Log Message:
for a dom0 PVH, the dom0_vga_console_info structure has to be retrieved
using a platform hypercall; do so in the XENPVHVM case.
Now genfb works in a PVH dom0 running on Xen 4.18 (Xen 4.15 doesn't support
this platoform op, so no way to make it work here).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/xen/xen/genfb_xen.c

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

Modified files:

Index: src/sys/arch/xen/xen/genfb_xen.c
diff -u src/sys/arch/xen/xen/genfb_xen.c:1.1 src/sys/arch/xen/xen/genfb_xen.c:1.2
--- src/sys/arch/xen/xen/genfb_xen.c:1.1	Tue Oct 17 12:07:42 2023
+++ src/sys/arch/xen/xen/genfb_xen.c	Tue Oct 17 16:09:12 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: genfb_xen.c,v 1.1 2023/10/17 12:07:42 bouyer Exp $  */
+/*  $NetBSD: genfb_xen.c,v 1.2 2023/10/17 16:09:12 bouyer Exp $  */
 
 /*
  * Copyright (c) 2023 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfb_xen.c,v 1.1 2023/10/17 12:07:42 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_xen.c,v 1.2 2023/10/17 16:09:12 bouyer Exp $");
 
 
 #include 
@@ -42,6 +42,7 @@ const struct btinfo_framebuffer *
 xen_genfb_getbtinfo(void)
 {
 	dom0_vga_console_info_t *d0_consi;
+	int info_size;
 
 	if (!xendomain_is_dom0())
 		return NULL;
@@ -49,8 +50,21 @@ xen_genfb_getbtinfo(void)
 	if (_xen_genfb_btinfo.common.type == BTINFO_FRAMEBUFFER)
 		return &_xen_genfb_btinfo;
 
+#ifdef XENPVHVM
+	struct xen_platform_op op = {
+		.cmd = XENPF_get_dom0_console,
+	};
+	info_size = HYPERVISOR_platform_op();
+	if (info_size < sizeof(dom0_vga_console_info_t)) {
+		printf("XENPF_get_dom0_console fail %d\n", info_size);
+		return NULL;
+	}
+	d0_consi = _console;
+#else
 	d0_consi = (void *)((char *)_start_info +
 	xen_start_info.console.dom0.info_off);
+	info_size = xen_start_info.console.dom0.info_size;
+#endif
 
 	if (d0_consi->video_type != XEN_VGATYPE_VESA_LFB &&
 	d0_consi->video_type != XEN_VGATYPE_EFI_LFB)
@@ -59,7 +73,7 @@ xen_genfb_getbtinfo(void)
 	_xen_genfb_btinfo.common.type = BTINFO_FRAMEBUFFER;
 	_xen_genfb_btinfo.common.len = sizeof(struct btinfo_framebuffer);
 	_xen_genfb_btinfo.physaddr = d0_consi->u.vesa_lfb.lfb_base;
-	if (xen_start_info.console.dom0.info_size >=
+	if (info_size >=
 	offsetof(dom0_vga_console_info_t, u.vesa_lfb.ext_lfb_base)) {
 		_xen_genfb_btinfo.physaddr |=
 		(uint64_t)d0_consi->u.vesa_lfb.ext_lfb_base << 32;



CVS commit: src/sys/arch

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 16:06:37 UTC 2023

Modified Files:
src/sys/arch/x86/x86: consinit.c
src/sys/arch/xen/conf: files.xen

Log Message:
XENPVH option is not used. Fix consinit.c to use XENPVHVM as intended
and XENPVH from defflag


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/x86/x86/consinit.c
cvs rdiff -u -r1.188 -r1.189 src/sys/arch/xen/conf/files.xen

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

Modified files:

Index: src/sys/arch/x86/x86/consinit.c
diff -u src/sys/arch/x86/x86/consinit.c:1.37 src/sys/arch/x86/x86/consinit.c:1.38
--- src/sys/arch/x86/x86/consinit.c:1.37	Tue Oct 17 12:07:42 2023
+++ src/sys/arch/x86/x86/consinit.c	Tue Oct 17 16:06:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: consinit.c,v 1.37 2023/10/17 12:07:42 bouyer Exp $	*/
+/*	$NetBSD: consinit.c,v 1.38 2023/10/17 16:06:36 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1998
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.37 2023/10/17 12:07:42 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.38 2023/10/17 16:06:36 bouyer Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_puc.h"
@@ -100,6 +100,7 @@ __KERNEL_RCSID(0, "$NetBSD: consinit.c,v
 #endif
 
 #ifdef XENPVHVM
+#include 
 #include 
 #endif
 
@@ -189,7 +190,7 @@ consinit(void)
 		consinfo = _consinfo;
 
 #if (NGENFB > 0)
-#if defined(XENPVH) && defined(DOM0OPS)
+#if defined(XENPVHVM) && defined(DOM0OPS)
 	if (vm_guest == VM_GUEST_XENPVH && xendomain_is_dom0())
 		fbinfo = xen_genfb_getbtinfo();
 	else

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.188 src/sys/arch/xen/conf/files.xen:1.189
--- src/sys/arch/xen/conf/files.xen:1.188	Tue Oct 17 12:07:42 2023
+++ src/sys/arch/xen/conf/files.xen	Tue Oct 17 16:06:36 2023
@@ -1,6 +1,6 @@
-#	$NetBSD: files.xen,v 1.188 2023/10/17 12:07:42 bouyer Exp $
+#	$NetBSD: files.xen,v 1.189 2023/10/17 16:06:36 bouyer Exp $
 
-defflag	opt_xen.h			XEN XENPVH XENPVHVM PAE DOM0OPS
+defflag	opt_xen.h			XEN XENPVHVM PAE DOM0OPS
 
 file	arch/xen/x86/hypervisor_machdep.c	xen
 file	arch/xen/x86/xen_intr.c			xen



CVS commit: src/sys/arch

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 16:06:37 UTC 2023

Modified Files:
src/sys/arch/x86/x86: consinit.c
src/sys/arch/xen/conf: files.xen

Log Message:
XENPVH option is not used. Fix consinit.c to use XENPVHVM as intended
and XENPVH from defflag


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/x86/x86/consinit.c
cvs rdiff -u -r1.188 -r1.189 src/sys/arch/xen/conf/files.xen

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



CVS commit: src/sys/external/mit/xen-include-public/dist/xen/include/public

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 16:02:55 UTC 2023

Modified Files:
src/sys/external/mit/xen-include-public/dist/xen/include/public:
platform.h

Log Message:
Add XENPF_get_dom0_console, which gets a dom0_vga_console_info stucture
from the hypervisor. To be used by PVH dom0 kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/mit/xen-include-public/dist/xen/include/public/platform.h

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

Modified files:

Index: src/sys/external/mit/xen-include-public/dist/xen/include/public/platform.h
diff -u src/sys/external/mit/xen-include-public/dist/xen/include/public/platform.h:1.1.1.1 src/sys/external/mit/xen-include-public/dist/xen/include/public/platform.h:1.2
--- src/sys/external/mit/xen-include-public/dist/xen/include/public/platform.h:1.1.1.1	Sat Feb  2 08:03:48 2019
+++ src/sys/external/mit/xen-include-public/dist/xen/include/public/platform.h	Tue Oct 17 16:02:55 2023
@@ -615,6 +615,15 @@ typedef struct xenpf_symdata xenpf_symda
 DEFINE_XEN_GUEST_HANDLE(xenpf_symdata_t);
 
 /*
+ * Fetch the video console information and mode setup by Xen.  A non-
+ * negative return value indicates the size of the (part of the) structure
+ * which was filled.
+ */
+#define XENPF_get_dom0_console 64
+typedef struct dom0_vga_console_info xenpf_dom0_console_t;
+DEFINE_XEN_GUEST_HANDLE(xenpf_dom0_console_t);
+
+/*
  * ` enum neg_errnoval
  * ` HYPERVISOR_platform_op(const struct xen_platform_op*);
  */
@@ -644,6 +653,7 @@ struct xen_platform_op {
 struct xenpf_core_parking  core_parking;
 struct xenpf_resource_op   resource_op;
 struct xenpf_symdata   symdata;
+xenpf_dom0_console_t   dom0_console;
 uint8_tpad[128];
 } u;
 };



CVS commit: src/sys/external/mit/xen-include-public/dist/xen/include/public

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 16:02:55 UTC 2023

Modified Files:
src/sys/external/mit/xen-include-public/dist/xen/include/public:
platform.h

Log Message:
Add XENPF_get_dom0_console, which gets a dom0_vga_console_info stucture
from the hypervisor. To be used by PVH dom0 kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/mit/xen-include-public/dist/xen/include/public/platform.h

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



CVS commit: src/sys/external/mit/xen-include-public/dist/xen/include/public

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 14:15:54 UTC 2023

Modified Files:
src/sys/external/mit/xen-include-public/dist/xen/include/public: xen.h

Log Message:
Add ext_lfb_base to dom0_vga_console_info, from recent Xen. We know if it's
present or not by checking dom0.info_size


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/mit/xen-include-public/dist/xen/include/public/xen.h

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

Modified files:

Index: src/sys/external/mit/xen-include-public/dist/xen/include/public/xen.h
diff -u src/sys/external/mit/xen-include-public/dist/xen/include/public/xen.h:1.1.1.1 src/sys/external/mit/xen-include-public/dist/xen/include/public/xen.h:1.2
--- src/sys/external/mit/xen-include-public/dist/xen/include/public/xen.h:1.1.1.1	Sat Feb  2 08:03:48 2019
+++ src/sys/external/mit/xen-include-public/dist/xen/include/public/xen.h	Tue Oct 17 14:15:54 2023
@@ -922,6 +922,8 @@ typedef struct dom0_vga_console_info {
 uint32_t gbl_caps;
 /* Mode attributes (offset 0x0, VESA command 0x4f01). */
 uint16_t mode_attrs;
+	/* high 32 bits of lfb_base */
+	uint32_t ext_lfb_base;
 #endif
 } vesa_lfb;
 } u;



CVS commit: src/sys/external/mit/xen-include-public/dist/xen/include/public

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 14:15:54 UTC 2023

Modified Files:
src/sys/external/mit/xen-include-public/dist/xen/include/public: xen.h

Log Message:
Add ext_lfb_base to dom0_vga_console_info, from recent Xen. We know if it's
present or not by checking dom0.info_size


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/sys/external/mit/xen-include-public/dist/xen/include/public/xen.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

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 13:30:57 UTC 2023

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0
src/sys/arch/i386/conf: XEN3PAE_DOM0

Log Message:
Enable genfb in DOM0 kernels


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/i386/conf/XEN3PAE_DOM0

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

Modified files:

Index: src/sys/arch/amd64/conf/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.200 src/sys/arch/amd64/conf/XEN3_DOM0:1.201
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.200	Wed Oct  4 07:48:55 2023
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Tue Oct 17 13:30:56 2023
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.200 2023/10/04 07:48:55 rin Exp $
+# $NetBSD: XEN3_DOM0,v 1.201 2023/10/17 13:30:56 bouyer Exp $
 
 # XEN3_DOM0 machine description file
 #
@@ -14,7 +14,7 @@ include 	"arch/amd64/conf/std.xen"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"XEN3_DOM0-$Revision: 1.200 $"
+#ident		"XEN3_DOM0-$Revision: 1.201 $"
 
 maxusers	32		# estimated number of users
 
@@ -443,8 +443,8 @@ options 	PMS_SYNAPTICS_TOUCHPAD	# Enable
 options 	PMS_ELANTECH_TOUCHPAD	# Enable support for Elantech Touchpads
 options 	PMS_ALPS_TOUCHPAD	# Enable support for Alps Touchpads
 vga*		at pci? dev ? function ?
-#genfb*		at pci? dev ? function ?# Needs acpi_md_vesa_modenum
-	# in acpi_wakeup.c (!xenpv)
+genfb*		at pci? dev ? function ?
+
 #options 	VCONS_DRAW_INTR
 #wsdisplay*	at vga? console ?
 wsdisplay*	at wsemuldisplaydev?

Index: src/sys/arch/i386/conf/XEN3PAE_DOM0
diff -u src/sys/arch/i386/conf/XEN3PAE_DOM0:1.40 src/sys/arch/i386/conf/XEN3PAE_DOM0:1.41
--- src/sys/arch/i386/conf/XEN3PAE_DOM0:1.40	Sat Aug  5 14:38:43 2023
+++ src/sys/arch/i386/conf/XEN3PAE_DOM0	Tue Oct 17 13:30:56 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: XEN3PAE_DOM0,v 1.40 2023/08/05 14:38:43 riastradh Exp $
+#	$NetBSD: XEN3PAE_DOM0,v 1.41 2023/10/17 13:30:56 bouyer Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
@@ -531,6 +531,7 @@ pms*		at pckbc?		# PS/2 mouse for wsmous
 options 	PMS_SYNAPTICS_TOUCHPAD	# Enable support for Synaptics Touchpads
 #vga0		at isa?
 vga*		at pci? dev ? function ?
+genfb*		at pci? dev ? function ?
 #pcdisplay0	at isa?			# CGA, MDA, EGA, HGA
 #machfb* 	at pci? dev ? function ? # ATI Mach64 framebuffer driver
 wsdisplay*	at vga? console ?



CVS commit: src/sys/arch

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 13:30:57 UTC 2023

Modified Files:
src/sys/arch/amd64/conf: XEN3_DOM0
src/sys/arch/i386/conf: XEN3PAE_DOM0

Log Message:
Enable genfb in DOM0 kernels


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/i386/conf/XEN3PAE_DOM0

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



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

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 13:27:58 UTC 2023

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

Log Message:
Make sure to always fall back to xen_early_console, even for dom0


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/xen/x86/pvh_consinit.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/xen/x86

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 13:27:58 UTC 2023

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

Log Message:
Make sure to always fall back to xen_early_console, even for dom0


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

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

Modified files:

Index: src/sys/arch/xen/x86/pvh_consinit.c
diff -u src/sys/arch/xen/x86/pvh_consinit.c:1.5 src/sys/arch/xen/x86/pvh_consinit.c:1.6
--- src/sys/arch/xen/x86/pvh_consinit.c:1.5	Mon Oct 16 17:31:18 2023
+++ src/sys/arch/xen/x86/pvh_consinit.c	Tue Oct 17 13:27:58 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: pvh_consinit.c,v 1.5 2023/10/16 17:31:18 bouyer Exp $ */
+/* $NetBSD: pvh_consinit.c,v 1.6 2023/10/17 13:27:58 bouyer Exp $ */
 
 /*
  * Copyright (c) 2020 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pvh_consinit.c,v 1.5 2023/10/16 17:31:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pvh_consinit.c,v 1.6 2023/10/17 13:27:58 bouyer Exp $");
 
 #include "xencons.h"
 #include 
@@ -51,6 +51,11 @@ xen_pvh_consinit(void)
 	 * boot stage.
 	 */
 	static int initted = 0;
+
+	if (initted == 0) {
+		/* fall back to printk() until we can setup our console */
+		xen_early_console();
+	}
 	if (xendomain_is_dom0()) {
 		union xen_cmdline_parseinfo xcp;
 		xen_parse_cmdline(XEN_PARSE_CONSOLE, );
@@ -61,12 +66,12 @@ xen_pvh_consinit(void)
 		if (strcmp(xcp.xcp_console, "tty0") == 0 || /* linux name */
 		strcmp(xcp.xcp_console, "pc") == 0) { /* NetBSD name */
 #endif /* CONS_OVERRIDE */
+			initted++;
 			return 0; /* native console code will do it */
 		}
 	}
 	if (initted == 0 && !xendomain_is_dom0()) {
-		/* pmap not up yet, fall back to printk() */
-		xen_early_console();
+		/* pmap not up yet */
 		initted++;
 		return 1;
 	} else if (initted > 1) {



CVS commit: src/sys/arch

2023-10-17 Thread Manuel Bouyer
device_register(device_t dev, void *aux)
 		if (strncmp(xcp.xcp_bootdev, device_xname(dev),
 		sizeof(xcp.xcp_bootdev)) == 0)
 		{
-			goto found;
+			found = dev;
 		}
 	}
 #endif
-	if (device_class(dev) == DV_IFNET) {
-		struct btinfo_netif *bin = lookup_bootinfo(BTINFO_NETIF);
-		if (bin == NULL)
-			return;
-
-		/*
-		 * We don't check the driver name against the device name
-		 * passed by the boot ROM. The ROM should stay usable
-		 * if the driver gets obsoleted.
-		 * The physical attachment information (checked below)
-		 * must be sufficient to identify the device.
-		 */
-
-		if (bin->bus == BI_BUS_ISA &&
-		device_is_a(device_parent(dev), "isa")) {
-			struct isa_attach_args *iaa = aux;
-
-			/* compare IO base address */
-			/* XXXJRT what about multiple I/O addrs? */
-			if (iaa->ia_nio > 0 &&
-			bin->addr.iobase == iaa->ia_io[0].ir_addr)
-goto found;
-		}
-#if NPCI > 0
-		if (bin->bus == BI_BUS_PCI &&
-		device_is_a(device_parent(dev), "pci")) {
-			struct pci_attach_args *paa = aux;
-			int b, d, f;
-
-			/*
-			 * Calculate BIOS representation of:
-			 *
-			 *	
-			 *
-			 * and compare.
-			 */
-			pci_decompose_tag(paa->pa_pc, paa->pa_tag, , , );
-			if (bin->addr.tag == ((b << 8) | (d << 3) | f))
-goto found;
-		}
-#endif
+	if (found == NULL) {
+		if (isaboot != NULL) 
+			found = isaboot;
+		else if (pciboot != NULL)
+			found = pciboot;
 	}
-	return;
 
-found:
-	if (booted_device) {
-		/* XXX should be a "panic()" */
-		printf("warning: double match for boot device (%s, %s)\n",
-		device_xname(booted_device), device_xname(dev));
-		return;
+	if (found) {
+		if (booted_device) {
+			/* XXX should be a "panic()" */
+			printf("warning: double match for boot device (%s, %s)\n",
+			device_xname(booted_device), device_xname(dev));
+			return;
+		}
+		booted_device = found;
+		booted_method = "device/register";
 	}
-	booted_device = dev;
 }

Index: src/sys/arch/xen/x86/consinit.c
diff -u src/sys/arch/xen/x86/consinit.c:1.17 src/sys/arch/xen/x86/consinit.c:1.18
--- src/sys/arch/xen/x86/consinit.c:1.17	Sat Jul 22 19:13:17 2023
+++ src/sys/arch/xen/x86/consinit.c	Tue Oct 17 12:07:42 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: consinit.c,v 1.17 2023/07/22 19:13:17 mrg Exp $	*/
+/*	$NetBSD: consinit.c,v 1.18 2023/10/17 12:07:42 bouyer Exp $	*/
 /*	NetBSD: consinit.c,v 1.4 2004/03/13 17:31:34 bjh21 Exp 	*/
 
 /*
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.17 2023/07/22 19:13:17 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.18 2023/10/17 12:07:42 bouyer Exp $");
 
 #include "opt_kgdb.h"
 
@@ -37,11 +37,13 @@ __KERNEL_RCSID(0, "$NetBSD: consinit.c,v
 #include 
 #include 
 #include 
+#include 
 
 #include "xencons.h"
 #include "vga.h"
 #include "ega.h"
 #include "pcdisplay.h"
+#include "genfb.h"
 #if (NVGA > 0) || (NEGA > 0) || (NPCDISPLAY > 0)
 #include 
 #include 
@@ -70,6 +72,10 @@ __KERNEL_RCSID(0, "$NetBSD: consinit.c,v
 #include 
 #endif
 
+#if (NGENFB > 0)
+#include 
+#endif
+
 #include "opt_xen.h"
 #if (XEN > 0)
 #include 
@@ -146,14 +152,26 @@ consinit(void)
 {
 	static int initted = 0;
 	union xen_cmdline_parseinfo xcp;
+#if (NGENFB > 0)
+const struct btinfo_framebuffer *fbinfo = NULL;
+#endif
+
 
 	if (initted) {
 		return;
 	}
+
+	xen_early_console();
+
+#if (NGENFB > 0) && defined(DOM0OPS)
+	if (xendomain_is_dom0())
+		fbinfo = xen_genfb_getbtinfo();
+#endif
+
 	initted = 1;
 	xen_parse_cmdline(XEN_PARSE_CONSOLE, );
 	
-#if (NVGA > 0)
+#if (NVGA > 0) || (NGENFB > 0)
 	if (xendomain_is_privileged()) {
 #ifdef CONS_OVERRIDE
 		if (strcmp(default_consinfo.devname, "tty0") == 0 ||
@@ -163,9 +181,26 @@ consinit(void)
 		strcmp(xcp.xcp_console, "pc") == 0) { /* NetBSD name */
 #endif /* CONS_OVERRIDE */
 			int error;
+
+#if (NGENFB > 0)
+			if (fbinfo && fbinfo->physaddr > 0) {
+if (x86_genfb_cnattach() == -1) {
+	initted = 0; /* defer */
+	return;
+				}
+genfb_cnattach();
+goto dokbd;
+			} else {
+genfb_disable();
+			}
+#endif
 			vga_cnattach(x86_bus_space_io, x86_bus_space_mem,
 			-1, 1);
+#if (NGENFB > 0)
+dokbd:
+#endif
 			error = ENODEV;
+
 #if (NPCKBC > 0)
 			error = pckbc_cnattach(x86_bus_space_io, IO_KBD, KBCMDP,
 			PCKBC_KBD_SLOT, 0);

Added files:

Index: src/sys/arch/xen/xen/genfb_xen.c
diff -u /dev/null src/sys/arch/xen/xen/genfb_xen.c:1.1
--- /dev/null	Tue Oct 17 12:07:42 2023
+++ src/sys/arch/xen/xen/genfb_xen.c	Tue Oct 17 12:07:42 2023
@@ -0,0 +1,81 @@
+/*  $NetBSD: genfb_xen.c,v 1.1 2023/10/17 12:07:42 bouyer Exp $  */
+
+/*
+ * Copyright (c) 2023 Manuel Bouyer.
+ *
+ * Redistribution and use in source and binary forms, with or withou

CVS commit: src/sys/arch

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 12:07:42 UTC 2023

Modified Files:
src/sys/arch/x86/include: genfb_machdep.h
src/sys/arch/x86/pci: pci_machdep.c
src/sys/arch/x86/x86: consinit.c genfb_machdep.c
src/sys/arch/xen/conf: files.xen
src/sys/arch/xen/x86: autoconf.c consinit.c
Added Files:
src/sys/arch/xen/xen: genfb_xen.c

Log Message:
Support non-VGA framebuffers for Xen dom0. This is mandatory for graphic
console on EFI-only hardware.
Add a xen_genfb_getbtinfo() function which will return a btinfo_framebuffer
structure, filled in with parameters provided by Xen
when runing as a Xen dom0, call xen_genfb_getbtinfo() instead of
lookup_bootinfo(BTINFO_FRAMEBUFFER) when adding properties to the
PCI graphic device (when genfb is attached) and in x86_genfb_init()
when genfb is used as console.
x86/x86/consinit.c: If running as a Xen dom0, use xen_genfb_getbtinfo()
to check if we have a genfb console
xen/x86/consinit.c: support genfb as possible console
xen/x86/consinit.c: use the hypervior IO as console until a better one
is found. If the hypervisor is using a serial port for boot messages,
we'll get NetBSD's boot message on the serial port too until
the real console takes over.
xen/x86/autoconf.c: rework device_register() to be closer to the x86 version.
Especially make sure that device_pci_register() is called.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x86/include/genfb_machdep.h
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/x86/pci/pci_machdep.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/x86/x86/consinit.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/x86/x86/genfb_machdep.c
cvs rdiff -u -r1.187 -r1.188 src/sys/arch/xen/conf/files.xen
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/xen/x86/autoconf.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/xen/x86/consinit.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/xen/xen/genfb_xen.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/xen/xenbus

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 11:52:45 UTC 2023

Modified Files:
src/sys/arch/xen/xenbus: xenbus_probe.c

Log Message:
xenbus: if dom0 support is not compiled in, panic with a usefull message
instead of waiting for an event which will never happen


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/xen/xenbus/xenbus_probe.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/xen/xenbus

2023-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Oct 17 11:52:45 UTC 2023

Modified Files:
src/sys/arch/xen/xenbus: xenbus_probe.c

Log Message:
xenbus: if dom0 support is not compiled in, panic with a usefull message
instead of waiting for an event which will never happen


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/xen/xenbus/xenbus_probe.c

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

Modified files:

Index: src/sys/arch/xen/xenbus/xenbus_probe.c
diff -u src/sys/arch/xen/xenbus/xenbus_probe.c:1.59 src/sys/arch/xen/xenbus/xenbus_probe.c:1.60
--- src/sys/arch/xen/xenbus/xenbus_probe.c:1.59	Tue Aug  1 07:58:41 2023
+++ src/sys/arch/xen/xenbus/xenbus_probe.c	Tue Oct 17 11:52:45 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_probe.c,v 1.59 2023/08/01 07:58:41 mrg Exp $ */
+/* $NetBSD: xenbus_probe.c,v 1.60 2023/10/17 11:52:45 bouyer Exp $ */
 /**
  * Talks to Xen Store to figure out what devices we have.
  *
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.59 2023/08/01 07:58:41 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.60 2023/10/17 11:52:45 bouyer Exp $");
 
 #if 0
 #define DPRINTK(fmt, args...) \
@@ -722,7 +722,7 @@ xenbus_probe_init(void *unused)
 
 		DELAY(1000);
 #else /* DOM0OPS */
-		kthread_exit(0); /* can't get a working xenstore in this case */
+		panic("dom0 support not compiled in");
 #endif /* DOM0OPS */
 	}
 



CVS commit: src/sys/arch/xen

2023-10-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Oct 16 17:31:18 UTC 2023

Modified Files:
src/sys/arch/xen/include: hypervisor.h
src/sys/arch/xen/x86: pvh_consinit.c
src/sys/arch/xen/xen: xen_machdep.c

Log Message:
Move the pvh_xencons so xen_machdep.c as early_xencons, so it can be
used in the future as early ouput for plain PV guests too.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/xen/x86/pvh_consinit.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/xen/xen/xen_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/xen/include/hypervisor.h
diff -u src/sys/arch/xen/include/hypervisor.h:1.58 src/sys/arch/xen/include/hypervisor.h:1.59
--- src/sys/arch/xen/include/hypervisor.h:1.58	Mon Oct 16 17:29:31 2023
+++ src/sys/arch/xen/include/hypervisor.h	Mon Oct 16 17:31:17 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor.h,v 1.58 2023/10/16 17:29:31 bouyer Exp $	*/
+/*	$NetBSD: hypervisor.h,v 1.59 2023/10/16 17:31:17 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -214,4 +214,6 @@ hypervisor_notify_via_evtchn(unsigned in
 void xen_init_ksyms(void);
 void xen_map_vcpu(struct cpu_info *);
 
+void xen_early_console(void);
+
 #endif /* _XEN_HYPERVISOR_H_ */

Index: src/sys/arch/xen/x86/pvh_consinit.c
diff -u src/sys/arch/xen/x86/pvh_consinit.c:1.4 src/sys/arch/xen/x86/pvh_consinit.c:1.5
--- src/sys/arch/xen/x86/pvh_consinit.c:1.4	Sat Jul 22 19:13:17 2023
+++ src/sys/arch/xen/x86/pvh_consinit.c	Mon Oct 16 17:31:18 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: pvh_consinit.c,v 1.4 2023/07/22 19:13:17 mrg Exp $ */
+/* $NetBSD: pvh_consinit.c,v 1.5 2023/10/16 17:31:18 bouyer Exp $ */
 
 /*
  * Copyright (c) 2020 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pvh_consinit.c,v 1.4 2023/07/22 19:13:17 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pvh_consinit.c,v 1.5 2023/10/16 17:31:18 bouyer Exp $");
 
 #include "xencons.h"
 #include 
@@ -43,16 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: pvh_consinit
 
 #include "xen_def_cons.h"
 
-static int pvh_xenconscn_getc(dev_t);
-static void pvh_xenconscn_putc(dev_t, int);
-static void pvh_xenconscn_pollc(dev_t, int);
-
-static struct consdev pvh_xencons = {
-NULL, NULL, pvh_xenconscn_getc, pvh_xenconscn_putc, pvh_xenconscn_pollc,
-	NULL, NULL, NULL, NODEV, CN_NORMAL
-};
-
-
 int
 xen_pvh_consinit(void)
 {
@@ -76,7 +66,7 @@ xen_pvh_consinit(void)
 	}
 	if (initted == 0 && !xendomain_is_dom0()) {
 		/* pmap not up yet, fall back to printk() */
-		cn_tab = _xencons;
+		xen_early_console();
 		initted++;
 		return 1;
 	} else if (initted > 1) {
@@ -116,23 +106,3 @@ xen_pvh_consinit(void)
 #endif
 	return 1;
 }
-
-static int
-pvh_xenconscn_getc(dev_t dev)
-{
-	while(1)
-		;
-	return -1;
-}
-
-static void
-pvh_xenconscn_putc(dev_t dev, int c)
-{
-	printk("%c", c);
-}
-
-static void
-pvh_xenconscn_pollc(dev_t dev, int on)
-{
-	return;
-}

Index: src/sys/arch/xen/xen/xen_machdep.c
diff -u src/sys/arch/xen/xen/xen_machdep.c:1.27 src/sys/arch/xen/xen/xen_machdep.c:1.28
--- src/sys/arch/xen/xen/xen_machdep.c:1.27	Sat Aug 20 23:48:51 2022
+++ src/sys/arch/xen/xen/xen_machdep.c	Mon Oct 16 17:31:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_machdep.c,v 1.27 2022/08/20 23:48:51 riastradh Exp $	*/
+/*	$NetBSD: xen_machdep.c,v 1.28 2023/10/16 17:31:18 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_machdep.c,v 1.27 2022/08/20 23:48:51 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_machdep.c,v 1.28 2023/10/16 17:31:18 bouyer Exp $");
 
 #include "opt_xen.h"
 
@@ -70,6 +70,8 @@ __KERNEL_RCSID(0, "$NetBSD: xen_machdep.
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -440,6 +442,41 @@ printk(const char *fmt, ...)
 	(void)HYPERVISOR_console_io(CONSOLEIO_write, ret, buf);
 }
 
+static int early_xenconscn_getc(dev_t);
+static void early_xenconscn_putc(dev_t, int);
+static void early_xenconscn_pollc(dev_t, int);
+
+static struct consdev early_xencons = {
+	NULL, NULL,
+	early_xenconscn_getc, early_xenconscn_putc, early_xenconscn_pollc,
+	NULL, NULL, NULL, NODEV, CN_NORMAL
+};
+
+void
+xen_early_console(void)
+{
+	cn_tab = _xencons; /* fallback console */
+}
+
+static int
+early_xenconscn_getc(dev_t dev)
+{
+	while(1)
+		;
+	return -1;
+}
+
+static void 
+early_xenconscn_putc(dev_t dev, int c)
+{
+	printk("%c", c);
+}
+
+static void
+early_xenconscn_pollc(dev_t dev, int on)
+{
+	return;
+}
 bool xen_feature_tables[XENFEAT_NR_SUBMAPS * 32];
 
 void



CVS commit: src/sys/arch/xen

2023-10-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Oct 16 17:31:18 UTC 2023

Modified Files:
src/sys/arch/xen/include: hypervisor.h
src/sys/arch/xen/x86: pvh_consinit.c
src/sys/arch/xen/xen: xen_machdep.c

Log Message:
Move the pvh_xencons so xen_machdep.c as early_xencons, so it can be
used in the future as early ouput for plain PV guests too.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/xen/include/hypervisor.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/xen/x86/pvh_consinit.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/xen/xen/xen_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

2023-10-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Oct 16 17:29:31 UTC 2023

Modified Files:
src/sys/arch/amd64/amd64: locore.S
src/sys/arch/i386/i386: locore.S
src/sys/arch/xen/include: hypervisor.h

Log Message:
Xen's start_info_t is larger than 512 bytes these days, so bump the copy
size to a whole PAGE_SIZE, and CTASSERT() that start_info_t is smaller.
Luckily we didn't use yet the parts skipped


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/xen/include/hypervisor.h

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

Modified files:

Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.223 src/sys/arch/amd64/amd64/locore.S:1.224
--- src/sys/arch/amd64/amd64/locore.S:1.223	Sun Jul 16 19:55:43 2023
+++ src/sys/arch/amd64/amd64/locore.S	Mon Oct 16 17:29:30 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.223 2023/07/16 19:55:43 riastradh Exp $	*/
+/*	$NetBSD: locore.S,v 1.224 2023/10/16 17:29:30 bouyer Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -939,7 +939,7 @@ longmode_hi:
 	/* Copy start_info to a safe place. */
 	movq	%rbx,%rsi
 	movq	$_C_LABEL(start_info_union),%rdi
-	movq	$64,%rcx
+	movq	$(PAGE_SIZE / 8),%rcx
 	rep
 	movsq
 

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.196 src/sys/arch/i386/i386/locore.S:1.197
--- src/sys/arch/i386/i386/locore.S:1.196	Sun Jul 16 19:55:43 2023
+++ src/sys/arch/i386/i386/locore.S	Mon Oct 16 17:29:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.196 2023/07/16 19:55:43 riastradh Exp $	*/
+/*	$NetBSD: locore.S,v 1.197 2023/10/16 17:29:31 bouyer Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -128,7 +128,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.196 2023/07/16 19:55:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.197 2023/10/16 17:29:31 bouyer Exp $");
 
 #include "opt_copy_symtab.h"
 #include "opt_ddb.h"
@@ -1142,7 +1142,7 @@ begin:
 	/* Copy the necessary stuff from start_info structure. */
 	/* We need to copy shared_info early, so that sti/cli work */
 	movl	$RELOC(start_info_union),%edi
-	movl	$128,%ecx
+	movl	$(PAGE_SIZE / 4),%ecx
 	rep
 	movsl
 

Index: src/sys/arch/xen/include/hypervisor.h
diff -u src/sys/arch/xen/include/hypervisor.h:1.57 src/sys/arch/xen/include/hypervisor.h:1.58
--- src/sys/arch/xen/include/hypervisor.h:1.57	Sat Feb 25 00:34:48 2023
+++ src/sys/arch/xen/include/hypervisor.h	Mon Oct 16 17:29:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor.h,v 1.57 2023/02/25 00:34:48 riastradh Exp $	*/
+/*	$NetBSD: hypervisor.h,v 1.58 2023/10/16 17:29:31 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -58,6 +58,8 @@
 #include "isa.h"
 #include "pci.h"
 
+#include 
+
 struct cpu_info;
 
 int xen_hvm_init(void);
@@ -134,11 +136,13 @@ struct xen_npx_attach_args {
 union start_info_union
 {
 start_info_t start_info;
-char padding[512];
+char padding[PAGE_SIZE];
 };
 extern union start_info_union start_info_union;
 #define xen_start_info (start_info_union.start_info)
 
+CTASSERT(sizeof(start_info_t) <= PAGE_SIZE);
+
 extern struct hvm_start_info *hvm_start_info;
 
 /* For use in guest OSes. */



CVS commit: src/sys/arch

2023-10-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Oct 16 17:29:31 UTC 2023

Modified Files:
src/sys/arch/amd64/amd64: locore.S
src/sys/arch/i386/i386: locore.S
src/sys/arch/xen/include: hypervisor.h

Log Message:
Xen's start_info_t is larger than 512 bytes these days, so bump the copy
size to a whole PAGE_SIZE, and CTASSERT() that start_info_t is smaller.
Luckily we didn't use yet the parts skipped


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.224 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/i386/i386/locore.S
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/xen/include/hypervisor.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/x86

2023-10-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Oct 16 17:27:03 UTC 2023

Modified Files:
src/sys/arch/x86/acpi: acpi_machdep.c acpi_wakeup.c
src/sys/arch/x86/include: genfb_machdep.h
src/sys/arch/x86/pci: pci_machdep.c
src/sys/arch/x86/x86: genfb_machdep.c hyperv.c

Log Message:
Declare
int acpi_md_vesa_modenum;
int acpi_md_vbios_reset;
struct vcons_screen x86_genfb_console_screen;

in genfb_machdep.h instead of locally as extern in various .c files.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/x86/acpi/acpi_machdep.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/x86/acpi/acpi_wakeup.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/include/genfb_machdep.h
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/x86/pci/pci_machdep.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/x86/genfb_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x86/x86/hyperv.c

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

Modified files:

Index: src/sys/arch/x86/acpi/acpi_machdep.c
diff -u src/sys/arch/x86/acpi/acpi_machdep.c:1.35 src/sys/arch/x86/acpi/acpi_machdep.c:1.36
--- src/sys/arch/x86/acpi/acpi_machdep.c:1.35	Tue Jan 24 09:35:20 2023
+++ src/sys/arch/x86/acpi/acpi_machdep.c	Mon Oct 16 17:27:02 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.35 2023/01/24 09:35:20 riastradh Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.36 2023/10/16 17:27:02 bouyer Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.35 2023/01/24 09:35:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.36 2023/10/16 17:27:02 bouyer Exp $");
 
 #include 
 #include 
@@ -72,6 +72,7 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_machdep
 
 #include 
 #include 
+#include 
 
 #include "ioapic.h"
 
@@ -594,6 +595,8 @@ acpi_md_callback(struct acpi_softc *sc)
 }
 
 #ifndef XENPV
+int acpi_md_vbios_reset = 0;
+
 void
 device_acpi_register(device_t dev, void *aux)
 {
@@ -609,8 +612,6 @@ device_acpi_register(device_t dev, void 
 	device_is_isa = device_is_a(parent, "isa");
 
 	if (device_is_vga && (device_is_pci || device_is_isa)) {
-		extern int acpi_md_vbios_reset;
-
 		acpi_md_vbios_reset = VBIOS_RESET_DEFAULT;
 	}
 }

Index: src/sys/arch/x86/acpi/acpi_wakeup.c
diff -u src/sys/arch/x86/acpi/acpi_wakeup.c:1.55 src/sys/arch/x86/acpi/acpi_wakeup.c:1.56
--- src/sys/arch/x86/acpi/acpi_wakeup.c:1.55	Fri Aug 25 08:05:18 2023
+++ src/sys/arch/x86/acpi/acpi_wakeup.c	Mon Oct 16 17:27:02 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_wakeup.c,v 1.55 2023/08/25 08:05:18 riastradh Exp $	*/
+/*	$NetBSD: acpi_wakeup.c,v 1.56 2023/10/16 17:27:02 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2011 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.55 2023/08/25 08:05:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.56 2023/10/16 17:27:02 bouyer Exp $");
 
 #include 
 #include 
@@ -98,6 +98,7 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.
 #include 
 #include 
 #include 
+#include 
 
 #include "opt_vga.h"
 
@@ -111,8 +112,6 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.
 static paddr_t acpi_wakeup_paddr = 3 * PAGE_SIZE;
 static vaddr_t acpi_wakeup_vaddr;
 
-int acpi_md_vbios_reset = 0; /* Referenced by dev/pci/vga_pci.c */
-int acpi_md_vesa_modenum = 0; /* Referenced by arch/x86/x86/genfb_machdep.c */
 static int acpi_md_beep_on_reset = 0;
 
 static int	acpi_md_s4bios(void);

Index: src/sys/arch/x86/include/genfb_machdep.h
diff -u src/sys/arch/x86/include/genfb_machdep.h:1.5 src/sys/arch/x86/include/genfb_machdep.h:1.6
--- src/sys/arch/x86/include/genfb_machdep.h:1.5	Thu Jan 28 01:57:31 2021
+++ src/sys/arch/x86/include/genfb_machdep.h	Mon Oct 16 17:27:02 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_machdep.h,v 1.5 2021/01/28 01:57:31 jmcneill Exp $ */
+/* $NetBSD: genfb_machdep.h,v 1.6 2023/10/16 17:27:02 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill 
@@ -34,4 +34,8 @@ int	x86_genfb_cnattach(void);
 void	x86_genfb_set_console_dev(device_t);
 void	x86_genfb_ddb_trap_callback(int);
 
+extern int acpi_md_vesa_modenum;
+extern int acpi_md_vbios_reset;
+extern struct vcons_screen x86_genfb_console_screen;
+
 #endif /* !_X86_GENFB_MACHDEP_H */

Index: src/sys/arch/x86/pci/pci_machdep.c
diff -u src/sys/arch/x86/pci/pci_machdep.c:1.95 src/sys/arch/x86/pci/pci_machdep.c:1.96
--- src/sys/arch/x86/pci/pci_machdep.c:1.95	Fri Aug 25 08:05:18 2023
+++ src/sys/arch/x86/pci/pci_machdep.c	Mon Oct 16 17:27:02 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.95 2023/08/25 08:05:18 riastradh Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.96 2023/10/16 17:27:02 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.95 2023/08/25 08:05:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.96 

CVS commit: src/sys/arch/x86

2023-10-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Oct 16 17:27:03 UTC 2023

Modified Files:
src/sys/arch/x86/acpi: acpi_machdep.c acpi_wakeup.c
src/sys/arch/x86/include: genfb_machdep.h
src/sys/arch/x86/pci: pci_machdep.c
src/sys/arch/x86/x86: genfb_machdep.c hyperv.c

Log Message:
Declare
int acpi_md_vesa_modenum;
int acpi_md_vbios_reset;
struct vcons_screen x86_genfb_console_screen;

in genfb_machdep.h instead of locally as extern in various .c files.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/x86/acpi/acpi_machdep.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/x86/acpi/acpi_wakeup.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/include/genfb_machdep.h
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/x86/pci/pci_machdep.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/x86/genfb_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x86/x86/hyperv.c

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



CVS commit: src/sys/netinet

2023-09-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 13 15:58:13 UTC 2023

Modified Files:
src/sys/netinet: sctp_output.c

Log Message:
handle EHOSTDOWN the same way as EHOSTUNREACH in sctp_med_chunk_output().
Compile-tested only (I don't have a sctp setup); proposed in
http://mail-index.netbsd.org/tech-net/2023/09/11/msg008611.html
LGTM from Greg Troxel and Robert Swindells


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/netinet/sctp_output.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/netinet/sctp_output.c
diff -u src/sys/netinet/sctp_output.c:1.33 src/sys/netinet/sctp_output.c:1.34
--- src/sys/netinet/sctp_output.c:1.33	Fri Nov  4 09:01:53 2022
+++ src/sys/netinet/sctp_output.c	Wed Sep 13 15:58:13 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sctp_output.c,v 1.33 2022/11/04 09:01:53 ozaki-r Exp $ */
+/*	$NetBSD: sctp_output.c,v 1.34 2023/09/13 15:58:13 bouyer Exp $ */
 /*	$KAME: sctp_output.c,v 1.48 2005/06/16 18:29:24 jinmei Exp $	*/
 
 /*
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sctp_output.c,v 1.33 2022/11/04 09:01:53 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctp_output.c,v 1.34 2023/09/13 15:58:13 bouyer Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -5643,7 +5643,8 @@ sctp_med_chunk_output(struct sctp_inpcb 
 			}
 			hbflag = 0;
 		}
-		if (error == EHOSTUNREACH) {
+		if (error == EHOSTUNREACH ||
+		error == EHOSTDOWN) {
 			/*
 			 * Destination went
 			 * unreachable during
@@ -5921,7 +5922,8 @@ sctp_med_chunk_output(struct sctp_inpcb 
 	}
 	hbflag = 0;
 }
-if (error == EHOSTUNREACH) {
+if (error == EHOSTUNREACH ||
+error == EHOSTDOWN) {
 	/*
 	 * Destination went unreachable during
 	 * this send



CVS commit: src/sys/netinet

2023-09-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 13 15:58:13 UTC 2023

Modified Files:
src/sys/netinet: sctp_output.c

Log Message:
handle EHOSTDOWN the same way as EHOSTUNREACH in sctp_med_chunk_output().
Compile-tested only (I don't have a sctp setup); proposed in
http://mail-index.netbsd.org/tech-net/2023/09/11/msg008611.html
LGTM from Greg Troxel and Robert Swindells


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/netinet/sctp_output.c

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



CVS commit: src/sys/netinet

2023-09-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 13 15:54:28 UTC 2023

Modified Files:
src/sys/netinet: tcp_output.c

Log Message:
Handle EHOSTDOWN the same way as EHOSTUNREACH and ENETDOWN for established
connections. Avoid premature end of tcp connection with "Host is down" error
in case of transient link-layer failure.
Discussed and patch proposed in
http://mail-index.netbsd.org/tech-net/2023/09/11/msg008610.html
and followups.


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 src/sys/netinet/tcp_output.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/netinet/tcp_output.c
diff -u src/sys/netinet/tcp_output.c:1.218 src/sys/netinet/tcp_output.c:1.219
--- src/sys/netinet/tcp_output.c:1.218	Fri Nov  4 09:01:53 2022
+++ src/sys/netinet/tcp_output.c	Wed Sep 13 15:54:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_output.c,v 1.218 2022/11/04 09:01:53 ozaki-r Exp $	*/
+/*	$NetBSD: tcp_output.c,v 1.219 2023/09/13 15:54:28 bouyer Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -135,7 +135,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.218 2022/11/04 09:01:53 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.219 2023/09/13 15:54:28 bouyer Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1612,8 +1612,8 @@ out:
 			TCP_STATINC(TCP_STAT_SELFQUENCH);
 			tcp_quench(tp->t_inpcb);
 			error = 0;
-		} else if ((error == EHOSTUNREACH || error == ENETDOWN) &&
-		TCPS_HAVERCVDSYN(tp->t_state)) {
+		} else if ((error == EHOSTUNREACH || error == ENETDOWN ||
+		error == EHOSTDOWN) && TCPS_HAVERCVDSYN(tp->t_state)) {
 			tp->t_softerror = error;
 			error = 0;
 		}



CVS commit: src/sys/netinet

2023-09-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Sep 13 15:54:28 UTC 2023

Modified Files:
src/sys/netinet: tcp_output.c

Log Message:
Handle EHOSTDOWN the same way as EHOSTUNREACH and ENETDOWN for established
connections. Avoid premature end of tcp connection with "Host is down" error
in case of transient link-layer failure.
Discussed and patch proposed in
http://mail-index.netbsd.org/tech-net/2023/09/11/msg008610.html
and followups.


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 src/sys/netinet/tcp_output.c

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



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

2023-09-12 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Sep 12 12:56:21 UTC 2023

Modified Files:
src/sys/arch/arm/dts: sun8i-h3-orangepi-plus2e.dts
Removed Files:
src/sys/arch/arm/dts: sun8i-h3-orangepi-one.dts

Log Message:
Remove now-unneeded and brocken (probably since dts-5.15 import)
sun8i-h3-orangepi-one.dts, and let the build use the one from sys/external.
Problem reported and fix tested by Dave Tyson as reported on port-arm@
While there remove #include "sun8i-h3.dtsi" from sun8i-h3-orangepi-plus2e.dts,
this file has been removed with the dts-5.15 import.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/sys/arch/arm/dts/sun8i-h3-orangepi-one.dts
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts

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

Modified files:

Index: src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts
diff -u src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts:1.4 src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts:1.5
--- src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts:1.4	Tue May 21 22:31:39 2019
+++ src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts	Tue Sep 12 12:56:21 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: sun8i-h3-orangepi-plus2e.dts,v 1.4 2019/05/21 22:31:39 jmcneill Exp $ */
+/* $NetBSD: sun8i-h3-orangepi-plus2e.dts,v 1.5 2023/09/12 12:56:21 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -27,7 +27,6 @@
  */
 
 #include "../../../external/gpl2/dts/dist/arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts"
-#include "sun8i-h3.dtsi"
 
 / {
 	cpus {



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

2023-09-12 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Sep 12 12:56:21 UTC 2023

Modified Files:
src/sys/arch/arm/dts: sun8i-h3-orangepi-plus2e.dts
Removed Files:
src/sys/arch/arm/dts: sun8i-h3-orangepi-one.dts

Log Message:
Remove now-unneeded and brocken (probably since dts-5.15 import)
sun8i-h3-orangepi-one.dts, and let the build use the one from sys/external.
Problem reported and fix tested by Dave Tyson as reported on port-arm@
While there remove #include "sun8i-h3.dtsi" from sun8i-h3-orangepi-plus2e.dts,
this file has been removed with the dts-5.15 import.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/sys/arch/arm/dts/sun8i-h3-orangepi-one.dts
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts

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



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

2023-09-10 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Sep 10 15:23:01 UTC 2023

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

Log Message:
If Xen system time went backward, instead of ignoring the event assume
one tick passed and reinitialise the local state.
If we need to call the hardclock timer several time to catch up missed events,
don't do more than one second in a single event; and schedule the next
event faster.

Hopefully fixes occasionnal
panic: cpu1: time has not advanced in 1501 heartbeats
or
panic: cpu0: softints stuck for 16 seconds
seen in daily Xen atf runs.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/xen/xen/xen_clock.c

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

Modified files:

Index: src/sys/arch/xen/xen/xen_clock.c
diff -u src/sys/arch/xen/xen/xen_clock.c:1.17 src/sys/arch/xen/xen/xen_clock.c:1.18
--- src/sys/arch/xen/xen/xen_clock.c:1.17	Tue Aug  1 20:11:13 2023
+++ src/sys/arch/xen/xen/xen_clock.c	Sun Sep 10 15:23:01 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_clock.c,v 1.17 2023/08/01 20:11:13 riastradh Exp $	*/
+/*	$NetBSD: xen_clock.c,v 1.18 2023/09/10 15:23:01 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2018 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.17 2023/08/01 20:11:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.18 2023/09/10 15:23:01 bouyer Exp $");
 
 #include 
 #include 
@@ -800,7 +800,6 @@ xen_timer_handler(void *cookie, struct c
 #if defined(XENPV)
 	frame = NULL; /* We use values cached in curcpu()  */
 #endif
-again:
 	/*
 	 * Find how many nanoseconds of Xen system time has elapsed
 	 * since the last hardclock tick.
@@ -817,7 +816,11 @@ again:
 		last - now);
 #endif
 		ci->ci_xen_systime_backwards_hardclock_evcnt.ev_count++;
-		now = last;
+		/*
+		 * we've lost track of time. Just pretends that one
+		 * tick elapsed, and reset our idea of last tick.
+		 */
+		ci->ci_xen_hardclock_systime_ns = last = now - ns_per_tick;
 	}
 	delta = now - last;
 
@@ -845,6 +848,9 @@ again:
 			xen_timecounter.tc_counter_mask);
 			ci->ci_xen_timecounter_jump_evcnt.ev_count++;
 		}
+		/* don't try to catch up more than one second at once */
+		if (delta > 10UL)
+			delta = 10UL;
 	}
 	while (delta >= ns_per_tick) {
 		ci->ci_xen_hardclock_systime_ns += ns_per_tick;
@@ -859,13 +865,19 @@ again:
 
 	/*
 	 * Re-arm the timer.  If it fails, it's probably because the
-	 * time is in the past, so update our idea of what the Xen
-	 * system time is and try again.
+	 * time is in the past, possibly because we're in the
+	 * process of catching up missed hardclock calls.
+	 * In this case schedule a tick in the nead future.
 	 */
 	next = ci->ci_xen_hardclock_systime_ns + ns_per_tick;
 	error = HYPERVISOR_set_timer_op(next);
-	if (error)
-		goto again;
+	if (error) {
+		next = xen_vcputime_systime_ns() + ns_per_tick / 2;
+		error = HYPERVISOR_set_timer_op(next);
+		if (error) {
+			panic("failed to re-arm Xen timer %d", error);
+		}
+	}
 
 	/* Success!  */
 	return 0;



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

2023-09-10 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Sep 10 15:23:01 UTC 2023

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

Log Message:
If Xen system time went backward, instead of ignoring the event assume
one tick passed and reinitialise the local state.
If we need to call the hardclock timer several time to catch up missed events,
don't do more than one second in a single event; and schedule the next
event faster.

Hopefully fixes occasionnal
panic: cpu1: time has not advanced in 1501 heartbeats
or
panic: cpu0: softints stuck for 16 seconds
seen in daily Xen atf runs.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/xen/xen/xen_clock.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/xen/xen

2023-07-25 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Jul 25 16:15:50 UTC 2023

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

Log Message:
Propoerly handle 4k sector size backends:
- report the backend's sector size to upper layers, not DEV_BSIZE.
  Adjust the number of sectors accordingly.
- Use sc_secsize instead of XEN_BSIZE where appropriate. The sectors numbers
  in I/O requests are still in XEN_BSIZE units, but must be a multiple
  of sc_secsize/XEN_BSIZE.
- As a consequence of previous, the buffer has to be aligned to sc_secsize,
  aligned to XEN_BSIZE may not be enough. This means that we may have to
  xbd_map_align() more buffer, including some without B_PHYS set.
- Add some more DPRINTF lines, related to I/O requests

Tested with a linux dom0.
thanks to Christian Kujau for providing access to his hardware for testing
and debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/xen/xen/xbd_xenbus.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/xen/xen

2023-07-25 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Jul 25 16:15:50 UTC 2023

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

Log Message:
Propoerly handle 4k sector size backends:
- report the backend's sector size to upper layers, not DEV_BSIZE.
  Adjust the number of sectors accordingly.
- Use sc_secsize instead of XEN_BSIZE where appropriate. The sectors numbers
  in I/O requests are still in XEN_BSIZE units, but must be a multiple
  of sc_secsize/XEN_BSIZE.
- As a consequence of previous, the buffer has to be aligned to sc_secsize,
  aligned to XEN_BSIZE may not be enough. This means that we may have to
  xbd_map_align() more buffer, including some without B_PHYS set.
- Add some more DPRINTF lines, related to I/O requests

Tested with a linux dom0.
thanks to Christian Kujau for providing access to his hardware for testing
and debugging.


To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/xen/xen/xbd_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.133 src/sys/arch/xen/xen/xbd_xenbus.c:1.134
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.133	Fri Jul 21 11:28:50 2023
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Tue Jul 25 16:15:50 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.133 2023/07/21 11:28:50 bouyer Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.134 2023/07/25 16:15:50 bouyer Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.133 2023/07/21 11:28:50 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.134 2023/07/25 16:15:50 bouyer Exp $");
 
 #include "opt_xen.h"
 
@@ -169,7 +169,7 @@ struct xbd_xenbus_softc {
 #define BLKIF_SHUTDOWN_REMOTE 1 /* backend-initiated shutdown in progress */
 #define BLKIF_SHUTDOWN_LOCAL  2 /* locally-initiated shutdown in progress */
 
-	uint64_t sc_sectors; /* number of XEN_BSIZE sectors for this device */
+	uint64_t sc_sectors; /* number of sc_secsize sectors for this device */
 	u_long sc_secsize; /* sector size */
 	uint64_t sc_xbdsize; /* size of disk in DEV_BSIZE */
 	u_long sc_info; /* VDISK_* */
@@ -674,15 +674,14 @@ xbd_backend_changed(void *arg, XenbusSta
 		xbd_connect(sc);
 		sc->sc_shutdown = BLKIF_SHUTDOWN_RUN;
 		sc->sc_xbdsize =
-		sc->sc_sectors * (uint64_t)XEN_BSIZE / DEV_BSIZE;
+		sc->sc_sectors * (uint64_t)sc->sc_secsize / DEV_BSIZE;
 		dg = >sc_dksc.sc_dkdev.dk_geom;
 		memset(dg, 0, sizeof(*dg));
 
-		dg->dg_secperunit = sc->sc_xbdsize;
-		dg->dg_secsize = DEV_BSIZE;
+		dg->dg_secperunit = sc->sc_sectors;
+		dg->dg_secsize = sc->sc_secsize;
 		dg->dg_ntracks = 1;
-		// XXX: Ok to hard-code DEV_BSIZE?
-		dg->dg_nsectors = 1024 * (1024 / dg->dg_secsize);
+		dg->dg_nsectors = (1024 * 1024) / dg->dg_secsize;
 		dg->dg_ncylinders = dg->dg_secperunit / dg->dg_nsectors;
 
 		bufq_alloc(>sc_dksc.sc_bufq, "fcfs", 0);
@@ -693,10 +692,10 @@ xbd_backend_changed(void *arg, XenbusSta
 		hypervisor_unmask_event(sc->sc_evtchn);
 
 		format_bytes(buf, uimin(9, sizeof(buf)),
-		sc->sc_sectors * XEN_BSIZE);
+		sc->sc_sectors * dg->dg_secsize);
 		aprint_normal_dev(sc->sc_dksc.sc_dev,
 "%s, %d bytes/sect x %" PRIu64 " sectors\n",
-buf, (int)dg->dg_secsize, sc->sc_xbdsize);
+buf, (int)dg->dg_secsize, sc->sc_sectors);
 		snprintb(buf, sizeof(buf), BLKIF_FEATURE_BITS,
 		sc->sc_features);
 		aprint_normal_dev(sc->sc_dksc.sc_dev,
@@ -739,14 +738,6 @@ xbd_connect(struct xbd_xenbus_softc *sc)
 		panic("%s: can't read number from %s/virtual-device\n",
 		device_xname(sc->sc_dksc.sc_dev),
 		sc->sc_xbusd->xbusd_otherend);
-	err = xenbus_read_ull(NULL,
-	sc->sc_xbusd->xbusd_otherend, "sectors", , 10);
-	if (err)
-		panic("%s: can't read number from %s/sectors\n",
-		device_xname(sc->sc_dksc.sc_dev),
-		sc->sc_xbusd->xbusd_otherend);
-	sc->sc_sectors = sectors;
-
 	err = xenbus_read_ul(NULL,
 	sc->sc_xbusd->xbusd_otherend, "info", >sc_info, 10);
 	if (err)
@@ -760,6 +751,14 @@ xbd_connect(struct xbd_xenbus_softc *sc)
 		device_xname(sc->sc_dksc.sc_dev),
 		sc->sc_xbusd->xbusd_otherend);
 
+	err = xenbus_read_ull(NULL,
+	sc->sc_xbusd->xbusd_otherend, "sectors", , 10);
+	if (err)
+		panic("%s: can't read number from %s/sectors\n",
+		device_xname(sc->sc_dksc.sc_dev),
+		sc->sc_xbusd->xbusd_otherend);
+	sc->sc_sectors = sectors * (uint64_t)XEN_BSIZE / sc->sc_secsize;
+
 	xenbus_switch_state(sc->sc_xbusd, NULL, XenbusStateConnected);
 }
 
@@ -839,6 +838,8 @@ again:
 		bp, (long)bp->b_bc

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

2023-07-21 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Jul 21 11:28:50 UTC 2023

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

Log Message:
Also use XEN_BSIZE when computing the number of bytes for format_bytes().
While there note in a comment that sc_sectors is in XEN_BSIZE units


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/xen/xen/xbd_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.132 src/sys/arch/xen/xen/xbd_xenbus.c:1.133
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.132	Fri Jul 21 11:21:55 2023
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Fri Jul 21 11:28:50 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.132 2023/07/21 11:21:55 bouyer Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.133 2023/07/21 11:28:50 bouyer Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.132 2023/07/21 11:21:55 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.133 2023/07/21 11:28:50 bouyer Exp $");
 
 #include "opt_xen.h"
 
@@ -169,7 +169,7 @@ struct xbd_xenbus_softc {
 #define BLKIF_SHUTDOWN_REMOTE 1 /* backend-initiated shutdown in progress */
 #define BLKIF_SHUTDOWN_LOCAL  2 /* locally-initiated shutdown in progress */
 
-	uint64_t sc_sectors; /* number of sectors for this device */
+	uint64_t sc_sectors; /* number of XEN_BSIZE sectors for this device */
 	u_long sc_secsize; /* sector size */
 	uint64_t sc_xbdsize; /* size of disk in DEV_BSIZE */
 	u_long sc_info; /* VDISK_* */
@@ -693,7 +693,7 @@ xbd_backend_changed(void *arg, XenbusSta
 		hypervisor_unmask_event(sc->sc_evtchn);
 
 		format_bytes(buf, uimin(9, sizeof(buf)),
-		sc->sc_sectors * sc->sc_secsize);
+		sc->sc_sectors * XEN_BSIZE);
 		aprint_normal_dev(sc->sc_dksc.sc_dev,
 "%s, %d bytes/sect x %" PRIu64 " sectors\n",
 buf, (int)dg->dg_secsize, sc->sc_xbdsize);



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

2023-07-21 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Jul 21 11:28:50 UTC 2023

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

Log Message:
Also use XEN_BSIZE when computing the number of bytes for format_bytes().
While there note in a comment that sc_sectors is in XEN_BSIZE units


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/xen/xen/xbd_xenbus.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/xen/xen

2023-07-21 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Jul 21 11:21:56 UTC 2023

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

Log Message:
The disk size reported in the xenstore is always in XEN_BSIZE units,
not sector-size. Should fix the issue reported by Christian Kujau
on netbsd-users and port-xen.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/arch/xen/xen/xbd_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.131 src/sys/arch/xen/xen/xbd_xenbus.c:1.132
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.131	Sat Feb 25 00:35:15 2023
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Fri Jul 21 11:21:55 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.131 2023/02/25 00:35:15 riastradh Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.132 2023/07/21 11:21:55 bouyer Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.131 2023/02/25 00:35:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.132 2023/07/21 11:21:55 bouyer Exp $");
 
 #include "opt_xen.h"
 
@@ -674,7 +674,7 @@ xbd_backend_changed(void *arg, XenbusSta
 		xbd_connect(sc);
 		sc->sc_shutdown = BLKIF_SHUTDOWN_RUN;
 		sc->sc_xbdsize =
-		sc->sc_sectors * (uint64_t)sc->sc_secsize / DEV_BSIZE;
+		sc->sc_sectors * (uint64_t)XEN_BSIZE / DEV_BSIZE;
 		dg = >sc_dksc.sc_dkdev.dk_geom;
 		memset(dg, 0, sizeof(*dg));
 



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

2023-07-21 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Jul 21 11:21:56 UTC 2023

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

Log Message:
The disk size reported in the xenstore is always in XEN_BSIZE units,
not sector-size. Should fix the issue reported by Christian Kujau
on netbsd-users and port-xen.


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/arch/xen/xen/xbd_xenbus.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/xen/xen

2023-07-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jul 17 10:12:54 UTC 2023

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

Log Message:
Unmask event after arming the one-shot timer in clock initialisation,
to avoid a possible race with xen_timer_handler() updating
ci_xen_hardclock_systime_ns while we're reading it.
Pointed out by Taylor R Campbell


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/xen/xen/xen_clock.c

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

Modified files:

Index: src/sys/arch/xen/xen/xen_clock.c
diff -u src/sys/arch/xen/xen/xen_clock.c:1.11 src/sys/arch/xen/xen/xen_clock.c:1.12
--- src/sys/arch/xen/xen/xen_clock.c:1.11	Thu Jul 13 13:34:15 2023
+++ src/sys/arch/xen/xen/xen_clock.c	Mon Jul 17 10:12:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_clock.c,v 1.11 2023/07/13 13:34:15 riastradh Exp $	*/
+/*	$NetBSD: xen_clock.c,v 1.12 2023/07/17 10:12:54 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2018 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.11 2023/07/13 13:34:15 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.12 2023/07/17 10:12:54 bouyer Exp $");
 
 #include 
 #include 
@@ -729,12 +729,12 @@ xen_resumeclocks(struct cpu_info *ci)
 	/* Pretend the last hardclock happened right now.  */
 	ci->ci_xen_hardclock_systime_ns = xen_vcputime_systime_ns();
 
-	hypervisor_unmask_event(evtch);
 
 	/* Arm the one-shot timer.  */
 	error = HYPERVISOR_set_timer_op(ci->ci_xen_hardclock_systime_ns +
 	NS_PER_TICK);
 	KASSERT(error == 0);
+	hypervisor_unmask_event(evtch);
 
 	/* We'd better not have switched CPUs.  */
 	KASSERT(ci == curcpu());



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

2023-07-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon Jul 17 10:12:54 UTC 2023

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

Log Message:
Unmask event after arming the one-shot timer in clock initialisation,
to avoid a possible race with xen_timer_handler() updating
ci_xen_hardclock_systime_ns while we're reading it.
Pointed out by Taylor R Campbell


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/xen/xen/xen_clock.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/xen/xen

2023-07-07 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Jul  7 15:13:41 UTC 2023

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

Log Message:
Unmask event after VCPUOP_stop_periodic_timer and
initializing ci->ci_xen_hardclock_systime_ns, to avoid a possible race with
xen_timer_handler()


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

2023-07-07 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Jul  7 15:13:41 UTC 2023

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

Log Message:
Unmask event after VCPUOP_stop_periodic_timer and
initializing ci->ci_xen_hardclock_systime_ns, to avoid a possible race with
xen_timer_handler()


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/xen/xen/xen_clock.c

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

Modified files:

Index: src/sys/arch/xen/xen/xen_clock.c
diff -u src/sys/arch/xen/xen/xen_clock.c:1.9 src/sys/arch/xen/xen/xen_clock.c:1.10
--- src/sys/arch/xen/xen/xen_clock.c:1.9	Mon May  1 09:03:19 2023
+++ src/sys/arch/xen/xen/xen_clock.c	Fri Jul  7 15:13:41 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_clock.c,v 1.9 2023/05/01 09:03:19 riastradh Exp $	*/
+/*	$NetBSD: xen_clock.c,v 1.10 2023/07/07 15:13:41 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2018 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.9 2023/05/01 09:03:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_clock.c,v 1.10 2023/07/07 15:13:41 bouyer Exp $");
 
 #include 
 #include 
@@ -700,7 +700,6 @@ xen_resumeclocks(struct cpu_info *ci)
 	ci, IPL_CLOCK, NULL, intr_xname, true, ci) == NULL)
 		panic("failed to establish timer interrupt handler");
 
-	hypervisor_unmask_event(evtch);
 
 	aprint_verbose("Xen %s: using event channel %d\n", intr_xname, evtch);
 
@@ -714,6 +713,8 @@ xen_resumeclocks(struct cpu_info *ci)
 	/* Pretend the last hardclock happened right now.  */
 	ci->ci_xen_hardclock_systime_ns = xen_vcputime_systime_ns();
 
+	hypervisor_unmask_event(evtch);
+
 	/* Arm the one-shot timer.  */
 	error = HYPERVISOR_set_timer_op(ci->ci_xen_hardclock_systime_ns +
 	NS_PER_TICK);



CVS commit: [netbsd-10] src/doc

2023-06-30 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Jun 30 18:10:44 UTC 2023

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
ticket #220


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.75 -r1.1.2.76 src/doc/CHANGES-10.0

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

Modified files:

Index: src/doc/CHANGES-10.0
diff -u src/doc/CHANGES-10.0:1.1.2.75 src/doc/CHANGES-10.0:1.1.2.76
--- src/doc/CHANGES-10.0:1.1.2.75	Fri Jun 30 17:21:33 2023
+++ src/doc/CHANGES-10.0	Fri Jun 30 18:10:44 2023
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.0,v 1.1.2.75 2023/06/30 17:21:33 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.76 2023/06/30 18:10:44 bouyer Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -2339,3 +2339,9 @@ sys/arch/i386/stand/bootxx/boot1.c		1.22
 	x86: primary bootstrap is now able to read a GPT inside RAIDframe.
 	[manu, ticket #222]
 
+usr.bin/dc/bcode.c1.4
+
+	Make this compile when BIGNUM limbs (BN_ULONG) are not the same
+	size as "unsigned long" (e.g. in bn(64/32) configurations of openssl).
+	[martin, ticket #220]
+



CVS commit: [netbsd-10] src/doc

2023-06-30 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Jun 30 18:10:44 UTC 2023

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
ticket #220


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.75 -r1.1.2.76 src/doc/CHANGES-10.0

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



CVS commit: [netbsd-10] src/usr.bin/dc

2023-06-30 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Jun 30 18:10:12 UTC 2023

Modified Files:
src/usr.bin/dc [netbsd-10]: bcode.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #220):
usr.bin/dc/bcode.c: revision 1.4
Make this compile when BIGNUM limbs (BN_ULONG) are not the same
size as "unsigned long" (e.g. in bn(64/32) configurations of openssl).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.14.1 src/usr.bin/dc/bcode.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/dc/bcode.c
diff -u src/usr.bin/dc/bcode.c:1.3 src/usr.bin/dc/bcode.c:1.3.14.1
--- src/usr.bin/dc/bcode.c:1.3	Tue Feb  6 17:58:19 2018
+++ src/usr.bin/dc/bcode.c	Fri Jun 30 18:10:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcode.c,v 1.3 2018/02/06 17:58:19 christos Exp $	*/
+/*	$NetBSD: bcode.c,v 1.3.14.1 2023/06/30 18:10:12 bouyer Exp $	*/
 /*	$OpenBSD: bcode.c,v 1.51 2017/02/26 11:29:55 otto Exp $	*/
 
 /*
@@ -17,7 +17,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 #include 
-__RCSID("$NetBSD: bcode.c,v 1.3 2018/02/06 17:58:19 christos Exp $");
+__RCSID("$NetBSD: bcode.c,v 1.3.14.1 2023/06/30 18:10:12 bouyer Exp $");
 
 #include 
 #include 
@@ -338,7 +338,7 @@ max(u_int a, u_int b)
 	return a > b ? a : b;
 }
 
-static unsigned long factors[] = {
+static BN_ULONG factors[] = {
 	0, 10, 100, 1000, 1, 10, 100, 1000,
 	1, 10
 };
@@ -370,7 +370,7 @@ scale_number(BIGNUM *n, int s)
 		bn_checkp(ctx);
 
 		bn_check(BN_set_word(a, 10));
-		bn_check(BN_set_word(p, abs_scale));
+		bn_check(BN_set_word(p, (BN_ULONG)abs_scale));
 		bn_check(BN_exp(a, a, p, ctx));
 		if (s > 0)
 			bn_check(BN_mul(n, n, a, ctx));
@@ -394,7 +394,7 @@ split_number(const struct number *n, BIG
 	else if (n->scale < sizeof(factors)/sizeof(factors[0])) {
 		rem = BN_div_word(i, factors[n->scale]);
 		if (f != NULL)
-			bn_check(BN_set_word(f, rem));
+			bn_check(BN_set_word(f, (BN_ULONG)rem));
 	} else {
 		BIGNUM *a, *p;
 		BN_CTX *ctx;
@@ -663,7 +663,7 @@ stackdepth(void)
 
 	i = stack_size();
 	n = new_number();
-	bn_check(BN_set_word(n->number, i));
+	bn_check(BN_set_word(n->number, (BN_ULONG)i));
 	push_number(n);
 }
 
@@ -732,12 +732,12 @@ num_digits(void)
 		case BCODE_NUMBER:
 			digits = count_digits(value->u.num);
 			n = new_number();
-			bn_check(BN_set_word(n->number, digits));
+			bn_check(BN_set_word(n->number, (BN_ULONG)digits));
 			break;
 		case BCODE_STRING:
 			digits = strlen(value->u.string);
 			n = new_number();
-			bn_check(BN_set_word(n->number, digits));
+			bn_check(BN_set_word(n->number, (BN_ULONG)digits));
 			break;
 		}
 		stack_free_value(value);



CVS commit: [netbsd-10] src/usr.bin/dc

2023-06-30 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Jun 30 18:10:12 UTC 2023

Modified Files:
src/usr.bin/dc [netbsd-10]: bcode.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #220):
usr.bin/dc/bcode.c: revision 1.4
Make this compile when BIGNUM limbs (BN_ULONG) are not the same
size as "unsigned long" (e.g. in bn(64/32) configurations of openssl).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.14.1 src/usr.bin/dc/bcode.c

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



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

2023-05-24 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed May 24 16:43:40 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6_platform.c

Log Message:
introduce imx6sx_platform_bootstrap(), which calls imx_platform_bootstrap()
and then checks for an "arm,cortex-a9-twd-timer" compatible entry in the
fdt. If not present, create one so that a9ptmr will attach.
We need this entry as this is the only timer we support for this platform,
but the upstream imx6sx.dtsi is missing the entry for it (and all A9 CPUs
have it anyway).

Thanks to Jared McNeill for advices and review.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/nxp/imx6_platform.c

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

Modified files:

Index: src/sys/arch/arm/nxp/imx6_platform.c
diff -u src/sys/arch/arm/nxp/imx6_platform.c:1.8 src/sys/arch/arm/nxp/imx6_platform.c:1.9
--- src/sys/arch/arm/nxp/imx6_platform.c:1.8	Thu May  4 13:28:04 2023
+++ src/sys/arch/arm/nxp/imx6_platform.c	Wed May 24 16:43:40 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6_platform.c,v 1.8 2023/05/04 13:28:04 bouyer Exp $	*/
+/*	$NetBSD: imx6_platform.c,v 1.9 2023/05/24 16:43:40 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.8 2023/05/04 13:28:04 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.9 2023/05/24 16:43:40 bouyer Exp $");
 
 #include "arml2cc.h"
 #include "opt_console.h"
@@ -175,6 +175,76 @@ imx_platform_bootstrap(void)
 	arm_fdt_cpu_bootstrap();
 }
 
+static void
+imx6sx_platform_bootstrap(void)
+{
+	void *fdt_data;
+	int ofw_root;
+	int soc_node, timer_node, intc_node, clks_node;
+	int ret;
+	fdt32_t intval[3];
+	fdt32_t clkval[2];
+	u_int val32;
+
+	imx_platform_bootstrap();
+
+	/*
+	 * if there's no entry for the TWD timer in the provided DTB, fake one.
+	 * we can't boot witthout it.
+	 * The upstream imx6sx.dtsi is missing the entry
+	 */
+
+	fdt_data = __UNCONST(fdtbus_get_data());
+	KASSERT(fdt_data != NULL);
+	ofw_root = OF_peer(0);
+	if (of_find_bycompat(ofw_root, "arm,cortex-a9-twd-timer") > 0) {
+		/* already there */
+		VPRINTF("timer already present\n");
+		return;
+	}
+	VPRINTF("creating timer fdt@%p", fdt_data);
+	soc_node = fdt_path_offset(fdt_data, "/soc");
+	VPRINTF(" soc_node %d", soc_node);
+	KASSERT(soc_node >= 0);
+
+	timer_node = fdt_add_subnode(fdt_data, soc_node, "timer@a00600");
+	VPRINTF(" timer_node %d\n", timer_node);
+	KASSERT(timer_node >= 0);
+
+	ret = fdt_setprop_string(fdt_data, timer_node, "compatible",
+	"arm,cortex-a9-twd-timer");
+	KASSERTMSG(ret == 0, "fdt_setprop(compatible) returns %d", ret);
+
+	ret = fdt_appendprop_addrrange(fdt_data, soc_node, timer_node,
+	"reg", 0x00a00600, 0x20);
+	KASSERTMSG(ret == 0, "fdt_appendprop_addrrange returns %d", ret);
+
+	intval[0] = cpu_to_fdt32(1);
+	intval[1] = cpu_to_fdt32(13);
+	intval[2] = cpu_to_fdt32(0xf01);
+	ret = fdt_setprop(fdt_data, timer_node, "interrupts",
+	intval, sizeof(intval));
+	KASSERTMSG(ret == 0, "fdt_setprop(interrupts) returns %d", ret);
+
+	intc_node = of_find_bycompat(ofw_root, "arm,cortex-a9-gic");
+	KASSERT(intc_node >= 0);
+	val32 = 0;
+	of_getprop_uint32(intc_node, "phandle", );
+	ret = fdt_setprop_u32(fdt_data, timer_node, "interrupt-parent",
+	val32);
+	KASSERTMSG(ret == 0, "fdt_setprop(interrupt-parent) returns %d", ret);
+
+	val32 = 0;
+	clks_node = of_find_bycompat(ofw_root, "fsl,imx6sx-ccm");
+	KASSERT(clks_node >= 0);
+	of_getprop_uint32(clks_node, "phandle", );
+	clkval[0] = cpu_to_fdt32(val32);
+	clkval[1] = cpu_to_fdt32(30); /* IMX6SXCLK_TWD */
+	ret = fdt_setprop(fdt_data, timer_node, "clocks",
+	clkval, sizeof(clkval));
+	KASSERTMSG(ret == 0, "fdt_setprop(clocks) returns %d", ret);
+}
+
 static int
 imx_platform_mpstart(void)
 {
@@ -256,7 +326,7 @@ static const struct fdt_platform imx6_pl
 
 static const struct fdt_platform imx6sx_platform = {
 	.fp_devmap = imx6sx_platform_devmap,
-	.fp_bootstrap = imx_platform_bootstrap,
+	.fp_bootstrap = imx6sx_platform_bootstrap,
 	.fp_init_attach_args = imx_platform_init_attach_args,
 	.fp_device_register = imx_platform_device_register,
 	.fp_reset = imx6_platform_reset,



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

2023-05-24 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed May 24 16:43:40 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6_platform.c

Log Message:
introduce imx6sx_platform_bootstrap(), which calls imx_platform_bootstrap()
and then checks for an "arm,cortex-a9-twd-timer" compatible entry in the
fdt. If not present, create one so that a9ptmr will attach.
We need this entry as this is the only timer we support for this platform,
but the upstream imx6sx.dtsi is missing the entry for it (and all A9 CPUs
have it anyway).

Thanks to Jared McNeill for advices and review.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/nxp/imx6_platform.c

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



Re: CVS commit: src/distrib/sets/lists/dtb

2023-05-07 Thread Manuel Bouyer
On Sat, May 06, 2023 at 08:43:20AM +, Nick Hudson wrote:
> Module Name:  src
> Committed By: skrll
> Date: Sat May  6 08:43:20 UTC 2023
> 
> Modified Files:
>   src/distrib/sets/lists/dtb: ad.earmv7hfeb
> 
> Log Message:
> Add imx6sx dtb files for BE too

Hum, I'm not sure that this SoC can run in BE mode.
I can't check righ now, I don't have access to my copy of the i.mx
document.

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--


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

2023-05-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri May  5 09:34:10 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6sx_clk.c

Log Message:
remove commented out entries, leftover from the imx6q ccm code.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6sx_clk.c

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

Modified files:

Index: src/sys/arch/arm/nxp/imx6sx_clk.c
diff -u src/sys/arch/arm/nxp/imx6sx_clk.c:1.2 src/sys/arch/arm/nxp/imx6sx_clk.c:1.3
--- src/sys/arch/arm/nxp/imx6sx_clk.c:1.2	Fri May  5 09:29:35 2023
+++ src/sys/arch/arm/nxp/imx6sx_clk.c	Fri May  5 09:34:09 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6sx_clk.c,v 1.2 2023/05/05 09:29:35 bouyer Exp $	*/
+/*	$NetBSD: imx6sx_clk.c,v 1.3 2023/05/05 09:34:09 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6sx_clk.c,v 1.2 2023/05/05 09:29:35 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6sx_clk.c,v 1.3 2023/05/05 09:34:09 bouyer Exp $");
 
 #include "opt_fdt.h"
 
@@ -975,15 +975,13 @@ static const int audiovideo_div_tbl[] = 
 
 static struct imx6_clk imx6sx_clks[] = {
 	CLK_FIXED("dummy", 0),
-
 	CLK_FIXED("ckil", IMX6_CKIL_FREQ),
 	CLK_FIXED("osc", IMX6_OSC_FREQ),
 	CLK_FIXED("ipp_di0", IMX6_OSC_FREQ), 
 	CLK_FIXED("ipp_di1", IMX6_OSC_FREQ), 
 	CLK_FIXED("anaclk1", IMX6_ANACLK1_FREQ),
 	CLK_FIXED("anaclk2", IMX6_ANACLK2_FREQ),
-//#
-//#	CLK_FIXED_FACTOR("sata_ref", "pll6_enet", 5, 1),
+
 	CLK_FIXED_FACTOR("pcie_ref", "pll6_enet", 5, 1),
 	CLK_FIXED_FACTOR("pll2_198m", "pll2_pfd2_396m", 2, 1),
 	CLK_FIXED_FACTOR("pll3_120m", "pll3_usb_otg", 4, 1),
@@ -991,15 +989,12 @@ static struct imx6_clk imx6sx_clks[] = {
 	CLK_FIXED_FACTOR("pll3_60m", "pll3_usb_otg", 8, 1),
 	CLK_FIXED_FACTOR("twd", "arm", 2, 1),
 	CLK_FIXED_FACTOR("gpt_3m", "osc", 8, 1),
-//#	CLK_FIXED_FACTOR("video_27m", "pll3_pfd1_540m", 20, 1),
-//#	CLK_FIXED_FACTOR("gpu2d_axi", "mmdc_ch0_axi_podf", 1, 1),
-//#	CLK_FIXED_FACTOR("gpu3d_axi", "mmdc_ch0_axi_podf", 1, 1),
 	CLK_FIXED_FACTOR("ldb_di0_div_3_5", "ldb_di0_sel", 7, 2),
 	CLK_FIXED_FACTOR("ldb_di0_div_7", "ldb_di0_sel", 7, 1),
 	CLK_FIXED_FACTOR("ldb_di1_div_3_5", "ldb_di1_sel", 7, 2),
 	CLK_FIXED_FACTOR("ldb_di1_div_7", "ldb_di1_sel", 7, 1),
 	CLK_FIXED_FACTOR("enet_ptp_ref", "pll6_enet", 20, 1),
-//#
+
 	CLK_PFD("pll2_pfd0_352m", "pll2_bus", PFD_528, 0),
 	CLK_PFD("pll2_pfd1_594m", "pll2_bus", PFD_528, 1),
 	CLK_PFD("pll2_pfd2_396m", "pll2_bus", PFD_528, 2),
@@ -1008,7 +1003,7 @@ static struct imx6_clk imx6sx_clks[] = {
 	CLK_PFD("pll3_pfd1_540m", "pll3_usb_otg", PFD_480, 1),
 	CLK_PFD("pll3_pfd2_508m", "pll3_usb_otg", PFD_480, 2),
 	CLK_PFD("pll3_pfd3_454m", "pll3_usb_otg", PFD_480, 3),
-//#
+
 	CLK_PLL("pll1", "osc", SYS, PLL_ARM, DIV_SELECT, POWERDOWN, 0),
 	CLK_PLL("pll2", "osc", GENERIC, PLL_SYS, DIV_SELECT, POWERDOWN, 0),
 	CLK_PLL("pll3", "osc", USB, PLL_USB1, DIV_SELECT, POWER, 0),
@@ -1016,7 +1011,7 @@ static struct imx6_clk imx6sx_clks[] = {
 	CLK_PLL("pll5", "osc", AUDIO_VIDEO, PLL_VIDEO, DIV_SELECT, POWERDOWN, 0),
 	CLK_PLL("pll6", "osc", ENET, PLL_ENET, DIV_SELECT, POWERDOWN, 5),
 	CLK_PLL("pll7", "osc", USB, PLL_USB2, DIV_SELECT, POWER, 0),
-//#
+
 	CLK_DIV("periph_clk2", "periph_clk2_sel", CBCDR, PERIPH_CLK2_PODF),
 	CLK_DIV("periph2_clk2", "periph2_clk2_sel", CBCDR, PERIPH2_CLK2_PODF),
 	CLK_DIV_BUSY("ocram_podf", "ocram_sel", CBCDR, AXI_PODF, CDHIPR, AXI_PODF_BUSY),
@@ -1026,36 +1021,19 @@ static struct imx6_clk imx6sx_clks[] = {
 	CLK_DIV("lcdif1_podf", "lcdif1_pred", CBCMR, GPU2D_CORE_CLK_PODF),
 	CLK_DIV("esai_pred", "esai_sel", CS1CDR, ESAI_CLK_PRED),
 	CLK_DIV("esai_podf", "esai_pred", CS1CDR, ESAI_CLK_PODF),
-//#	CLK_DIV("asrc_pred", "asrc_sel", CDCDR, SPDIF1_CLK_PRED),
-//#	CLK_DIV("asrc_podf", "asrc_pred", CDCDR, SPDIF1_CLK_PODF),
 	CLK_DIV("spdif_pred", "spdif_sel", CDCDR, SPDIF0_CLK_PRED),
 	CLK_DIV("spdif_podf", "spdif_pred", CDCDR, SPDIF0_CLK_PODF),
 	CLK_DIV("audio_pred", "audio_sel", CDCDR, SPDIF1_CLK_PRED),
 	CLK_DIV("audio_podf", "audio_pred", CDCDR, SPDIF1_CLK_PODF),
-//#	CLK_DIV("ecspi_root", "pll3_60m", CSCDR2, ECSPI_CLK_PODF),
-//#	CLK_DIV("can_root", "pll3_60m", CSCMR2, CAN_CLK_PODF),
 	CLK_DIV("vid_podf", "vid_sel", CSCMR2, VID_CLK_PODF),
 	CLK_DIV("can_podf", "can_sel", CSCMR2, CAN_CLK_PODF),
-//#	CLK_DIV("uart_serial_podf", "pll3_80m", CSCDR1, UART_CLK_PODF),
-//#	CLK_DIV("gpu2d_core_podf", "gpu2d_core_sel", CBCMR, GPU2D_CORE_CLK_PODF),
-//#	CLK_DIV("gpu3d_core_podf", "gpu3d_core_sel", CBCMR, GPU3D_CORE_PODF),
-//#	CLK_DIV("gpu3d_shader", "gpu3d_shader_sel", CBCMR, GPU3D_SHADER_PODF),
 	CLK_DIV("display_podf", "display_sel", CSCDR3, IPU2_HSP_PODF),
 	CLK_DIV("csi_podf", "csi_sel", CSCDR3, IPU1_HSP_PODF),
-//#	CLK_DIV("ipu1_podf", "ipu1_sel", CSCDR3, IPU1_HSP_PODF),
-//#	CLK_DIV("ipu2_podf", "ipu2_sel", CSCDR3, IPU2_HSP_PODF),
-//#	CLK_DIV("ldb_di0_podf", 

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

2023-05-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri May  5 09:34:10 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6sx_clk.c

Log Message:
remove commented out entries, leftover from the imx6q ccm code.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nxp/imx6sx_clk.c

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



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

2023-05-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri May  5 09:29:35 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6sx_clk.c

Log Message:
Fix typo, preventing i2c4 from attaching


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6sx_clk.c

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

Modified files:

Index: src/sys/arch/arm/nxp/imx6sx_clk.c
diff -u src/sys/arch/arm/nxp/imx6sx_clk.c:1.1 src/sys/arch/arm/nxp/imx6sx_clk.c:1.2
--- src/sys/arch/arm/nxp/imx6sx_clk.c:1.1	Thu May  4 13:25:07 2023
+++ src/sys/arch/arm/nxp/imx6sx_clk.c	Fri May  5 09:29:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: imx6sx_clk.c,v 1.1 2023/05/04 13:25:07 bouyer Exp $	*/
+/*	$NetBSD: imx6sx_clk.c,v 1.2 2023/05/05 09:29:35 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2019 Genetec Corporation.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imx6sx_clk.c,v 1.1 2023/05/04 13:25:07 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imx6sx_clk.c,v 1.2 2023/05/05 09:29:35 bouyer Exp $");
 
 #include "opt_fdt.h"
 
@@ -1297,7 +1297,7 @@ static struct imx6_clk imx6sx_clks[] = {
 	CLK_GATE("pwm8", "perclk", CCM, CCGR6, PWM8_CLK_ENABLE),
 	CLK_GATE("vadc", "vid_podf", CCM, CCGR6, VADC_CLK_ENABLE),
 	CLK_GATE("gis", "display_podf", CCM, CCGR6, GIS_CLK_ENABLE),
-	CLK_GATE("i2cs4", "perclk", CCM, CCGR6, I2CS4_CLK_ENABLE),
+	CLK_GATE("i2c4", "perclk", CCM, CCGR6, I2CS4_CLK_ENABLE),
 	CLK_GATE("pwm5", "perclk", CCM, CCGR6, PWM5_CLK_ENABLE),
 	CLK_GATE("pwm6", "perclk", CCM, CCGR6, PWM6_CLK_ENABLE),
 	CLK_GATE("pwm7", "perclk", CCM, CCGR6, PWM7_CLK_ENABLE),



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

2023-05-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri May  5 09:29:35 UTC 2023

Modified Files:
src/sys/arch/arm/nxp: imx6sx_clk.c

Log Message:
Fix typo, preventing i2c4 from attaching


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nxp/imx6sx_clk.c

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



CVS commit: src/sys/arch/arm

2023-05-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu May  4 17:09:45 UTC 2023

Modified Files:
src/sys/arch/arm/imx: imx23_usb.c imxusb.c imxusbvar.h
src/sys/arch/arm/nxp: imx6_usb.c

Log Message:
The i.mx6sx has 2 OTG and one host-only USB controller, while the 6q has
only one OTG.
Add a "uintptr_t data" argument to all sc_*_md_hook callbacks, which
gets the sc_md_hook_data value when called.
In imx6_usb.c use this to pass the number of OTG controllers to the callbacks.
imx6_usb_init() can then properly call init_otg() or init_h1() for unit 1.

In imx6_usb_attach(), test if there is a vbus-supply property in the fdt,
and enable the regulator if present.

Now the USB port of the UDOO Neo works.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/imx23_usb.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/imx/imxusb.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/imx/imxusbvar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nxp/imx6_usb.c

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



  1   2   3   4   5   6   >