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

2023-01-23 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Jan 24 07:57:20 UTC 2023

Modified Files:
src/sys/arch/atari/atari: stalloc.c

Log Message:
whitespace, no code change.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/atari/atari/stalloc.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/atari/atari/stalloc.c
diff -u src/sys/arch/atari/atari/stalloc.c:1.19 src/sys/arch/atari/atari/stalloc.c:1.20
--- src/sys/arch/atari/atari/stalloc.c:1.19	Fri Jan  6 10:28:27 2023
+++ src/sys/arch/atari/atari/stalloc.c	Tue Jan 24 07:57:20 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: stalloc.c,v 1.19 2023/01/06 10:28:27 tsutsui Exp $	*/
+/*	$NetBSD: stalloc.c,v 1.20 2023/01/24 07:57:20 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman (Atari modifications)
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: stalloc.c,v 1.19 2023/01/06 10:28:27 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: stalloc.c,v 1.20 2023/01/24 07:57:20 mlelstv Exp $");
 
 #include 
 #include 
@@ -219,7 +219,7 @@ free_stmem(void *mem)
 			} else {
 TAILQ_INSERT_HEAD(_list,mn,free_link);
 			}
-mn->type = MNODE_FREE;
+			mn->type = MNODE_FREE;
 		}
 		stmem_total += mn->size;/* add our helpings to the pool. */
 	}



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

2023-01-23 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Jan 24 07:57:20 UTC 2023

Modified Files:
src/sys/arch/atari/atari: stalloc.c

Log Message:
whitespace, no code change.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/atari/atari/stalloc.c

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



CVS commit: src/sys/dev/i2c

2023-01-23 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Jan 24 07:09:48 UTC 2023

Modified Files:
src/sys/dev/i2c: ds1307.c

Log Message:
Don't panic with invalid user data, just return an error.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/i2c/ds1307.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/i2c/ds1307.c
diff -u src/sys/dev/i2c/ds1307.c:1.39 src/sys/dev/i2c/ds1307.c:1.40
--- src/sys/dev/i2c/ds1307.c:1.39	Tue Aug  3 23:12:14 2021
+++ src/sys/dev/i2c/ds1307.c	Tue Jan 24 07:09:48 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ds1307.c,v 1.39 2021/08/03 23:12:14 andvar Exp $	*/
+/*	$NetBSD: ds1307.c,v 1.40 2023/01/24 07:09:48 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.39 2021/08/03 23:12:14 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ds1307.c,v 1.40 2023/01/24 07:09:48 mlelstv Exp $");
 
 #include 
 #include 
@@ -411,13 +411,12 @@ dsrtc_read(dev_t dev, struct uio *uio, i
 		return ENXIO;
 
 	const struct dsrtc_model * const dm = >sc_model;
-	if (uio->uio_offset >= dm->dm_nvram_size)
+	if (uio->uio_offset < 0 || uio->uio_offset >= dm->dm_nvram_size)
 		return EINVAL;
 
 	if ((error = iic_acquire_bus(sc->sc_tag, 0)) != 0)
 		return error;
 
-	KASSERT(uio->uio_offset >= 0);
 	while (uio->uio_resid && uio->uio_offset < dm->dm_nvram_size) {
 		uint8_t ch, cmd;
 		const u_int a = uio->uio_offset;



CVS commit: src/sys/dev/i2c

2023-01-23 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Jan 24 07:09:48 UTC 2023

Modified Files:
src/sys/dev/i2c: ds1307.c

Log Message:
Don't panic with invalid user data, just return an error.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/i2c/ds1307.c

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



CVS commit: src/common/lib/libc/arch/arm/string

2023-01-23 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Jan 24 07:04:27 UTC 2023

Modified Files:
src/common/lib/libc/arch/arm/string: memcpy_arm.S

Log Message:
Fix two signed comparisons that were missed in the last patch.
Found be rillig@


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/arm/string/memcpy_arm.S

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/libc/arch/arm/string/memcpy_arm.S
diff -u src/common/lib/libc/arch/arm/string/memcpy_arm.S:1.6 src/common/lib/libc/arch/arm/string/memcpy_arm.S:1.7
--- src/common/lib/libc/arch/arm/string/memcpy_arm.S:1.6	Thu Jan 19 18:03:03 2023
+++ src/common/lib/libc/arch/arm/string/memcpy_arm.S	Tue Jan 24 07:04:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: memcpy_arm.S,v 1.6 2023/01/19 18:03:03 mlelstv Exp $	*/
+/*	$NetBSD: memcpy_arm.S,v 1.7 2023/01/24 07:04:27 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -111,8 +111,8 @@ ENTRY(memcpy)
 	blo	.Lmemcpy_l4
 
 	subs	r2, r2, #4
-	ldrlt	r3, [r1], #4
-	strlt	r3, [r0], #4
+	ldrlo	r3, [r1], #4
+	strlo	r3, [r0], #4
 	ldmiahs	r1!, {r3, r12}
 	stmiahs	r0!, {r3, r12}
 	subhs	r2, r2, #4



CVS commit: src/common/lib/libc/arch/arm/string

2023-01-23 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Jan 24 07:04:27 UTC 2023

Modified Files:
src/common/lib/libc/arch/arm/string: memcpy_arm.S

Log Message:
Fix two signed comparisons that were missed in the last patch.
Found be rillig@


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/arch/arm/string/memcpy_arm.S

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



CVS commit: src/sys/arch

2023-01-23 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Jan 24 06:56:40 UTC 2023

Modified Files:
src/sys/arch/arm/acpi: acpi_platform.c plcom_acpi.c
src/sys/arch/arm/fdt: plcom_fdt.c
src/sys/arch/evbarm/dev: plcom.c plcomreg.h plcomvar.h

Log Message:
Add support for FIFOs and hardware flow-control to plcom driver.
Add a PLCOM_TYPE_GENERIC_UART variant to match SBSA requirements.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/arm/acpi/acpi_platform.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/acpi/plcom_acpi.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/fdt/plcom_fdt.c
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/evbarm/dev/plcom.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/dev/plcomreg.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/dev/plcomvar.h

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

Modified files:

Index: src/sys/arch/arm/acpi/acpi_platform.c
diff -u src/sys/arch/arm/acpi/acpi_platform.c:1.34 src/sys/arch/arm/acpi/acpi_platform.c:1.35
--- src/sys/arch/arm/acpi/acpi_platform.c:1.34	Wed Nov 16 11:54:26 2022
+++ src/sys/arch/arm/acpi/acpi_platform.c	Tue Jan 24 06:56:40 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_platform.c,v 1.34 2022/11/16 11:54:26 skrll Exp $ */
+/* $NetBSD: acpi_platform.c,v 1.35 2023/01/24 06:56:40 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.34 2022/11/16 11:54:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.35 2023/01/24 06:56:40 mlelstv Exp $");
 
 #include 
 #include 
@@ -188,7 +188,10 @@ acpi_platform_attach_uart(ACPI_TABLE_SPC
 	case ACPI_DBG2_ARM_PL011:
 	case ACPI_DBG2_ARM_SBSA_32BIT:
 	case ACPI_DBG2_ARM_SBSA_GENERIC:
-		plcom_console.pi_type = PLCOM_TYPE_PL011;
+		if (spcr->InterfaceType == ACPI_DBG2_ARM_PL011)
+			plcom_console.pi_type = PLCOM_TYPE_PL011;
+		else
+			plcom_console.pi_type = PLCOM_TYPE_GENERIC_UART;
 		plcom_console.pi_iot = _generic_bs_tag;
 		plcom_console.pi_iobase = le64toh(spcr->SerialPort.Address);
 		plcom_console.pi_size = PL011COM_UART_SIZE;

Index: src/sys/arch/arm/acpi/plcom_acpi.c
diff -u src/sys/arch/arm/acpi/plcom_acpi.c:1.3 src/sys/arch/arm/acpi/plcom_acpi.c:1.4
--- src/sys/arch/arm/acpi/plcom_acpi.c:1.3	Sat Apr 25 21:34:26 2020
+++ src/sys/arch/arm/acpi/plcom_acpi.c	Tue Jan 24 06:56:40 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: plcom_acpi.c,v 1.3 2020/04/25 21:34:26 jmcneill Exp $ */
+/* $NetBSD: plcom_acpi.c,v 1.4 2023/01/24 06:56:40 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plcom_acpi.c,v 1.3 2020/04/25 21:34:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plcom_acpi.c,v 1.4 2023/01/24 06:56:40 mlelstv Exp $");
 
 #include 
 #include 
@@ -50,9 +50,17 @@ static void	plcom_acpi_attach(device_t, 
 
 CFATTACH_DECL_NEW(plcom_acpi, sizeof(struct plcom_softc), plcom_acpi_match, plcom_acpi_attach, NULL, NULL);
 
-static const char * const compatible[] = {
-	"ARMH0011",
-	NULL
+enum plcom_acpi_variant {
+	PLCOM_ACPI_GENERIC,
+	PLCOM_ACPI_PL011,
+	PLCOM_ACPI_BCM2837
+};
+
+static const struct device_compatible_entry compat_data[] = {
+	{ .compat = "BCM2837",		.value = PLCOM_ACPI_BCM2837 },
+	{ .compat = "ARMH0011",		.value = PLCOM_ACPI_PL011 },
+	{ .compat = "ARMHB000",		.value = PLCOM_ACPI_GENERIC },
+	DEVICE_COMPAT_EOL
 };
 
 static int
@@ -63,7 +71,7 @@ plcom_acpi_match(device_t parent, cfdata
 	if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
 		return 0;
 
-	return acpi_match_hid(aa->aa_node->ad_devinfo, compatible);
+	return acpi_compatible_match(aa, compat_data);
 }
 
 static void
@@ -98,9 +106,19 @@ plcom_acpi_attach(device_t parent, devic
 
 	sc->sc_hwflags = 0;
 	sc->sc_swflags = 0;
-
+	sc->sc_fifolen = 0;
 	sc->sc_pi.pi_type = PLCOM_TYPE_PL011;
 	sc->sc_pi.pi_flags = PLC_FLAG_32BIT_ACCESS;
+
+	switch (acpi_compatible_lookup(aa, compat_data)->value) {
+	case PLCOM_ACPI_BCM2837:
+		sc->sc_fifolen = 16;
+		break;
+	case PLCOM_ACPI_GENERIC:
+		sc->sc_pi.pi_type = PLCOM_TYPE_GENERIC_UART;
+		break;
+	}
+
 	sc->sc_pi.pi_iot = aa->aa_memt;
 	sc->sc_pi.pi_iobase = mem->ar_base;
 	if (bus_space_map(aa->aa_memt, mem->ar_base, mem->ar_length, 0, >sc_pi.pi_ioh) != 0) {

Index: src/sys/arch/arm/fdt/plcom_fdt.c
diff -u src/sys/arch/arm/fdt/plcom_fdt.c:1.5 src/sys/arch/arm/fdt/plcom_fdt.c:1.6
--- src/sys/arch/arm/fdt/plcom_fdt.c:1.5	Wed Jan 27 03:10:19 2021
+++ src/sys/arch/arm/fdt/plcom_fdt.c	Tue Jan 24 06:56:40 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: plcom_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */
+/* $NetBSD: plcom_fdt.c,v 1.6 2023/01/24 06:56:40 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: plcom_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: plcom_fdt.c,v 1.6 

CVS commit: src/sys/arch

2023-01-23 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Jan 24 06:56:40 UTC 2023

Modified Files:
src/sys/arch/arm/acpi: acpi_platform.c plcom_acpi.c
src/sys/arch/arm/fdt: plcom_fdt.c
src/sys/arch/evbarm/dev: plcom.c plcomreg.h plcomvar.h

Log Message:
Add support for FIFOs and hardware flow-control to plcom driver.
Add a PLCOM_TYPE_GENERIC_UART variant to match SBSA requirements.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/arm/acpi/acpi_platform.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/acpi/plcom_acpi.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/fdt/plcom_fdt.c
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/evbarm/dev/plcom.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/dev/plcomreg.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/dev/plcomvar.h

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



CVS commit: src/usr.bin/make

2023-01-23 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Tue Jan 24 00:24:02 UTC 2023

Modified Files:
src/usr.bin/make: dir.c dir.h main.c make.1 parse.c
src/usr.bin/make/unit-tests: Makefile dir.mk opt-debug-graph1.exp
opt-debug-graph2.exp opt-debug-graph3.exp suff-main-several.exp
suff-transform-debug.exp

Log Message:
make: .SYSPATH: to add dirs to sysIncPath

.SYSPATH: with no sources will clear sysIncPath
otherwise sources are added

Reviewed by: rillig


To generate a diff of this commit:
cvs rdiff -u -r1.279 -r1.280 src/usr.bin/make/dir.c
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/make/dir.h
cvs rdiff -u -r1.587 -r1.588 src/usr.bin/make/main.c
cvs rdiff -u -r1.358 -r1.359 src/usr.bin/make/make.1
cvs rdiff -u -r1.691 -r1.692 src/usr.bin/make/parse.c
cvs rdiff -u -r1.330 -r1.331 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/dir.mk
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/opt-debug-graph1.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/opt-debug-graph2.exp \
src/usr.bin/make/unit-tests/opt-debug-graph3.exp \
src/usr.bin/make/unit-tests/suff-transform-debug.exp
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/suff-main-several.exp

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

Modified files:

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.279 src/usr.bin/make/dir.c:1.280
--- src/usr.bin/make/dir.c:1.279	Sat May  7 21:19:43 2022
+++ src/usr.bin/make/dir.c	Tue Jan 24 00:24:02 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.279 2022/05/07 21:19:43 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.280 2023/01/24 00:24:02 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -138,7 +138,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.279 2022/05/07 21:19:43 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.280 2023/01/24 00:24:02 sjg Exp $");
 
 /*
  * A search path is a list of CachedDir structures. A CachedDir has in it the
@@ -577,6 +577,21 @@ Dir_SetPATH(void)
 	}
 }
 
+
+void
+Dir_SetSYSPATH(void)
+{
+	CachedDirListNode *ln;
+
+	Var_ReadOnly(".SYSPATH", false);
+	Global_Delete(".SYSPATH");
+	for (ln = sysIncPath->dirs.first; ln != NULL; ln = ln->next) {
+		CachedDir *dir = ln->datum;
+		Global_Append(".SYSPATH", dir->name);
+	}
+	Var_ReadOnly(".SYSPATH", true);
+}
+
 /*
  * See if the given name has any wildcard characters in it and all braces and
  * brackets are properly balanced.

Index: src/usr.bin/make/dir.h
diff -u src/usr.bin/make/dir.h:1.46 src/usr.bin/make/dir.h:1.47
--- src/usr.bin/make/dir.h:1.46	Wed Dec 15 12:08:25 2021
+++ src/usr.bin/make/dir.h	Tue Jan 24 00:24:02 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.h,v 1.46 2021/12/15 12:08:25 rillig Exp $	*/
+/*	$NetBSD: dir.h,v 1.47 2023/01/24 00:24:02 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -82,6 +82,7 @@ void Dir_InitCur(const char *);
 void Dir_InitDot(void);
 void Dir_End(void);
 void Dir_SetPATH(void);
+void Dir_SetSYSPATH(void);
 bool Dir_HasWildcards(const char *) MAKE_ATTR_USE;
 void SearchPath_Expand(SearchPath *, const char *, StringList *);
 char *Dir_FindFile(const char *, SearchPath *) MAKE_ATTR_USE;

Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.587 src/usr.bin/make/main.c:1.588
--- src/usr.bin/make/main.c:1.587	Thu Jan 19 21:33:06 2023
+++ src/usr.bin/make/main.c	Tue Jan 24 00:24:02 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.587 2023/01/19 21:33:06 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.588 2023/01/24 00:24:02 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.587 2023/01/19 21:33:06 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.588 2023/01/24 00:24:02 sjg Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -428,6 +428,7 @@ MainParseArgSysInc(const char *argvalue)
 	}
 	Global_Append(MAKEFLAGS, "-m");
 	Global_Append(MAKEFLAGS, argvalue);
+	Dir_SetSYSPATH();
 }
 
 static bool
@@ -1477,6 +1478,10 @@ static void
 main_ReadFiles(void)
 {
 
+	if (Lst_IsEmpty(>dirs))
+		SearchPath_AddAll(sysIncPath, defSysIncPath);
+
+	Dir_SetSYSPATH();
 	if (!opts.noBuiltins)
 		ReadBuiltinRules();
 

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.358 src/usr.bin/make/make.1:1.359
--- src/usr.bin/make/make.1:1.358	Mon Jan 23 23:01:52 2023
+++ src/usr.bin/make/make.1	Tue Jan 24 00:24:02 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.358 2023/01/23 23:01:52 sjg Exp $
+.\"	$NetBSD: make.1,v 1.359 2023/01/24 00:24:02 sjg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -299,6 

CVS commit: src/usr.bin/make

2023-01-23 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Tue Jan 24 00:24:02 UTC 2023

Modified Files:
src/usr.bin/make: dir.c dir.h main.c make.1 parse.c
src/usr.bin/make/unit-tests: Makefile dir.mk opt-debug-graph1.exp
opt-debug-graph2.exp opt-debug-graph3.exp suff-main-several.exp
suff-transform-debug.exp

Log Message:
make: .SYSPATH: to add dirs to sysIncPath

.SYSPATH: with no sources will clear sysIncPath
otherwise sources are added

Reviewed by: rillig


To generate a diff of this commit:
cvs rdiff -u -r1.279 -r1.280 src/usr.bin/make/dir.c
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/make/dir.h
cvs rdiff -u -r1.587 -r1.588 src/usr.bin/make/main.c
cvs rdiff -u -r1.358 -r1.359 src/usr.bin/make/make.1
cvs rdiff -u -r1.691 -r1.692 src/usr.bin/make/parse.c
cvs rdiff -u -r1.330 -r1.331 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/dir.mk
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/opt-debug-graph1.exp
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/opt-debug-graph2.exp \
src/usr.bin/make/unit-tests/opt-debug-graph3.exp \
src/usr.bin/make/unit-tests/suff-transform-debug.exp
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/suff-main-several.exp

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



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

2023-01-23 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Tue Jan 24 00:20:00 UTC 2023

Added Files:
src/usr.bin/make/unit-tests: var-readonly.exp var-readonly.mk

Log Message:
Add the unit tests


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/var-readonly.exp \
src/usr.bin/make/unit-tests/var-readonly.mk

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

Added files:

Index: src/usr.bin/make/unit-tests/var-readonly.exp
diff -u /dev/null src/usr.bin/make/unit-tests/var-readonly.exp:1.1
--- /dev/null	Tue Jan 24 00:20:00 2023
+++ src/usr.bin/make/unit-tests/var-readonly.exp	Tue Jan 24 00:20:00 2023
@@ -0,0 +1 @@
+exit status 0
Index: src/usr.bin/make/unit-tests/var-readonly.mk
diff -u /dev/null src/usr.bin/make/unit-tests/var-readonly.mk:1.1
--- /dev/null	Tue Jan 24 00:20:00 2023
+++ src/usr.bin/make/unit-tests/var-readonly.mk	Tue Jan 24 00:20:00 2023
@@ -0,0 +1,20 @@
+# $NetBSD: var-readonly.mk,v 1.1 2023/01/24 00:20:00 sjg Exp $
+
+# the answer
+N = 42
+.READONLY: N
+# this should be ignored
+N = 666
+.if ${N} != 42
+.error N ($N) should be 42
+.endif
+
+.NOREADONLY: N
+# now we can change it
+N = 69
+.if ${N} == 42
+.error N should not be 42
+.endif
+
+all:
+



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

2023-01-23 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Tue Jan 24 00:20:00 UTC 2023

Added Files:
src/usr.bin/make/unit-tests: var-readonly.exp var-readonly.mk

Log Message:
Add the unit tests


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/var-readonly.exp \
src/usr.bin/make/unit-tests/var-readonly.mk

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



CVS commit: src/usr.bin/make

2023-01-23 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Tue Jan 24 00:19:15 UTC 2023

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

Log Message:
make: log adjustments of var.readOnly


To generate a diff of this commit:
cvs rdiff -u -r1.1037 -r1.1038 src/usr.bin/make/var.c

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

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.1037 src/usr.bin/make/var.c:1.1038
--- src/usr.bin/make/var.c:1.1037	Mon Jan 23 23:01:52 2023
+++ src/usr.bin/make/var.c	Tue Jan 24 00:19:14 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.1037 2023/01/23 23:01:52 sjg Exp $	*/
+/*	$NetBSD: var.c,v 1.1038 2023/01/24 00:19:14 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -139,7 +139,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.1037 2023/01/23 23:01:52 sjg Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1038 2023/01/24 00:19:14 sjg Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -192,6 +192,7 @@ typedef struct Var {
 	 * The variable value cannot be changed anymore, and the variable
 	 * cannot be deleted.  Any attempts to do so are silently ignored,
 	 * they are logged with -dv though.
+	 * Use .[NO]READONLY: to adjust.
 	 *
 	 * See VAR_SET_READONLY.
 	 */
@@ -1235,6 +1236,7 @@ Var_ReadOnly(const char *name, bool bf)
 		return;
 	}
 	v->readOnly = bf;
+	DEBUG2(VAR, "Var_ReadOnly: %s %s\n", name, bf ? "true" : "false");
 }
 
 /*



CVS commit: src/usr.bin/make

2023-01-23 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Tue Jan 24 00:19:15 UTC 2023

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

Log Message:
make: log adjustments of var.readOnly


To generate a diff of this commit:
cvs rdiff -u -r1.1037 -r1.1038 src/usr.bin/make/var.c

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



CVS commit: src

2023-01-23 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Mon Jan 23 23:01:53 UTC 2023

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make: make.1 make.h parse.c var.c
src/usr.bin/make/unit-tests: Makefile

Log Message:
make: .[NO]READONLY for control of read-only variables

Reviewed by: rillig


To generate a diff of this commit:
cvs rdiff -u -r1.1247 -r1.1248 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.357 -r1.358 src/usr.bin/make/make.1
cvs rdiff -u -r1.309 -r1.310 src/usr.bin/make/make.h
cvs rdiff -u -r1.690 -r1.691 src/usr.bin/make/parse.c
cvs rdiff -u -r1.1036 -r1.1037 src/usr.bin/make/var.c
cvs rdiff -u -r1.329 -r1.330 src/usr.bin/make/unit-tests/Makefile

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1247 src/distrib/sets/lists/tests/mi:1.1248
--- src/distrib/sets/lists/tests/mi:1.1247	Sun Jan 22 17:17:24 2023
+++ src/distrib/sets/lists/tests/mi	Mon Jan 23 23:01:52 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1247 2023/01/22 17:17:24 rillig Exp $
+# $NetBSD: mi,v 1.1248 2023/01/23 23:01:52 sjg Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6036,6 +6036,8 @@
 ./usr/tests/usr.bin/make/unit-tests/var-op-sunsh.mktests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/var-op.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/var-op.mk	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/var-readonly.exptests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/var-readonly.mktests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/var-recursive.exptests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/var-recursive.mktests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/var-scope-cmdline.exp			tests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.357 src/usr.bin/make/make.1:1.358
--- src/usr.bin/make/make.1:1.357	Sun Jan  1 21:02:09 2023
+++ src/usr.bin/make/make.1	Mon Jan 23 23:01:52 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.357 2023/01/01 21:02:09 rillig Exp $
+.\"	$NetBSD: make.1,v 1.358 2023/01/23 23:01:52 sjg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)make.1	8.4 (Berkeley) 3/19/94
 .\"
-.Dd January 1, 2023
+.Dd January 23, 2023
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -2390,6 +2390,8 @@ Disable parallel mode.
 Synonym for
 .Ic .NOTPARALLEL ,
 for compatibility with other pmake variants.
+.It Ic .NOREADONLY
+clear the read-only attribute from the global variables specified as sources.
 .It Ic .OBJDIR
 The source is a new value for
 .Sq Va .OBJDIR .
@@ -2458,6 +2460,8 @@ attribute to any specified sources.
 If no sources are specified, the
 .Ic .PRECIOUS
 attribute is applied to every target in the file.
+.It Ic .READONLY
+set the read-only attribute on the global variables specified as sources.
 .It Ic .SHELL
 Sets the shell that
 .Nm

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.309 src/usr.bin/make/make.h:1.310
--- src/usr.bin/make/make.h:1.309	Thu Jan 19 21:33:06 2023
+++ src/usr.bin/make/make.h	Mon Jan 23 23:01:52 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.309 2023/01/19 21:33:06 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.310 2023/01/23 23:01:52 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -1026,6 +1026,7 @@ void Var_ReexportVars(void);
 void Var_Export(VarExportMode, const char *);
 void Var_ExportVars(const char *);
 void Var_UnExport(bool, const char *);
+void Var_ReadOnly(const char *, bool);
 
 void Global_Set(const char *, const char *);
 void Global_Append(const char *, const char *);

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.690 src/usr.bin/make/parse.c:1.691
--- src/usr.bin/make/parse.c:1.690	Tue Jan  3 00:00:45 2023
+++ src/usr.bin/make/parse.c	Mon Jan 23 23:01:52 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.690 2023/01/03 00:00:45 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.691 2023/01/23 23:01:52 sjg Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -105,7 +105,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.690 2023/01/03 00:00:45 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.691 2023/01/23 23:01:52 sjg Exp $");
 
 /*
  * A file being read.
@@ -149,6 +149,7 @@ typedef enum ParseSpecial {
 	SP_NOMETA,	/* .NOMETA */
 	SP_NOMETA_CMP,	/* .NOMETA_CMP */
 	SP_NOPATH,	/* .NOPATH */
+	SP_NOREADONLY,	/* .NOREADONLY */
 	SP_NOT,		/* Not special */
 	SP_NOTPARALLEL,	/* .NOTPARALLEL or .NO_PARALLEL */
 	SP_NULL,	/* .NULL; not mentioned in the manual page */
@@ -161,6 +162,7 @@ typedef enum 

CVS commit: src

2023-01-23 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Mon Jan 23 23:01:53 UTC 2023

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make: make.1 make.h parse.c var.c
src/usr.bin/make/unit-tests: Makefile

Log Message:
make: .[NO]READONLY for control of read-only variables

Reviewed by: rillig


To generate a diff of this commit:
cvs rdiff -u -r1.1247 -r1.1248 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.357 -r1.358 src/usr.bin/make/make.1
cvs rdiff -u -r1.309 -r1.310 src/usr.bin/make/make.h
cvs rdiff -u -r1.690 -r1.691 src/usr.bin/make/parse.c
cvs rdiff -u -r1.1036 -r1.1037 src/usr.bin/make/var.c
cvs rdiff -u -r1.329 -r1.330 src/usr.bin/make/unit-tests/Makefile

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



CVS commit: src/sys/dev/i2c

2023-01-23 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 23 22:20:59 UTC 2023

Modified Files:
src/sys/dev/i2c: m41st84reg.h

Log Message:
fix typos in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/m41st84reg.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/i2c/m41st84reg.h
diff -u src/sys/dev/i2c/m41st84reg.h:1.3 src/sys/dev/i2c/m41st84reg.h:1.4
--- src/sys/dev/i2c/m41st84reg.h:1.3	Sun Dec 11 12:21:22 2005
+++ src/sys/dev/i2c/m41st84reg.h	Mon Jan 23 22:20:59 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: m41st84reg.h,v 1.3 2005/12/11 12:21:22 christos Exp $	*/
+/*	$NetBSD: m41st84reg.h,v 1.4 2023/01/23 22:20:59 andvar Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -77,13 +77,13 @@
 #define	M41ST84_CONTROL_FT		0x40	/* Frequency test bit */
 #define	M41ST84_CONTROL_OUT		0x80	/* Output level */
 
-#define	M41ST84_WATCHDOG_RB_MASK	0x03	/* Watchdog resulotion bits */
+#define	M41ST84_WATCHDOG_RB_MASK	0x03	/* Watchdog resolution bits */
 #define	M41ST84_WATCHDOG_BMB_MASK	0x7c	/* Watchdog multiplier bits */
 #define	M41ST84_WATCHDOG_WDS		0x80	/* Watchdog steering bit */
 
 #define	M41ST84_AL_MONTH_ABE		0x20	/* alarm in b-backup mode en */
 #define	M41ST84_AL_MONTH_SQWE		0x40	/* square wave enable */
-#define	M41ST84_AL_MONTH_AFE		0x80	/* alarm flage enable */
+#define	M41ST84_AL_MONTH_AFE		0x80	/* alarm flag enable */
 
 #define	M41ST84_AL_HOUR_HT		0x40	/* Halt Update Bit */
 



CVS commit: src/sys/dev/i2c

2023-01-23 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 23 22:20:59 UTC 2023

Modified Files:
src/sys/dev/i2c: m41st84reg.h

Log Message:
fix typos in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/m41st84reg.h

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



CVS commit: src/sys

2023-01-23 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 23 22:16:45 UTC 2023

Modified Files:
src/sys/arch/sparc/dev: sw.c
src/sys/arch/sun3/dev: si_sebuf.c sivar.h
src/sys/dev/ic: sunscpalvar.h

Log Message:
s/lager/larger/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sparc/dev/sw.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sun3/dev/si_sebuf.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sun3/dev/sivar.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/sunscpalvar.h

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



CVS commit: src/sys

2023-01-23 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 23 22:16:45 UTC 2023

Modified Files:
src/sys/arch/sparc/dev: sw.c
src/sys/arch/sun3/dev: si_sebuf.c sivar.h
src/sys/dev/ic: sunscpalvar.h

Log Message:
s/lager/larger/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sparc/dev/sw.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sun3/dev/si_sebuf.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sun3/dev/sivar.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/sunscpalvar.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/sparc/dev/sw.c
diff -u src/sys/arch/sparc/dev/sw.c:1.25 src/sys/arch/sparc/dev/sw.c:1.26
--- src/sys/arch/sparc/dev/sw.c:1.25	Sun Nov 22 03:55:33 2020
+++ src/sys/arch/sparc/dev/sw.c	Mon Jan 23 22:16:44 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sw.c,v 1.25 2020/11/22 03:55:33 thorpej Exp $	*/
+/*	$NetBSD: sw.c,v 1.26 2023/01/23 22:16:44 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -85,7 +85,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sw.c,v 1.25 2020/11/22 03:55:33 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sw.c,v 1.26 2023/01/23 22:16:44 andvar Exp $");
 
 #include "opt_ddb.h"
 
@@ -129,7 +129,7 @@ __KERNEL_RCSID(0, "$NetBSD: sw.c,v 1.25 
 #define	MIN_DMA_LEN 128
 
 /*
- * Transfers lager than 65535 bytes need to be split-up.
+ * Transfers larger than 65535 bytes need to be split-up.
  * (Some of the FIFO logic has only 16 bits counters.)
  * Make the size an integer multiple of the page size
  * to avoid buf/cluster remap problems.  (paranoid?)

Index: src/sys/arch/sun3/dev/si_sebuf.c
diff -u src/sys/arch/sun3/dev/si_sebuf.c:1.31 src/sys/arch/sun3/dev/si_sebuf.c:1.32
--- src/sys/arch/sun3/dev/si_sebuf.c:1.31	Mon Aug  2 12:56:23 2021
+++ src/sys/arch/sun3/dev/si_sebuf.c	Mon Jan 23 22:16:44 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: si_sebuf.c,v 1.31 2021/08/02 12:56:23 andvar Exp $	*/
+/*	$NetBSD: si_sebuf.c,v 1.32 2023/01/23 22:16:44 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: si_sebuf.c,v 1.31 2021/08/02 12:56:23 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: si_sebuf.c,v 1.32 2023/01/23 22:16:44 andvar Exp $");
 
 #include 
 #include 
@@ -70,7 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: si_sebuf.c,v
 #define	MIN_DMA_LEN 128
 
 /*
- * Transfers lager than 65535 bytes need to be split-up.
+ * Transfers larger than 65535 bytes need to be split-up.
  * (Some of the FIFO logic has only 16 bits counters.)
  * Make the size an integer multiple of the page size
  * to avoid buf/cluster remap problems.  (paranoid?)

Index: src/sys/arch/sun3/dev/sivar.h
diff -u src/sys/arch/sun3/dev/sivar.h:1.11 src/sys/arch/sun3/dev/sivar.h:1.12
--- src/sys/arch/sun3/dev/sivar.h:1.11	Mon Apr 28 20:23:38 2008
+++ src/sys/arch/sun3/dev/sivar.h	Mon Jan 23 22:16:44 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sivar.h,v 1.11 2008/04/28 20:23:38 martin Exp $	*/
+/*	$NetBSD: sivar.h,v 1.12 2023/01/23 22:16:44 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 #define	MIN_DMA_LEN 128
 
 /*
- * Transfers lager than 65535 bytes need to be split-up.
+ * Transfers larger than 65535 bytes need to be split-up.
  * (Some of the FIFO logic has only 16 bits counters.)
  * Make the size an integer multiple of the page size
  * to avoid buf/cluster remap problems.  (paranoid?)

Index: src/sys/dev/ic/sunscpalvar.h
diff -u src/sys/dev/ic/sunscpalvar.h:1.9 src/sys/dev/ic/sunscpalvar.h:1.10
--- src/sys/dev/ic/sunscpalvar.h:1.9	Sun Jul  6 13:29:50 2008
+++ src/sys/dev/ic/sunscpalvar.h	Mon Jan 23 22:16:44 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunscpalvar.h,v 1.9 2008/07/06 13:29:50 tsutsui Exp $	*/
+/*	$NetBSD: sunscpalvar.h,v 1.10 2023/01/23 22:16:44 andvar Exp $	*/
 
 /*
  * Copyright (c) 2001 Matthew Fredette
@@ -116,7 +116,7 @@
 #define SUNSCPAL_PHASE_INVALID	SUNSCPAL_PHASE_UNSPEC1
 
 /*
- * Transfers lager than 65535 bytes need to be split-up.
+ * Transfers larger than 65535 bytes need to be split-up.
  * (The DMA count register is only 16 bits.)
  * Make the size an integer multiple of the page size
  * to avoid buf/cluster remap problems.  (paranoid?)



CVS commit: src/sys

2023-01-23 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 23 21:52:01 UTC 2023

Modified Files:
src/sys/arch/sun3/dev: xd.c
src/sys/dev/pci: artsata.c
src/sys/dev/vme: xd.c

Log Message:
s/cyliner/cylinder/ and s/specturm/spectrum/ in messages.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/sun3/dev/xd.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/pci/artsata.c
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/vme/xd.c

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



CVS commit: src/sys

2023-01-23 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 23 21:52:01 UTC 2023

Modified Files:
src/sys/arch/sun3/dev: xd.c
src/sys/dev/pci: artsata.c
src/sys/dev/vme: xd.c

Log Message:
s/cyliner/cylinder/ and s/specturm/spectrum/ in messages.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/sun3/dev/xd.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/pci/artsata.c
cvs rdiff -u -r1.98 -r1.99 src/sys/dev/vme/xd.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/sun3/dev/xd.c
diff -u src/sys/arch/sun3/dev/xd.c:1.77 src/sys/arch/sun3/dev/xd.c:1.78
--- src/sys/arch/sun3/dev/xd.c:1.77	Sat Aug  7 16:19:06 2021
+++ src/sys/arch/sun3/dev/xd.c	Mon Jan 23 21:52:01 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xd.c,v 1.77 2021/08/07 16:19:06 thorpej Exp $	*/
+/*	$NetBSD: xd.c,v 1.78 2023/01/23 21:52:01 andvar Exp $	*/
 
 /*
  * Copyright (c) 1995 Charles D. Cranor
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.77 2021/08/07 16:19:06 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.78 2023/01/23 21:52:01 andvar Exp $");
 
 #undef XDC_DEBUG		/* full debug */
 #define XDC_DIAG		/* extra sanity checks */
@@ -2334,7 +2334,7 @@ xdc_e2str(int no)
 	case XD_ERR_DFLT:
 		return "Drive faulted";
 	case XD_ERR_HECY:
-		return "Header error/cyliner";
+		return "Header error/cylinder";
 	case XD_ERR_HEHD:
 		return "Header error/head";
 	case XD_ERR_NOCY:

Index: src/sys/dev/pci/artsata.c
diff -u src/sys/dev/pci/artsata.c:1.29 src/sys/dev/pci/artsata.c:1.30
--- src/sys/dev/pci/artsata.c:1.29	Sun Dec  9 11:14:01 2018
+++ src/sys/dev/pci/artsata.c	Mon Jan 23 21:52:01 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: artsata.c,v 1.29 2018/12/09 11:14:01 jdolecek Exp $	*/
+/*	$NetBSD: artsata.c,v 1.30 2023/01/23 21:52:01 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: artsata.c,v 1.29 2018/12/09 11:14:01 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: artsata.c,v 1.30 2023/01/23 21:52:01 andvar Exp $");
 
 #include "opt_pciide.h"
 
@@ -358,7 +358,7 @@ artisea_chip_map_dpa(struct pciide_softc
 	ARTISEA_DPA_PORT_BASE(0) + ARTISEA_SUPERSET_DPA_OFF +
 	ARTISEA_SUPDPFR) & SUPDPFR_SSCEN) != 0) {
 		aprint_error_dev(sc->sc_wdcdev.sc_atac.atac_dev,
-		"Spread-specturm clocking not supported by device\n");
+		"Spread-spectrum clocking not supported by device\n");
 		return;
 	}
 

Index: src/sys/dev/vme/xd.c
diff -u src/sys/dev/vme/xd.c:1.98 src/sys/dev/vme/xd.c:1.99
--- src/sys/dev/vme/xd.c:1.98	Sat Aug  7 16:19:17 2021
+++ src/sys/dev/vme/xd.c	Mon Jan 23 21:52:01 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xd.c,v 1.98 2021/08/07 16:19:17 thorpej Exp $	*/
+/*	$NetBSD: xd.c,v 1.99 2023/01/23 21:52:01 andvar Exp $	*/
 
 /*
  * Copyright (c) 1995 Charles D. Cranor
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.98 2021/08/07 16:19:17 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.99 2023/01/23 21:52:01 andvar Exp $");
 
 #undef XDC_DEBUG		/* full debug */
 #define XDC_DIAG		/* extra sanity checks */
@@ -2529,7 +2529,7 @@ xdc_e2str(int no)
 	case XD_ERR_DFLT:
 		return ("Drive faulted");
 	case XD_ERR_HECY:
-		return ("Header error/cyliner");
+		return ("Header error/cylinder");
 	case XD_ERR_HEHD:
 		return ("Header error/head");
 	case XD_ERR_NOCY:



CVS commit: src/sys/arch/amiga/dev

2023-01-23 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 23 21:22:44 UTC 2023

Modified Files:
src/sys/arch/amiga/dev: grfabs_cc.c

Log Message:
s/makre/make/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/amiga/dev/grfabs_cc.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/amiga/dev

2023-01-23 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 23 21:22:44 UTC 2023

Modified Files:
src/sys/arch/amiga/dev: grfabs_cc.c

Log Message:
s/makre/make/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/amiga/dev/grfabs_cc.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/amiga/dev/grfabs_cc.c
diff -u src/sys/arch/amiga/dev/grfabs_cc.c:1.37 src/sys/arch/amiga/dev/grfabs_cc.c:1.38
--- src/sys/arch/amiga/dev/grfabs_cc.c:1.37	Sat Mar 26 17:15:18 2022
+++ src/sys/arch/amiga/dev/grfabs_cc.c	Mon Jan 23 21:22:44 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: grfabs_cc.c,v 1.37 2022/03/26 17:15:18 andvar Exp $ */
+/*	$NetBSD: grfabs_cc.c,v 1.38 2023/01/23 21:22:44 andvar Exp $ */
 
 /*
  * Copyright (c) 1994 Christian E. Hopps
@@ -38,7 +38,7 @@
 #include "opt_amigaccgrf.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grfabs_cc.c,v 1.37 2022/03/26 17:15:18 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grfabs_cc.c,v 1.38 2023/01/23 21:22:44 andvar Exp $");
 
 #include 
 #include 
@@ -169,7 +169,7 @@ cc_init_monitor(void)
 	/* turn sprite DMA off. we don't support them yet. */
 	custom.dmacon = DMAF_SPRITE;
 
-	/* makre sure sprite data registers are clear as well */
+	/* make sure sprite data registers are clear as well */
 	custom.spr[0].data = 0;
 	custom.spr[0].datb = 0;
 



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 16:02:49 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-10]: piixpm.c piixpmreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #55):

sys/dev/pci/piixpm.c: revision 1.68
sys/dev/pci/piixpm.c: revision 1.69
sys/dev/pci/piixpmreg.h: revision 1.13
sys/dev/pci/piixpm.c: revision 1.70
sys/dev/pci/piixpm.c: revision 1.71
sys/dev/pci/piixpm.c: revision 1.72

Modify comment. Whitespace. No functional change.

Simplify and modify for following MMIO support. No functional change.
Modify for following MMIO support. No functional change.

Use MMIO for PM register access on newer revision's devices.
 Newer revision's device only support memory mapped access. At least,
X670E's SMBus device that the revision ID is 0x71 doesn't support I/O
access. Use MMIO access for newer devices. Linux uses >= 0x51 for the
check, so we do the same check. Note that X570's SMBus(rev. 0x61) supports
I/O access...

Modify error message to match the current behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.67.4.1 src/sys/dev/pci/piixpm.c
cvs rdiff -u -r1.12 -r1.12.24.1 src/sys/dev/pci/piixpmreg.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/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.67 src/sys/dev/pci/piixpm.c:1.67.4.1
--- src/sys/dev/pci/piixpm.c:1.67	Fri Apr  1 15:34:34 2022
+++ src/sys/dev/pci/piixpm.c	Mon Jan 23 16:02:49 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.67 2022/04/01 15:34:34 pgoyette Exp $ */
+/* $NetBSD: piixpm.c,v 1.67.4.1 2023/01/23 16:02:49 martin Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.67 2022/04/01 15:34:34 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.67.4.1 2023/01/23 16:02:49 martin Exp $");
 
 #include 
 #include 
@@ -52,7 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1
 
 #define PIIXPM_IS_CSB5(sc)		  \
 	(PCI_VENDOR((sc)->sc_id) == PCI_VENDOR_SERVERWORKS &&		  \
-	PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_SERVERWORKS_CSB5)
+	PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_SERVERWORKS_CSB5)
 #define PIIXPM_DELAY	200
 #define PIIXPM_TIMEOUT	1
 
@@ -76,20 +76,20 @@ __KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1
 struct piixpm_smbus {
 	int			sda;
 	int			sda_save;
-	struct			piixpm_softc *softc;
+	struct piixpm_softc	*softc;
 };
 
 struct piixpm_softc {
 	device_t		sc_dev;
 
 	bus_space_tag_t		sc_iot;
-#define	sc_pm_iot sc_iot
-#define sc_smb_iot sc_iot
+	bus_space_tag_t		sc_sb800_bt;
 	bus_space_handle_t	sc_pm_ioh;
-	bus_space_handle_t	sc_sb800_ioh;
+	bus_space_handle_t	sc_sb800_bh;
 	bus_space_handle_t	sc_smb_ioh;
 	void *			sc_smb_ih;
 	int			sc_poll;
+	bool			sc_sb800_mmio;	/* Use MMIO access */
 	bool			sc_sb800_selen; /* Use SMBUS0SEL */
 
 	pci_chipset_tag_t	sc_pc;
@@ -125,6 +125,7 @@ static void	piixpm_chdet(device_t, devic
 static bool	piixpm_suspend(device_t, const pmf_qual_t *);
 static bool	piixpm_resume(device_t, const pmf_qual_t *);
 
+static uint8_t	piixpm_sb800_pmread(struct piixpm_softc *, bus_size_t);
 static int	piixpm_sb800_init(struct piixpm_softc *);
 static void	piixpm_csb5_reset(void *);
 static int	piixpm_i2c_sb800_acquire_bus(void *, int);
@@ -222,7 +223,7 @@ piixpm_attach(device_t parent, device_t 
 
 	/* Map I/O space */
 	base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_PM_BASE);
-	if (base == 0 || bus_space_map(sc->sc_pm_iot, PCI_MAPREG_IO_ADDR(base),
+	if (base == 0 || bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(base),
 	PIIX_PM_SIZE, 0, >sc_pm_ioh)) {
 		aprint_error_dev(self,
 		"can't map power management I/O space\n");
@@ -234,13 +235,22 @@ piixpm_attach(device_t parent, device_t 
 	 * PIIX4 and PIIX4E have a bug in the timer latch, see Errata #20
 	 * in the "Specification update" (document #297738).
 	 */
-	acpipmtimer_attach(self, sc->sc_pm_iot, sc->sc_pm_ioh, PIIX_PM_PMTMR,
+	acpipmtimer_attach(self, sc->sc_iot, sc->sc_pm_ioh, PIIX_PM_PMTMR,
 	(PCI_REVISION(pa->pa_class) < 3) ? ACPIPMT_BADLATCH : 0);
 
 nopowermanagement:
 
 	/* SB800 rev 0x40+, AMD HUDSON and newer need special initialization */
 	if (PIIXPM_IS_FCHGRP(sc) || PIIXPM_IS_SB800GRP(sc)) {
+		/* Newer chips don't support I/O access */
+		if (PIIXPM_IS_KERNCZ(sc) && (sc->sc_rev >= 0x51)) {
+			sc->sc_sb800_mmio = true;
+			sc->sc_sb800_bt = pa->pa_memt;
+		} else {
+			sc->sc_sb800_mmio = false;
+			sc->sc_sb800_bt = pa->pa_iot;
+		}
+
 		if (piixpm_sb800_init(sc) == 0) {
 			/* Read configuration */
 			conf = bus_space_read_1(sc->sc_iot,
@@ -265,7 +275,7 @@ nopowermanagement:
 	/* Map I/O space */
 	base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_SMB_BASE) & 0x;
 	if (base == 0 ||
-	bus_space_map(sc->sc_smb_iot, PCI_MAPREG_IO_ADDR(base),
+	bus_space_map(sc->sc_iot, 

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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 16:02:49 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-10]: piixpm.c piixpmreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #55):

sys/dev/pci/piixpm.c: revision 1.68
sys/dev/pci/piixpm.c: revision 1.69
sys/dev/pci/piixpmreg.h: revision 1.13
sys/dev/pci/piixpm.c: revision 1.70
sys/dev/pci/piixpm.c: revision 1.71
sys/dev/pci/piixpm.c: revision 1.72

Modify comment. Whitespace. No functional change.

Simplify and modify for following MMIO support. No functional change.
Modify for following MMIO support. No functional change.

Use MMIO for PM register access on newer revision's devices.
 Newer revision's device only support memory mapped access. At least,
X670E's SMBus device that the revision ID is 0x71 doesn't support I/O
access. Use MMIO access for newer devices. Linux uses >= 0x51 for the
check, so we do the same check. Note that X570's SMBus(rev. 0x61) supports
I/O access...

Modify error message to match the current behavior.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.67.4.1 src/sys/dev/pci/piixpm.c
cvs rdiff -u -r1.12 -r1.12.24.1 src/sys/dev/pci/piixpmreg.h

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



CVS commit: [netbsd-9] src/sys/arch/x86/pci

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:27:33 UTC 2023

Modified Files:
src/sys/arch/x86/pci [netbsd-9]: amdzentemp.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1572):

sys/arch/x86/pci/amdzentemp.c: revision 1.16

match zen3 "cezanne" (ryzen 5000-series APU.)


To generate a diff of this commit:
cvs rdiff -u -r1.9.2.2 -r1.9.2.3 src/sys/arch/x86/pci/amdzentemp.c

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



CVS commit: [netbsd-9] xsrc/external/mit

2023-01-23 Thread Martin Husemann
Module Name:xsrc
Committed By:   martin
Date:   Mon Jan 23 13:40:01 UTC 2023

Modified Files:
xsrc/external/mit/libX11/dist/modules/om/generic [netbsd-9]:
omGeneric.c
xsrc/external/mit/libXpm/dist/src [netbsd-9]: RdFToI.c WrFFrI.c
create.c data.c parse.c
xsrc/external/mit/xorg-server/dist/Xext [netbsd-9]: saver.c xtest.c
xvmain.c
xsrc/external/mit/xorg-server/dist/Xi [netbsd-9]: xipassivegrab.c
xiproperty.c
xsrc/external/mit/xorg-server/dist/dix [netbsd-9]: property.c
xsrc/external/mit/xorg-server/dist/xkb [netbsd-9]: xkbUtils.c

Log Message:
Apply patch, requested by mrg in ticket #1577:

Apply upstream fixes for the following CVEs:

   CVE-2022-46285, CVE-2022-44617, CVE-2022-4883, CVE-2020-14363,
   CVE-2022-46340, CVE-2022-46341, CVE-2022-46342 CVE-2022-46343,
   CVE-2022-46344, CVE-2022-46283, CVE-2021-4008, CVE-2021-4009,
   CVE-2021-4010, CVE-2021-4011


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9.2.1 -r1.1.1.9.2.2 \
xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.10.1 \
xsrc/external/mit/libXpm/dist/src/RdFToI.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.10.1 \
xsrc/external/mit/libXpm/dist/src/WrFFrI.c
cvs rdiff -u -r1.3 -r1.3.4.1 xsrc/external/mit/libXpm/dist/src/create.c
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.12.1 \
xsrc/external/mit/libXpm/dist/src/data.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.4.1 \
xsrc/external/mit/libXpm/dist/src/parse.c
cvs rdiff -u -r1.3 -r1.3.2.1 xsrc/external/mit/xorg-server/dist/Xext/saver.c
cvs rdiff -u -r1.6 -r1.6.2.1 xsrc/external/mit/xorg-server/dist/Xext/xtest.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.2.1 \
xsrc/external/mit/xorg-server/dist/Xext/xvmain.c
cvs rdiff -u -r1.4 -r1.4.2.1 \
xsrc/external/mit/xorg-server/dist/Xi/xipassivegrab.c \
xsrc/external/mit/xorg-server/dist/Xi/xiproperty.c
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.2.1 \
xsrc/external/mit/xorg-server/dist/dix/property.c
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.2.1 \
xsrc/external/mit/xorg-server/dist/xkb/xkbUtils.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/libX11/dist/modules/om/generic/omGeneric.c
diff -u xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c:1.1.1.9.2.1 xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c:1.1.1.9.2.2
--- xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c:1.1.1.9.2.1	Wed Aug  5 13:44:40 2020
+++ xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c	Mon Jan 23 13:40:00 2023
@@ -1908,7 +1908,8 @@ init_om(
 char **required_list;
 XOrientation *orientation;
 char **value, buf[BUFSIZ], *bufptr;
-int count = 0, num = 0, length = 0;
+int count = 0, num = 0;
+unsigned int length = 0;
 
 _XlcGetResource(lcd, "XLC_FONTSET", "on_demand_loading", , );
 if (count > 0 && _XlcCompareISOLatin1(*value, "True") == 0)

Index: xsrc/external/mit/libXpm/dist/src/RdFToI.c
diff -u xsrc/external/mit/libXpm/dist/src/RdFToI.c:1.1.1.4 xsrc/external/mit/libXpm/dist/src/RdFToI.c:1.1.1.4.10.1
--- xsrc/external/mit/libXpm/dist/src/RdFToI.c:1.1.1.4	Sun Mar 16 22:20:04 2014
+++ xsrc/external/mit/libXpm/dist/src/RdFToI.c	Mon Jan 23 13:40:00 2023
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 #else
 #ifdef FOR_MSW
 #include 
@@ -161,7 +162,17 @@ xpmPipeThrough(
 	goto err;
 	if ( 0 == pid )
 	{
-	execlp(cmd, cmd, arg1, (char *)NULL);
+#ifdef HAVE_CLOSEFROM
+	closefrom(3);
+#elif defined(HAVE_CLOSE_RANGE)
+# ifdef CLOSE_RANGE_UNSHARE
+#  define close_range_flags CLOSE_RANGE_UNSHARE
+# else
+#  define close_range_flags 0
+#endif
+	close_range(3, ~0U, close_range_flags);
+#endif
+	execl(cmd, cmd, arg1, (char *)NULL);
 	perror(cmd);
 	goto err;
 	}
@@ -235,12 +246,12 @@ OpenReadFile(
 	if ( ext && !strcmp(ext, ".Z") )
 	{
 	mdata->type = XPMPIPE;
-	mdata->stream.file = xpmPipeThrough(fd, "uncompress", "-c", "r");
+	mdata->stream.file = xpmPipeThrough(fd, XPM_PATH_UNCOMPRESS, "-c", "r");
 	}
 	else if ( ext && !strcmp(ext, ".gz") )
 	{
 	mdata->type = XPMPIPE;
-	mdata->stream.file = xpmPipeThrough(fd, "gunzip", "-qc", "r");
+	mdata->stream.file = xpmPipeThrough(fd, XPM_PATH_GZIP, "-dqc", "r");
 	}
 	else
 #endif /* z-files */

Index: xsrc/external/mit/libXpm/dist/src/WrFFrI.c
diff -u xsrc/external/mit/libXpm/dist/src/WrFFrI.c:1.1.1.5 xsrc/external/mit/libXpm/dist/src/WrFFrI.c:1.1.1.5.10.1
--- xsrc/external/mit/libXpm/dist/src/WrFFrI.c:1.1.1.5	Sun Mar 16 22:20:04 2014
+++ xsrc/external/mit/libXpm/dist/src/WrFFrI.c	Mon Jan 23 13:40:00 2023
@@ -336,10 +336,10 @@ OpenWriteFile(
 #ifndef NO_ZPIPE
 	len = strlen(filename);
 	if (len > 2 && !strcmp(".Z", filename + (len - 2))) {
-	mdata->stream.file = xpmPipeThrough(fd, "compress", NULL, "w");
+	mdata->stream.file = xpmPipeThrough(fd, XPM_PATH_COMPRESS, 

CVS commit: [netbsd-8] src/external/mit/xorg

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:36:04 UTC 2023

Modified Files:
src/external/mit/xorg/bin/cxpm [netbsd-8]: Makefile
src/external/mit/xorg/bin/sxpm [netbsd-8]: Makefile
src/external/mit/xorg/lib/libXpm [netbsd-8]: Makefile
Added Files:
src/external/mit/xorg/lib/libXpm [netbsd-8]: xpm.mk

Log Message:
Apply patch, requested by mrg in ticket #1794:

Adjust for upstream fixes for the following CVEs:

   CVE-2022-46285, CVE-2022-44617, CVE-2022-4883, CVE-2020-14363,
   CVE-2022-46340, CVE-2022-46341, CVE-2022-46342 CVE-2022-46343,
   CVE-2022-46344, CVE-2022-46283, CVE-2021-4008, CVE-2021-4009,
   CVE-2021-4010, CVE-2021-4011


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.20.1 src/external/mit/xorg/bin/cxpm/Makefile
cvs rdiff -u -r1.2 -r1.2.20.1 src/external/mit/xorg/bin/sxpm/Makefile
cvs rdiff -u -r1.2 -r1.2.56.1 src/external/mit/xorg/lib/libXpm/Makefile
cvs rdiff -u -r0 -r1.2.2.2 src/external/mit/xorg/lib/libXpm/xpm.mk

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/mit/xorg

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:53:03 UTC 2023

Modified Files:
src/external/mit/xorg/bin/cxpm [netbsd-10]: Makefile
src/external/mit/xorg/bin/sxpm [netbsd-10]: Makefile
src/external/mit/xorg/lib/libXpm [netbsd-10]: Makefile
Added Files:
src/external/mit/xorg/lib/libXpm [netbsd-10]: xpm.mk

Log Message:
Sync to HEAD, requested by mrg in ticket #59:

external/mit/xorg/bin/cxpm/Makefile up to 1.3
external/mit/xorg/bin/sxpm/Makefile up to 1.3
external/mit/xorg/lib/libXpm/xpm.mk up to 1.2
external/mit/xorg/lib/libXpm/Makefile   up to 1.4

Adjust for upstream fixes for CVE-2022-46285, CVE-2022-44617, and
CVE-2022-4883.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.38.1 src/external/mit/xorg/bin/cxpm/Makefile
cvs rdiff -u -r1.2 -r1.2.38.1 src/external/mit/xorg/bin/sxpm/Makefile
cvs rdiff -u -r1.3 -r1.3.2.1 src/external/mit/xorg/lib/libXpm/Makefile
cvs rdiff -u -r0 -r1.2.6.2 src/external/mit/xorg/lib/libXpm/xpm.mk

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/bin/cxpm/Makefile
diff -u src/external/mit/xorg/bin/cxpm/Makefile:1.2 src/external/mit/xorg/bin/cxpm/Makefile:1.2.38.1
--- src/external/mit/xorg/bin/cxpm/Makefile:1.2	Fri May 31 01:41:08 2013
+++ src/external/mit/xorg/bin/cxpm/Makefile	Mon Jan 23 13:53:03 2023
@@ -1,11 +1,10 @@
-#	$NetBSD: Makefile,v 1.2 2013/05/31 01:41:08 mrg Exp $
+#	$NetBSD: Makefile,v 1.2.38.1 2023/01/23 13:53:03 martin Exp $
 
 .include 
 
 PROG=	cxpm
 
 CPPFLAGS+=	-I${X11SRCDIR.Xpm}/src
-CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/X11
 
 LDADD+=	-lXpm -lXt -lSM -lICE -lXext -lX11
 DPADD+=	${LIBXPM} ${LIBXT} ${LIBSM} ${LIBICE} ${LIBXEXT} ${LIBX11}
@@ -13,5 +12,7 @@ DPADD+=	${LIBXPM} ${LIBXT} ${LIBSM} ${LI
 .PATH:	${X11SRCDIR.Xpm}/${PROG}
 .PATH:	${X11SRCDIR.Xpm}/man
 
+.include "${NETBSDSRCDIR}/external/mit/xorg/lib/libXpm/xpm.mk"
+
 .include 
 .include 

Index: src/external/mit/xorg/bin/sxpm/Makefile
diff -u src/external/mit/xorg/bin/sxpm/Makefile:1.2 src/external/mit/xorg/bin/sxpm/Makefile:1.2.38.1
--- src/external/mit/xorg/bin/sxpm/Makefile:1.2	Fri May 31 01:41:56 2013
+++ src/external/mit/xorg/bin/sxpm/Makefile	Mon Jan 23 13:53:03 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2013/05/31 01:41:56 mrg Exp $
+#	$NetBSD: Makefile,v 1.2.38.1 2023/01/23 13:53:03 martin Exp $
 
 .include 
 
@@ -13,5 +13,7 @@ DPADD+=	${LIBXPM} ${LIBXT} ${LIBSM} ${LI
 .PATH:	${X11SRCDIR.Xpm}/${PROG}
 .PATH:	${X11SRCDIR.Xpm}/man
 
+.include "${NETBSDSRCDIR}/external/mit/xorg/lib/libXpm/xpm.mk"
+
 .include 
 .include 

Index: src/external/mit/xorg/lib/libXpm/Makefile
diff -u src/external/mit/xorg/lib/libXpm/Makefile:1.3 src/external/mit/xorg/lib/libXpm/Makefile:1.3.2.1
--- src/external/mit/xorg/lib/libXpm/Makefile:1.3	Tue Nov 16 09:25:52 2021
+++ src/external/mit/xorg/lib/libXpm/Makefile	Mon Jan 23 13:53:03 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2021/11/16 09:25:52 nia Exp $
+#	$NetBSD: Makefile,v 1.3.2.1 2023/01/23 13:53:03 martin Exp $
 
 USE_FORT?=	yes # data-driven bugs?
 
@@ -17,14 +17,58 @@ SRCS=	Attrib.c CrBufFrI.c CrBufFrP.c CrD
 INCS=	xpm.h
 INCSDIR=${X11INCDIR}/X11
 
-CPPFLAGS+=-DHAS_SNPRINTF
-CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/X11
-
 LIBDPLIBS=\
 	Xext	${.CURDIR}/../libXext \
 	X11	${.CURDIR}/../libX11/dynamic
 
 PKGDIST=	${LIB}
 
+.include "xpm.mk"
+
+.if 0 # not yet
+MAN=	\
+	XpmAttributesSize.3 \
+	XpmCreateBuffer.3 \
+	XpmCreateBufferFromImage.3 \
+	XpmCreateBufferFromPixmap.3 \
+	XpmCreateBufferFromXpmImage.3 \
+	XpmCreateData.3 \
+	XpmCreateDataFromImage.3 \
+	XpmCreateDataFromPixmap.3 \
+	XpmCreateDataFromXpmImage.3 \
+	XpmCreateImage.3 \
+	XpmCreateImageFromBuffer.3 \
+	XpmCreateImageFromData.3 \
+	XpmCreateImageFromXpmImage.3 \
+	XpmCreatePixmap.3 \
+	XpmCreatePixmapFromBuffer.3 \
+	XpmCreatePixmapFromData.3 \
+	XpmCreatePixmapFromXpmImage.3 \
+	XpmCreateXpmImage.3 \
+	XpmCreateXpmImageFromBuffer.3 \
+	XpmCreateXpmImageFromData.3 \
+	XpmCreateXpmImageFromImage.3 \
+	XpmCreateXpmImageFromPixmap.3 \
+	XpmFree.3 \
+	XpmFreeAttributes.3 \
+	XpmFreeExtensions.3 \
+	XpmFreeXpmImage.3 \
+	XpmFreeXpmInfo.3 \
+	XpmGetErrorString.3 \
+	XpmLibraryVersion.3 \
+	XpmMisc.3 \
+	XpmRead.3 \
+	XpmReadFileToBuffer.3 \
+	XpmReadFileToData.3 \
+	XpmReadFileToImage.3 \
+	XpmReadFileToPixmap.3 \
+	XpmReadFileToXpmImage.3 \
+	XpmWrite.3 \
+	XpmWriteFileFromBuffer.3 \
+	XpmWriteFileFromImage.3 \
+	XpmWriteFileFromPixmap.3 \
+	XpmWriteFileFromXpmImage.3
+.endif
+
 .include 
 .include 

Added files:

Index: src/external/mit/xorg/lib/libXpm/xpm.mk
diff -u /dev/null src/external/mit/xorg/lib/libXpm/xpm.mk:1.2.6.2
--- /dev/null	Mon Jan 23 13:53:03 2023
+++ src/external/mit/xorg/lib/libXpm/xpm.mk	Mon Jan 23 13:53:03 2023
@@ -0,0 +1,7 @@
+#	$NetBSD: xpm.mk,v 1.2.6.2 2023/01/23 13:53:03 martin Exp $
+
+CPPFLAGS+=	-DHAS_SNPRINTF
+CPPFLAGS+=	

CVS commit: [netbsd-10] src/external/mit/xorg

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:53:03 UTC 2023

Modified Files:
src/external/mit/xorg/bin/cxpm [netbsd-10]: Makefile
src/external/mit/xorg/bin/sxpm [netbsd-10]: Makefile
src/external/mit/xorg/lib/libXpm [netbsd-10]: Makefile
Added Files:
src/external/mit/xorg/lib/libXpm [netbsd-10]: xpm.mk

Log Message:
Sync to HEAD, requested by mrg in ticket #59:

external/mit/xorg/bin/cxpm/Makefile up to 1.3
external/mit/xorg/bin/sxpm/Makefile up to 1.3
external/mit/xorg/lib/libXpm/xpm.mk up to 1.2
external/mit/xorg/lib/libXpm/Makefile   up to 1.4

Adjust for upstream fixes for CVE-2022-46285, CVE-2022-44617, and
CVE-2022-4883.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.38.1 src/external/mit/xorg/bin/cxpm/Makefile
cvs rdiff -u -r1.2 -r1.2.38.1 src/external/mit/xorg/bin/sxpm/Makefile
cvs rdiff -u -r1.3 -r1.3.2.1 src/external/mit/xorg/lib/libXpm/Makefile
cvs rdiff -u -r0 -r1.2.6.2 src/external/mit/xorg/lib/libXpm/xpm.mk

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



CVS commit: [netbsd-8] src/doc

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:11:23 UTC 2023

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

Log Message:
Tickets #1787 - #1796


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.163 -r1.1.2.164 src/doc/CHANGES-8.3

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.163 src/doc/CHANGES-8.3:1.1.2.164
--- src/doc/CHANGES-8.3:1.1.2.163	Thu Jan 19 10:59:09 2023
+++ src/doc/CHANGES-8.3	Mon Jan 23 14:11:22 2023
@@ -1,4 +1,4 @@
- $NetBSD: CHANGES-8.3,v 1.1.2.163 2023/01/19 10:59:09 martin Exp $
+ $NetBSD: CHANGES-8.3,v 1.1.2.164 2023/01/23 14:11:22 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -3031,3 +3031,125 @@ sys/dev/usb/usb.h1.121
 	usb(4): avoid undefined behavior in UGETDW().
 	[msaitoh, ticket #1786]
 
+sys/dev/pci/xhci_pci.c1.31 via patch
+sys/dev/usb/xhci.c1.173-1.175
+sys/dev/usb/xhcivar.h1.22
+
+	Support xHCI device which has USB 2 port only.
+	[msaitoh, ticket #1787]
+
+sys/arch/x86/x86/procfs_machdep.c		1.46
+
+	Add x2avic. Modify comment.
+	[msaitoh, ticket #1788]
+
+sys/arch/x86/pci/amdzentemp.c			1.16
+
+	amdzentemp(4): match zen3 "cezanne" (ryzen 5000-series APU.)
+	[msaitoh, ticket #1789]
+
+sys/dev/pci/piixpm.c1.66,1.68-1.72 via patch
+sys/dev/pci/piixpmreg.h 			1.13
+
+	Add support new AMD chipsets that do not have indirect access
+	I/O ports.
+	[msaitoh, ticket #1790]
+
+sys/arch/x86/include/specialreg.h		1.193-1.198 via patch
+
+	- Add CPUID Fn_0006 %eax bit 24 IA32_THERM_INTERRUPT MSR bit 25
+	  Hardware Feedback Notification support.
+	- Add CPUID Fn_0007 %ecx bit 29 ENQCMD.
+	- Add CPUID Fn_0007 %edx bit 1 SGX-KEYS.
+	- Add CPUID Fn_0007 %edx bit 5 UINTR(User INTeRrupts).
+	- Add CPUID Fn_0007 %edx bit 11 RTM_ALWAYS_ABORT.
+	- Add CPUID Fn_0007 %edx bit 22 AMX_BF16.
+	- Add CPUID Fn_0007 %edx bit 23 AVX512_FP16.
+	- Add CPUID Fn_0007 %edx bit 24 AMX_TILE.
+	- Add CPUID Fn_0007 %edx bit 25 AMX_INT8.
+	- Add CPUID Fn_0007 sub-leaf 1 %edx bit 18 CET_SSS.
+	- Add CPUID Fn_0007 sub-leaf 2 %edx definitions.
+	- Add CPUID Fn_000d sub-leaf 1 %eax bit 4 XFD.
+	- Add CPUID Fn_001d Tile Information.
+	- Add CPUID Fn_001e TMUL Information.
+	- Add CPUID Fn8000_0007 %eax RAS capabilities.
+	- Add CPUID Fn8000_0008 %ebx BTC_NO,
+	- Add cpuid Fn8000_000a x2AVIC, VNMI, IBSVIRT and ROGPT.
+	- Add CPUID Fn8000_001b Instruction-Based Sampling.
+	- Add CPUID Fn8000_001e Processor Topology Information.
+	- Add CPUID Fn8000_001f %eax RPMQUERY, VmplSSS, TscAuxVirt,
+	  VmgexitParam, VirtualTomMsr, IbsVirtGuest, SmtProtection,
+	  vsmCommPageMSR and NestedVirtSnpMsr.
+	- Add CPUID Fn8000_0021 AMD Extended Features Identification 2.
+	- Add CPUID Fn8000_0022 AMD Extended Performance Monitoring and Debug.
+	- Rename HW_FEEDBACK to HWI (Hardware Feedback Interface).
+	- Rename TSX_FORCE_ABORT to RTM_FORCE_ABORT.
+	- Modify comment. Both Intel and AMD support CPUID Fn000b.
+	- Modify comment. Hybrid Information -> Native Model ID Information.
+	- Use __BIT(). Add comment. Whitespace fix.
+	[msaitoh, ticket #1791]
+
+usr.sbin/cpuctl/arch/i386.c			1.129-1.135 (via patch)
+
+	- Print cpuid 7 sub-leaf 1 %ebx, %edx and sub-leaf 2 %edx.
+	- Add Raptor Lake and Sapphire Rapids.
+	- Modify messages a little.
+	[msaitoh, ticket #1792]
+
+usr.bin/locate/locate/updatedb.sh		1.18
+
+	locate.updatedb(8): PR 57191: add -- to the invocation of locate.code.
+	[uwe, ticket #1793]
+
+xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c	(apply patch)
+xsrc/external/mit/libXpm/dist/src/RdFToI.c			(apply patch)
+xsrc/external/mit/libXpm/dist/src/WrFFrI.c			(apply patch)
+xsrc/external/mit/libXpm/dist/src/create.c			(apply patch)
+xsrc/external/mit/libXpm/dist/src/data.c			(apply patch)
+xsrc/external/mit/libXpm/dist/src/parse.c			(apply patch)
+xsrc/external/mit/xorg-server/dist/Xext/saver.c			(apply patch)
+xsrc/external/mit/xorg-server/dist/Xext/xtest.c			(apply patch)
+xsrc/external/mit/xorg-server/dist/Xext/xvmain.c		(apply patch)
+xsrc/external/mit/xorg-server/dist/Xi/xipassivegrab.c		(apply patch)
+xsrc/external/mit/xorg-server/dist/Xi/xiproperty.c		(apply patch)
+xsrc/external/mit/xorg-server/dist/dix/property.c		(apply patch)
+xsrc/external/mit/xorg-server/dist/xkb/xkbUtils.c		(apply patch)
+external/mit/xorg/bin/cxpm/Makefile(apply patch)
+external/mit/xorg/bin/sxpm/Makefile(apply patch)
+external/mit/xorg/lib/libXpm/Makefile(apply patch)
+external/mit/xorg/lib/libXpm/xpm.mk(apply patch)
+
+	Apply upstream fixes for the following CVEs:
+	CVE-2022-46285, CVE-2022-44617, CVE-2022-4883, CVE-2020-14363,
+	CVE-2022-46340, CVE-2022-46341, CVE-2022-46342 CVE-2022-46343,
+	CVE-2022-46344, CVE-2022-46283, CVE-2021-4008, CVE-2021-4009,
+	CVE-2021-4010, CVE-2021-4011
+	[mrg, ticket 

CVS commit: [netbsd-9] src/doc

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:12:08 UTC 2023

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

Log Message:
Tickets #1570 - #1579


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.41 -r1.1.2.42 src/doc/CHANGES-9.4

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

Modified files:

Index: src/doc/CHANGES-9.4
diff -u src/doc/CHANGES-9.4:1.1.2.41 src/doc/CHANGES-9.4:1.1.2.42
--- src/doc/CHANGES-9.4:1.1.2.41	Thu Jan 19 10:59:51 2023
+++ src/doc/CHANGES-9.4	Mon Jan 23 14:12:08 2023
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.41 2023/01/19 10:59:51 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.42 2023/01/23 14:12:08 martin Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -583,3 +583,125 @@ usr.bin/netstat/netstat.1			1.76
 	netstat(1): add note about "netstat -mssv".
 	[msaitoh, ticket #1569]
 
+sys/dev/pci/xhci_pci.c1.31 via patch
+sys/dev/usb/xhci.c1.173-1.175
+sys/dev/usb/xhcivar.h1.22
+
+	Support xHCI device which has USB 2 port only.
+	[msaitoh, ticket #1570]
+
+sys/arch/x86/x86/procfs_machdep.c		1.46
+
+	Add x2avic. Modify comment.
+	[msaitoh, ticket #1571]
+
+sys/arch/x86/pci/amdzentemp.c			1.16
+
+	amdzentemp(4): match zen3 "cezanne" (ryzen 5000-series APU.)
+	[msaitoh, ticket #1572]
+
+sys/dev/pci/piixpm.c1.66,1.68-1.72 via patch
+sys/dev/pci/piixpmreg.h 			1.13
+
+	Add support new AMD chipsets that do not have indirect access
+	I/O ports.
+	[msaitoh, ticket #1573]
+
+sys/arch/x86/include/specialreg.h		1.193-1.198
+
+	- Add CPUID Fn_0006 %eax bit 24 IA32_THERM_INTERRUPT MSR bit 25
+	  Hardware Feedback Notification support.
+	- Add CPUID Fn_0007 %ecx bit 29 ENQCMD.
+	- Add CPUID Fn_0007 %edx bit 1 SGX-KEYS.
+	- Add CPUID Fn_0007 %edx bit 5 UINTR(User INTeRrupts).
+	- Add CPUID Fn_0007 %edx bit 11 RTM_ALWAYS_ABORT.
+	- Add CPUID Fn_0007 %edx bit 22 AMX_BF16.
+	- Add CPUID Fn_0007 %edx bit 23 AVX512_FP16.
+	- Add CPUID Fn_0007 %edx bit 24 AMX_TILE.
+	- Add CPUID Fn_0007 %edx bit 25 AMX_INT8.
+	- Add CPUID Fn_0007 sub-leaf 1 %edx bit 18 CET_SSS.
+	- Add CPUID Fn_0007 sub-leaf 2 %edx definitions.
+	- Add CPUID Fn_000d sub-leaf 1 %eax bit 4 XFD.
+	- Add CPUID Fn_001d Tile Information.
+	- Add CPUID Fn_001e TMUL Information.
+	- Add CPUID Fn8000_0007 %eax RAS capabilities.
+	- Add CPUID Fn8000_0008 %ebx BTC_NO,
+	- Add cpuid Fn8000_000a x2AVIC, VNMI, IBSVIRT and ROGPT.
+	- Add CPUID Fn8000_001b Instruction-Based Sampling.
+	- Add CPUID Fn8000_001e Processor Topology Information.
+	- Add CPUID Fn8000_001f %eax RPMQUERY, VmplSSS, TscAuxVirt,
+	  VmgexitParam, VirtualTomMsr, IbsVirtGuest, SmtProtection,
+	  vsmCommPageMSR and NestedVirtSnpMsr.
+	- Add CPUID Fn8000_0021 AMD Extended Features Identification 2.
+	- Add CPUID Fn8000_0022 AMD Extended Performance Monitoring and Debug.
+	- Rename HW_FEEDBACK to HWI (Hardware Feedback Interface).
+	- Rename TSX_FORCE_ABORT to RTM_FORCE_ABORT.
+	- Modify comment. Both Intel and AMD support CPUID Fn000b.
+	- Modify comment. Hybrid Information -> Native Model ID Information.
+	- Use __BIT(). Add comment. Whitespace fix.
+	[msaitoh, ticket #1574]
+
+usr.sbin/cpuctl/arch/i386.c			1.129-1.135 (via patch)
+
+	- Print cpuid 7 sub-leaf 1 %ebx, %edx and sub-leaf 2 %edx.
+	- Add Raptor Lake and Sapphire Rapids.
+	- Modify messages a little.
+	[msaitoh, ticket #1575]
+
+usr.bin/locate/locate/updatedb.sh		1.18
+
+	locate.updatedb(8): PR 57191: add -- to the invocation of locate.code.
+	[uwe, ticket #1576]
+
+xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c	(apply patch)
+xsrc/external/mit/libXpm/dist/src/RdFToI.c			(apply patch)
+xsrc/external/mit/libXpm/dist/src/WrFFrI.c			(apply patch)
+xsrc/external/mit/libXpm/dist/src/create.c			(apply patch)
+xsrc/external/mit/libXpm/dist/src/data.c			(apply patch)
+xsrc/external/mit/libXpm/dist/src/parse.c			(apply patch)
+xsrc/external/mit/xorg-server/dist/Xext/saver.c			(apply patch)
+xsrc/external/mit/xorg-server/dist/Xext/xtest.c			(apply patch)
+xsrc/external/mit/xorg-server/dist/Xext/xvmain.c		(apply patch)
+xsrc/external/mit/xorg-server/dist/Xi/xipassivegrab.c		(apply patch)
+xsrc/external/mit/xorg-server/dist/Xi/xiproperty.c		(apply patch)
+xsrc/external/mit/xorg-server/dist/dix/property.c		(apply patch)
+xsrc/external/mit/xorg-server/dist/xkb/xkbUtils.c		(apply patch)
+external/mit/xorg/bin/cxpm/Makefile(apply patch)
+external/mit/xorg/bin/sxpm/Makefile(apply patch)
+external/mit/xorg/lib/libXpm/Makefile(apply patch)
+external/mit/xorg/lib/libXpm/xpm.mk(apply patch)
+
+	Apply upstream fixes for the following CVEs:
+	CVE-2022-46285, CVE-2022-44617, CVE-2022-4883, CVE-2020-14363,
+	CVE-2022-46340, CVE-2022-46341, CVE-2022-46342 CVE-2022-46343,
+	CVE-2022-46344, CVE-2022-46283, CVE-2021-4008, CVE-2021-4009,
+	CVE-2021-4010, CVE-2021-4011
+	[mrg, ticket #1577]
+

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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:07:25 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-8]: files.pci
src/sys/dev/pci/ixgbe [netbsd-8]: ix_txrx.c ixgbe.c ixgbe_82598.c
ixgbe_api.c ixgbe_common.c ixgbe_netbsd.h ixv.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1796:

sys/dev/pci/files.pci   1.442
sys/dev/pci/ixgbe/ix_txrx.c 1.99-1.100
sys/dev/pci/ixgbe/ixgbe.c   1.320-1.324 via patch
sys/dev/pci/ixgbe/ixgbe_82598.c 1.19
sys/dev/pci/ixgbe/ixgbe_api.c   1.28
sys/dev/pci/ixgbe/ixgbe_common.c1.43
sys/dev/pci/ixgbe/ixgbe_netbsd.h1.17
sys/dev/pci/ixgbe/ixv.c 1.183

- Add an option for Tx to use deferred softint regardless of whether
  can get txq lock or not. It's off by default.
- Call txeof first, then rxeof for the consistency.
- Make three "Unsupported SFP+ module..." messages the same.
- KNF. Modify comment. Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.388.4.7 -r1.388.4.8 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.24.2.26 -r1.24.2.27 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.88.2.53 -r1.88.2.54 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.8.8.7 -r1.8.8.8 src/sys/dev/pci/ixgbe/ixgbe_82598.c
cvs rdiff -u -r1.15.8.8 -r1.15.8.9 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.13.2.12 -r1.13.2.13 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.7.6.5 -r1.7.6.6 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.56.2.39 -r1.56.2.40 src/sys/dev/pci/ixgbe/ixv.c

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



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:04:42 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: files.pci
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe_82598.c
ixgbe_api.c ixgbe_common.c ixgbe_netbsd.h ixv.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1579:

sys/dev/pci/files.pci   1.442
sys/dev/pci/ixgbe/ix_txrx.c 1.99-1.100
sys/dev/pci/ixgbe/ixgbe.c   1.320-1.324 via patch
sys/dev/pci/ixgbe/ixgbe_82598.c 1.19
sys/dev/pci/ixgbe/ixgbe_api.c   1.28
sys/dev/pci/ixgbe/ixgbe_common.c1.43
sys/dev/pci/ixgbe/ixgbe_netbsd.h1.17
sys/dev/pci/ixgbe/ixv.c 1.183

- Add an option for Tx to use deferred softint regardless of whether
  can get txq lock or not. It's off by default.
- Call txeof first, then rxeof for the consistency.
- Make three "Unsupported SFP+ module..." messages the same.
- KNF. Modify comment. Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.413.2.5 -r1.413.2.6 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.54.2.10 -r1.54.2.11 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.24 -r1.199.2.25 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.12.8.5 -r1.12.8.6 src/sys/dev/pci/ixgbe/ixgbe_82598.c
cvs rdiff -u -r1.23.2.3 -r1.23.2.4 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.25.2.5 -r1.25.2.6 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.11.4.3 -r1.11.4.4 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.125.2.20 -r1.125.2.21 src/sys/dev/pci/ixgbe/ixv.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/files.pci
diff -u src/sys/dev/pci/files.pci:1.413.2.5 src/sys/dev/pci/files.pci:1.413.2.6
--- src/sys/dev/pci/files.pci:1.413.2.5	Thu Oct 21 14:30:10 2021
+++ src/sys/dev/pci/files.pci	Mon Jan 23 14:04:41 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.413.2.5 2021/10/21 14:30:10 martin Exp $
+#	$NetBSD: files.pci,v 1.413.2.6 2023/01/23 14:04:41 martin Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -691,6 +691,7 @@ file	dev/pci/ixgbe/ixgbe_phy.c	ixg | ixv
 file	dev/pci/ixgbe/ixgbe_vf.c	ixg | ixv
 file	dev/pci/ixgbe/if_bypass.c	ixg | ixv
 file	dev/pci/ixgbe/if_fdir.c		ixg | ixv
+defflag	opt_if_ixg.h	IXGBE_ALWAYS_TXDEFER
 
 # This appears to be the driver for virtual instances of i82599.
 device	ixv: ether, ifnet, arp, mii, mii_phy

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.10 src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.11
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.10	Mon May 30 17:01:06 2022
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Mon Jan 23 14:04:42 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.54.2.10 2022/05/30 17:01:06 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.54.2.11 2023/01/23 14:04:42 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.10 2022/05/30 17:01:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.54.2.11 2023/01/23 14:04:42 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -250,6 +250,11 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 		IXGBE_EVC_ADD(>pcq_drops, 1);
 		return ENOBUFS;
 	}
+#ifdef IXGBE_ALWAYS_TXDEFER
+	kpreempt_disable();
+	softint_schedule(txr->txr_si);
+	kpreempt_enable();
+#else
 	if (IXGBE_TX_TRYLOCK(txr)) {
 		ixgbe_mq_start_locked(ifp, txr);
 		IXGBE_TX_UNLOCK(txr);
@@ -279,6 +284,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 			kpreempt_enable();
 		}
 	}
+#endif
 
 	return (0);
 } /* ixgbe_mq_start */
@@ -316,7 +322,7 @@ ixgbe_mq_start_locked(struct ifnet *ifp,
 #if __FreeBSD_version >= 1100036
 		/*
 		 * Since we're looking at the tx ring, we can check
-		 * to see if we're a VF by examing our tail register
+		 * to see if we're a VF by examining our tail register
 		 * address.
 		 */
 		if ((txr->adapter->feat_en & IXGBE_FEATURE_VF) &&
@@ -1977,7 +1983,7 @@ ixgbe_rxeof(struct ix_queue *que)
 		 * not be fragmented across sequential
 		 * descriptors, rather the next descriptor
 		 * is indicated in bits of the descriptor.
-		 * This also means that we might proceses
+		 * This also means that we might process
 		 * more than one packet at a time, something
 		 * that has never been true before, it
 		 * required eliminating global chain pointers

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.24 src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.25
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.24	Fri Jun  3 04:00:49 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Jan 23 14:04:42 2023
@@ -1,4 +1,4 @@

CVS commit: [netbsd-8] src/doc

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:11:23 UTC 2023

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

Log Message:
Tickets #1787 - #1796


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.163 -r1.1.2.164 src/doc/CHANGES-8.3

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



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:04:42 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: files.pci
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe_82598.c
ixgbe_api.c ixgbe_common.c ixgbe_netbsd.h ixv.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1579:

sys/dev/pci/files.pci   1.442
sys/dev/pci/ixgbe/ix_txrx.c 1.99-1.100
sys/dev/pci/ixgbe/ixgbe.c   1.320-1.324 via patch
sys/dev/pci/ixgbe/ixgbe_82598.c 1.19
sys/dev/pci/ixgbe/ixgbe_api.c   1.28
sys/dev/pci/ixgbe/ixgbe_common.c1.43
sys/dev/pci/ixgbe/ixgbe_netbsd.h1.17
sys/dev/pci/ixgbe/ixv.c 1.183

- Add an option for Tx to use deferred softint regardless of whether
  can get txq lock or not. It's off by default.
- Call txeof first, then rxeof for the consistency.
- Make three "Unsupported SFP+ module..." messages the same.
- KNF. Modify comment. Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.413.2.5 -r1.413.2.6 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.54.2.10 -r1.54.2.11 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.24 -r1.199.2.25 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.12.8.5 -r1.12.8.6 src/sys/dev/pci/ixgbe/ixgbe_82598.c
cvs rdiff -u -r1.23.2.3 -r1.23.2.4 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.25.2.5 -r1.25.2.6 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.11.4.3 -r1.11.4.4 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.125.2.20 -r1.125.2.21 src/sys/dev/pci/ixgbe/ixv.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/doc

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:12:59 UTC 2023

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

Log Message:
Tickets #53 - #59


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 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.24 src/doc/CHANGES-10.0:1.1.2.25
--- src/doc/CHANGES-10.0:1.1.2.24	Thu Jan 19 11:00:25 2023
+++ src/doc/CHANGES-10.0	Mon Jan 23 14:12:59 2023
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.0,v 1.1.2.24 2023/01/19 11:00:25 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.25 2023/01/23 14:12:59 martin Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -546,3 +546,178 @@ usr.bin/netstat/netstat.1			1.76
 	netstat(1): add note about "netstat -mssv".
 	[msaitoh, ticket #52]
 
+share/man/man4/igpio.41.3
+sys/dev/ic/igpio.c1.5
+sys/dev/ic/igpioreg.h1.3-1.8
+sys/dev/ic/igpiovar.h1.2
+
+	- Improve support for many devices.
+	- Add support for Ice Lake-N, Raptor Lake-S, and another Baytrail.
+	[msaitoh, ticket #53]
+
+sys/arch/x86/x86/procfs_machdep.c		1.46
+
+	Add x2avic. Modify comment.
+	[msaitoh, ticket #54]
+
+sys/dev/pci/piixpm.c1.68-1.72
+sys/dev/pci/piixpmreg.h 			1.13
+
+	Add support new AMD chipsets that do not have indirect access
+	I/O ports.
+	[msaitoh, ticket #55]
+
+sys/arch/x86/include/specialreg.h		1.199-1.201
+
+	- Add CPUID Fn_0006 %eax bit 24 IA32_THERM_INTERRUPT MSR bit 25
+	  Hardware Feedback Notification support.
+	- Add CPUID Fn_0007 %ecx bit 29 ENQCMD.
+	- Add CPUID Fn_0007 %edx bit 1 SGX-KEYS.
+	- Add CPUID Fn_0007 %edx bit 5 UINTR(User INTeRrupts).
+	- Add CPUID Fn_0007 %edx bit 1 RTM_ALWAYS_ABORT.
+	- Add CPUID Fn_0007 %edx bit 22 AMX_BF16.
+	- Add CPUID Fn_0007 %edx bit 23 AVX512_FP16.
+	- Add CPUID Fn_0007 %edx bit 24 AMX_TILE.
+	- Add CPUID Fn_0007 %edx bit 25 AMX_INT8.
+	- Add CPUID Fn_0007 sub-leaf 1 %edx bit 18 CET_SSS.
+	- Add CPUID Fn_0007 sub-leaf 2 %edx definitions.
+	- Add CPUID Fn_000d sub-leaf 1 %eax bit 4 XFD.
+	- Add CPUID Fn_001d Tile Information.
+	- Add CPUID Fn_001e TMUL Information.
+	- Rename HW_FEEDBACK to HWI (Hardware Feedback Interface).
+	- Rename TSX_FORCE_ABORT to RTM_FORCE_ABORT.
+	- Modify comment. Both Intel and AMD support CPUID Fn000b.
+	- Modify comment. Hybrid Information -> Native Model ID Information.
+	- Use __BIT(). Add comment. Whitespace fix.
+	[msaitoh, ticket #56]
+
+usr.sbin/cpuctl/arch/i386.c			1.134,1.135
+
+	Print cpuid 7 sub-leaf 1 %ebx, %edx and sub-leaf 2 %edx.
+	Add Raptor Lake and Sapphire Rapids.
+	[msaitoh, ticket #57]
+
+usr.bin/locate/locate/updatedb.sh		1.18
+
+	locate.updatedb(8): PR 57191: add -- to the invocation of locate.code.
+	[uwe, ticket #58]
+
+xsrc/external/mit/libXpm/dist/man/XpmAttributesSize.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateBuffer.man up to 1.1.1.2
+xsrc/external/mit/libXpm/dist/man/XpmCreateBufferFromImage.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateBufferFromPixmap.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateBufferFromXpmImage.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateData.man  up to 1.1.1.2
+xsrc/external/mit/libXpm/dist/man/XpmCreateDataFromImage.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateDataFromPixmap.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateDataFromXpmImage.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateImage.man up to 1.1.1.2
+xsrc/external/mit/libXpm/dist/man/XpmFree.man	 up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateImageFromBuffer.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateImageFromData.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateImageFromXpmImage.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreatePixmap.man up to 1.1.1.2
+xsrc/external/mit/libXpm/dist/man/XpmCreatePixmapFromBuffer.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreatePixmapFromData.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreatePixmapFromXpmImage.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateXpmImage.man up to 1.1.1.2
+xsrc/external/mit/libXpm/dist/man/XpmCreateXpmImageFromBuffer.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateXpmImageFromData.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateXpmImageFromImage.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmCreateXpmImageFromPixmap.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmFreeAttributes.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmFreeXpmImage.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmFreeExtensions.man up to 1.1.1.1
+xsrc/external/mit/libXpm/dist/man/XpmFreeXpmInfo.man up to 1.1.1.1

CVS commit: [netbsd-10] src/doc

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:12:59 UTC 2023

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

Log Message:
Tickets #53 - #59


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 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-9] src/sys/dev/pci

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:59:04 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1578:

sys/dev/pci/if_wm.c 1.764-1.767 via patch
sys/dev/pci/if_wmreg.h  1.128

- Workaround for some hypervisor environments. The environments
  cannot stop e1000 interrupt immediately.
- Rename nq_txdesc' member "nqrx_ctx" to "nqtx_ctx". No functional
  change.
- Add comment. Modify comment.
- KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.14 -r1.645.2.15 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.115.2.6 -r1.115.2.7 src/sys/dev/pci/if_wmreg.h

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



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:01:26 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c if_wmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1795:

sys/dev/pci/if_wm.c 1.764-1.767 via patch
sys/dev/pci/if_wmreg.h  1.128

- Workaround for some hypervisor environments. The environments
  cannot stop e1000 interrupt immediately.
- Rename nq_txdesc' member "nqrx_ctx" to "nqtx_ctx". No functional
  change.
- Add comment. Modify comment.
- KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.47 -r1.508.4.48 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98.6.15 -r1.98.6.16 src/sys/dev/pci/if_wmreg.h

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



CVS commit: [netbsd-9] src/doc

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:12:08 UTC 2023

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

Log Message:
Tickets #1570 - #1579


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.41 -r1.1.2.42 src/doc/CHANGES-9.4

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



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:59:04 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: if_wm.c if_wmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1578:

sys/dev/pci/if_wm.c 1.764-1.767 via patch
sys/dev/pci/if_wmreg.h  1.128

- Workaround for some hypervisor environments. The environments
  cannot stop e1000 interrupt immediately.
- Rename nq_txdesc' member "nqrx_ctx" to "nqtx_ctx". No functional
  change.
- Add comment. Modify comment.
- KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.645.2.14 -r1.645.2.15 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.115.2.6 -r1.115.2.7 src/sys/dev/pci/if_wmreg.h

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.645.2.14 src/sys/dev/pci/if_wm.c:1.645.2.15
--- src/sys/dev/pci/if_wm.c:1.645.2.14	Wed Sep  7 10:05:42 2022
+++ src/sys/dev/pci/if_wm.c	Mon Jan 23 13:59:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.645.2.14 2022/09/07 10:05:42 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.645.2.15 2023/01/23 13:59:04 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.14 2022/09/07 10:05:42 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.645.2.15 2023/01/23 13:59:04 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -490,6 +490,7 @@ struct wm_queue {
 	char sysctlname[32];		/* Name for sysctl */
 
 	bool wmq_txrx_use_workqueue;
+	bool wmq_wq_enqueued;
 	struct work wmq_cookie;
 	void *wmq_si;
 	krndsource_t rnd_source;	/* random source */
@@ -2289,7 +2290,7 @@ alloc_retry:
 aprint_error_dev(sc->sc_dev,
 "unable to find PCIX capability\n");
 			else if (sc->sc_type != WM_T_82545_3 &&
- sc->sc_type != WM_T_82546_3) {
+			sc->sc_type != WM_T_82546_3) {
 /*
  * Work around a problem caused by the BIOS
  * setting the max memory read byte count
@@ -3673,7 +3674,7 @@ wm_watchdog_txq_locked(struct ifnet *ifp
 		ifp->if_oerrors++;
 #ifdef WM_DEBUG
 		for (i = txq->txq_sdirty; i != txq->txq_snext;
-		i = WM_NEXTTXS(txq, i)) {
+		 i = WM_NEXTTXS(txq, i)) {
 			txs = >txq_soft[i];
 			printf("txs %d tx %d -> %d\n",
 			i, txs->txs_firstdesc, txs->txs_lastdesc);
@@ -3834,9 +3835,9 @@ wm_tick(void *arg)
 	crcerrs + algnerrc + symerrc + rxerrc + sec + cexterr + rlec;
 
 	/*
-	 * WMREG_RNBC is incremented when there are no available buffers in host
-	 * memory. It does not mean the number of dropped packets, because an
-	 * Ethernet controller can receive packets in such case if there is
+	 * WMREG_RNBC is incremented when there are no available buffers in
+	 * host memory. It does not mean the number of dropped packets, because
+	 * an Ethernet controller can receive packets in such case if there is
 	 * space in the phy's FIFO.
 	 *
 	 * If you want to know the nubmer of WMREG_RMBC, you should use such as
@@ -4153,7 +4154,7 @@ wm_read_mac_addr(struct wm_softc *sc, ui
 
 	return 0;
 
- bad:
+bad:
 	return -1;
 }
 
@@ -4442,10 +4443,10 @@ wm_set_filter(struct wm_softc *sc)
 
 	goto setit;
 
- allmulti:
+allmulti:
 	sc->sc_rctl |= RCTL_MPE;
 
- setit:
+setit:
 	if (sc->sc_type >= WM_T_PCH2) {
 		if (((ec->ec_capabilities & ETHERCAP_JUMBO_MTU) != 0)
 		&& (ifp->if_mtu > ETHERMTU))
@@ -4836,7 +4837,8 @@ wm_init_lcd_from_nvm(struct wm_softc *sc
 		 * LCD Write Enable bits are set in the NVM. When both NVM bits
 		 * are cleared, SW will configure them instead.
 		 */
-		DPRINTF(sc, WM_DEBUG_INIT, ("%s: %s: Configure SMBus and LED\n",
+		DPRINTF(sc, WM_DEBUG_INIT,
+		("%s: %s: Configure SMBus and LED\n",
 			device_xname(sc->sc_dev), __func__));
 		if ((rv = wm_write_smbus_addr(sc)) != 0)
 			goto release;
@@ -5147,15 +5149,15 @@ wm_initialize_hardware_bits(struct wm_so
 		CSR_WRITE(sc, WMREG_TARC0, tarc0);
 
 		switch (sc->sc_type) {
-		/*
-		 * 8257[12] Errata No.52, 82573 Errata No.43 and some others.
-		 * Avoid RSS Hash Value bug.
-		 */
 		case WM_T_82571:
 		case WM_T_82572:
 		case WM_T_82573:
 		case WM_T_80003:
 		case WM_T_ICH8:
+			/*
+			 * 8257[12] Errata No.52, 82573 Errata No.43 and some
+			 * others to avoid RSS Hash Value bug.
+			 */
 			reg = CSR_READ(sc, WMREG_RFCTL);
 			reg |= WMREG_RFCTL_NEWIPV6EXDIS |WMREG_RFCTL_IPV6EXDIS;
 			CSR_WRITE(sc, WMREG_RFCTL, reg);
@@ -5560,6 +5562,11 @@ wm_reset(struct wm_softc *sc)
 		CSR_WRITE(sc, WMREG_CTRL, reg);
 		/* Don't insert a completion barrier when reset */
 		delay(20*1000);
+		/*
+		 * The EXTCNFCTR_MDIO_SW_OWNERSHIP bit is cleared by the reset,
+		 * so don't use sc->phy.release(sc). Release sc_ich_phymtx
+		 * only. See also wm_get_swflag_ich8lan().
+		 */
 		mutex_exit(sc->sc_ich_phymtx);
 		break;
 	case WM_T_82580:
@@ 

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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:01:26 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c if_wmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1795:

sys/dev/pci/if_wm.c 1.764-1.767 via patch
sys/dev/pci/if_wmreg.h  1.128

- Workaround for some hypervisor environments. The environments
  cannot stop e1000 interrupt immediately.
- Rename nq_txdesc' member "nqrx_ctx" to "nqtx_ctx". No functional
  change.
- Add comment. Modify comment.
- KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.47 -r1.508.4.48 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98.6.15 -r1.98.6.16 src/sys/dev/pci/if_wmreg.h

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.47 src/sys/dev/pci/if_wm.c:1.508.4.48
--- src/sys/dev/pci/if_wm.c:1.508.4.47	Thu Sep  8 10:29:36 2022
+++ src/sys/dev/pci/if_wm.c	Mon Jan 23 14:01:25 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.47 2022/09/08 10:29:36 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.48 2023/01/23 14:01:25 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.47 2022/09/08 10:29:36 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.48 2023/01/23 14:01:25 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -487,6 +487,7 @@ struct wm_queue {
 	char sysctlname[32];		/* Name for sysctl */
 
 	bool wmq_txrx_use_workqueue;
+	bool wmq_wq_enqueued;
 	struct work wmq_cookie;
 	void *wmq_si;
 	krndsource_t rnd_source;	/* random source */
@@ -2263,7 +2264,7 @@ alloc_retry:
 aprint_error_dev(sc->sc_dev,
 "unable to find PCIX capability\n");
 			else if (sc->sc_type != WM_T_82545_3 &&
- sc->sc_type != WM_T_82546_3) {
+			sc->sc_type != WM_T_82546_3) {
 /*
  * Work around a problem caused by the BIOS
  * setting the max memory read byte count
@@ -3633,7 +3634,7 @@ wm_watchdog_txq_locked(struct ifnet *ifp
 		ifp->if_oerrors++;
 #ifdef WM_DEBUG
 		for (i = txq->txq_sdirty; i != txq->txq_snext;
-		i = WM_NEXTTXS(txq, i)) {
+		 i = WM_NEXTTXS(txq, i)) {
 			txs = >txq_soft[i];
 			printf("txs %d tx %d -> %d\n",
 			i, txs->txs_firstdesc, txs->txs_lastdesc);
@@ -3794,9 +3795,9 @@ wm_tick(void *arg)
 	crcerrs + algnerrc + symerrc + rxerrc + sec + cexterr + rlec;
 
 	/*
-	 * WMREG_RNBC is incremented when there are no available buffers in host
-	 * memory. It does not mean the number of dropped packets, because an
-	 * Ethernet controller can receive packets in such case if there is
+	 * WMREG_RNBC is incremented when there are no available buffers in
+	 * host memory. It does not mean the number of dropped packets, because
+	 * an Ethernet controller can receive packets in such case if there is
 	 * space in the phy's FIFO.
 	 *
 	 * If you want to know the nubmer of WMREG_RMBC, you should use such as
@@ -4093,7 +4094,7 @@ wm_read_mac_addr(struct wm_softc *sc, ui
 
 	return 0;
 
- bad:
+bad:
 	return -1;
 }
 
@@ -4378,11 +4379,11 @@ wm_set_filter(struct wm_softc *sc)
 	ifp->if_flags &= ~IFF_ALLMULTI;
 	goto setit;
 
- allmulti:
+allmulti:
 	ifp->if_flags |= IFF_ALLMULTI;
 	sc->sc_rctl |= RCTL_MPE;
 
- setit:
+setit:
 	CSR_WRITE(sc, WMREG_RCTL, sc->sc_rctl);
 }
 
@@ -4750,7 +4751,8 @@ wm_init_lcd_from_nvm(struct wm_softc *sc
 		 * LCD Write Enable bits are set in the NVM. When both NVM bits
 		 * are cleared, SW will configure them instead.
 		 */
-		DPRINTF(sc, WM_DEBUG_INIT, ("%s: %s: Configure SMBus and LED\n",
+		DPRINTF(sc, WM_DEBUG_INIT,
+		("%s: %s: Configure SMBus and LED\n",
 			device_xname(sc->sc_dev), __func__));
 		wm_write_smbus_addr(sc);
 
@@ -5056,15 +5058,15 @@ wm_initialize_hardware_bits(struct wm_so
 		CSR_WRITE(sc, WMREG_TARC0, tarc0);
 
 		switch (sc->sc_type) {
-		/*
-		 * 8257[12] Errata No.52, 82573 Errata No.43 and some others.
-		 * Avoid RSS Hash Value bug.
-		 */
 		case WM_T_82571:
 		case WM_T_82572:
 		case WM_T_82573:
 		case WM_T_80003:
 		case WM_T_ICH8:
+			/*
+			 * 8257[12] Errata No.52, 82573 Errata No.43 and some
+			 * others to avoid RSS Hash Value bug.
+			 */
 			reg = CSR_READ(sc, WMREG_RFCTL);
 			reg |= WMREG_RFCTL_NEWIPV6EXDIS |WMREG_RFCTL_IPV6EXDIS;
 			CSR_WRITE(sc, WMREG_RFCTL, reg);
@@ -5468,6 +5470,11 @@ wm_reset(struct wm_softc *sc)
 		CSR_WRITE(sc, WMREG_CTRL, reg);
 		/* Don't insert a completion barrier when reset */
 		delay(20*1000);
+		/*
+		 * The EXTCNFCTR_MDIO_SW_OWNERSHIP bit is cleared by the reset,
+		 * so don't use sc->phy.release(sc). Release sc_ich_phymtx
+		 * only. See also wm_get_swflag_ich8lan().
+		 */
 		mutex_exit(sc->sc_ich_phymtx);
 		break;
 	case WM_T_82580:
@@ -6091,7 +6098,7 @@ wm_setup_msix(struct wm_softc *sc)

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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 14:07:25 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-8]: files.pci
src/sys/dev/pci/ixgbe [netbsd-8]: ix_txrx.c ixgbe.c ixgbe_82598.c
ixgbe_api.c ixgbe_common.c ixgbe_netbsd.h ixv.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1796:

sys/dev/pci/files.pci   1.442
sys/dev/pci/ixgbe/ix_txrx.c 1.99-1.100
sys/dev/pci/ixgbe/ixgbe.c   1.320-1.324 via patch
sys/dev/pci/ixgbe/ixgbe_82598.c 1.19
sys/dev/pci/ixgbe/ixgbe_api.c   1.28
sys/dev/pci/ixgbe/ixgbe_common.c1.43
sys/dev/pci/ixgbe/ixgbe_netbsd.h1.17
sys/dev/pci/ixgbe/ixv.c 1.183

- Add an option for Tx to use deferred softint regardless of whether
  can get txq lock or not. It's off by default.
- Call txeof first, then rxeof for the consistency.
- Make three "Unsupported SFP+ module..." messages the same.
- KNF. Modify comment. Fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.388.4.7 -r1.388.4.8 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.24.2.26 -r1.24.2.27 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.88.2.53 -r1.88.2.54 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.8.8.7 -r1.8.8.8 src/sys/dev/pci/ixgbe/ixgbe_82598.c
cvs rdiff -u -r1.15.8.8 -r1.15.8.9 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.13.2.12 -r1.13.2.13 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.7.6.5 -r1.7.6.6 src/sys/dev/pci/ixgbe/ixgbe_netbsd.h
cvs rdiff -u -r1.56.2.39 -r1.56.2.40 src/sys/dev/pci/ixgbe/ixv.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/files.pci
diff -u src/sys/dev/pci/files.pci:1.388.4.7 src/sys/dev/pci/files.pci:1.388.4.8
--- src/sys/dev/pci/files.pci:1.388.4.7	Sat Oct 23 11:49:22 2021
+++ src/sys/dev/pci/files.pci	Mon Jan 23 14:07:24 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.388.4.7 2021/10/23 11:49:22 martin Exp $
+#	$NetBSD: files.pci,v 1.388.4.8 2023/01/23 14:07:24 martin Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -687,6 +687,7 @@ file	dev/pci/ixgbe/ixgbe_phy.c	ixg | ixv
 file	dev/pci/ixgbe/ixgbe_vf.c	ixg | ixv
 file	dev/pci/ixgbe/if_bypass.c	ixg | ixv
 file	dev/pci/ixgbe/if_fdir.c		ixg | ixv
+defflag	opt_if_ixg.h	IXGBE_ALWAYS_TXDEFER
 
 # This appears to be the driver for virtual instances of i82599.
 device	ixv: ether, ifnet, arp, mii, mii_phy

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.26 src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.27
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.26	Fri Jun  3 12:31:09 2022
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Mon Jan 23 14:07:24 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.24.2.26 2022/06/03 12:31:09 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.24.2.27 2023/01/23 14:07:24 martin Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.24.2.26 2022/06/03 12:31:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.24.2.27 2023/01/23 14:07:24 martin Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -250,6 +250,11 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 		IXGBE_EVC_ADD(>pcq_drops, 1);
 		return ENOBUFS;
 	}
+#ifdef IXGBE_ALWAYS_TXDEFER
+	kpreempt_disable();
+	softint_schedule(txr->txr_si);
+	kpreempt_enable();
+#else
 	if (IXGBE_TX_TRYLOCK(txr)) {
 		ixgbe_mq_start_locked(ifp, txr);
 		IXGBE_TX_UNLOCK(txr);
@@ -279,6 +284,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct
 			kpreempt_enable();
 		}
 	}
+#endif
 
 	return (0);
 } /* ixgbe_mq_start */
@@ -316,7 +322,7 @@ ixgbe_mq_start_locked(struct ifnet *ifp,
 #if __FreeBSD_version >= 1100036
 		/*
 		 * Since we're looking at the tx ring, we can check
-		 * to see if we're a VF by examing our tail register
+		 * to see if we're a VF by examining our tail register
 		 * address.
 		 */
 		if ((txr->adapter->feat_en & IXGBE_FEATURE_VF) &&
@@ -1977,7 +1983,7 @@ ixgbe_rxeof(struct ix_queue *que)
 		 * not be fragmented across sequential
 		 * descriptors, rather the next descriptor
 		 * is indicated in bits of the descriptor.
-		 * This also means that we might proceses
+		 * This also means that we might process
 		 * more than one packet at a time, something
 		 * that has never been true before, it
 		 * required eliminating global chain pointers

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.53 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.54
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.53	Mon Jun  6 11:09:16 2022
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Mon Jan 23 14:07:24 2023
@@ -1,4 +1,4 @@
-/* 

CVS commit: [netbsd-10] xsrc/external/mit/libXpm/dist

2023-01-23 Thread Martin Husemann
Module Name:xsrc
Committed By:   martin
Date:   Mon Jan 23 13:49:22 UTC 2023

Modified Files:
xsrc/external/mit/libXpm/dist [netbsd-10]: AUTHORS COPYING ChangeLog
Makefile.am Makefile.in README.md aclocal.m4 compile config.guess
config.h.in config.sub configure configure.ac depcomp install-sh
ltmain.sh missing
xsrc/external/mit/libXpm/dist/cxpm [netbsd-10]: Makefile.in cxpm.c
xsrc/external/mit/libXpm/dist/doc [netbsd-10]: Makefile.in README.MSW
README.html
xsrc/external/mit/libXpm/dist/include [netbsd-10]: Makefile.in
xsrc/external/mit/libXpm/dist/m4 [netbsd-10]: libtool.m4
xsrc/external/mit/libXpm/dist/man [netbsd-10]: Makefile.am Makefile.in
xsrc/external/mit/libXpm/dist/src [netbsd-10]: Makefile.in RdFToI.c
WrFFrI.c create.c data.c hashtab.c parse.c rgbtab.h scan.c
xsrc/external/mit/libXpm/dist/sxpm [netbsd-10]: Makefile.in
Added Files:
xsrc/external/mit/libXpm/dist [netbsd-10]: tap-driver.sh test-driver
xsrc/external/mit/libXpm/dist/man [netbsd-10]: XpmAttributesSize.man
XpmCreateBuffer.man XpmCreateBufferFromImage.man
XpmCreateBufferFromPixmap.man XpmCreateBufferFromXpmImage.man
XpmCreateData.man XpmCreateDataFromImage.man
XpmCreateDataFromPixmap.man XpmCreateDataFromXpmImage.man
XpmCreateImage.man XpmCreateImageFromBuffer.man
XpmCreateImageFromData.man XpmCreateImageFromXpmImage.man
XpmCreatePixmap.man XpmCreatePixmapFromBuffer.man
XpmCreatePixmapFromData.man XpmCreatePixmapFromXpmImage.man
XpmCreateXpmImage.man XpmCreateXpmImageFromBuffer.man
XpmCreateXpmImageFromData.man XpmCreateXpmImageFromImage.man
XpmCreateXpmImageFromPixmap.man XpmFree.man XpmFreeAttributes.man
XpmFreeExtensions.man XpmFreeXpmImage.man XpmFreeXpmInfo.man
XpmGetErrorString.man XpmLibraryVersion.man XpmMisc.man XpmRead.man
XpmReadFileToBuffer.man XpmReadFileToData.man
XpmReadFileToImage.man XpmReadFileToPixmap.man
XpmReadFileToXpmImage.man XpmWrite.man XpmWriteFileFromBuffer.man
XpmWriteFileFromImage.man XpmWriteFileFromPixmap.man
XpmWriteFileFromXpmImage.man
xsrc/external/mit/libXpm/dist/test [netbsd-10]: CompareXpmImage.h
Makefile.am Makefile.in TestAllFiles.h XpmCreate.c XpmMisc.c
XpmRead.c XpmWrite.c tap-test
xsrc/external/mit/libXpm/dist/test/pixmaps/good [netbsd-10]:
BlueCurves.xpm Dimple.xpm Dolphins.xpm Miniweave.xpm Squares.xpm
Swirl.xpm Utah-teapot.xpm chromesphere.xpm plaid-lisp.xpm
plaid-v1.xpm plaid-v2.xpm plaid-v3.xpm xorg-bw.xpm xorg.xpm
xsrc/external/mit/libXpm/dist/test/pixmaps/invalid [netbsd-10]:
CVE-2016-10164-poc.xpm.gz.gz.gz doom.xpm doom2.xpm invalid-type.xpm
no-contents.xpm unending-comment-c.xpm zero-width-v1.xpm
zero-width.xpm
xsrc/external/mit/libXpm/dist/test/pixmaps/no-mem [netbsd-10]:
oversize.xpm

Log Message:
Sync with HEAD, requested by mrg in ticket #59:

external/mit/libXpm/dist/man/XpmAttributesSize.man up to 1.1.1.1
external/mit/libXpm/dist/man/XpmCreateBuffer.man up to 1.1.1.2
external/mit/libXpm/dist/man/XpmCreateBufferFromImage.man up to 1.1.1.1
external/mit/libXpm/dist/man/XpmCreateBufferFromPixmap.man up to 1.1.1.1
external/mit/libXpm/dist/man/XpmCreateBufferFromXpmImage.man up to 
1.1.1.1
external/mit/libXpm/dist/man/XpmCreateData.man  up to 1.1.1.2
external/mit/libXpm/dist/man/XpmCreateDataFromImage.man up to 1.1.1.1
external/mit/libXpm/dist/man/XpmCreateDataFromPixmap.man up to 1.1.1.1
external/mit/libXpm/dist/man/XpmCreateDataFromXpmImage.man up to 1.1.1.1
external/mit/libXpm/dist/man/XpmCreateImage.man up to 1.1.1.2
external/mit/libXpm/dist/man/XpmFree.manup to 1.1.1.1
external/mit/libXpm/dist/man/XpmCreateImageFromBuffer.man up to 1.1.1.1
external/mit/libXpm/dist/man/XpmCreateImageFromData.man up to 1.1.1.1
external/mit/libXpm/dist/man/XpmCreateImageFromXpmImage.man up to 
1.1.1.1
external/mit/libXpm/dist/man/XpmCreatePixmap.man up to 1.1.1.2
external/mit/libXpm/dist/man/XpmCreatePixmapFromBuffer.man up to 1.1.1.1
external/mit/libXpm/dist/man/XpmCreatePixmapFromData.man up to 1.1.1.1
external/mit/libXpm/dist/man/XpmCreatePixmapFromXpmImage.man up to 
1.1.1.1
external/mit/libXpm/dist/man/XpmCreateXpmImage.man up to 1.1.1.2
external/mit/libXpm/dist/man/XpmCreateXpmImageFromBuffer.man up to 
1.1.1.1
external/mit/libXpm/dist/man/XpmCreateXpmImageFromData.man up to 1.1.1.1
external/mit/libXpm/dist/man/XpmCreateXpmImageFromImage.man up to 
1.1.1.1

CVS commit: [netbsd-9] src/external/mit/xorg

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:43:07 UTC 2023

Modified Files:
src/external/mit/xorg/bin/cxpm [netbsd-9]: Makefile
src/external/mit/xorg/bin/sxpm [netbsd-9]: Makefile
src/external/mit/xorg/lib/libXpm [netbsd-9]: Makefile
Added Files:
src/external/mit/xorg/lib/libXpm [netbsd-9]: xpm.mk

Log Message:
Apply patch, requested by mrg in ticket #1577:

Adjust for upstream patches for the followign CVEs:

   CVE-2022-46285, CVE-2022-44617, CVE-2022-4883, CVE-2020-14363,
   CVE-2022-46340, CVE-2022-46341, CVE-2022-46342 CVE-2022-46343,
   CVE-2022-46344, CVE-2022-46283, CVE-2021-4008, CVE-2021-4009,
   CVE-2021-4010, CVE-2021-4011


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.30.1 src/external/mit/xorg/bin/cxpm/Makefile
cvs rdiff -u -r1.2 -r1.2.30.1 src/external/mit/xorg/bin/sxpm/Makefile
cvs rdiff -u -r1.2 -r1.2.66.1 src/external/mit/xorg/lib/libXpm/Makefile
cvs rdiff -u -r0 -r1.2.4.2 src/external/mit/xorg/lib/libXpm/xpm.mk

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



CVS commit: [netbsd-8] src/usr.sbin/cpuctl/arch

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:13:08 UTC 2023

Modified Files:
src/usr.sbin/cpuctl/arch [netbsd-8]: i386.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1792:

usr.sbin/cpuctl/arch/i386.c 1.129-1.135

- Print cpuid 7 sub-leaf 1 %ebx, %edx and sub-leaf 2 %edx.
- Add Raptor Lake and Sapphire Rapids.
- Modify messages a little.


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

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



CVS commit: src/sys/net/npf

2023-01-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jan 23 13:40:05 UTC 2023

Modified Files:
src/sys/net/npf: npf_tableset.c

Log Message:
npf(9): Drop table lock around copyout.

It is forbidden to hold a spin lock around copyout, and t_lock is a
spin lock.

We need t_lock in order to iterate over the list of entries.
However, during copyout itself, we only need to ensure that the
object we're copying out isn't freed by npf_table_remove or
npf_table_gc.

Fortunately, the only caller of npf_table_list, npf_table_remove, and
npf_table_gc is npfctl_table, and it serializes all of them by the
npf config lock.  So we can safely drop t_lock across copyout.

PR kern/57136
PR kern/57181


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/net/npf/npf_tableset.c

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

Modified files:

Index: src/sys/net/npf/npf_tableset.c
diff -u src/sys/net/npf/npf_tableset.c:1.40 src/sys/net/npf/npf_tableset.c:1.41
--- src/sys/net/npf/npf_tableset.c:1.40	Sun Jan 22 18:45:43 2023
+++ src/sys/net/npf/npf_tableset.c	Mon Jan 23 13:40:04 2023
@@ -46,7 +46,7 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf_tableset.c,v 1.40 2023/01/22 18:45:43 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_tableset.c,v 1.41 2023/01/23 13:40:04 riastradh Exp $");
 
 #include 
 #include 
@@ -766,15 +766,17 @@ table_ent_copyout(const npf_addr_t *addr
 }
 
 static int
-table_generic_list(const npf_table_t *t, void *ubuf, size_t len)
+table_generic_list(npf_table_t *t, void *ubuf, size_t len)
 {
 	npf_tblent_t *ent;
 	size_t off = 0;
 	int error = 0;
 
 	LIST_FOREACH(ent, >t_list, te_listent) {
+		mutex_exit(>t_lock);
 		error = table_ent_copyout(>te_addr,
 		ent->te_alen, ent->te_preflen, ubuf, len, );
+		mutex_enter(>t_lock);
 		if (error)
 			break;
 	}



CVS commit: src/sys/net/npf

2023-01-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jan 23 13:40:05 UTC 2023

Modified Files:
src/sys/net/npf: npf_tableset.c

Log Message:
npf(9): Drop table lock around copyout.

It is forbidden to hold a spin lock around copyout, and t_lock is a
spin lock.

We need t_lock in order to iterate over the list of entries.
However, during copyout itself, we only need to ensure that the
object we're copying out isn't freed by npf_table_remove or
npf_table_gc.

Fortunately, the only caller of npf_table_list, npf_table_remove, and
npf_table_gc is npfctl_table, and it serializes all of them by the
npf config lock.  So we can safely drop t_lock across copyout.

PR kern/57136
PR kern/57181


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/net/npf/npf_tableset.c

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



CVS commit: [netbsd-9] src/external/mit/xorg

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:43:07 UTC 2023

Modified Files:
src/external/mit/xorg/bin/cxpm [netbsd-9]: Makefile
src/external/mit/xorg/bin/sxpm [netbsd-9]: Makefile
src/external/mit/xorg/lib/libXpm [netbsd-9]: Makefile
Added Files:
src/external/mit/xorg/lib/libXpm [netbsd-9]: xpm.mk

Log Message:
Apply patch, requested by mrg in ticket #1577:

Adjust for upstream patches for the followign CVEs:

   CVE-2022-46285, CVE-2022-44617, CVE-2022-4883, CVE-2020-14363,
   CVE-2022-46340, CVE-2022-46341, CVE-2022-46342 CVE-2022-46343,
   CVE-2022-46344, CVE-2022-46283, CVE-2021-4008, CVE-2021-4009,
   CVE-2021-4010, CVE-2021-4011


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.30.1 src/external/mit/xorg/bin/cxpm/Makefile
cvs rdiff -u -r1.2 -r1.2.30.1 src/external/mit/xorg/bin/sxpm/Makefile
cvs rdiff -u -r1.2 -r1.2.66.1 src/external/mit/xorg/lib/libXpm/Makefile
cvs rdiff -u -r0 -r1.2.4.2 src/external/mit/xorg/lib/libXpm/xpm.mk

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/bin/cxpm/Makefile
diff -u src/external/mit/xorg/bin/cxpm/Makefile:1.2 src/external/mit/xorg/bin/cxpm/Makefile:1.2.30.1
--- src/external/mit/xorg/bin/cxpm/Makefile:1.2	Fri May 31 01:41:08 2013
+++ src/external/mit/xorg/bin/cxpm/Makefile	Mon Jan 23 13:43:07 2023
@@ -1,11 +1,10 @@
-#	$NetBSD: Makefile,v 1.2 2013/05/31 01:41:08 mrg Exp $
+#	$NetBSD: Makefile,v 1.2.30.1 2023/01/23 13:43:07 martin Exp $
 
 .include 
 
 PROG=	cxpm
 
 CPPFLAGS+=	-I${X11SRCDIR.Xpm}/src
-CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/X11
 
 LDADD+=	-lXpm -lXt -lSM -lICE -lXext -lX11
 DPADD+=	${LIBXPM} ${LIBXT} ${LIBSM} ${LIBICE} ${LIBXEXT} ${LIBX11}
@@ -13,5 +12,7 @@ DPADD+=	${LIBXPM} ${LIBXT} ${LIBSM} ${LI
 .PATH:	${X11SRCDIR.Xpm}/${PROG}
 .PATH:	${X11SRCDIR.Xpm}/man
 
+.include "${NETBSDSRCDIR}/external/mit/xorg/lib/libXpm/xpm.mk"
+
 .include 
 .include 

Index: src/external/mit/xorg/bin/sxpm/Makefile
diff -u src/external/mit/xorg/bin/sxpm/Makefile:1.2 src/external/mit/xorg/bin/sxpm/Makefile:1.2.30.1
--- src/external/mit/xorg/bin/sxpm/Makefile:1.2	Fri May 31 01:41:56 2013
+++ src/external/mit/xorg/bin/sxpm/Makefile	Mon Jan 23 13:43:07 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2013/05/31 01:41:56 mrg Exp $
+#	$NetBSD: Makefile,v 1.2.30.1 2023/01/23 13:43:07 martin Exp $
 
 .include 
 
@@ -13,5 +13,7 @@ DPADD+=	${LIBXPM} ${LIBXT} ${LIBSM} ${LI
 .PATH:	${X11SRCDIR.Xpm}/${PROG}
 .PATH:	${X11SRCDIR.Xpm}/man
 
+.include "${NETBSDSRCDIR}/external/mit/xorg/lib/libXpm/xpm.mk"
+
 .include 
 .include 

Index: src/external/mit/xorg/lib/libXpm/Makefile
diff -u src/external/mit/xorg/lib/libXpm/Makefile:1.2 src/external/mit/xorg/lib/libXpm/Makefile:1.2.66.1
--- src/external/mit/xorg/lib/libXpm/Makefile:1.2	Sat Sep 13 04:32:30 2008
+++ src/external/mit/xorg/lib/libXpm/Makefile	Mon Jan 23 13:43:07 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2008/09/13 04:32:30 cube Exp $
+#	$NetBSD: Makefile,v 1.2.66.1 2023/01/23 13:43:07 martin Exp $
 
 .include 
 
@@ -15,14 +15,13 @@ SRCS=	Attrib.c CrBufFrI.c CrBufFrP.c CrD
 INCS=	xpm.h
 INCSDIR=${X11INCDIR}/X11
 
-CPPFLAGS+=-DHAS_SNPRINTF
-CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/X11
-
 LIBDPLIBS=\
 	Xext	${.CURDIR}/../libXext \
 	X11	${.CURDIR}/../libX11/dynamic
 
 PKGDIST=	${LIB}
 
+.include "xpm.mk"
+
 .include 
 .include 

Added files:

Index: src/external/mit/xorg/lib/libXpm/xpm.mk
diff -u /dev/null src/external/mit/xorg/lib/libXpm/xpm.mk:1.2.4.2
--- /dev/null	Mon Jan 23 13:43:07 2023
+++ src/external/mit/xorg/lib/libXpm/xpm.mk	Mon Jan 23 13:43:07 2023
@@ -0,0 +1,7 @@
+#	$NetBSD: xpm.mk,v 1.2.4.2 2023/01/23 13:43:07 martin Exp $
+
+CPPFLAGS+=	-DHAS_SNPRINTF
+CPPFLAGS+=	-DXPM_PATH_COMPRESS=\"/usr/bin/compress\"
+CPPFLAGS+=	-DXPM_PATH_GZIP=\"/usr/bin/gzip\"
+CPPFLAGS+=	-DXPM_PATH_UNCOMPRESS=\"/usr/bin/uncompress\"
+CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/X11



CVS commit: [netbsd-8] src/external/mit/xorg

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:36:04 UTC 2023

Modified Files:
src/external/mit/xorg/bin/cxpm [netbsd-8]: Makefile
src/external/mit/xorg/bin/sxpm [netbsd-8]: Makefile
src/external/mit/xorg/lib/libXpm [netbsd-8]: Makefile
Added Files:
src/external/mit/xorg/lib/libXpm [netbsd-8]: xpm.mk

Log Message:
Apply patch, requested by mrg in ticket #1794:

Adjust for upstream fixes for the following CVEs:

   CVE-2022-46285, CVE-2022-44617, CVE-2022-4883, CVE-2020-14363,
   CVE-2022-46340, CVE-2022-46341, CVE-2022-46342 CVE-2022-46343,
   CVE-2022-46344, CVE-2022-46283, CVE-2021-4008, CVE-2021-4009,
   CVE-2021-4010, CVE-2021-4011


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.20.1 src/external/mit/xorg/bin/cxpm/Makefile
cvs rdiff -u -r1.2 -r1.2.20.1 src/external/mit/xorg/bin/sxpm/Makefile
cvs rdiff -u -r1.2 -r1.2.56.1 src/external/mit/xorg/lib/libXpm/Makefile
cvs rdiff -u -r0 -r1.2.2.2 src/external/mit/xorg/lib/libXpm/xpm.mk

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/bin/cxpm/Makefile
diff -u src/external/mit/xorg/bin/cxpm/Makefile:1.2 src/external/mit/xorg/bin/cxpm/Makefile:1.2.20.1
--- src/external/mit/xorg/bin/cxpm/Makefile:1.2	Fri May 31 01:41:08 2013
+++ src/external/mit/xorg/bin/cxpm/Makefile	Mon Jan 23 13:36:04 2023
@@ -1,11 +1,10 @@
-#	$NetBSD: Makefile,v 1.2 2013/05/31 01:41:08 mrg Exp $
+#	$NetBSD: Makefile,v 1.2.20.1 2023/01/23 13:36:04 martin Exp $
 
 .include 
 
 PROG=	cxpm
 
 CPPFLAGS+=	-I${X11SRCDIR.Xpm}/src
-CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/X11
 
 LDADD+=	-lXpm -lXt -lSM -lICE -lXext -lX11
 DPADD+=	${LIBXPM} ${LIBXT} ${LIBSM} ${LIBICE} ${LIBXEXT} ${LIBX11}
@@ -13,5 +12,7 @@ DPADD+=	${LIBXPM} ${LIBXT} ${LIBSM} ${LI
 .PATH:	${X11SRCDIR.Xpm}/${PROG}
 .PATH:	${X11SRCDIR.Xpm}/man
 
+.include "${NETBSDSRCDIR}/external/mit/xorg/lib/libXpm/xpm.mk"
+
 .include 
 .include 

Index: src/external/mit/xorg/bin/sxpm/Makefile
diff -u src/external/mit/xorg/bin/sxpm/Makefile:1.2 src/external/mit/xorg/bin/sxpm/Makefile:1.2.20.1
--- src/external/mit/xorg/bin/sxpm/Makefile:1.2	Fri May 31 01:41:56 2013
+++ src/external/mit/xorg/bin/sxpm/Makefile	Mon Jan 23 13:36:04 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2013/05/31 01:41:56 mrg Exp $
+#	$NetBSD: Makefile,v 1.2.20.1 2023/01/23 13:36:04 martin Exp $
 
 .include 
 
@@ -13,5 +13,7 @@ DPADD+=	${LIBXPM} ${LIBXT} ${LIBSM} ${LI
 .PATH:	${X11SRCDIR.Xpm}/${PROG}
 .PATH:	${X11SRCDIR.Xpm}/man
 
+.include "${NETBSDSRCDIR}/external/mit/xorg/lib/libXpm/xpm.mk"
+
 .include 
 .include 

Index: src/external/mit/xorg/lib/libXpm/Makefile
diff -u src/external/mit/xorg/lib/libXpm/Makefile:1.2 src/external/mit/xorg/lib/libXpm/Makefile:1.2.56.1
--- src/external/mit/xorg/lib/libXpm/Makefile:1.2	Sat Sep 13 04:32:30 2008
+++ src/external/mit/xorg/lib/libXpm/Makefile	Mon Jan 23 13:36:04 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2008/09/13 04:32:30 cube Exp $
+#	$NetBSD: Makefile,v 1.2.56.1 2023/01/23 13:36:04 martin Exp $
 
 .include 
 
@@ -15,14 +15,13 @@ SRCS=	Attrib.c CrBufFrI.c CrBufFrP.c CrD
 INCS=	xpm.h
 INCSDIR=${X11INCDIR}/X11
 
-CPPFLAGS+=-DHAS_SNPRINTF
-CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/X11
-
 LIBDPLIBS=\
 	Xext	${.CURDIR}/../libXext \
 	X11	${.CURDIR}/../libX11/dynamic
 
 PKGDIST=	${LIB}
 
+.include "xpm.mk"
+
 .include 
 .include 

Added files:

Index: src/external/mit/xorg/lib/libXpm/xpm.mk
diff -u /dev/null src/external/mit/xorg/lib/libXpm/xpm.mk:1.2.2.2
--- /dev/null	Mon Jan 23 13:36:04 2023
+++ src/external/mit/xorg/lib/libXpm/xpm.mk	Mon Jan 23 13:36:04 2023
@@ -0,0 +1,7 @@
+#	$NetBSD: xpm.mk,v 1.2.2.2 2023/01/23 13:36:04 martin Exp $
+
+CPPFLAGS+=	-DHAS_SNPRINTF
+CPPFLAGS+=	-DXPM_PATH_COMPRESS=\"/usr/bin/compress\"
+CPPFLAGS+=	-DXPM_PATH_GZIP=\"/usr/bin/gzip\"
+CPPFLAGS+=	-DXPM_PATH_UNCOMPRESS=\"/usr/bin/uncompress\"
+CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/X11



CVS commit: [netbsd-9] xsrc/external/mit

2023-01-23 Thread Martin Husemann
Module Name:xsrc
Committed By:   martin
Date:   Mon Jan 23 13:40:01 UTC 2023

Modified Files:
xsrc/external/mit/libX11/dist/modules/om/generic [netbsd-9]:
omGeneric.c
xsrc/external/mit/libXpm/dist/src [netbsd-9]: RdFToI.c WrFFrI.c
create.c data.c parse.c
xsrc/external/mit/xorg-server/dist/Xext [netbsd-9]: saver.c xtest.c
xvmain.c
xsrc/external/mit/xorg-server/dist/Xi [netbsd-9]: xipassivegrab.c
xiproperty.c
xsrc/external/mit/xorg-server/dist/dix [netbsd-9]: property.c
xsrc/external/mit/xorg-server/dist/xkb [netbsd-9]: xkbUtils.c

Log Message:
Apply patch, requested by mrg in ticket #1577:

Apply upstream fixes for the following CVEs:

   CVE-2022-46285, CVE-2022-44617, CVE-2022-4883, CVE-2020-14363,
   CVE-2022-46340, CVE-2022-46341, CVE-2022-46342 CVE-2022-46343,
   CVE-2022-46344, CVE-2022-46283, CVE-2021-4008, CVE-2021-4009,
   CVE-2021-4010, CVE-2021-4011


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9.2.1 -r1.1.1.9.2.2 \
xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.10.1 \
xsrc/external/mit/libXpm/dist/src/RdFToI.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.10.1 \
xsrc/external/mit/libXpm/dist/src/WrFFrI.c
cvs rdiff -u -r1.3 -r1.3.4.1 xsrc/external/mit/libXpm/dist/src/create.c
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.12.1 \
xsrc/external/mit/libXpm/dist/src/data.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.4.1 \
xsrc/external/mit/libXpm/dist/src/parse.c
cvs rdiff -u -r1.3 -r1.3.2.1 xsrc/external/mit/xorg-server/dist/Xext/saver.c
cvs rdiff -u -r1.6 -r1.6.2.1 xsrc/external/mit/xorg-server/dist/Xext/xtest.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.2.1 \
xsrc/external/mit/xorg-server/dist/Xext/xvmain.c
cvs rdiff -u -r1.4 -r1.4.2.1 \
xsrc/external/mit/xorg-server/dist/Xi/xipassivegrab.c \
xsrc/external/mit/xorg-server/dist/Xi/xiproperty.c
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.2.1 \
xsrc/external/mit/xorg-server/dist/dix/property.c
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.2.1 \
xsrc/external/mit/xorg-server/dist/xkb/xkbUtils.c

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



CVS commit: [netbsd-8] xsrc/external/mit

2023-01-23 Thread Martin Husemann
Module Name:xsrc
Committed By:   martin
Date:   Mon Jan 23 13:33:05 UTC 2023

Modified Files:
xsrc/external/mit/libX11/dist/modules/om/generic [netbsd-8]:
omGeneric.c
xsrc/external/mit/libXpm/dist/src [netbsd-8]: RdFToI.c WrFFrI.c
create.c data.c parse.c
xsrc/external/mit/xorg-server/dist/Xext [netbsd-8]: saver.c xtest.c
xvmain.c
xsrc/external/mit/xorg-server/dist/Xi [netbsd-8]: xipassivegrab.c
xiproperty.c
xsrc/external/mit/xorg-server/dist/dix [netbsd-8]: property.c
xsrc/external/mit/xorg-server/dist/xkb [netbsd-8]: xkbUtils.c

Log Message:
Apply patch, requested by mrg in ticket #1794:

Apply upstream security fixes for the following CVEs:

   CVE-2022-46285, CVE-2022-44617, CVE-2022-4883, CVE-2020-14363,
   CVE-2022-46340, CVE-2022-46341, CVE-2022-46342 CVE-2022-46343,
   CVE-2022-46344, CVE-2022-46283, CVE-2021-4008, CVE-2021-4009,
   CVE-2021-4010, CVE-2021-4011


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.8.2.1 -r1.1.1.8.2.2 \
xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.8.1 \
xsrc/external/mit/libXpm/dist/src/RdFToI.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.8.1 \
xsrc/external/mit/libXpm/dist/src/WrFFrI.c
cvs rdiff -u -r1.3 -r1.3.2.1 xsrc/external/mit/libXpm/dist/src/create.c
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.10.1 \
xsrc/external/mit/libXpm/dist/src/data.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.2.1 \
xsrc/external/mit/libXpm/dist/src/parse.c
cvs rdiff -u -r1.1.1.7.2.1 -r1.1.1.7.2.2 \
xsrc/external/mit/xorg-server/dist/Xext/saver.c
cvs rdiff -u -r1.5 -r1.5.2.1 xsrc/external/mit/xorg-server/dist/Xext/xtest.c
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.2.1 \
xsrc/external/mit/xorg-server/dist/Xext/xvmain.c
cvs rdiff -u -r1.3 -r1.3.2.1 \
xsrc/external/mit/xorg-server/dist/Xi/xipassivegrab.c \
xsrc/external/mit/xorg-server/dist/Xi/xiproperty.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.2.1 \
xsrc/external/mit/xorg-server/dist/dix/property.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.2.1 \
xsrc/external/mit/xorg-server/dist/xkb/xkbUtils.c

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



CVS commit: [netbsd-8] xsrc/external/mit

2023-01-23 Thread Martin Husemann
Module Name:xsrc
Committed By:   martin
Date:   Mon Jan 23 13:33:05 UTC 2023

Modified Files:
xsrc/external/mit/libX11/dist/modules/om/generic [netbsd-8]:
omGeneric.c
xsrc/external/mit/libXpm/dist/src [netbsd-8]: RdFToI.c WrFFrI.c
create.c data.c parse.c
xsrc/external/mit/xorg-server/dist/Xext [netbsd-8]: saver.c xtest.c
xvmain.c
xsrc/external/mit/xorg-server/dist/Xi [netbsd-8]: xipassivegrab.c
xiproperty.c
xsrc/external/mit/xorg-server/dist/dix [netbsd-8]: property.c
xsrc/external/mit/xorg-server/dist/xkb [netbsd-8]: xkbUtils.c

Log Message:
Apply patch, requested by mrg in ticket #1794:

Apply upstream security fixes for the following CVEs:

   CVE-2022-46285, CVE-2022-44617, CVE-2022-4883, CVE-2020-14363,
   CVE-2022-46340, CVE-2022-46341, CVE-2022-46342 CVE-2022-46343,
   CVE-2022-46344, CVE-2022-46283, CVE-2021-4008, CVE-2021-4009,
   CVE-2021-4010, CVE-2021-4011


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.8.2.1 -r1.1.1.8.2.2 \
xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.8.1 \
xsrc/external/mit/libXpm/dist/src/RdFToI.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.8.1 \
xsrc/external/mit/libXpm/dist/src/WrFFrI.c
cvs rdiff -u -r1.3 -r1.3.2.1 xsrc/external/mit/libXpm/dist/src/create.c
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.10.1 \
xsrc/external/mit/libXpm/dist/src/data.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.2.1 \
xsrc/external/mit/libXpm/dist/src/parse.c
cvs rdiff -u -r1.1.1.7.2.1 -r1.1.1.7.2.2 \
xsrc/external/mit/xorg-server/dist/Xext/saver.c
cvs rdiff -u -r1.5 -r1.5.2.1 xsrc/external/mit/xorg-server/dist/Xext/xtest.c
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.2.1 \
xsrc/external/mit/xorg-server/dist/Xext/xvmain.c
cvs rdiff -u -r1.3 -r1.3.2.1 \
xsrc/external/mit/xorg-server/dist/Xi/xipassivegrab.c \
xsrc/external/mit/xorg-server/dist/Xi/xiproperty.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.2.1 \
xsrc/external/mit/xorg-server/dist/dix/property.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.2.1 \
xsrc/external/mit/xorg-server/dist/xkb/xkbUtils.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/libX11/dist/modules/om/generic/omGeneric.c
diff -u xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c:1.1.1.8.2.1 xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c:1.1.1.8.2.2
--- xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c:1.1.1.8.2.1	Wed Aug  5 14:10:17 2020
+++ xsrc/external/mit/libX11/dist/modules/om/generic/omGeneric.c	Mon Jan 23 13:33:04 2023
@@ -1908,7 +1908,8 @@ init_om(
 char **required_list;
 XOrientation *orientation;
 char **value, buf[BUFSIZ], *bufptr;
-int count = 0, num = 0, length = 0;
+int count = 0, num = 0;
+unsigned int length = 0;
 
 _XlcGetResource(lcd, "XLC_FONTSET", "on_demand_loading", , );
 if (count > 0 && _XlcCompareISOLatin1(*value, "True") == 0)

Index: xsrc/external/mit/libXpm/dist/src/RdFToI.c
diff -u xsrc/external/mit/libXpm/dist/src/RdFToI.c:1.1.1.4 xsrc/external/mit/libXpm/dist/src/RdFToI.c:1.1.1.4.8.1
--- xsrc/external/mit/libXpm/dist/src/RdFToI.c:1.1.1.4	Sun Mar 16 22:20:04 2014
+++ xsrc/external/mit/libXpm/dist/src/RdFToI.c	Mon Jan 23 13:33:04 2023
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 #else
 #ifdef FOR_MSW
 #include 
@@ -161,7 +162,17 @@ xpmPipeThrough(
 	goto err;
 	if ( 0 == pid )
 	{
-	execlp(cmd, cmd, arg1, (char *)NULL);
+#ifdef HAVE_CLOSEFROM
+	closefrom(3);
+#elif defined(HAVE_CLOSE_RANGE)
+# ifdef CLOSE_RANGE_UNSHARE
+#  define close_range_flags CLOSE_RANGE_UNSHARE
+# else
+#  define close_range_flags 0
+#endif
+	close_range(3, ~0U, close_range_flags);
+#endif
+	execl(cmd, cmd, arg1, (char *)NULL);
 	perror(cmd);
 	goto err;
 	}
@@ -235,12 +246,12 @@ OpenReadFile(
 	if ( ext && !strcmp(ext, ".Z") )
 	{
 	mdata->type = XPMPIPE;
-	mdata->stream.file = xpmPipeThrough(fd, "uncompress", "-c", "r");
+	mdata->stream.file = xpmPipeThrough(fd, XPM_PATH_UNCOMPRESS, "-c", "r");
 	}
 	else if ( ext && !strcmp(ext, ".gz") )
 	{
 	mdata->type = XPMPIPE;
-	mdata->stream.file = xpmPipeThrough(fd, "gunzip", "-qc", "r");
+	mdata->stream.file = xpmPipeThrough(fd, XPM_PATH_GZIP, "-dqc", "r");
 	}
 	else
 #endif /* z-files */

Index: xsrc/external/mit/libXpm/dist/src/WrFFrI.c
diff -u xsrc/external/mit/libXpm/dist/src/WrFFrI.c:1.1.1.5 xsrc/external/mit/libXpm/dist/src/WrFFrI.c:1.1.1.5.8.1
--- xsrc/external/mit/libXpm/dist/src/WrFFrI.c:1.1.1.5	Sun Mar 16 22:20:04 2014
+++ xsrc/external/mit/libXpm/dist/src/WrFFrI.c	Mon Jan 23 13:33:04 2023
@@ -336,10 +336,10 @@ OpenWriteFile(
 #ifndef NO_ZPIPE
 	len = strlen(filename);
 	if (len > 2 && !strcmp(".Z", filename + (len - 2))) {
-	mdata->stream.file = xpmPipeThrough(fd, "compress", NULL, "w");
+	mdata->stream.file = 

CVS commit: [netbsd-8] src/usr.sbin/cpuctl/arch

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:13:08 UTC 2023

Modified Files:
src/usr.sbin/cpuctl/arch [netbsd-8]: i386.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1792:

usr.sbin/cpuctl/arch/i386.c 1.129-1.135

- Print cpuid 7 sub-leaf 1 %ebx, %edx and sub-leaf 2 %edx.
- Add Raptor Lake and Sapphire Rapids.
- Modify messages a little.


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

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.74.6.15 src/usr.sbin/cpuctl/arch/i386.c:1.74.6.16
--- src/usr.sbin/cpuctl/arch/i386.c:1.74.6.15	Sat Oct 15 10:16:08 2022
+++ src/usr.sbin/cpuctl/arch/i386.c	Mon Jan 23 13:13:08 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.74.6.15 2022/10/15 10:16:08 martin Exp $	*/
+/*	$NetBSD: i386.c,v 1.74.6.16 2023/01/23 13:13:08 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.74.6.15 2022/10/15 10:16:08 martin Exp $");
+__RCSID("$NetBSD: i386.c,v 1.74.6.16 2023/01/23 13:13:08 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -351,7 +351,7 @@ const struct cpu_cpuid_nameclass i386_cp
 [0x8c] = "11th gen Core (Tiger Lake)",
 [0x8d] = "11th gen Core (Tiger Lake)",
 [0x8e] = "7th or 8th gen Core (Kaby Lake, Coffee Lake) or Xeon E (Coffee Lake)",
-[0x8f] = "future Xeon (Sapphire Rapids)",
+[0x8f] = "4th gen Xeon Scalable (Sapphire Rapids)",
 [0x96] = "Atom x6000E (Elkhart Lake)",
 [0x97] = "12th gen Core (Alder Lake)",
 [0x9a] = "12th gen Core (Alder Lake)",
@@ -361,7 +361,9 @@ const struct cpu_cpuid_nameclass i386_cp
 [0xa6] = "10th gen Core (Comet Lake)",
 [0xa7] = "11th gen Core (Rocket Lake)",
 [0xa8] = "11th gen Core (Rocket Lake)",
-[0xbf] = "12th gen Core (Alder Lake)",
+[0xba] = "13th gen Core (Raptor Lake)",
+[0xb7] = "13th gen Core (Raptor Lake)",
+[0xbf] = "13th gen Core (Raptor Lake)",
 			},
 			"Pentium Pro, II or III",	/* Default */
 			NULL,
@@ -2132,13 +2134,25 @@ identifycpu(int fd, const char *cpuname)
 	if ((ci->ci_max_cpuid >= 7)
 	&& ((cpu_vendor == CPUVENDOR_INTEL)
 		|| (cpu_vendor == CPUVENDOR_AMD))) {
+		unsigned int maxsubleaf;
+
 		x86_cpuid(7, descs);
+		maxsubleaf = descs[0];
 		aprint_verbose("%s: SEF highest subleaf %08x\n",
-		cpuname, descs[0]);
-		if (descs[0] >= 1) {
+		cpuname, maxsubleaf);
+		if (maxsubleaf >= 1) {
 			x86_cpuid2(7, 1, descs);
 			print_bits(cpuname, "SEF-subleaf1-eax",
 			CPUID_SEF1_FLAGS_A, descs[0]);
+			print_bits(cpuname, "SEF-subleaf1-ebx",
+			CPUID_SEF1_FLAGS_B, descs[1]);
+			print_bits(cpuname, "SEF-subleaf1-edx",
+			CPUID_SEF1_FLAGS_D, descs[3]);
+		}
+		if (maxsubleaf >= 2) {
+			x86_cpuid2(7, 2, descs);
+			print_bits(cpuname, "SEF-subleaf2-edx",
+			CPUID_SEF2_FLAGS_D, descs[3]);
 		}
 	}
 
@@ -2154,6 +2168,17 @@ identifycpu(int fd, const char *cpuname)
 	}
 
 	if (cpu_vendor == CPUVENDOR_AMD) {
+		if (ci->ci_max_ext_cpuid >= 0x8021) {
+			x86_cpuid(0x8021, descs);
+			print_bits(cpuname, "AMD Extended features2",
+			CPUID_AMDEXT2_FLAGS, descs[0]);
+		}
+
+		if (ci->ci_max_ext_cpuid >= 0x8007) {
+			x86_cpuid(0x8007, descs);
+			print_bits(cpuname, "RAS features",
+			CPUID_RAS_FLAGS, descs[1]);
+		}
 		if ((ci->ci_max_ext_cpuid >= 0x800a)
 		&& (ci->ci_feat_val[3] & CPUID_SVM) != 0) {
 			x86_cpuid(0x800a, descs);
@@ -2164,11 +2189,32 @@ identifycpu(int fd, const char *cpuname)
 			print_bits(cpuname, "SVM features",
 			CPUID_AMD_SVM_FLAGS, descs[3]);
 		}
+		if (ci->ci_max_ext_cpuid >= 0x801b) {
+			x86_cpuid(0x801b, descs);
+			print_bits(cpuname, "IBS features",
+			CPUID_IBS_FLAGS, descs[0]);
+		}
 		if (ci->ci_max_ext_cpuid >= 0x801f) {
 			x86_cpuid(0x801f, descs);
 			print_bits(cpuname, "Encrypted Memory features",
 			CPUID_AMD_ENCMEM_FLAGS, descs[0]);
 		}
+		if (ci->ci_max_ext_cpuid >= 0x8022) {
+			uint8_t ncore, nnb, nlbrs;
+
+			x86_cpuid(0x8022, descs);
+			print_bits(cpuname, "Perfmon:",
+			CPUID_AXPERF_FLAGS, descs[0]);
+
+			ncore = __SHIFTOUT(descs[1], CPUID_AXPERF_NCPC);
+			nnb = __SHIFTOUT(descs[1], CPUID_AXPERF_NNBPC);
+			nlbrs = __SHIFTOUT(descs[1], CPUID_AXPERF_NLBRSTACK);
+			aprint_verbose("%s: Perfmon: counters: "
+			"Core %hhu, Northbridge %hhu\n", cpuname,
+			ncore, nnb);
+			aprint_verbose("%s: Perfmon: LBR Stack %hhu entries\n",
+			cpuname, nlbrs);
+		}
 	} else if (cpu_vendor == CPUVENDOR_INTEL) {
 		if (ci->ci_max_cpuid >= 0x0a) {
 			unsigned int pmcver, ncounter, veclen;



CVS commit: [netbsd-9] src/usr.bin/locate/locate

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:17:28 UTC 2023

Modified Files:
src/usr.bin/locate/locate [netbsd-9]: updatedb.sh

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1576):

usr.bin/locate/locate/updatedb.sh: revision 1.18

locate.updatedb: Add -- to the invocation of locate.code

A bigram can start with a dash/minus, don't let getopt misinterpret it
as an option.

>From Hakan Engvall in PR misc/57191


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.26.1 src/usr.bin/locate/locate/updatedb.sh

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/locate/locate/updatedb.sh
diff -u src/usr.bin/locate/locate/updatedb.sh:1.15 src/usr.bin/locate/locate/updatedb.sh:1.15.26.1
--- src/usr.bin/locate/locate/updatedb.sh:1.15	Mon Aug  4 21:56:30 2014
+++ src/usr.bin/locate/locate/updatedb.sh	Mon Jan 23 13:17:27 2023
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: updatedb.sh,v 1.15 2014/08/04 21:56:30 apb Exp $
+#	$NetBSD: updatedb.sh,v 1.15.26.1 2023/01/23 13:17:27 martin Exp $
 #
 # Copyright (c) 1989, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -192,6 +192,6 @@ if [ -z "$BIGRAMS" ]; then
 	echo 'locate: updatedb failed' >&2
 	exit 1
 else
-	$LIBDIR/locate.code "$BIGRAMS" <"$FILELIST" >"$FCODES"
+	$LIBDIR/locate.code -- "$BIGRAMS" <"$FILELIST" >"$FCODES"
 	chmod 644 "$FCODES"
 fi



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:18:33 UTC 2023

Modified Files:
src/usr.bin/locate/locate [netbsd-10]: updatedb.sh

Log Message:
Pull up following revision(s) (requested by uwe in ticket #58):

usr.bin/locate/locate/updatedb.sh: revision 1.18

locate.updatedb: Add -- to the invocation of locate.code

A bigram can start with a dash/minus, don't let getopt misinterpret it
as an option.

>From Hakan Engvall in PR misc/57191


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.6.1 src/usr.bin/locate/locate/updatedb.sh

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/locate/locate

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:18:33 UTC 2023

Modified Files:
src/usr.bin/locate/locate [netbsd-10]: updatedb.sh

Log Message:
Pull up following revision(s) (requested by uwe in ticket #58):

usr.bin/locate/locate/updatedb.sh: revision 1.18

locate.updatedb: Add -- to the invocation of locate.code

A bigram can start with a dash/minus, don't let getopt misinterpret it
as an option.

>From Hakan Engvall in PR misc/57191


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.6.1 src/usr.bin/locate/locate/updatedb.sh

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/locate/locate/updatedb.sh
diff -u src/usr.bin/locate/locate/updatedb.sh:1.17 src/usr.bin/locate/locate/updatedb.sh:1.17.6.1
--- src/usr.bin/locate/locate/updatedb.sh:1.17	Sat Apr 25 10:06:42 2020
+++ src/usr.bin/locate/locate/updatedb.sh	Mon Jan 23 13:18:32 2023
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: updatedb.sh,v 1.17 2020/04/25 10:06:42 simonb Exp $
+#	$NetBSD: updatedb.sh,v 1.17.6.1 2023/01/23 13:18:32 martin Exp $
 #
 # Copyright (c) 1989, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -216,6 +216,6 @@ if [ -z "$BIGRAMS" ]; then
 	echo 'locate: updatedb failed' >&2
 	exit 1
 else
-	$LIBDIR/locate.code "$BIGRAMS" <"$FILELIST" >"$FCODES"
+	$LIBDIR/locate.code -- "$BIGRAMS" <"$FILELIST" >"$FCODES"
 	chmod 644 "$FCODES"
 fi



CVS commit: [netbsd-9] src/usr.bin/locate/locate

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:17:28 UTC 2023

Modified Files:
src/usr.bin/locate/locate [netbsd-9]: updatedb.sh

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1576):

usr.bin/locate/locate/updatedb.sh: revision 1.18

locate.updatedb: Add -- to the invocation of locate.code

A bigram can start with a dash/minus, don't let getopt misinterpret it
as an option.

>From Hakan Engvall in PR misc/57191


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.26.1 src/usr.bin/locate/locate/updatedb.sh

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



CVS commit: [netbsd-8] src/usr.bin/locate/locate

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:16:18 UTC 2023

Modified Files:
src/usr.bin/locate/locate [netbsd-8]: updatedb.sh

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1793):

usr.bin/locate/locate/updatedb.sh: revision 1.18

locate.updatedb: Add -- to the invocation of locate.code

A bigram can start with a dash/minus, don't let getopt misinterpret it
as an option.

>From Hakan Engvall in PR misc/57191


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.16.1 src/usr.bin/locate/locate/updatedb.sh

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



CVS commit: [netbsd-8] src/usr.bin/locate/locate

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:16:18 UTC 2023

Modified Files:
src/usr.bin/locate/locate [netbsd-8]: updatedb.sh

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1793):

usr.bin/locate/locate/updatedb.sh: revision 1.18

locate.updatedb: Add -- to the invocation of locate.code

A bigram can start with a dash/minus, don't let getopt misinterpret it
as an option.

>From Hakan Engvall in PR misc/57191


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.16.1 src/usr.bin/locate/locate/updatedb.sh

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/locate/locate/updatedb.sh
diff -u src/usr.bin/locate/locate/updatedb.sh:1.15 src/usr.bin/locate/locate/updatedb.sh:1.15.16.1
--- src/usr.bin/locate/locate/updatedb.sh:1.15	Mon Aug  4 21:56:30 2014
+++ src/usr.bin/locate/locate/updatedb.sh	Mon Jan 23 13:16:18 2023
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: updatedb.sh,v 1.15 2014/08/04 21:56:30 apb Exp $
+#	$NetBSD: updatedb.sh,v 1.15.16.1 2023/01/23 13:16:18 martin Exp $
 #
 # Copyright (c) 1989, 1993
 #	The Regents of the University of California.  All rights reserved.
@@ -192,6 +192,6 @@ if [ -z "$BIGRAMS" ]; then
 	echo 'locate: updatedb failed' >&2
 	exit 1
 else
-	$LIBDIR/locate.code "$BIGRAMS" <"$FILELIST" >"$FCODES"
+	$LIBDIR/locate.code -- "$BIGRAMS" <"$FILELIST" >"$FCODES"
 	chmod 644 "$FCODES"
 fi



CVS commit: [netbsd-9] src/sys/arch/x86/include

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:00:53 UTC 2023

Modified Files:
src/sys/arch/x86/include [netbsd-9]: specialreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1574:

sys/arch/x86/include/specialreg.h   1.193-1.198

- Add CPUID Fn_0006 %eax bit 24 IA32_THERM_INTERRUPT MSR bit 25
  Hardware Feedback Notification support.
- Add CPUID Fn_0007 %ecx bit 29 ENQCMD.
- Add CPUID Fn_0007 %edx bit 1 SGX-KEYS.
- Add CPUID Fn_0007 %edx bit 5 UINTR(User INTeRrupts).
- Add CPUID Fn_0007 %edx bit 11 RTM_ALWAYS_ABORT.
- Add CPUID Fn_0007 %edx bit 22 AMX_BF16.
- Add CPUID Fn_0007 %edx bit 23 AVX512_FP16.
- Add CPUID Fn_0007 %edx bit 24 AMX_TILE.
- Add CPUID Fn_0007 %edx bit 25 AMX_INT8.
- Add CPUID Fn_0007 sub-leaf 1 %edx bit 18 CET_SSS.
- Add CPUID Fn_0007 sub-leaf 2 %edx definitions.
- Add CPUID Fn_000d sub-leaf 1 %eax bit 4 XFD.
- Add CPUID Fn_001d Tile Information.
- Add CPUID Fn_001e TMUL Information.
- Add CPUID Fn8000_0007 %eax RAS capabilities.
- Add CPUID Fn8000_0008 %ebx BTC_NO,
- Add cpuid Fn8000_000a x2AVIC, VNMI, IBSVIRT and ROGPT.
- Add CPUID Fn8000_001b Instruction-Based Sampling.
- Add CPUID Fn8000_001e Processor Topology Information.
- Add CPUID Fn8000_001f %eax RPMQUERY, VmplSSS, TscAuxVirt,
  VmgexitParam, VirtualTomMsr, IbsVirtGuest, SmtProtection,
  vsmCommPageMSR and NestedVirtSnpMsr.
- Add CPUID Fn8000_0021 AMD Extended Features Identification 2.
- Add CPUID Fn8000_0022 AMD Extended Performance Monitoring and Debug.
- Rename HW_FEEDBACK to HWI (Hardware Feedback Interface).
- Rename TSX_FORCE_ABORT to RTM_FORCE_ABORT.
- Modify comment. Both Intel and AMD support CPUID Fn000b.
- Modify comment. Hybrid Information -> Native Model ID Information.
- Use __BIT(). Add comment. Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.150.2.11 -r1.150.2.12 src/sys/arch/x86/include/specialreg.h

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



CVS commit: [netbsd-8] src/sys/arch/x86/include

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:09:54 UTC 2023

Modified Files:
src/sys/arch/x86/include [netbsd-8]: specialreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1791:

sys/arch/x86/include/specialreg.h   1.193-1.198

- Add CPUID Fn_0006 %eax bit 24 IA32_THERM_INTERRUPT MSR bit 25
  Hardware Feedback Notification support.
- Add CPUID Fn_0007 %ecx bit 29 ENQCMD.
- Add CPUID Fn_0007 %edx bit 1 SGX-KEYS.
- Add CPUID Fn_0007 %edx bit 5 UINTR(User INTeRrupts).
- Add CPUID Fn_0007 %edx bit 11 RTM_ALWAYS_ABORT.
- Add CPUID Fn_0007 %edx bit 22 AMX_BF16.
- Add CPUID Fn_0007 %edx bit 23 AVX512_FP16.
- Add CPUID Fn_0007 %edx bit 24 AMX_TILE.
- Add CPUID Fn_0007 %edx bit 25 AMX_INT8.
- Add CPUID Fn_0007 sub-leaf 1 %edx bit 18 CET_SSS.
- Add CPUID Fn_0007 sub-leaf 2 %edx definitions.
- Add CPUID Fn_000d sub-leaf 1 %eax bit 4 XFD.
- Add CPUID Fn_001d Tile Information.
- Add CPUID Fn_001e TMUL Information.
- Add CPUID Fn8000_0007 %eax RAS capabilities.
- Add CPUID Fn8000_0008 %ebx BTC_NO,
- Add cpuid Fn8000_000a x2AVIC, VNMI, IBSVIRT and ROGPT.
- Add CPUID Fn8000_001b Instruction-Based Sampling.
- Add CPUID Fn8000_001e Processor Topology Information.
- Add CPUID Fn8000_001f %eax RPMQUERY, VmplSSS, TscAuxVirt,
  VmgexitParam, VirtualTomMsr, IbsVirtGuest, SmtProtection,
  vsmCommPageMSR and NestedVirtSnpMsr.
- Add CPUID Fn8000_0021 AMD Extended Features Identification 2.
- Add CPUID Fn8000_0022 AMD Extended Performance Monitoring and Debug.
- Rename HW_FEEDBACK to HWI (Hardware Feedback Interface).
- Rename TSX_FORCE_ABORT to RTM_FORCE_ABORT.
- Modify comment. Both Intel and AMD support CPUID Fn000b.
- Modify comment. Hybrid Information -> Native Model ID Information.
- Use __BIT(). Add comment. Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.98.2.24 -r1.98.2.25 src/sys/arch/x86/include/specialreg.h

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



CVS commit: [netbsd-8] src/sys/arch/x86/include

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:09:54 UTC 2023

Modified Files:
src/sys/arch/x86/include [netbsd-8]: specialreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1791:

sys/arch/x86/include/specialreg.h   1.193-1.198

- Add CPUID Fn_0006 %eax bit 24 IA32_THERM_INTERRUPT MSR bit 25
  Hardware Feedback Notification support.
- Add CPUID Fn_0007 %ecx bit 29 ENQCMD.
- Add CPUID Fn_0007 %edx bit 1 SGX-KEYS.
- Add CPUID Fn_0007 %edx bit 5 UINTR(User INTeRrupts).
- Add CPUID Fn_0007 %edx bit 11 RTM_ALWAYS_ABORT.
- Add CPUID Fn_0007 %edx bit 22 AMX_BF16.
- Add CPUID Fn_0007 %edx bit 23 AVX512_FP16.
- Add CPUID Fn_0007 %edx bit 24 AMX_TILE.
- Add CPUID Fn_0007 %edx bit 25 AMX_INT8.
- Add CPUID Fn_0007 sub-leaf 1 %edx bit 18 CET_SSS.
- Add CPUID Fn_0007 sub-leaf 2 %edx definitions.
- Add CPUID Fn_000d sub-leaf 1 %eax bit 4 XFD.
- Add CPUID Fn_001d Tile Information.
- Add CPUID Fn_001e TMUL Information.
- Add CPUID Fn8000_0007 %eax RAS capabilities.
- Add CPUID Fn8000_0008 %ebx BTC_NO,
- Add cpuid Fn8000_000a x2AVIC, VNMI, IBSVIRT and ROGPT.
- Add CPUID Fn8000_001b Instruction-Based Sampling.
- Add CPUID Fn8000_001e Processor Topology Information.
- Add CPUID Fn8000_001f %eax RPMQUERY, VmplSSS, TscAuxVirt,
  VmgexitParam, VirtualTomMsr, IbsVirtGuest, SmtProtection,
  vsmCommPageMSR and NestedVirtSnpMsr.
- Add CPUID Fn8000_0021 AMD Extended Features Identification 2.
- Add CPUID Fn8000_0022 AMD Extended Performance Monitoring and Debug.
- Rename HW_FEEDBACK to HWI (Hardware Feedback Interface).
- Rename TSX_FORCE_ABORT to RTM_FORCE_ABORT.
- Modify comment. Both Intel and AMD support CPUID Fn000b.
- Modify comment. Hybrid Information -> Native Model ID Information.
- Use __BIT(). Add comment. Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.98.2.24 -r1.98.2.25 src/sys/arch/x86/include/specialreg.h

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

Modified files:

Index: src/sys/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.98.2.24 src/sys/arch/x86/include/specialreg.h:1.98.2.25
--- src/sys/arch/x86/include/specialreg.h:1.98.2.24	Sat Oct 15 10:16:07 2022
+++ src/sys/arch/x86/include/specialreg.h	Mon Jan 23 13:09:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.98.2.24 2022/10/15 10:16:07 martin Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.98.2.25 2023/01/23 13:09:54 martin Exp $	*/
 
 /*
  * Copyright (c) 2014-2019 The NetBSD Foundation, Inc.
@@ -117,21 +117,21 @@
 /*
  * Extended Control Register XCR0
  */
-#define XCR0_X87	0x0001	/* x87 FPU/MMX state */
-#define XCR0_SSE	0x0002	/* SSE state */
-#define XCR0_YMM_Hi128	0x0004	/* AVX-256 (ymmn registers) */
-#define XCR0_BNDREGS	0x0008	/* Memory protection ext bounds */
-#define XCR0_BNDCSR	0x0010	/* Memory protection ext state */
-#define XCR0_Opmask	0x0020	/* AVX-512 Opmask */
-#define XCR0_ZMM_Hi256	0x0040	/* AVX-512 upper 256 bits low regs */
-#define XCR0_Hi16_ZMM	0x0080	/* AVX-512 512 bits upper registers */
-#define XCR0_PT		0x0100	/* Processor Trace state */
-#define XCR0_PKRU	0x0200	/* Protection Key state */
-#define XCR0_CET_U	0x0800	/* User CET state */
-#define XCR0_CET_S	0x1000	/* Kern CET state */
-#define XCR0_HDC	0x2000	/* Hardware Duty Cycle state */
-#define XCR0_LBR	0x8000	/* Last Branch Record */
-#define XCR0_HWP	0x0001	/* Hardware P-states */
+#define XCR0_X87	__BIT(0)	/* x87 FPU/MMX state */
+#define XCR0_SSE	__BIT(1)	/* SSE state */
+#define XCR0_YMM_Hi128	__BIT(2)	/* AVX-256 (ymmn registers) */
+#define XCR0_BNDREGS	__BIT(3)	/* Memory protection ext bounds */
+#define XCR0_BNDCSR	__BIT(4)	/* Memory protection ext state */
+#define XCR0_Opmask	__BIT(5)	/* AVX-512 Opmask */
+#define XCR0_ZMM_Hi256	__BIT(6)	/* AVX-512 upper 256 bits low regs */
+#define XCR0_Hi16_ZMM	__BIT(7)	/* AVX-512 512 bits upper registers */
+#define XCR0_PT		__BIT(8)	/* Processor Trace state */
+#define XCR0_PKRU	__BIT(9)	/* Protection Key state */
+#define XCR0_CET_U	__BIT(11)	/* User CET state */
+#define XCR0_CET_S	__BIT(12)	/* Kern CET state */
+#define XCR0_HDC	__BIT(13)	/* Hardware Duty Cycle state */
+#define XCR0_LBR	__BIT(15)	/* Last Branch Record */
+#define XCR0_HWP	__BIT(16)	/* Hardware P-states */
 
 #define XCR0_FLAGS1	"\20"		  \
 	"\1" "x87"	"\2" "SSE"	"\3" "AVX"	"\4" "BNDREGS"	  \
@@ -200,38 +200,38 @@
 #endif
 
 /* %ecx */
-#define CPUID2_SSE3	0x0001	/* Streaming SIMD Extensions 3 */
-#define CPUID2_PCLMULQDQ 0x0002	/* PCLMULQDQ instructions */
-#define CPUID2_DTES64	0x0004	/* 64-bit Debug Trace */
-#define CPUID2_MONITOR	0x0008	/* MONITOR/MWAIT instructions */
-#define CPUID2_DS_CPL	0x0010	/* CPL Qualified Debug Store */
-#define CPUID2_VMX	0x0020	/* Virtual Machine eXtensions */
-#define CPUID2_SMX	

CVS commit: [netbsd-9] src/usr.sbin/cpuctl/arch

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:04:12 UTC 2023

Modified Files:
src/usr.sbin/cpuctl/arch [netbsd-9]: i386.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1575:

usr.sbin/cpuctl/arch/i386.c 1.129-1.135 (via patch)

- Print cpuid 7 sub-leaf 1 %ebx, %edx and sub-leaf 2 %edx.
- Add Raptor Lake and Sapphire Rapids.
- Modify messages a little.


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

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



CVS commit: [netbsd-9] src/usr.sbin/cpuctl/arch

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:04:12 UTC 2023

Modified Files:
src/usr.sbin/cpuctl/arch [netbsd-9]: i386.c

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1575:

usr.sbin/cpuctl/arch/i386.c 1.129-1.135 (via patch)

- Print cpuid 7 sub-leaf 1 %ebx, %edx and sub-leaf 2 %edx.
- Add Raptor Lake and Sapphire Rapids.
- Modify messages a little.


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

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.104.2.11 src/usr.sbin/cpuctl/arch/i386.c:1.104.2.12
--- src/usr.sbin/cpuctl/arch/i386.c:1.104.2.11	Sat Oct 15 10:08:41 2022
+++ src/usr.sbin/cpuctl/arch/i386.c	Mon Jan 23 13:04:11 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.104.2.11 2022/10/15 10:08:41 martin Exp $	*/
+/*	$NetBSD: i386.c,v 1.104.2.12 2023/01/23 13:04:11 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.104.2.11 2022/10/15 10:08:41 martin Exp $");
+__RCSID("$NetBSD: i386.c,v 1.104.2.12 2023/01/23 13:04:11 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -351,7 +351,7 @@ const struct cpu_cpuid_nameclass i386_cp
 [0x8c] = "11th gen Core (Tiger Lake)",
 [0x8d] = "11th gen Core (Tiger Lake)",
 [0x8e] = "7th or 8th gen Core (Kaby Lake, Coffee Lake) or Xeon E (Coffee Lake)",
-[0x8f] = "future Xeon (Sapphire Rapids)",
+[0x8f] = "4th gen Xeon Scalable (Sapphire Rapids)",
 [0x96] = "Atom x6000E (Elkhart Lake)",
 [0x97] = "12th gen Core (Alder Lake)",
 [0x9a] = "12th gen Core (Alder Lake)",
@@ -361,7 +361,9 @@ const struct cpu_cpuid_nameclass i386_cp
 [0xa6] = "10th gen Core (Comet Lake)",
 [0xa7] = "11th gen Core (Rocket Lake)",
 [0xa8] = "11th gen Core (Rocket Lake)",
-[0xbf] = "12th gen Core (Alder Lake)",
+[0xba] = "13th gen Core (Raptor Lake)",
+[0xb7] = "13th gen Core (Raptor Lake)",
+[0xbf] = "13th gen Core (Raptor Lake)",
 			},
 			"Pentium Pro, II or III",	/* Default */
 			NULL,
@@ -2206,13 +2208,25 @@ identifycpu(int fd, const char *cpuname)
 	if ((ci->ci_max_cpuid >= 7)
 	&& ((cpu_vendor == CPUVENDOR_INTEL)
 		|| (cpu_vendor == CPUVENDOR_AMD))) {
+		unsigned int maxsubleaf;
+
 		x86_cpuid(7, descs);
+		maxsubleaf = descs[0];
 		aprint_verbose("%s: SEF highest subleaf %08x\n",
-		cpuname, descs[0]);
-		if (descs[0] >= 1) {
+		cpuname, maxsubleaf);
+		if (maxsubleaf >= 1) {
 			x86_cpuid2(7, 1, descs);
 			print_bits(cpuname, "SEF-subleaf1-eax",
 			CPUID_SEF1_FLAGS_A, descs[0]);
+			print_bits(cpuname, "SEF-subleaf1-ebx",
+			CPUID_SEF1_FLAGS_B, descs[1]);
+			print_bits(cpuname, "SEF-subleaf1-edx",
+			CPUID_SEF1_FLAGS_D, descs[3]);
+		}
+		if (maxsubleaf >= 2) {
+			x86_cpuid2(7, 2, descs);
+			print_bits(cpuname, "SEF-subleaf2-edx",
+			CPUID_SEF2_FLAGS_D, descs[3]);
 		}
 	}
 
@@ -2228,6 +2242,17 @@ identifycpu(int fd, const char *cpuname)
 	}
 
 	if (cpu_vendor == CPUVENDOR_AMD) {
+		if (ci->ci_max_ext_cpuid >= 0x8021) {
+			x86_cpuid(0x8021, descs);
+			print_bits(cpuname, "AMD Extended features2",
+			CPUID_AMDEXT2_FLAGS, descs[0]);
+		}
+
+		if (ci->ci_max_ext_cpuid >= 0x8007) {
+			x86_cpuid(0x8007, descs);
+			print_bits(cpuname, "RAS features",
+			CPUID_RAS_FLAGS, descs[1]);
+		}
 		if ((ci->ci_max_ext_cpuid >= 0x800a)
 		&& (ci->ci_feat_val[3] & CPUID_SVM) != 0) {
 			x86_cpuid(0x800a, descs);
@@ -2238,11 +2263,32 @@ identifycpu(int fd, const char *cpuname)
 			print_bits(cpuname, "SVM features",
 			CPUID_AMD_SVM_FLAGS, descs[3]);
 		}
+		if (ci->ci_max_ext_cpuid >= 0x801b) {
+			x86_cpuid(0x801b, descs);
+			print_bits(cpuname, "IBS features",
+			CPUID_IBS_FLAGS, descs[0]);
+		}
 		if (ci->ci_max_ext_cpuid >= 0x801f) {
 			x86_cpuid(0x801f, descs);
 			print_bits(cpuname, "Encrypted Memory features",
 			CPUID_AMD_ENCMEM_FLAGS, descs[0]);
 		}
+		if (ci->ci_max_ext_cpuid >= 0x8022) {
+			uint8_t ncore, nnb, nlbrs;
+
+			x86_cpuid(0x8022, descs);
+			print_bits(cpuname, "Perfmon:",
+			CPUID_AXPERF_FLAGS, descs[0]);
+
+			ncore = __SHIFTOUT(descs[1], CPUID_AXPERF_NCPC);
+			nnb = __SHIFTOUT(descs[1], CPUID_AXPERF_NNBPC);
+			nlbrs = __SHIFTOUT(descs[1], CPUID_AXPERF_NLBRSTACK);
+			aprint_verbose("%s: Perfmon: counters: "
+			"Core %hhu, Northbridge %hhu\n", cpuname,
+			ncore, nnb);
+			aprint_verbose("%s: Perfmon: LBR Stack %hhu entries\n",
+			cpuname, nlbrs);
+		}
 	} else if (cpu_vendor == CPUVENDOR_INTEL) {
 		if (ci->ci_max_cpuid >= 0x0a) {
 			unsigned int pmcver, ncounter, veclen;



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:54:14 UTC 2023

Modified Files:
src/usr.sbin/cpuctl/arch [netbsd-10]: i386.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #57):

usr.sbin/cpuctl/arch/i386.c: revision 1.134
usr.sbin/cpuctl/arch/i386.c: revision 1.135

Print cpuid 7 sub-leaf 1 %ebx, %edx and sub-leaf 2 %edx.

Add Raptor Lake and Sapphire Rapids.


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

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



CVS commit: [netbsd-9] src/sys/arch/x86/include

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 13:00:53 UTC 2023

Modified Files:
src/sys/arch/x86/include [netbsd-9]: specialreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1574:

sys/arch/x86/include/specialreg.h   1.193-1.198

- Add CPUID Fn_0006 %eax bit 24 IA32_THERM_INTERRUPT MSR bit 25
  Hardware Feedback Notification support.
- Add CPUID Fn_0007 %ecx bit 29 ENQCMD.
- Add CPUID Fn_0007 %edx bit 1 SGX-KEYS.
- Add CPUID Fn_0007 %edx bit 5 UINTR(User INTeRrupts).
- Add CPUID Fn_0007 %edx bit 11 RTM_ALWAYS_ABORT.
- Add CPUID Fn_0007 %edx bit 22 AMX_BF16.
- Add CPUID Fn_0007 %edx bit 23 AVX512_FP16.
- Add CPUID Fn_0007 %edx bit 24 AMX_TILE.
- Add CPUID Fn_0007 %edx bit 25 AMX_INT8.
- Add CPUID Fn_0007 sub-leaf 1 %edx bit 18 CET_SSS.
- Add CPUID Fn_0007 sub-leaf 2 %edx definitions.
- Add CPUID Fn_000d sub-leaf 1 %eax bit 4 XFD.
- Add CPUID Fn_001d Tile Information.
- Add CPUID Fn_001e TMUL Information.
- Add CPUID Fn8000_0007 %eax RAS capabilities.
- Add CPUID Fn8000_0008 %ebx BTC_NO,
- Add cpuid Fn8000_000a x2AVIC, VNMI, IBSVIRT and ROGPT.
- Add CPUID Fn8000_001b Instruction-Based Sampling.
- Add CPUID Fn8000_001e Processor Topology Information.
- Add CPUID Fn8000_001f %eax RPMQUERY, VmplSSS, TscAuxVirt,
  VmgexitParam, VirtualTomMsr, IbsVirtGuest, SmtProtection,
  vsmCommPageMSR and NestedVirtSnpMsr.
- Add CPUID Fn8000_0021 AMD Extended Features Identification 2.
- Add CPUID Fn8000_0022 AMD Extended Performance Monitoring and Debug.
- Rename HW_FEEDBACK to HWI (Hardware Feedback Interface).
- Rename TSX_FORCE_ABORT to RTM_FORCE_ABORT.
- Modify comment. Both Intel and AMD support CPUID Fn000b.
- Modify comment. Hybrid Information -> Native Model ID Information.
- Use __BIT(). Add comment. Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.150.2.11 -r1.150.2.12 src/sys/arch/x86/include/specialreg.h

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

Modified files:

Index: src/sys/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.150.2.11 src/sys/arch/x86/include/specialreg.h:1.150.2.12
--- src/sys/arch/x86/include/specialreg.h:1.150.2.11	Sat Oct 15 10:08:40 2022
+++ src/sys/arch/x86/include/specialreg.h	Mon Jan 23 13:00:53 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.150.2.11 2022/10/15 10:08:40 martin Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.150.2.12 2023/01/23 13:00:53 martin Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -124,21 +124,21 @@
 /*
  * Extended Control Register XCR0
  */
-#define XCR0_X87	0x0001	/* x87 FPU/MMX state */
-#define XCR0_SSE	0x0002	/* SSE state */
-#define XCR0_YMM_Hi128	0x0004	/* AVX-256 (ymmn registers) */
-#define XCR0_BNDREGS	0x0008	/* Memory protection ext bounds */
-#define XCR0_BNDCSR	0x0010	/* Memory protection ext state */
-#define XCR0_Opmask	0x0020	/* AVX-512 Opmask */
-#define XCR0_ZMM_Hi256	0x0040	/* AVX-512 upper 256 bits low regs */
-#define XCR0_Hi16_ZMM	0x0080	/* AVX-512 512 bits upper registers */
-#define XCR0_PT		0x0100	/* Processor Trace state */
-#define XCR0_PKRU	0x0200	/* Protection Key state */
-#define XCR0_CET_U	0x0800	/* User CET state */
-#define XCR0_CET_S	0x1000	/* Kern CET state */
-#define XCR0_HDC	0x2000	/* Hardware Duty Cycle state */
-#define XCR0_LBR	0x8000	/* Last Branch Record */
-#define XCR0_HWP	0x0001	/* Hardware P-states */
+#define XCR0_X87	__BIT(0)	/* x87 FPU/MMX state */
+#define XCR0_SSE	__BIT(1)	/* SSE state */
+#define XCR0_YMM_Hi128	__BIT(2)	/* AVX-256 (ymmn registers) */
+#define XCR0_BNDREGS	__BIT(3)	/* Memory protection ext bounds */
+#define XCR0_BNDCSR	__BIT(4)	/* Memory protection ext state */
+#define XCR0_Opmask	__BIT(5)	/* AVX-512 Opmask */
+#define XCR0_ZMM_Hi256	__BIT(6)	/* AVX-512 upper 256 bits low regs */
+#define XCR0_Hi16_ZMM	__BIT(7)	/* AVX-512 512 bits upper registers */
+#define XCR0_PT		__BIT(8)	/* Processor Trace state */
+#define XCR0_PKRU	__BIT(9)	/* Protection Key state */
+#define XCR0_CET_U	__BIT(11)	/* User CET state */
+#define XCR0_CET_S	__BIT(12)	/* Kern CET state */
+#define XCR0_HDC	__BIT(13)	/* Hardware Duty Cycle state */
+#define XCR0_LBR	__BIT(15)	/* Last Branch Record */
+#define XCR0_HWP	__BIT(16)	/* Hardware P-states */
 
 #define XCR0_FLAGS1	"\20"		  \
 	"\1" "x87"	"\2" "SSE"	"\3" "AVX"	"\4" "BNDREGS"	  \
@@ -224,38 +224,38 @@
 #endif
 
 /* %ecx */
-#define CPUID2_SSE3	0x0001	/* Streaming SIMD Extensions 3 */
-#define CPUID2_PCLMULQDQ 0x0002	/* PCLMULQDQ instructions */
-#define CPUID2_DTES64	0x0004	/* 64-bit Debug Trace */
-#define CPUID2_MONITOR	0x0008	/* MONITOR/MWAIT instructions */
-#define CPUID2_DS_CPL	0x0010	/* CPL Qualified Debug Store */
-#define CPUID2_VMX	0x0020	/* Virtual Machine eXtensions */
-#define 

CVS commit: [netbsd-10] src/sys/arch/x86/include

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:52:17 UTC 2023

Modified Files:
src/sys/arch/x86/include [netbsd-10]: specialreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #56):

sys/arch/x86/include/specialreg.h: revision 1.200
sys/arch/x86/include/specialreg.h: revision 1.201
sys/arch/x86/include/specialreg.h: revision 1.199

Use __BIT(). Add comment. Whitespace. No functional change.

Update definitions from the latest Intel SDM.
 - Rename HW_FEEDBACK to HWI (Hardware Feedback Interface).
 - Add CPUID Fn_0006 %eax bit 24 IA32_THERM_INTERRUPT MSR bit 25 Hardware
   Feedback Notification support.
 - Add CPUID Fn_0007 %ecx bit 29 ENQCMD.
 - Add CPUID Fn_0007 %edx bit 1 SGX-KEYS.
 - Add CPUID Fn_0007 %edx bit 5 UINTR(User INTeRrupts).
 - Add CPUID Fn_0007 %edx bit 1 RTM_ALWAYS_ABORT.
 - Rename TSX_FORCE_ABORT to RTM_FORCE_ABORT.
 - Add CPUID Fn_0007 %edx bit 22 AMX_BF16.
 - Add CPUID Fn_0007 %edx bit 23 AVX512_FP16.
 - Add CPUID Fn_0007 %edx bit 24 AMX_TILE.
 - Add CPUID Fn_0007 %edx bit 25 AMX_INT8.
 - Add CPUID Fn_0007 sub-leaf 1 %edx bit 18 CET_SSS.
 - Add CPUID Fn_0007 sub-leaf 2 %edx bit 0 PSFD.
 - Add CPUID Fn_0007 sub-leaf 2 %edx bit 1 IPRED_CTRL.
 - Add CPUID Fn_0007 sub-leaf 2 %edx bit 2 RRSBA_CTRL.
 - Add CPUID Fn_0007 sub-leaf 2 %edx bit 3 DDPD_U.
 - Add CPUID Fn_0007 sub-leaf 2 %edx bit 4 BHI_CTRL.
 - Add CPUID Fn_0007 sub-leaf 2 %edx bit 5 MCDT_NO.
 - Modify comment. Both Intel and AMD support CPUID Fn000b.
 - Add CPUID Fn_000d sub-leaf 1 %eax bit 4 XFD.
 - Modify comment. Hybrid Information -> Native Model ID Information.
 - Add CPUID Fn_001d Tile Information.
 - Add CPUID Fn_001e TMUL Information.

Fix comment.


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.198.2.1 src/sys/arch/x86/include/specialreg.h

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

Modified files:

Index: src/sys/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.198 src/sys/arch/x86/include/specialreg.h:1.198.2.1
--- src/sys/arch/x86/include/specialreg.h:1.198	Mon Nov 21 12:21:17 2022
+++ src/sys/arch/x86/include/specialreg.h	Mon Jan 23 12:52:17 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.198 2022/11/21 12:21:17 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.198.2.1 2023/01/23 12:52:17 martin Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -124,21 +124,21 @@
 /*
  * Extended Control Register XCR0
  */
-#define XCR0_X87	0x0001	/* x87 FPU/MMX state */
-#define XCR0_SSE	0x0002	/* SSE state */
-#define XCR0_YMM_Hi128	0x0004	/* AVX-256 (ymmn registers) */
-#define XCR0_BNDREGS	0x0008	/* Memory protection ext bounds */
-#define XCR0_BNDCSR	0x0010	/* Memory protection ext state */
-#define XCR0_Opmask	0x0020	/* AVX-512 Opmask */
-#define XCR0_ZMM_Hi256	0x0040	/* AVX-512 upper 256 bits low regs */
-#define XCR0_Hi16_ZMM	0x0080	/* AVX-512 512 bits upper registers */
-#define XCR0_PT		0x0100	/* Processor Trace state */
-#define XCR0_PKRU	0x0200	/* Protection Key state */
-#define XCR0_CET_U	0x0800	/* User CET state */
-#define XCR0_CET_S	0x1000	/* Kern CET state */
-#define XCR0_HDC	0x2000	/* Hardware Duty Cycle state */
-#define XCR0_LBR	0x8000	/* Last Branch Record */
-#define XCR0_HWP	0x0001	/* Hardware P-states */
+#define XCR0_X87	__BIT(0)	/* x87 FPU/MMX state */
+#define XCR0_SSE	__BIT(1)	/* SSE state */
+#define XCR0_YMM_Hi128	__BIT(2)	/* AVX-256 (ymmn registers) */
+#define XCR0_BNDREGS	__BIT(3)	/* Memory protection ext bounds */
+#define XCR0_BNDCSR	__BIT(4)	/* Memory protection ext state */
+#define XCR0_Opmask	__BIT(5)	/* AVX-512 Opmask */
+#define XCR0_ZMM_Hi256	__BIT(6)	/* AVX-512 upper 256 bits low regs */
+#define XCR0_Hi16_ZMM	__BIT(7)	/* AVX-512 512 bits upper registers */
+#define XCR0_PT		__BIT(8)	/* Processor Trace state */
+#define XCR0_PKRU	__BIT(9)	/* Protection Key state */
+#define XCR0_CET_U	__BIT(11)	/* User CET state */
+#define XCR0_CET_S	__BIT(12)	/* Kern CET state */
+#define XCR0_HDC	__BIT(13)	/* Hardware Duty Cycle state */
+#define XCR0_LBR	__BIT(15)	/* Last Branch Record */
+#define XCR0_HWP	__BIT(16)	/* Hardware P-states */
 
 #define XCR0_FLAGS1	"\20"		  \
 	"\1" "x87"	"\2" "SSE"	"\3" "AVX"	"\4" "BNDREGS"	  \
@@ -224,38 +224,38 @@
 #endif
 
 /* %ecx */
-#define CPUID2_SSE3	0x0001	/* Streaming SIMD Extensions 3 */
-#define CPUID2_PCLMULQDQ 0x0002	/* PCLMULQDQ instructions */
-#define CPUID2_DTES64	0x0004	/* 64-bit Debug Trace */
-#define CPUID2_MONITOR	0x0008	/* MONITOR/MWAIT instructions */
-#define CPUID2_DS_CPL	0x0010	/* CPL Qualified Debug Store */
-#define CPUID2_VMX	0x0020	/* Virtual Machine eXtensions */
-#define CPUID2_SMX	0x0040	/* Safer Mode eXtensions */
-#define CPUID2_EST	0x0080	/* 

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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:54:14 UTC 2023

Modified Files:
src/usr.sbin/cpuctl/arch [netbsd-10]: i386.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #57):

usr.sbin/cpuctl/arch/i386.c: revision 1.134
usr.sbin/cpuctl/arch/i386.c: revision 1.135

Print cpuid 7 sub-leaf 1 %ebx, %edx and sub-leaf 2 %edx.

Add Raptor Lake and Sapphire Rapids.


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

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.133 src/usr.sbin/cpuctl/arch/i386.c:1.133.2.1
--- src/usr.sbin/cpuctl/arch/i386.c:1.133	Thu Nov 17 15:21:31 2022
+++ src/usr.sbin/cpuctl/arch/i386.c	Mon Jan 23 12:54:14 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.133 2022/11/17 15:21:31 msaitoh Exp $	*/
+/*	$NetBSD: i386.c,v 1.133.2.1 2023/01/23 12:54:14 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.133 2022/11/17 15:21:31 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.133.2.1 2023/01/23 12:54:14 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -351,7 +351,7 @@ const struct cpu_cpuid_nameclass i386_cp
 [0x8c] = "11th gen Core (Tiger Lake)",
 [0x8d] = "11th gen Core (Tiger Lake)",
 [0x8e] = "7th or 8th gen Core (Kaby Lake, Coffee Lake) or Xeon E (Coffee Lake)",
-[0x8f] = "future Xeon (Sapphire Rapids)",
+[0x8f] = "4th gen Xeon Scalable (Sapphire Rapids)",
 [0x96] = "Atom x6000E (Elkhart Lake)",
 [0x97] = "12th gen Core (Alder Lake)",
 [0x9a] = "12th gen Core (Alder Lake)",
@@ -361,7 +361,9 @@ const struct cpu_cpuid_nameclass i386_cp
 [0xa6] = "10th gen Core (Comet Lake)",
 [0xa7] = "11th gen Core (Rocket Lake)",
 [0xa8] = "11th gen Core (Rocket Lake)",
-[0xbf] = "12th gen Core (Alder Lake)",
+[0xba] = "13th gen Core (Raptor Lake)",
+[0xb7] = "13th gen Core (Raptor Lake)",
+[0xbf] = "13th gen Core (Raptor Lake)",
 			},
 			"Pentium Pro, II or III",	/* Default */
 			NULL,
@@ -2210,13 +2212,25 @@ identifycpu(int fd, const char *cpuname)
 	if ((ci->ci_max_cpuid >= 7)
 	&& ((cpu_vendor == CPUVENDOR_INTEL)
 		|| (cpu_vendor == CPUVENDOR_AMD))) {
+		unsigned int maxsubleaf;
+
 		x86_cpuid(7, descs);
+		maxsubleaf = descs[0];
 		aprint_verbose("%s: SEF highest subleaf %08x\n",
-		cpuname, descs[0]);
-		if (descs[0] >= 1) {
+		cpuname, maxsubleaf);
+		if (maxsubleaf >= 1) {
 			x86_cpuid2(7, 1, descs);
 			print_bits(cpuname, "SEF-subleaf1-eax",
 			CPUID_SEF1_FLAGS_A, descs[0]);
+			print_bits(cpuname, "SEF-subleaf1-ebx",
+			CPUID_SEF1_FLAGS_B, descs[1]);
+			print_bits(cpuname, "SEF-subleaf1-edx",
+			CPUID_SEF1_FLAGS_D, descs[3]);
+		}
+		if (maxsubleaf >= 2) {
+			x86_cpuid2(7, 2, descs);
+			print_bits(cpuname, "SEF-subleaf2-edx",
+			CPUID_SEF2_FLAGS_D, descs[3]);
 		}
 	}
 



CVS commit: [netbsd-10] src/sys/arch/x86/include

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:52:17 UTC 2023

Modified Files:
src/sys/arch/x86/include [netbsd-10]: specialreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #56):

sys/arch/x86/include/specialreg.h: revision 1.200
sys/arch/x86/include/specialreg.h: revision 1.201
sys/arch/x86/include/specialreg.h: revision 1.199

Use __BIT(). Add comment. Whitespace. No functional change.

Update definitions from the latest Intel SDM.
 - Rename HW_FEEDBACK to HWI (Hardware Feedback Interface).
 - Add CPUID Fn_0006 %eax bit 24 IA32_THERM_INTERRUPT MSR bit 25 Hardware
   Feedback Notification support.
 - Add CPUID Fn_0007 %ecx bit 29 ENQCMD.
 - Add CPUID Fn_0007 %edx bit 1 SGX-KEYS.
 - Add CPUID Fn_0007 %edx bit 5 UINTR(User INTeRrupts).
 - Add CPUID Fn_0007 %edx bit 1 RTM_ALWAYS_ABORT.
 - Rename TSX_FORCE_ABORT to RTM_FORCE_ABORT.
 - Add CPUID Fn_0007 %edx bit 22 AMX_BF16.
 - Add CPUID Fn_0007 %edx bit 23 AVX512_FP16.
 - Add CPUID Fn_0007 %edx bit 24 AMX_TILE.
 - Add CPUID Fn_0007 %edx bit 25 AMX_INT8.
 - Add CPUID Fn_0007 sub-leaf 1 %edx bit 18 CET_SSS.
 - Add CPUID Fn_0007 sub-leaf 2 %edx bit 0 PSFD.
 - Add CPUID Fn_0007 sub-leaf 2 %edx bit 1 IPRED_CTRL.
 - Add CPUID Fn_0007 sub-leaf 2 %edx bit 2 RRSBA_CTRL.
 - Add CPUID Fn_0007 sub-leaf 2 %edx bit 3 DDPD_U.
 - Add CPUID Fn_0007 sub-leaf 2 %edx bit 4 BHI_CTRL.
 - Add CPUID Fn_0007 sub-leaf 2 %edx bit 5 MCDT_NO.
 - Modify comment. Both Intel and AMD support CPUID Fn000b.
 - Add CPUID Fn_000d sub-leaf 1 %eax bit 4 XFD.
 - Modify comment. Hybrid Information -> Native Model ID Information.
 - Add CPUID Fn_001d Tile Information.
 - Add CPUID Fn_001e TMUL Information.

Fix comment.


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.198.2.1 src/sys/arch/x86/include/specialreg.h

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



CVS commit: [netbsd-9] src/sys/arch/x86/pci

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:27:33 UTC 2023

Modified Files:
src/sys/arch/x86/pci [netbsd-9]: amdzentemp.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1572):

sys/arch/x86/pci/amdzentemp.c: revision 1.16

match zen3 "cezanne" (ryzen 5000-series APU.)


To generate a diff of this commit:
cvs rdiff -u -r1.9.2.2 -r1.9.2.3 src/sys/arch/x86/pci/amdzentemp.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/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.9.2.2 src/sys/arch/x86/pci/amdzentemp.c:1.9.2.3
--- src/sys/arch/x86/pci/amdzentemp.c:1.9.2.2	Tue Oct 11 18:16:20 2022
+++ src/sys/arch/x86/pci/amdzentemp.c	Mon Jan 23 12:27:33 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdzentemp.c,v 1.9.2.2 2022/10/11 18:16:20 martin Exp $ */
+/*  $NetBSD: amdzentemp.c,v 1.9.2.3 2023/01/23 12:27:33 martin Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -53,7 +53,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.9.2.2 2022/10/11 18:16:20 martin Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.9.2.3 2023/01/23 12:27:33 martin Exp $ ");
 
 #include 
 #include 
@@ -398,6 +398,7 @@ amdzentemp_probe_ccd_sensors19h(struct a
 	switch (model) {
 	case 0x00 ... 0x0f: /* Zen3 EPYC "Milan" */
 	case 0x20 ... 0x2f: /* Zen3 Ryzen "Vermeer" */
+	case 0x50 ... 0x5f: /* Zen3 Ryzen "Cezanne" */
 		maxreg = 8;
 		break;
 	case 0x60 ... 0x6f: /* Zen4 Ryzen "Raphael" */



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:43:36 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: piixpm.c piixpmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1573:

sys/dev/pci/piixpm.c1.66,1.68-1.72 via patch
sys/dev/pci/piixpmreg.h 1.13

Add support new AMD chipsets that do not have indirect access
I/O ports.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.2 -r1.54.2.3 src/sys/dev/pci/piixpm.c
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/sys/dev/pci/piixpmreg.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/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.54.2.2 src/sys/dev/pci/piixpm.c:1.54.2.3
--- src/sys/dev/pci/piixpm.c:1.54.2.2	Tue Nov 30 11:44:39 2021
+++ src/sys/dev/pci/piixpm.c	Mon Jan 23 12:43:35 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.54.2.2 2021/11/30 11:44:39 martin Exp $ */
+/* $NetBSD: piixpm.c,v 1.54.2.3 2023/01/23 12:43:35 martin Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.54.2.2 2021/11/30 11:44:39 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.54.2.3 2023/01/23 12:43:35 martin Exp $");
 
 #include 
 #include 
@@ -51,7 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1
 
 #define PIIXPM_IS_CSB5(sc)		  \
 	(PCI_VENDOR((sc)->sc_id) == PCI_VENDOR_SERVERWORKS &&		  \
-	PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_SERVERWORKS_CSB5)
+	PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_SERVERWORKS_CSB5)
 #define PIIXPM_DELAY	200
 #define PIIXPM_TIMEOUT	1
 
@@ -75,20 +75,20 @@ __KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1
 struct piixpm_smbus {
 	int			sda;
 	int			sda_save;
-	struct			piixpm_softc *softc;
+	struct piixpm_softc	*softc;
 };
 
 struct piixpm_softc {
 	device_t		sc_dev;
 
 	bus_space_tag_t		sc_iot;
-#define	sc_pm_iot sc_iot
-#define sc_smb_iot sc_iot
+	bus_space_tag_t		sc_sb800_bt;
 	bus_space_handle_t	sc_pm_ioh;
-	bus_space_handle_t	sc_sb800_ioh;
+	bus_space_handle_t	sc_sb800_bh;
 	bus_space_handle_t	sc_smb_ioh;
 	void *			sc_smb_ih;
 	int			sc_poll;
+	bool			sc_sb800_mmio;	/* Use MMIO access */
 	bool			sc_sb800_selen; /* Use SMBUS0SEL */
 
 	pci_chipset_tag_t	sc_pc;
@@ -121,6 +121,7 @@ static void	piixpm_chdet(device_t, devic
 static bool	piixpm_suspend(device_t, const pmf_qual_t *);
 static bool	piixpm_resume(device_t, const pmf_qual_t *);
 
+static uint8_t	piixpm_sb800_pmread(struct piixpm_softc *, bus_size_t);
 static int	piixpm_sb800_init(struct piixpm_softc *);
 static void	piixpm_csb5_reset(void *);
 static int	piixpm_i2c_sb600_acquire_bus(void *, int);
@@ -217,7 +218,7 @@ piixpm_attach(device_t parent, device_t 
 
 	/* Map I/O space */
 	base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_PM_BASE);
-	if (base == 0 || bus_space_map(sc->sc_pm_iot, PCI_MAPREG_IO_ADDR(base),
+	if (base == 0 || bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(base),
 	PIIX_PM_SIZE, 0, >sc_pm_ioh)) {
 		aprint_error_dev(self,
 		"can't map power management I/O space\n");
@@ -229,13 +230,22 @@ piixpm_attach(device_t parent, device_t 
 	 * PIIX4 and PIIX4E have a bug in the timer latch, see Errata #20
 	 * in the "Specification update" (document #297738).
 	 */
-	acpipmtimer_attach(self, sc->sc_pm_iot, sc->sc_pm_ioh, PIIX_PM_PMTMR,
+	acpipmtimer_attach(self, sc->sc_iot, sc->sc_pm_ioh, PIIX_PM_PMTMR,
 	(PCI_REVISION(pa->pa_class) < 3) ? ACPIPMT_BADLATCH : 0);
 
 nopowermanagement:
 
 	/* SB800 rev 0x40+, AMD HUDSON and newer need special initialization */
 	if (PIIXPM_IS_FCHGRP(sc) || PIIXPM_IS_SB800GRP(sc)) {
+		/* Newer chips don't support I/O access */
+		if (PIIXPM_IS_KERNCZ(sc) && (sc->sc_rev >= 0x51)) {
+			sc->sc_sb800_mmio = true;
+			sc->sc_sb800_bt = pa->pa_memt;
+		} else {
+			sc->sc_sb800_mmio = false;
+			sc->sc_sb800_bt = pa->pa_iot;
+		}
+
 		if (piixpm_sb800_init(sc) == 0) {
 			/* Read configuration */
 			conf = bus_space_read_1(sc->sc_iot,
@@ -260,7 +270,7 @@ nopowermanagement:
 	/* Map I/O space */
 	base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_SMB_BASE) & 0x;
 	if (base == 0 ||
-	bus_space_map(sc->sc_smb_iot, PCI_MAPREG_IO_ADDR(base),
+	bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(base),
 	PIIX_SMB_SIZE, 0, >sc_smb_ioh)) {
 		aprint_error_dev(self, "can't map smbus I/O space\n");
 		return;
@@ -395,18 +405,37 @@ piixpm_resume(device_t dv, const pmf_qua
 	return true;
 }
 
+static uint8_t
+piixpm_sb800_pmread(struct piixpm_softc *sc, bus_size_t offset)
+{
+	bus_space_tag_t sbt = sc->sc_sb800_bt;
+	bus_space_handle_t sbh = sc->sc_sb800_bh;
+	uint8_t val;
+
+	if (sc->sc_sb800_mmio)
+		val = bus_space_read_1(sbt, sbh, offset);
+	else {
+		bus_space_write_1(sbt, sbh, SB800_INDIRECTIO_INDEX, offset);
+		val = bus_space_read_1(sbt, sbh, SB800_INDIRECTIO_DATA);
+	}
+
+	return val;
+}
+
 

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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:46:14 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-8]: piixpm.c piixpmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1790:

sys/dev/pci/piixpm.c1.66,1.68-1.72 via patch
sys/dev/pci/piixpmreg.h 1.13

Add support new AMD chipsets that do not have indirect access
I/O ports.


To generate a diff of this commit:
cvs rdiff -u -r1.52.6.3 -r1.52.6.4 src/sys/dev/pci/piixpm.c
cvs rdiff -u -r1.7.22.2 -r1.7.22.3 src/sys/dev/pci/piixpmreg.h

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



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:46:14 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-8]: piixpm.c piixpmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1790:

sys/dev/pci/piixpm.c1.66,1.68-1.72 via patch
sys/dev/pci/piixpmreg.h 1.13

Add support new AMD chipsets that do not have indirect access
I/O ports.


To generate a diff of this commit:
cvs rdiff -u -r1.52.6.3 -r1.52.6.4 src/sys/dev/pci/piixpm.c
cvs rdiff -u -r1.7.22.2 -r1.7.22.3 src/sys/dev/pci/piixpmreg.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/piixpm.c
diff -u src/sys/dev/pci/piixpm.c:1.52.6.3 src/sys/dev/pci/piixpm.c:1.52.6.4
--- src/sys/dev/pci/piixpm.c:1.52.6.3	Tue Nov 30 11:48:29 2021
+++ src/sys/dev/pci/piixpm.c	Mon Jan 23 12:46:14 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.52.6.3 2021/11/30 11:48:29 martin Exp $ */
+/* $NetBSD: piixpm.c,v 1.52.6.4 2023/01/23 12:46:14 martin Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.39 2013/10/01 20:06:02 sf Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.52.6.3 2021/11/30 11:48:29 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.52.6.4 2023/01/23 12:46:14 martin Exp $");
 
 #include 
 #include 
@@ -51,7 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1
 
 #define PIIXPM_IS_CSB5(sc)		  \
 	(PCI_VENDOR((sc)->sc_id) == PCI_VENDOR_SERVERWORKS &&		  \
-	PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_SERVERWORKS_CSB5)
+	PCI_PRODUCT((sc)->sc_id) == PCI_PRODUCT_SERVERWORKS_CSB5)
 #define PIIXPM_DELAY	200
 #define PIIXPM_TIMEOUT	1
 
@@ -75,20 +75,20 @@ __KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1
 struct piixpm_smbus {
 	int			sda;
 	int			sda_save;
-	struct			piixpm_softc *softc;
+	struct piixpm_softc	*softc;
 };
 
 struct piixpm_softc {
 	device_t		sc_dev;
 
 	bus_space_tag_t		sc_iot;
-#define	sc_pm_iot sc_iot
-#define sc_smb_iot sc_iot
+	bus_space_tag_t		sc_sb800_bt;
 	bus_space_handle_t	sc_pm_ioh;
-	bus_space_handle_t	sc_sb800_ioh;
+	bus_space_handle_t	sc_sb800_bh;
 	bus_space_handle_t	sc_smb_ioh;
 	void *			sc_smb_ih;
 	int			sc_poll;
+	bool			sc_sb800_mmio;	/* Use MMIO access */
 	bool			sc_sb800_selen; /* Use SMBUS0SEL */
 
 	pci_chipset_tag_t	sc_pc;
@@ -121,6 +121,7 @@ static void	piixpm_chdet(device_t, devic
 static bool	piixpm_suspend(device_t, const pmf_qual_t *);
 static bool	piixpm_resume(device_t, const pmf_qual_t *);
 
+static uint8_t	piixpm_sb800_pmread(struct piixpm_softc *, bus_size_t);
 static int	piixpm_sb800_init(struct piixpm_softc *);
 static void	piixpm_csb5_reset(void *);
 static int	piixpm_i2c_sb600_acquire_bus(void *, int);
@@ -217,7 +218,7 @@ piixpm_attach(device_t parent, device_t 
 
 	/* Map I/O space */
 	base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_PM_BASE);
-	if (base == 0 || bus_space_map(sc->sc_pm_iot, PCI_MAPREG_IO_ADDR(base),
+	if (base == 0 || bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(base),
 	PIIX_PM_SIZE, 0, >sc_pm_ioh)) {
 		aprint_error_dev(self,
 		"can't map power management I/O space\n");
@@ -229,13 +230,22 @@ piixpm_attach(device_t parent, device_t 
 	 * PIIX4 and PIIX4E have a bug in the timer latch, see Errata #20
 	 * in the "Specification update" (document #297738).
 	 */
-	acpipmtimer_attach(self, sc->sc_pm_iot, sc->sc_pm_ioh, PIIX_PM_PMTMR,
+	acpipmtimer_attach(self, sc->sc_iot, sc->sc_pm_ioh, PIIX_PM_PMTMR,
 	(PCI_REVISION(pa->pa_class) < 3) ? ACPIPMT_BADLATCH : 0);
 
 nopowermanagement:
 
 	/* SB800 rev 0x40+, AMD HUDSON and newer need special initialization */
 	if (PIIXPM_IS_FCHGRP(sc) || PIIXPM_IS_SB800GRP(sc)) {
+		/* Newer chips don't support I/O access */
+		if (PIIXPM_IS_KERNCZ(sc) && (sc->sc_rev >= 0x51)) {
+			sc->sc_sb800_mmio = true;
+			sc->sc_sb800_bt = pa->pa_memt;
+		} else {
+			sc->sc_sb800_mmio = false;
+			sc->sc_sb800_bt = pa->pa_iot;
+		}
+
 		if (piixpm_sb800_init(sc) == 0) {
 			/* Read configuration */
 			conf = bus_space_read_1(sc->sc_iot,
@@ -260,7 +270,7 @@ nopowermanagement:
 	/* Map I/O space */
 	base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_SMB_BASE) & 0x;
 	if (base == 0 ||
-	bus_space_map(sc->sc_smb_iot, PCI_MAPREG_IO_ADDR(base),
+	bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(base),
 	PIIX_SMB_SIZE, 0, >sc_smb_ioh)) {
 		aprint_error_dev(self, "can't map smbus I/O space\n");
 		return;
@@ -395,18 +405,37 @@ piixpm_resume(device_t dv, const pmf_qua
 	return true;
 }
 
+static uint8_t
+piixpm_sb800_pmread(struct piixpm_softc *sc, bus_size_t offset)
+{
+	bus_space_tag_t sbt = sc->sc_sb800_bt;
+	bus_space_handle_t sbh = sc->sc_sb800_bh;
+	uint8_t val;
+
+	if (sc->sc_sb800_mmio)
+		val = bus_space_read_1(sbt, sbh, offset);
+	else {
+		bus_space_write_1(sbt, sbh, SB800_INDIRECTIO_INDEX, offset);
+		val = bus_space_read_1(sbt, sbh, SB800_INDIRECTIO_DATA);
+	}
+
+	return val;
+}
+

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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:43:36 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: piixpm.c piixpmreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1573:

sys/dev/pci/piixpm.c1.66,1.68-1.72 via patch
sys/dev/pci/piixpmreg.h 1.13

Add support new AMD chipsets that do not have indirect access
I/O ports.


To generate a diff of this commit:
cvs rdiff -u -r1.54.2.2 -r1.54.2.3 src/sys/dev/pci/piixpm.c
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/sys/dev/pci/piixpmreg.h

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



CVS commit: [netbsd-8] src/sys/arch/x86/x86

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:25:06 UTC 2023

Modified Files:
src/sys/arch/x86/x86 [netbsd-8]: procfs_machdep.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1788):

sys/arch/x86/x86/procfs_machdep.c: revision 1.46

Add x2avic. Modify comment.


To generate a diff of this commit:
cvs rdiff -u -r1.15.2.14 -r1.15.2.15 src/sys/arch/x86/x86/procfs_machdep.c

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



CVS commit: [netbsd-8] src/sys/arch/x86/pci

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:28:51 UTC 2023

Modified Files:
src/sys/arch/x86/pci [netbsd-8]: amdzentemp.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1789):

sys/arch/x86/pci/amdzentemp.c: revision 1.16

match zen3 "cezanne" (ryzen 5000-series APU.)


To generate a diff of this commit:
cvs rdiff -u -r1.7.2.3 -r1.7.2.4 src/sys/arch/x86/pci/amdzentemp.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/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.7.2.3 src/sys/arch/x86/pci/amdzentemp.c:1.7.2.4
--- src/sys/arch/x86/pci/amdzentemp.c:1.7.2.3	Tue Oct 11 18:22:44 2022
+++ src/sys/arch/x86/pci/amdzentemp.c	Mon Jan 23 12:28:51 2023
@@ -1,4 +1,4 @@
-/*  $NetBSD: amdzentemp.c,v 1.7.2.3 2022/10/11 18:22:44 martin Exp $ */
+/*  $NetBSD: amdzentemp.c,v 1.7.2.4 2023/01/23 12:28:51 martin Exp $ */
 /*  $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -53,7 +53,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.7.2.3 2022/10/11 18:22:44 martin Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.7.2.4 2023/01/23 12:28:51 martin Exp $ ");
 
 #include 
 #include 
@@ -398,6 +398,7 @@ amdzentemp_probe_ccd_sensors19h(struct a
 	switch (model) {
 	case 0x00 ... 0x0f: /* Zen3 EPYC "Milan" */
 	case 0x20 ... 0x2f: /* Zen3 Ryzen "Vermeer" */
+	case 0x50 ... 0x5f: /* Zen3 Ryzen "Cezanne" */
 		maxreg = 8;
 		break;
 	case 0x60 ... 0x6f: /* Zen4 Ryzen "Raphael" */



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:10:12 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-8]: xhci_pci.c
src/sys/dev/usb [netbsd-8]: xhci.c xhcivar.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1787:

sys/dev/pci/xhci_pci.c  1.31 via patch
sys/dev/usb/xhci.c  1.173-1.175
sys/dev/usb/xhcivar.h   1.22

Support xHCI device which has USB 2 port only.


To generate a diff of this commit:
cvs rdiff -u -r1.8.6.3 -r1.8.6.4 src/sys/dev/pci/xhci_pci.c
cvs rdiff -u -r1.72.2.13 -r1.72.2.14 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.7.6.1 -r1.7.6.2 src/sys/dev/usb/xhcivar.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/sys/arch/x86/x86

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:21:48 UTC 2023

Modified Files:
src/sys/arch/x86/x86 [netbsd-10]: procfs_machdep.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #54):

sys/arch/x86/x86/procfs_machdep.c: revision 1.46

Add x2avic. Modify comment.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.45.4.1 src/sys/arch/x86/x86/procfs_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/x86/procfs_machdep.c
diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.45 src/sys/arch/x86/x86/procfs_machdep.c:1.45.4.1
--- src/sys/arch/x86/x86/procfs_machdep.c:1.45	Mon Jun 20 15:40:24 2022
+++ src/sys/arch/x86/x86/procfs_machdep.c	Mon Jan 23 12:21:48 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.45 2022/06/20 15:40:24 msaitoh Exp $ */
+/*	$NetBSD: procfs_machdep.c,v 1.45.4.1 2023/01/23 12:21:48 martin Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.45 2022/06/20 15:40:24 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.45.4.1 2023/01/23 12:21:48 martin Exp $");
 
 #include 
 #include 
@@ -171,7 +171,7 @@ static const char * const x86_features[]
 	"tsc_scale", "vmcb_clean", "flushbyasid", "decodeassists",
 	NULL, NULL, "pausefilter", NULL, "pfthreshold", "avic", NULL,
 	"v_vmsave_vmload",
-	"vgif", NULL, NULL, NULL, "v_spec_ctrl", NULL, NULL, NULL,
+	"vgif", NULL, "x2avic", NULL, "v_spec_ctrl", NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
 	{ /* (16) 0x0007:0 ecx */
@@ -183,7 +183,7 @@ static const char * const x86_features[]
 	NULL, "cldemote", NULL, "movdiri",
 	"movdir64b", "enqcmd", "sgx_lc", NULL},
 
-	{ /* (17) 0x8007 ebx */
+	{ /* (17) AMD 0x8007 ebx */
 	"overflow_recov", "succor", NULL, "smca", NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:21:48 UTC 2023

Modified Files:
src/sys/arch/x86/x86 [netbsd-10]: procfs_machdep.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #54):

sys/arch/x86/x86/procfs_machdep.c: revision 1.46

Add x2avic. Modify comment.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.45.4.1 src/sys/arch/x86/x86/procfs_machdep.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-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:16:00 UTC 2023

Modified Files:
src/share/man/man4 [netbsd-10]: igpio.4
src/sys/dev/ic [netbsd-10]: igpio.c igpioreg.h igpiovar.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #53):

sys/dev/ic/igpio.c: revision 1.5
sys/dev/ic/igpioreg.h: revision 1.3
sys/dev/ic/igpioreg.h: revision 1.4
sys/dev/ic/igpioreg.h: revision 1.5
sys/dev/ic/igpioreg.h: revision 1.6
sys/dev/ic/igpioreg.h: revision 1.7
sys/dev/ic/igpioreg.h: revision 1.8
sys/dev/ic/igpiovar.h: revision 1.2
share/man/man4/igpio.4: revision 1.3

Fix entries for Lewisburg.

One more fix for Lewisburg.

Modify comment. Whitespace. No functional change.

Whitespace. No functional change.

Whitespace. No functional change.

Move entries of Alder Lake-S and Tiger Lake-LP. No functional change.

igpio: Update pin definitions.
- Add Ice Lake-N(INT34C3)
- Add Raptor Lake-S(INTC1085).
- Add another Baytrail(INT33FC).
- Modify INTC1057. It was for Tiger Lake-LP and reused for Alder Lake-N.
- Fix pin group definitions for Sunrisepoint-LP, Tiger Lake-LP, Tiger Lake-H,
  Alder Lake-P and Lewisburg.
- Modify pin group names for Coffee Lake-S, Sunrisepoint-H, Cannon Lake-LP
  and Denverton.
- Add two missing entries to Ice Lake-LP's pin group table.
- Modify comment. INT3455 is Ice Lake-LP.
- Add comment.

igpio.4: Update list of supported devices.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.2.1 src/share/man/man4/igpio.4
cvs rdiff -u -r1.4 -r1.4.4.1 src/sys/dev/ic/igpio.c
cvs rdiff -u -r1.2 -r1.2.4.1 src/sys/dev/ic/igpioreg.h
cvs rdiff -u -r1.1 -r1.1.4.1 src/sys/dev/ic/igpiovar.h

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/igpio.4
diff -u src/share/man/man4/igpio.4:1.2 src/share/man/man4/igpio.4:1.2.2.1
--- src/share/man/man4/igpio.4:1.2	Thu Mar 24 16:33:58 2022
+++ src/share/man/man4/igpio.4	Mon Jan 23 12:16:00 2023
@@ -1,4 +1,4 @@
-.\" $NetBSD: igpio.4,v 1.2 2022/03/24 16:33:58 wiz Exp $
+.\" $NetBSD: igpio.4,v 1.2.2.1 2023/01/23 12:16:00 martin Exp $
 .\"
 .\" Copyright (c) 2022 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 24, 2022
+.Dd January 7, 2023
 .Dt IGPIO 4
 .Os
 .Sh NAME
@@ -42,23 +42,28 @@ provides a
 .Xr gpio 4
 interface for the following Intel chipsets:
 .Bl -tag -width autoselect -compact
-.It Alderlake
+.It Alder Lake-N
+.It Alder Lake-P
+.It Alder Lake-S
 .It Baytrail
-.It Cannonlake-H
-.It Cannonlake-LP
+.It Cannon Lake-H
+.It Cannon Lake-LP
 .It Cedarfork
+.It Coffee Lake-S
 .It Denverton
 .It Emmitsburg
-.It Geminilake
-.It Icelake
-.It Jasperlake
+.It Gemini Lake
+.It Ice Lake-LP
+.It Ice Lake-N
+.It Jasper Lake
 .It Lakefield
 .It Lewisburg
 .It Lynxpoint
+.It Raptor Lake-S
 .It Sunrisepoint-H
 .It Sunrisepoint-LP
-.It Tigerlake-H
-.It Tigerlake-LP
+.It Tiger Lake-H
+.It Tiger Lake-LP
 .El
 Support for Broxton and Cherryview is not enabled yet.
 .Pp

Index: src/sys/dev/ic/igpio.c
diff -u src/sys/dev/ic/igpio.c:1.4 src/sys/dev/ic/igpio.c:1.4.4.1
--- src/sys/dev/ic/igpio.c:1.4	Sat Mar 26 19:35:56 2022
+++ src/sys/dev/ic/igpio.c	Mon Jan 23 12:15:59 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: igpio.c,v 1.4 2022/03/26 19:35:56 riastradh Exp $ */
+/* $NetBSD: igpio.c,v 1.4.4.1 2023/01/23 12:15:59 martin Exp $ */
 
 /*
  * Copyright (c) 2021,2022 Emmanuel Dreyfus
@@ -301,7 +301,7 @@ igpio_attach(struct igpio_softc *sc)
 		DPRINTF(("padbar[%d] = #%x\n", i, ib->ib_padbar));
 		if (ib->ib_padbar > sc->sc_length[i]) {
 			printf("PADBAR = #%x higher than max #%lx\n",
-			 ib->ib_padbar, sc->sc_length[i]);
+			ib->ib_padbar, sc->sc_length[i]);
 			goto out;
 		}
 
@@ -320,7 +320,7 @@ igpio_attach(struct igpio_softc *sc)
 		npins = 1 + ibs->ibs_last_pin - ibs->ibs_first_pin;
 
 		ib->ib_intr =
-		kmem_zalloc(sizeof(*ib->ib_intr) * npins, KM_SLEEP);
+		kmem_zalloc(sizeof(*ib->ib_intr) * npins, KM_SLEEP);
 
 		sc->sc_npins += npins;
 	}
@@ -640,8 +640,8 @@ igpio_intr_establish(void *priv, int pin
 		newval |= IGPIO_PADCFG0_RXEVCFG_EDGE_BOTH;
 		break;
 	case GPIO_INTR_NEG_EDGE:
-newval |= IGPIO_PADCFG0_RXEVCFG_EDGE;
-newval |= IGPIO_PADCFG0_RXINV;
+		newval |= IGPIO_PADCFG0_RXEVCFG_EDGE;
+		newval |= IGPIO_PADCFG0_RXINV;
 		break;
 	case GPIO_INTR_POS_EDGE:
 		newval |= IGPIO_PADCFG0_RXEVCFG_EDGE;

Index: src/sys/dev/ic/igpioreg.h
diff -u src/sys/dev/ic/igpioreg.h:1.2 src/sys/dev/ic/igpioreg.h:1.2.4.1
--- src/sys/dev/ic/igpioreg.h:1.2	Sat Mar 26 19:35:35 2022
+++ src/sys/dev/ic/igpioreg.h	Mon Jan 23 12:15:59 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: igpioreg.h,v 1.2 2022/03/26 19:35:35 riastradh Exp $ */
+/* $NetBSD: igpioreg.h,v 1.2.4.1 2023/01/23 

CVS commit: [netbsd-8] src/sys/arch/x86/pci

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:28:51 UTC 2023

Modified Files:
src/sys/arch/x86/pci [netbsd-8]: amdzentemp.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1789):

sys/arch/x86/pci/amdzentemp.c: revision 1.16

match zen3 "cezanne" (ryzen 5000-series APU.)


To generate a diff of this commit:
cvs rdiff -u -r1.7.2.3 -r1.7.2.4 src/sys/arch/x86/pci/amdzentemp.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-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:16:00 UTC 2023

Modified Files:
src/share/man/man4 [netbsd-10]: igpio.4
src/sys/dev/ic [netbsd-10]: igpio.c igpioreg.h igpiovar.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #53):

sys/dev/ic/igpio.c: revision 1.5
sys/dev/ic/igpioreg.h: revision 1.3
sys/dev/ic/igpioreg.h: revision 1.4
sys/dev/ic/igpioreg.h: revision 1.5
sys/dev/ic/igpioreg.h: revision 1.6
sys/dev/ic/igpioreg.h: revision 1.7
sys/dev/ic/igpioreg.h: revision 1.8
sys/dev/ic/igpiovar.h: revision 1.2
share/man/man4/igpio.4: revision 1.3

Fix entries for Lewisburg.

One more fix for Lewisburg.

Modify comment. Whitespace. No functional change.

Whitespace. No functional change.

Whitespace. No functional change.

Move entries of Alder Lake-S and Tiger Lake-LP. No functional change.

igpio: Update pin definitions.
- Add Ice Lake-N(INT34C3)
- Add Raptor Lake-S(INTC1085).
- Add another Baytrail(INT33FC).
- Modify INTC1057. It was for Tiger Lake-LP and reused for Alder Lake-N.
- Fix pin group definitions for Sunrisepoint-LP, Tiger Lake-LP, Tiger Lake-H,
  Alder Lake-P and Lewisburg.
- Modify pin group names for Coffee Lake-S, Sunrisepoint-H, Cannon Lake-LP
  and Denverton.
- Add two missing entries to Ice Lake-LP's pin group table.
- Modify comment. INT3455 is Ice Lake-LP.
- Add comment.

igpio.4: Update list of supported devices.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.2.1 src/share/man/man4/igpio.4
cvs rdiff -u -r1.4 -r1.4.4.1 src/sys/dev/ic/igpio.c
cvs rdiff -u -r1.2 -r1.2.4.1 src/sys/dev/ic/igpioreg.h
cvs rdiff -u -r1.1 -r1.1.4.1 src/sys/dev/ic/igpiovar.h

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



CVS commit: [netbsd-8] src/sys/arch/x86/x86

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:25:06 UTC 2023

Modified Files:
src/sys/arch/x86/x86 [netbsd-8]: procfs_machdep.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1788):

sys/arch/x86/x86/procfs_machdep.c: revision 1.46

Add x2avic. Modify comment.


To generate a diff of this commit:
cvs rdiff -u -r1.15.2.14 -r1.15.2.15 src/sys/arch/x86/x86/procfs_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/x86/procfs_machdep.c
diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.15.2.14 src/sys/arch/x86/x86/procfs_machdep.c:1.15.2.15
--- src/sys/arch/x86/x86/procfs_machdep.c:1.15.2.14	Fri Sep 16 18:39:16 2022
+++ src/sys/arch/x86/x86/procfs_machdep.c	Mon Jan 23 12:25:06 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.15.2.14 2022/09/16 18:39:16 martin Exp $ */
+/*	$NetBSD: procfs_machdep.c,v 1.15.2.15 2023/01/23 12:25:06 martin Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.15.2.14 2022/09/16 18:39:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.15.2.15 2023/01/23 12:25:06 martin Exp $");
 
 #include 
 #include 
@@ -171,7 +171,7 @@ static const char * const x86_features[]
 	"tsc_scale", "vmcb_clean", "flushbyasid", "decodeassists",
 	NULL, NULL, "pausefilter", NULL, "pfthreshold", "avic", NULL,
 	"v_vmsave_vmload",
-	"vgif", NULL, NULL, NULL, "v_spec_ctrl", NULL, NULL, NULL,
+	"vgif", NULL, "x2avic", NULL, "v_spec_ctrl", NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
 	{ /* (16) 0x0007:0 ecx */
@@ -183,7 +183,7 @@ static const char * const x86_features[]
 	NULL, "cldemote", NULL, "movdiri",
 	"movdir64b", "enqcmd", "sgx_lc", NULL},
 
-	{ /* (17) 0x8007 ebx */
+	{ /* (17) AMD 0x8007 ebx */
 	"overflow_recov", "succor", NULL, "smca", NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,



CVS commit: [netbsd-9] src/sys/arch/x86/x86

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:23:53 UTC 2023

Modified Files:
src/sys/arch/x86/x86 [netbsd-9]: procfs_machdep.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1571):

sys/arch/x86/x86/procfs_machdep.c: revision 1.46

Add x2avic. Modify comment.


To generate a diff of this commit:
cvs rdiff -u -r1.33.2.6 -r1.33.2.7 src/sys/arch/x86/x86/procfs_machdep.c

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



CVS commit: [netbsd-9] src/sys/arch/x86/x86

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:23:53 UTC 2023

Modified Files:
src/sys/arch/x86/x86 [netbsd-9]: procfs_machdep.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1571):

sys/arch/x86/x86/procfs_machdep.c: revision 1.46

Add x2avic. Modify comment.


To generate a diff of this commit:
cvs rdiff -u -r1.33.2.6 -r1.33.2.7 src/sys/arch/x86/x86/procfs_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/x86/procfs_machdep.c
diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.33.2.6 src/sys/arch/x86/x86/procfs_machdep.c:1.33.2.7
--- src/sys/arch/x86/x86/procfs_machdep.c:1.33.2.6	Fri Sep 16 18:36:43 2022
+++ src/sys/arch/x86/x86/procfs_machdep.c	Mon Jan 23 12:23:53 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.33.2.6 2022/09/16 18:36:43 martin Exp $ */
+/*	$NetBSD: procfs_machdep.c,v 1.33.2.7 2023/01/23 12:23:53 martin Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.33.2.6 2022/09/16 18:36:43 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.33.2.7 2023/01/23 12:23:53 martin Exp $");
 
 #include 
 #include 
@@ -171,7 +171,7 @@ static const char * const x86_features[]
 	"tsc_scale", "vmcb_clean", "flushbyasid", "decodeassists",
 	NULL, NULL, "pausefilter", NULL, "pfthreshold", "avic", NULL,
 	"v_vmsave_vmload",
-	"vgif", NULL, NULL, NULL, "v_spec_ctrl", NULL, NULL, NULL,
+	"vgif", NULL, "x2avic", NULL, "v_spec_ctrl", NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
 	{ /* (16) 0x0007:0 ecx */
@@ -183,7 +183,7 @@ static const char * const x86_features[]
 	NULL, "cldemote", NULL, "movdiri",
 	"movdir64b", "enqcmd", "sgx_lc", NULL},
 
-	{ /* (17) 0x8007 ebx */
+	{ /* (17) AMD 0x8007 ebx */
 	"overflow_recov", "succor", NULL, "smca", NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:10:12 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-8]: xhci_pci.c
src/sys/dev/usb [netbsd-8]: xhci.c xhcivar.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1787:

sys/dev/pci/xhci_pci.c  1.31 via patch
sys/dev/usb/xhci.c  1.173-1.175
sys/dev/usb/xhcivar.h   1.22

Support xHCI device which has USB 2 port only.


To generate a diff of this commit:
cvs rdiff -u -r1.8.6.3 -r1.8.6.4 src/sys/dev/pci/xhci_pci.c
cvs rdiff -u -r1.72.2.13 -r1.72.2.14 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.7.6.1 -r1.7.6.2 src/sys/dev/usb/xhcivar.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/xhci_pci.c
diff -u src/sys/dev/pci/xhci_pci.c:1.8.6.3 src/sys/dev/pci/xhci_pci.c:1.8.6.4
--- src/sys/dev/pci/xhci_pci.c:1.8.6.3	Sat Nov 16 16:30:09 2019
+++ src/sys/dev/pci/xhci_pci.c	Mon Jan 23 12:10:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci_pci.c,v 1.8.6.3 2019/11/16 16:30:09 martin Exp $	*/
+/*	$NetBSD: xhci_pci.c,v 1.8.6.4 2023/01/23 12:10:12 martin Exp $	*/
 /*	OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.8.6.3 2019/11/16 16:30:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.8.6.4 2023/01/23 12:10:12 martin Exp $");
 
 #include 
 #include 
@@ -245,9 +245,11 @@ xhci_pci_attach(device_t parent, device_
 		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	/* Attach usb buses. */
-	sc->sc_child = config_found(self, >sc_bus, usbctlprint);
+	if (sc->sc_usb3nports != 0)
+		sc->sc_child = config_found(self, >sc_bus, usbctlprint);
 
- 	sc->sc_child2 = config_found(self, >sc_bus2, usbctlprint);
+	if (sc->sc_usb2nports != 0)
+		sc->sc_child2 = config_found(self, >sc_bus2, usbctlprint);
 
 	return;
 

Index: src/sys/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.72.2.13 src/sys/dev/usb/xhci.c:1.72.2.14
--- src/sys/dev/usb/xhci.c:1.72.2.13	Fri Sep 16 18:34:20 2022
+++ src/sys/dev/usb/xhci.c	Mon Jan 23 12:10:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.72.2.13 2022/09/16 18:34:20 martin Exp $	*/
+/*	$NetBSD: xhci.c,v 1.72.2.14 2023/01/23 12:10:12 martin Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.72.2.13 2022/09/16 18:34:20 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.72.2.14 2023/01/23 12:10:12 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -783,7 +783,11 @@ xhci_id_protocols(struct xhci_softc *sc,
 	case 0x0310:
 	case 0x0320:
 		aprint_debug_dev(sc->sc_dev, " %s ports %d - %d\n",
-		major == 3 ? "ss" : "hs", cpo, cpo + cpc -1);
+		major == 3 ? "ss" : "hs", cpo, cpo + cpc - 1);
+		if (major == 3)
+			sc->sc_usb3nports += cpo + cpc - 1;
+		else
+			sc->sc_usb2nports += cpo + cpc - 1;
 		break;
 	default:
 		aprint_debug_dev(sc->sc_dev, " unknown major/minor (%d/%d)\n",
@@ -987,11 +991,13 @@ xhci_init(struct xhci_softc *sc)
 	/* default all ports to bus 0, i.e. usb 3 */
 	sc->sc_ctlrportbus = kmem_zalloc(
 	howmany(sc->sc_maxports * sizeof(uint8_t), NBBY), KM_SLEEP);
-	sc->sc_ctlrportmap = kmem_zalloc(sc->sc_maxports * sizeof(int), KM_SLEEP);
+	sc->sc_ctlrportmap =
+	kmem_zalloc(sc->sc_maxports * sizeof(int), KM_SLEEP);
 
 	/* controller port to bus roothub port map */
 	for (size_t j = 0; j < __arraycount(sc->sc_rhportmap); j++) {
-		sc->sc_rhportmap[j] = kmem_zalloc(sc->sc_maxports * sizeof(int), KM_SLEEP);
+		sc->sc_rhportmap[j] =
+		kmem_zalloc(sc->sc_maxports * sizeof(int), KM_SLEEP);
 	}
 
 	/*

Index: src/sys/dev/usb/xhcivar.h
diff -u src/sys/dev/usb/xhcivar.h:1.7.6.1 src/sys/dev/usb/xhcivar.h:1.7.6.2
--- src/sys/dev/usb/xhcivar.h:1.7.6.1	Sat Aug 25 11:29:52 2018
+++ src/sys/dev/usb/xhcivar.h	Mon Jan 23 12:10:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhcivar.h,v 1.7.6.1 2018/08/25 11:29:52 martin Exp $	*/
+/*	$NetBSD: xhcivar.h,v 1.7.6.2 2023/01/23 12:10:12 martin Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -100,6 +100,8 @@ struct xhci_softc {
 	 * Port routing and root hub - xHCI 4.19.7
 	 */
 	int sc_maxports;		/* number of controller ports */
+	int sc_usb3nports;
+	int sc_usb2nports;
 
 	uint8_t *sc_ctlrportbus;	/* a bus bit per port */
 



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:05:36 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: xhci_pci.c
src/sys/dev/usb [netbsd-9]: xhci.c xhcivar.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1570:

sys/dev/pci/xhci_pci.c  1.31 via patch
sys/dev/usb/xhci.c  1.173-1.175
sys/dev/usb/xhcivar.h   1.22

Support xHCI device which has USB 2 port only.


To generate a diff of this commit:
cvs rdiff -u -r1.21.4.1 -r1.21.4.2 src/sys/dev/pci/xhci_pci.c
cvs rdiff -u -r1.107.2.10 -r1.107.2.11 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.11.4.2 -r1.11.4.3 src/sys/dev/usb/xhcivar.h

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



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

2023-01-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jan 23 12:05:36 UTC 2023

Modified Files:
src/sys/dev/pci [netbsd-9]: xhci_pci.c
src/sys/dev/usb [netbsd-9]: xhci.c xhcivar.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1570:

sys/dev/pci/xhci_pci.c  1.31 via patch
sys/dev/usb/xhci.c  1.173-1.175
sys/dev/usb/xhcivar.h   1.22

Support xHCI device which has USB 2 port only.


To generate a diff of this commit:
cvs rdiff -u -r1.21.4.1 -r1.21.4.2 src/sys/dev/pci/xhci_pci.c
cvs rdiff -u -r1.107.2.10 -r1.107.2.11 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.11.4.2 -r1.11.4.3 src/sys/dev/usb/xhcivar.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/xhci_pci.c
diff -u src/sys/dev/pci/xhci_pci.c:1.21.4.1 src/sys/dev/pci/xhci_pci.c:1.21.4.2
--- src/sys/dev/pci/xhci_pci.c:1.21.4.1	Mon May 17 15:50:35 2021
+++ src/sys/dev/pci/xhci_pci.c	Mon Jan 23 12:05:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci_pci.c,v 1.21.4.1 2021/05/17 15:50:35 martin Exp $	*/
+/*	$NetBSD: xhci_pci.c,v 1.21.4.2 2023/01/23 12:05:36 martin Exp $	*/
 /*	OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.21.4.1 2021/05/17 15:50:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.21.4.2 2023/01/23 12:05:36 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_xhci_pci.h"
@@ -267,9 +267,11 @@ xhci_pci_attach(device_t parent, device_
 		aprint_error_dev(self, "couldn't establish power handler\n");
 
 	/* Attach usb buses. */
-	sc->sc_child = config_found(self, >sc_bus, usbctlprint);
+	if (sc->sc_usb3nports != 0)
+		sc->sc_child = config_found(self, >sc_bus, usbctlprint);
 
- 	sc->sc_child2 = config_found(self, >sc_bus2, usbctlprint);
+	if (sc->sc_usb2nports != 0)
+		sc->sc_child2 = config_found(self, >sc_bus2, usbctlprint);
 
 	return;
 

Index: src/sys/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.107.2.10 src/sys/dev/usb/xhci.c:1.107.2.11
--- src/sys/dev/usb/xhci.c:1.107.2.10	Fri Sep 16 18:32:49 2022
+++ src/sys/dev/usb/xhci.c	Mon Jan 23 12:05:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.107.2.10 2022/09/16 18:32:49 martin Exp $	*/
+/*	$NetBSD: xhci.c,v 1.107.2.11 2023/01/23 12:05:36 martin Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.10 2022/09/16 18:32:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.11 2023/01/23 12:05:36 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1177,7 +1177,11 @@ xhci_id_protocols(struct xhci_softc *sc,
 	case 0x0310:
 	case 0x0320:
 		aprint_debug_dev(sc->sc_dev, " %s ports %d - %d\n",
-		major == 3 ? "ss" : "hs", cpo, cpo + cpc -1);
+		major == 3 ? "ss" : "hs", cpo, cpo + cpc - 1);
+		if (major == 3)
+			sc->sc_usb3nports += cpo + cpc - 1;
+		else
+			sc->sc_usb2nports += cpo + cpc - 1;
 		break;
 	default:
 		aprint_error_dev(sc->sc_dev, " unknown major/minor (%d/%d)\n",
@@ -1399,11 +1403,13 @@ xhci_init(struct xhci_softc *sc)
 	/* default all ports to bus 0, i.e. usb 3 */
 	sc->sc_ctlrportbus = kmem_zalloc(
 	howmany(sc->sc_maxports * sizeof(uint8_t), NBBY), KM_SLEEP);
-	sc->sc_ctlrportmap = kmem_zalloc(sc->sc_maxports * sizeof(int), KM_SLEEP);
+	sc->sc_ctlrportmap =
+	kmem_zalloc(sc->sc_maxports * sizeof(int), KM_SLEEP);
 
 	/* controller port to bus roothub port map */
 	for (size_t j = 0; j < __arraycount(sc->sc_rhportmap); j++) {
-		sc->sc_rhportmap[j] = kmem_zalloc(sc->sc_maxports * sizeof(int), KM_SLEEP);
+		sc->sc_rhportmap[j] =
+		kmem_zalloc(sc->sc_maxports * sizeof(int), KM_SLEEP);
 	}
 
 	/*

Index: src/sys/dev/usb/xhcivar.h
diff -u src/sys/dev/usb/xhcivar.h:1.11.4.2 src/sys/dev/usb/xhcivar.h:1.11.4.3
--- src/sys/dev/usb/xhcivar.h:1.11.4.2	Tue Jun 22 05:10:50 2021
+++ src/sys/dev/usb/xhcivar.h	Mon Jan 23 12:05:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhcivar.h,v 1.11.4.2 2021/06/22 05:10:50 martin Exp $	*/
+/*	$NetBSD: xhcivar.h,v 1.11.4.3 2023/01/23 12:05:36 martin Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -103,6 +103,8 @@ struct xhci_softc {
 	 * Port routing and root hub - xHCI 4.19.7
 	 */
 	int sc_maxports;		/* number of controller ports */
+	int sc_usb3nports;
+	int sc_usb2nports;
 
 	uint8_t *sc_ctlrportbus;	/* a bus bit per port */