CVS commit: src/sys/arch

2022-01-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 22 15:08:11 UTC 2022

Modified Files:
src/sys/arch/emips/emips: bus_dma.c
src/sys/arch/evbmips/malta/pci: pcib.c
src/sys/arch/mips/mips: bus_dma.c
src/sys/arch/mips/rmi: rmixl_obio.c rmixl_pcix.c
src/sys/arch/mips/sibyte/pci: sbbrz.c
src/sys/arch/newsmips/newsmips: bus.c
src/sys/arch/playstation2/playstation2: bus_dma.c
src/sys/arch/pmax/pmax: bus_dma.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/emips/emips/bus_dma.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbmips/malta/pci/pcib.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/mips/mips/bus_dma.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/rmi/rmixl_obio.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/rmi/rmixl_pcix.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/sibyte/pci/sbbrz.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/newsmips/newsmips/bus.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/playstation2/playstation2/bus_dma.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/pmax/pmax/bus_dma.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

2022-01-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 22 15:08:11 UTC 2022

Modified Files:
src/sys/arch/emips/emips: bus_dma.c
src/sys/arch/evbmips/malta/pci: pcib.c
src/sys/arch/mips/mips: bus_dma.c
src/sys/arch/mips/rmi: rmixl_obio.c rmixl_pcix.c
src/sys/arch/mips/sibyte/pci: sbbrz.c
src/sys/arch/newsmips/newsmips: bus.c
src/sys/arch/playstation2/playstation2: bus_dma.c
src/sys/arch/pmax/pmax: bus_dma.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/emips/emips/bus_dma.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbmips/malta/pci/pcib.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/mips/mips/bus_dma.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/rmi/rmixl_obio.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/rmi/rmixl_pcix.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/sibyte/pci/sbbrz.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/newsmips/newsmips/bus.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/playstation2/playstation2/bus_dma.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/pmax/pmax/bus_dma.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/emips/emips/bus_dma.c
diff -u src/sys/arch/emips/emips/bus_dma.c:1.6 src/sys/arch/emips/emips/bus_dma.c:1.7
--- src/sys/arch/emips/emips/bus_dma.c:1.6	Sun Dec  5 03:07:15 2021
+++ src/sys/arch/emips/emips/bus_dma.c	Sat Jan 22 15:08:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.6 2021/12/05 03:07:15 msaitoh Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.7 2022/01/22 15:08:10 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.6 2021/12/05 03:07:15 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.7 2022/01/22 15:08:10 skrll Exp $");
 
 #include "opt_cputype.h"
 
@@ -88,9 +88,9 @@ emips_bus_dma_init(void)
 #endif
 }
 
-static size_t 
+static size_t
 _bus_dmamap_mapsize(int const nsegments)
-{   
+{
 	KASSERT(nsegments > 0);
 	return sizeof(struct emips_bus_dmamap) +
 	(sizeof(bus_dma_segment_t) * (nsegments - 1));
@@ -488,11 +488,11 @@ _bus_dmamap_sync_r3k(bus_dma_tag_t t, bu
 		}
 
 		/*
-		 * Now at the first segment to sync; nail 
+		 * Now at the first segment to sync; nail
 		 * each segment until we have exhausted the
 		 * length.
 		 */
-		minlen = len < map->dm_segs[i].ds_len - offset ?  
+		minlen = len < map->dm_segs[i].ds_len - offset ?
 		len : map->dm_segs[i].ds_len - offset;
 
 		addr = map->dm_segs[i].ds_addr;
@@ -736,6 +736,6 @@ _bus_dmamem_mmap(bus_dma_tag_t t, bus_dm
 	rv = _bus_dmamem_mmap_common(t, segs, nsegs, off, prot, flags);
 	if (rv == (bus_addr_t)-1)
 		return (-1);
-	
+
 	return (mips_btop((char *)rv));
 }

Index: src/sys/arch/evbmips/malta/pci/pcib.c
diff -u src/sys/arch/evbmips/malta/pci/pcib.c:1.22 src/sys/arch/evbmips/malta/pci/pcib.c:1.23
--- src/sys/arch/evbmips/malta/pci/pcib.c:1.22	Sat Aug  7 16:18:51 2021
+++ src/sys/arch/evbmips/malta/pci/pcib.c	Sat Jan 22 15:08:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcib.c,v 1.22 2021/08/07 16:18:51 thorpej Exp $	*/
+/*	$NetBSD: pcib.c,v 1.23 2022/01/22 15:08:10 skrll Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.22 2021/08/07 16:18:51 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.23 2022/01/22 15:08:10 skrll Exp $");
 
 #include 
 #include 
@@ -426,7 +426,7 @@ pcib_intr(void *v)
 		 * From YAMON source code:
 		 *
 		 * IRQ7 is used to detect spurious interrupts.
-		 * The interrupt acknowledge cycle returns IRQ7, if no 
+		 * The interrupt acknowledge cycle returns IRQ7, if no
 		 * interrupts is requested.
 		 * We can differentiate between this situation and a
 		 * "Normal" IRQ7 by reading the ISR.

Index: src/sys/arch/mips/mips/bus_dma.c
diff -u src/sys/arch/mips/mips/bus_dma.c:1.44 src/sys/arch/mips/mips/bus_dma.c:1.45
--- src/sys/arch/mips/mips/bus_dma.c:1.44	Thu Jan  7 17:28:20 2021
+++ src/sys/arch/mips/mips/bus_dma.c	Sat Jan 22 15:08:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.44 2021/01/07 17:28:20 skrll Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.45 2022/01/22 15:08:10 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001, 2020 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.44 2021/01/07 17:28:20 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.45 2022/01/22 15:08:10 skrll Exp $");
 
 #define _MIPS_BUS_DMA_PRIVATE
 
@@ -285,9 +285,9 @@ _bus_dma_load_bouncebuf(bus_dma_tag_t t,
 }
 #endif /* _MIPS_NEED_BUS_DMA_BOUNCE */
 
-static size_t 
+static size_t
 _bus_dmamap_mapsize(int const nsegments)
-{ 
+{
 	KASSERT(nsegments > 0);
 	return sizeof(struct mips_bus_dmamap) +
 	(sizeof(bus_dma_segment_t) * (nsegments - 1));
@@ -862,7 +862,7 @@ 

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

2022-01-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jan 21 19:22:56 UTC 2022

Modified Files:
src/sys/arch/sparc/dev: vme_machdep.c

Log Message:
Don't bother with prom_node_to_devhandle() if we're just forwarding along
our own node; use device_handle(self) instead.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/sparc/dev/vme_machdep.c

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



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

2022-01-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jan 21 19:22:56 UTC 2022

Modified Files:
src/sys/arch/sparc/dev: vme_machdep.c

Log Message:
Don't bother with prom_node_to_devhandle() if we're just forwarding along
our own node; use device_handle(self) instead.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/sparc/dev/vme_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/sparc/dev/vme_machdep.c
diff -u src/sys/arch/sparc/dev/vme_machdep.c:1.75 src/sys/arch/sparc/dev/vme_machdep.c:1.76
--- src/sys/arch/sparc/dev/vme_machdep.c:1.75	Sun Dec  5 04:21:31 2021
+++ src/sys/arch/sparc/dev/vme_machdep.c	Fri Jan 21 19:22:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vme_machdep.c,v 1.75 2021/12/05 04:21:31 msaitoh Exp $	*/
+/*	$NetBSD: vme_machdep.c,v 1.76 2022/01/21 19:22:56 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vme_machdep.c,v 1.75 2021/12/05 04:21:31 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vme_machdep.c,v 1.76 2022/01/21 19:22:56 thorpej Exp $");
 
 #include 
 #include 
@@ -432,7 +432,7 @@ vmeattach_iommu(device_t parent, device_
 	   sc->sc_reg->vmebus_cr & VMEBUS_CR_IMPL);
 
 	(void)config_found(self, , 0,
-	CFARGS(.devhandle = prom_node_to_devhandle(node)));
+	CFARGS(.devhandle = device_handle(self)));
 #endif /* SUN4M */
 }
 



CVS commit: src/sys/arch

2022-01-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jan 21 19:12:28 UTC 2022

Modified Files:
src/sys/arch/macppc/pci: bandit.c grackle.c u3.c uninorth.c
src/sys/arch/shark/ofw: ofisascr.c vlpci.c

Log Message:
Don't bother with devhandle_from_of() if we're just forwarding along
our own node; use device_handle(self) instead.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/macppc/pci/bandit.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/macppc/pci/grackle.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/macppc/pci/u3.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/macppc/pci/uninorth.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/shark/ofw/ofisascr.c \
src/sys/arch/shark/ofw/vlpci.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/macppc/pci/bandit.c
diff -u src/sys/arch/macppc/pci/bandit.c:1.34 src/sys/arch/macppc/pci/bandit.c:1.35
--- src/sys/arch/macppc/pci/bandit.c:1.34	Sat Aug  7 16:18:58 2021
+++ src/sys/arch/macppc/pci/bandit.c	Fri Jan 21 19:12:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bandit.c,v 1.34 2021/08/07 16:18:58 thorpej Exp $	*/
+/*	$NetBSD: bandit.c,v 1.35 2022/01/21 19:12:28 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bandit.c,v 1.34 2021/08/07 16:18:58 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bandit.c,v 1.35 2022/01/21 19:12:28 thorpej Exp $");
 
 #include 
 #include 
@@ -153,7 +153,7 @@ bandit_attach(device_t parent, device_t 
 	pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
 
 	config_found(self, , pcibusprint,
-	CFARGS(.devhandle = devhandle_from_of(node)));
+	CFARGS(.devhandle = device_handle(self)));
 }
 
 static pcireg_t

Index: src/sys/arch/macppc/pci/grackle.c
diff -u src/sys/arch/macppc/pci/grackle.c:1.18 src/sys/arch/macppc/pci/grackle.c:1.19
--- src/sys/arch/macppc/pci/grackle.c:1.18	Sat Aug  7 16:18:58 2021
+++ src/sys/arch/macppc/pci/grackle.c	Fri Jan 21 19:12:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: grackle.c,v 1.18 2021/08/07 16:18:58 thorpej Exp $	*/
+/*	$NetBSD: grackle.c,v 1.19 2022/01/21 19:12:28 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grackle.c,v 1.18 2021/08/07 16:18:58 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grackle.c,v 1.19 2022/01/21 19:12:28 thorpej Exp $");
 
 #include 
 #include 
@@ -146,7 +146,7 @@ grackle_attach(device_t parent, device_t
 	pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
 
 	config_found(self, , pcibusprint,
-	CFARGS(.devhandle = devhandle_from_of(node)));
+	CFARGS(.devhandle = device_handle(self)));
 }
 
 static pcireg_t

Index: src/sys/arch/macppc/pci/u3.c
diff -u src/sys/arch/macppc/pci/u3.c:1.11 src/sys/arch/macppc/pci/u3.c:1.12
--- src/sys/arch/macppc/pci/u3.c:1.11	Sat Aug  7 16:18:58 2021
+++ src/sys/arch/macppc/pci/u3.c	Fri Jan 21 19:12:28 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: u3.c,v 1.11 2021/08/07 16:18:58 thorpej Exp $ */
+/* $NetBSD: u3.c,v 1.12 2022/01/21 19:12:28 thorpej Exp $ */
 
 /*
  * Copyright 2006 Kyma Systems LLC.
@@ -166,7 +166,7 @@ ibmcpc_attach(device_t parent, device_t 
 		pba.pba_flags = PCI_FLAGS_MEM_OKAY | PCI_FLAGS_IO_OKAY;
 
 		config_found(self, , pcibusprint,
-		CFARGS(.devhandle = devhandle_from_of(child)));
+		CFARGS(.devhandle = device_handle(self)));
 
 		pc++;
 	}

Index: src/sys/arch/macppc/pci/uninorth.c
diff -u src/sys/arch/macppc/pci/uninorth.c:1.22 src/sys/arch/macppc/pci/uninorth.c:1.23
--- src/sys/arch/macppc/pci/uninorth.c:1.22	Sat Aug  7 16:18:58 2021
+++ src/sys/arch/macppc/pci/uninorth.c	Fri Jan 21 19:12:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: uninorth.c,v 1.22 2021/08/07 16:18:58 thorpej Exp $	*/
+/*	$NetBSD: uninorth.c,v 1.23 2022/01/21 19:12:28 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uninorth.c,v 1.22 2021/08/07 16:18:58 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uninorth.c,v 1.23 2022/01/21 19:12:28 thorpej Exp $");
 
 #include 
 #include 
@@ -184,7 +184,7 @@ uninorth_attach(device_t parent, device_
 	pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
 
 	config_found(self, , pcibusprint,
-	CFARGS(.devhandle = devhandle_from_of(node)));
+	CFARGS(.devhandle = device_handle(self)));
 }
 
 static pcireg_t

Index: src/sys/arch/shark/ofw/ofisascr.c
diff -u src/sys/arch/shark/ofw/ofisascr.c:1.12 src/sys/arch/shark/ofw/ofisascr.c:1.13
--- src/sys/arch/shark/ofw/ofisascr.c:1.12	Sat Aug  7 16:19:05 2021
+++ src/sys/arch/shark/ofw/ofisascr.c	Fri Jan 21 19:12:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofisascr.c,v 1.12 2021/08/07 16:19:05 thorpej Exp $	*/
+/*	$NetBSD: ofisascr.c,v 1.13 2022/01/21 19:12:28 thorpej Exp $	*/
 
 /*
  * Copyright 1997
@@ -38,7 +38,7 @@
  */
 
 #include 

CVS commit: src/sys/arch

2022-01-21 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Jan 21 19:12:28 UTC 2022

Modified Files:
src/sys/arch/macppc/pci: bandit.c grackle.c u3.c uninorth.c
src/sys/arch/shark/ofw: ofisascr.c vlpci.c

Log Message:
Don't bother with devhandle_from_of() if we're just forwarding along
our own node; use device_handle(self) instead.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/macppc/pci/bandit.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/macppc/pci/grackle.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/macppc/pci/u3.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/macppc/pci/uninorth.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/shark/ofw/ofisascr.c \
src/sys/arch/shark/ofw/vlpci.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/aarch64/aarch64

2022-01-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 16 10:50:02 UTC 2022

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

Log Message:
aarch64/pmap: remove stray semicolon

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/aarch64/aarch64/pmap.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.124 src/sys/arch/aarch64/aarch64/pmap.c:1.125
--- src/sys/arch/aarch64/aarch64/pmap.c:1.124	Sat Jan 15 07:39:04 2022
+++ src/sys/arch/aarch64/aarch64/pmap.c	Sun Jan 16 10:50:02 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.124 2022/01/15 07:39:04 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.125 2022/01/16 10:50:02 rillig Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.124 2022/01/15 07:39:04 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.125 2022/01/16 10:50:02 rillig Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -77,7 +77,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.1
 #endif
 
 struct kern_history_ent pmaphistbuf[UVMHIST_PMAPHIST_SIZE];
-UVMHIST_DEFINE(pmaphist) = UVMHIST_INITIALIZER(pmaphist, pmaphistbuf);;
+UVMHIST_DEFINE(pmaphist) = UVMHIST_INITIALIZER(pmaphist, pmaphistbuf);
 
 static void
 pmap_hist_init(void)



CVS commit: src/sys/arch/aarch64/aarch64

2022-01-16 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jan 16 10:50:02 UTC 2022

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

Log Message:
aarch64/pmap: remove stray semicolon

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/aarch64/aarch64/pmap.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/sparc64/doc

2022-01-15 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Jan 15 18:45:13 UTC 2022

Modified Files:
src/sys/arch/sparc64/doc: TODO

Log Message:
sun4v: update TODO with T2000 device configuration state


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/sparc64/doc/TODO

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/sparc64/doc/TODO
diff -u src/sys/arch/sparc64/doc/TODO:1.46 src/sys/arch/sparc64/doc/TODO:1.47
--- src/sys/arch/sparc64/doc/TODO:1.46	Wed Jan  5 16:01:54 2022
+++ src/sys/arch/sparc64/doc/TODO	Sat Jan 15 18:45:13 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO,v 1.46 2022/01/05 16:01:54 andvar Exp $ */
+/* $NetBSD: TODO,v 1.47 2022/01/15 18:45:13 palle Exp $ */
 
 Things to be done:
 
@@ -21,6 +21,7 @@ sun4v:
 		 the 'sh MAKEDEV all' command hangs.
 	 T2000 ldom with 8 VCPU and 4GB:
 	   - crashes in /sbin/init doing an access() call where %o0 is corrupted (zero)
+	   - device pci/ebus/com failes to enable interrupts (hv_intr_settarget() fails returning 6)
 	 S7 ldom with 8 VCPU and 16GB (primary ldom is Solaris 11.4 SRU33):
 	   - same status as T5 ldom
 - 64-bit kernel support



CVS commit: src/sys/arch/sparc64/doc

2022-01-15 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Jan 15 18:45:13 UTC 2022

Modified Files:
src/sys/arch/sparc64/doc: TODO

Log Message:
sun4v: update TODO with T2000 device configuration state


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/sparc64/doc/TODO

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



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

2022-01-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan 15 10:59:40 UTC 2022

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

Log Message:
Add Some definitions from AMD APM:

 - CPUID Fn8001 %ecx bit 30 AddrMaskExt.
 - CPUID Fn8008 %ebx bit 13 INT_WBINVD.
 - CPUID Fn8008 %ebx bit 19 IbrsSameMode.
 - CPUID Fn8008 %ebx bit 20 EferLmsleUnsupported.
 - CPUID Fn8008 %ebx bit 28 PSFD.
 - CPUID Fn8008 %edx bit 30 as "B30". Not documented.
 - CPUID Fn801f %eax bit  8 SecureTSC.
 - CPUID Fn801f %eax bit 24 VmsaRegProt.
 - Tested by nonaka@.


To generate a diff of this commit:
cvs rdiff -u -r1.185 -r1.186 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.185 src/sys/arch/x86/include/specialreg.h:1.186
--- src/sys/arch/x86/include/specialreg.h:1.185	Sat Jan 15 10:09:15 2022
+++ src/sys/arch/x86/include/specialreg.h	Sat Jan 15 10:59:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.185 2022/01/15 10:09:15 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.186 2022/01/15 10:59:40 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -730,6 +730,7 @@
 #define CPUID_PTSC	  __BIT(27)	/* PerfTsc */
 #define CPUID_L2IPERFC	  __BIT(28)	/* L2I performance counter Extension */
 #define CPUID_MWAITX	  __BIT(29)	/* MWAITX/MONITORX support */
+#define CPUID_ADDRMASKEXT __BIT(30)	/* Breakpoint Addressing Mask ext. */
 
 #define CPUID_AMD_FLAGS4	"\20"	\
 	"\1" "LAHF"	"\2" "CMPLEGACY" "\3" "SVM"	"\4" "EAPIC"	\
@@ -740,7 +741,7 @@
 	"\21" "FMA4"	"\22" "TCE"	"\23" "B18"	"\24" "NodeID"	\
 	"\25" "B20"	"\26" "TBM"	"\27" "TopoExt"	"\30" "PCExtC"	\
 	"\31" "PCExtNB"	"\32" "StrmPM"	"\33" "DBExt"	"\34" "PerfTsc"	\
-	"\35" "L2IPERFC" "\36" "MWAITX"	"\37" "B30"	"\40" "B31"
+	"\35" "L2IPERFC" "\36" "MWAITX"	"\37" "AddrMaskExt" "\40" "B31"
 
 /*
  * Advanced Power Management.
@@ -788,22 +789,29 @@
 #define CPUID_CAPEX_MCOMMIT	   __BIT(8)  /* MCOMMIT instruction */
 #define CPUID_CAPEX_WBNOINVD	   __BIT(9)  /* WBNOINVD instruction */
 #define CPUID_CAPEX_IBPB	   __BIT(12) /* Speculation Control IBPB */
+#define CPUID_CAPEX_INT_WBINVD	   __BIT(13) /* Interruptable WB[NO]INVD */
 #define CPUID_CAPEX_IBRS	   __BIT(14) /* Speculation Control IBRS */
 #define CPUID_CAPEX_STIBP	   __BIT(15) /* Speculation Control STIBP */
 #define CPUID_CAPEX_IBRS_ALWAYSON  __BIT(16) /* IBRS always on mode */
 #define CPUID_CAPEX_STIBP_ALWAYSON __BIT(17) /* STIBP always on mode */
 #define CPUID_CAPEX_PREFER_IBRS	   __BIT(18) /* IBRS preferred */
+#define CPUID_CAPEX_IBRS_SAMEMODE  __BIT(19) /* IBRS same speculation limits */
+#define CPUID_CAPEX_EFER_LSMSLE_UN __BIT(20) /* EFER.LMSLE is unsupported */
 #define CPUID_CAPEX_SSBD	   __BIT(24) /* Speculation Control SSBD */
 #define CPUID_CAPEX_VIRT_SSBD	   __BIT(25) /* Virt Spec Control SSBD */
 #define CPUID_CAPEX_SSB_NO	   __BIT(26) /* SSBD not required */
+#define CPUID_CAPEX_PSFD	   __BIT(28) /* Predictive Store Froward Dis */
 
 #define CPUID_CAPEX_FLAGS	"\20"	   \
 	"\1CLZERO"	"\2IRPERF"	"\3XSAVEERPTR"			   \
 	"\5RDPRU"			"\7B6"   \
 	"\11MCOMMIT"	"\12WBNOINVD"	"\13B10"			   \
-	"\15IBPB"	"\16B13"	"\17IBRS"	"\20STIBP"	   \
-	"\21IBRS_ALWAYSON" "\22STIBP_ALWAYSON" "\23PREFER_IBRS"	"\24B19"   \
-	"\31SSBD"	"\32VIRT_SSBD"	"\33SSB_NO"
+	"\15IBPB"	"\16INT_WBINVD"	"\17IBRS"	"\20STIBP"	   \
+	"\21IBRS_ALWAYSON" "\22STIBP_ALWAYSON" "\23PREFER_IBRS"		   \
+			"\24IBRS_SAMEMODE" \
+	"\25EFER_LSMSLE_UN"		   \
+	"\31SSBD"	"\32VIRT_SSBD"	"\33SSB_NO"			   \
+	"\35PSFD"
 
 /* %ecx */
 #define CPUID_CAPEX_PerfTscSize	__BITS(17,16)
@@ -833,6 +841,7 @@
 #define CPUID_AMD_SVM_V_VMSAVE_VMLOAD __BIT(15) /* Virtual VM{SAVE/LOAD} */
 #define CPUID_AMD_SVM_vGIF	  __BIT(16) /* Virtualized GIF */
 #define CPUID_AMD_SVM_GMET	  __BIT(17) /* Guest Mode Execution Trap */
+#define CPUID_AMD_SVM_SSSCHECK	  __BIT(19)  /* Shadow Stack restrictions */
 #define CPUID_AMD_SVM_SPEC_CTRL	  __BIT(20) /* SPEC_CTRL virtualization */
 #define CPUID_AMD_SVM_TLBICTL	  __BIT(24) /* TLB Intercept Control */
 
@@ -843,9 +852,10 @@
 	"\11" "B08"	"\12" "B09"	"\13" "PauseFilter" "\14" "B11"	\
 	"\15" "PFThreshold" "\16" "AVIC" "\17" "B14"			\
 		"\20" "V_VMSAVE_VMLOAD"	\
-	"\21" "VGIF"	"\22" "GMET"	\
+	"\21" "VGIF"	"\22" "GMET"			"\24SSSCHECK"	\
 	"\25" "SPEC_CTRL"		\
-	"\31" "TLBICTL"
+	"\31" "TLBICTL"			\
+	"\35B28"
 
 /*
  * AMD Cache Topology Information.
@@ -872,6 +882,7 @@
 #define CPUID_AMD_ENCMEM_SEVES	__BIT(3)   /* SEV Encrypted State */
 #define CPUID_AMD_ENCMEM_SEV_SNP __BIT(4)  /* Secure Nested Paging */
 #define CPUID_AMD_ENCMEM_VMPL	__BIT(5)   /* Virtual Machine Privilege Lvl */
+#define CPUID_AMD_ENCMEM_SECTSC	__BIT(8)   /* Secure TSC */
 #define CPUID_AMD_ENCMEM_HECC	__BIT(10) 

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

2022-01-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan 15 10:59:40 UTC 2022

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

Log Message:
Add Some definitions from AMD APM:

 - CPUID Fn8001 %ecx bit 30 AddrMaskExt.
 - CPUID Fn8008 %ebx bit 13 INT_WBINVD.
 - CPUID Fn8008 %ebx bit 19 IbrsSameMode.
 - CPUID Fn8008 %ebx bit 20 EferLmsleUnsupported.
 - CPUID Fn8008 %ebx bit 28 PSFD.
 - CPUID Fn8008 %edx bit 30 as "B30". Not documented.
 - CPUID Fn801f %eax bit  8 SecureTSC.
 - CPUID Fn801f %eax bit 24 VmsaRegProt.
 - Tested by nonaka@.


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

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



CVS commit: src/sys/arch/evbppc/obs405

2022-01-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan 15 10:55:06 UTC 2022

Modified Files:
src/sys/arch/evbppc/obs405: obs600_machdep.c

Log Message:
s/adressing/addressing/


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbppc/obs405/obs600_machdep.c

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



CVS commit: src/sys/arch/evbppc/obs405

2022-01-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan 15 10:55:06 UTC 2022

Modified Files:
src/sys/arch/evbppc/obs405: obs600_machdep.c

Log Message:
s/adressing/addressing/


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbppc/obs405/obs600_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/evbppc/obs405/obs600_machdep.c
diff -u src/sys/arch/evbppc/obs405/obs600_machdep.c:1.16 src/sys/arch/evbppc/obs405/obs600_machdep.c:1.17
--- src/sys/arch/evbppc/obs405/obs600_machdep.c:1.16	Tue Aug  3 09:25:44 2021
+++ src/sys/arch/evbppc/obs405/obs600_machdep.c	Sat Jan 15 10:55:06 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: obs600_machdep.c,v 1.16 2021/08/03 09:25:44 rin Exp $	*/
+/*	$NetBSD: obs600_machdep.c,v 1.17 2022/01/15 10:55:06 msaitoh Exp $	*/
 /*	Original: md_machdep.c,v 1.3 2005/01/24 18:47:37 shige Exp $	*/
 
 /*
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: obs600_machdep.c,v 1.16 2021/08/03 09:25:44 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obs600_machdep.c,v 1.17 2022/01/15 10:55:06 msaitoh Exp $");
 
 #include "opt_ddb.h"
 
@@ -275,7 +275,7 @@ read_eeprom(int len, char *buf)
 	IIC0_WRITE(IIC_MDCNTL,
 	IIC0_READ(IIC_MDCNTL) | IIC_MDCNTL_FMDB | IIC_MDCNTL_FSDB);
 
-	/* 7-bit adressing */
+	/* 7-bit addressing */
 	IIC0_WRITE(IIC_HMADR, 0);
 	IIC0_WRITE(IIC_LMADR, I2C_EEPROM_ADDR << 1);
 



CVS commit: src/sys/arch/mips/mips

2022-01-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 10:32:32 UTC 2022

Modified Files:
src/sys/arch/mips/mips: db_interface.c

Log Message:
Add 'mach cpuinfo' support


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/mips/mips/db_interface.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/mips/mips/db_interface.c
diff -u src/sys/arch/mips/mips/db_interface.c:1.95 src/sys/arch/mips/mips/db_interface.c:1.96
--- src/sys/arch/mips/mips/db_interface.c:1.95	Sat Jan 15 08:56:41 2022
+++ src/sys/arch/mips/mips/db_interface.c	Sat Jan 15 10:32:32 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.95 2022/01/15 08:56:41 skrll Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.96 2022/01/15 10:32:32 skrll Exp $	*/
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.95 2022/01/15 08:56:41 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.96 2022/01/15 10:32:32 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -88,8 +88,10 @@ static void db_mach_cpu_cmd(db_expr_t, b
 #endif
 
 void db_cp0dump_cmd(db_expr_t, bool, db_expr_t, const char *);
+void db_cpuinfo_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_kvtophys_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_tlbdump_cmd(db_expr_t, bool, db_expr_t, const char *);
+
 #ifdef MIPS64_XLS
 void db_mfcr_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_mtcr_cmd(db_expr_t, bool, db_expr_t, const char *);
@@ -570,6 +572,66 @@ db_cp0dump_cmd(db_expr_t addr, bool have
 	}
 }
 
+
+static void
+show_cpuinfo(struct cpu_info *kci)
+{
+	struct cpu_info cpuinfobuf;
+	cpuid_t cpuid;
+	int i;
+
+	db_read_bytes((db_addr_t)kci, sizeof(cpuinfobuf), (char *));
+
+	struct cpu_info *ci = 
+	cpuid = ci->ci_cpuid;
+	db_printf("cpu_info=%p, cpu_name=%s\n", kci, ci->ci_cpuname);
+	db_printf("%p cpu[%lu].ci_cpuid = %lu\n",
+	>ci_cpuid, cpuid, ci->ci_cpuid);
+	db_printf("%p cpu[%lu].ci_curlwp= %p\n",
+	>ci_curlwp, cpuid, ci->ci_curlwp);
+	for (i = 0; i < SOFTINT_COUNT; i++) {
+		db_printf("%p cpu[%lu].ci_softlwps[%d]   = %p\n",
+		>ci_softlwps[i], cpuid, i, ci->ci_softlwps[i]);
+	}
+	db_printf("%p cpu[%lu].ci_want_resched  = %d\n",
+	>ci_want_resched, cpuid, ci->ci_want_resched);
+	db_printf("%p cpu[%lu].ci_cpl   = %d\n",
+	>ci_cpl, cpuid, ci->ci_cpl);
+	db_printf("%p cpu[%lu].ci_softints  = 0x%08x\n",
+	>ci_softints, cpuid, ci->ci_softints);
+	db_printf("%p cpu[%lu].ci_idepth= %u\n",
+	>ci_idepth, cpuid, ci->ci_idepth);
+}
+
+void
+db_cpuinfo_cmd(db_expr_t addr, bool have_addr, db_expr_t count,
+const char *modif)
+{
+#ifdef MULTIPROCESSOR
+	CPU_INFO_ITERATOR cii;
+	struct cpu_info *ci;
+	bool showall = false;
+
+	if (modif != NULL) {
+		for (; *modif != '\0'; modif++) {
+			switch (*modif) {
+			case 'a':
+showall = true;
+break;
+			}
+		}
+	}
+
+	if (showall) {
+		for (CPU_INFO_FOREACH(cii, ci)) {
+			show_cpuinfo(ci);
+		}
+	} else
+#endif /* MULTIPROCESSOR */
+		show_cpuinfo(curcpu());
+}
+
+
 #if (MIPS32 + MIPS32R2 + MIPS64 + MIPS64R2) > 0
 static void
 db_watch_cmd(db_expr_t address, bool have_addr, db_expr_t count,
@@ -827,6 +889,10 @@ const struct db_command db_machine_comma
 	{ DDB_ADD_CMD("cp0",	db_cp0dump_cmd,	0,
 		"Dump CP0 registers.",
 		NULL, NULL) },
+	{ DDB_ADD_CMD("cpuinfo", db_cpuinfo_cmd,	0,
+			"Displays the cpuinfo",
+		NULL, NULL)
+	},
 	{ DDB_ADD_CMD("kvtop",	db_kvtophys_cmd,	0,
 		"Print the physical address for a given kernel virtual address",
 		"address",



CVS commit: src/sys/arch/mips/mips

2022-01-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 10:32:32 UTC 2022

Modified Files:
src/sys/arch/mips/mips: db_interface.c

Log Message:
Add 'mach cpuinfo' support


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/mips/mips/db_interface.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/x86/include

2022-01-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan 15 10:09:15 UTC 2022

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

Log Message:
Whitespace. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 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.184 src/sys/arch/x86/include/specialreg.h:1.185
--- src/sys/arch/x86/include/specialreg.h:1.184	Sat Jan 15 09:58:23 2022
+++ src/sys/arch/x86/include/specialreg.h	Sat Jan 15 10:09:15 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.184 2022/01/15 09:58:23 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.185 2022/01/15 10:09:15 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -781,28 +781,28 @@
  */
 
 /* %ebx */
-#define CPUID_CAPEX_CLZERO	__BIT(0)	/* CLZERO instruction */
-#define CPUID_CAPEX_IRPERF	__BIT(1)	/* InstRetCntMsr */
-#define CPUID_CAPEX_XSAVEERPTR	__BIT(2)	/* RstrFpErrPtrs by XRSTOR */
-#define CPUID_CAPEX_RDPRU	__BIT(4)	/* RDPRU instruction */
-#define CPUID_CAPEX_MCOMMIT	__BIT(8)	/* MCOMMIT instruction */
-#define CPUID_CAPEX_WBNOINVD	__BIT(9)	/* WBNOINVD instruction */
-#define CPUID_CAPEX_IBPB	__BIT(12)	/* Speculation Control IBPB */
-#define CPUID_CAPEX_IBRS	__BIT(14)	/* Speculation Control IBRS */
-#define CPUID_CAPEX_STIBP	__BIT(15)	/* Speculation Control STIBP */
-#define CPUID_CAPEX_IBRS_ALWAYSON __BIT(16)	/* IBRS always on mode */
-#define CPUID_CAPEX_STIBP_ALWAYSON __BIT(17)	/* STIBP always on mode */
-#define CPUID_CAPEX_PREFER_IBRS	__BIT(18)	/* IBRS preferred */
-#define CPUID_CAPEX_SSBD	__BIT(24)	/* Speculation Control SSBD */
-#define CPUID_CAPEX_VIRT_SSBD	__BIT(25)	/* Virt Spec Control SSBD */
-#define CPUID_CAPEX_SSB_NO	__BIT(26)	/* SSBD not required */
-
-#define CPUID_CAPEX_FLAGS	"\20"	 \
-	"\1CLZERO"	"\2IRPERF"	"\3XSAVEERPTR"			 \
-	"\5RDPRU"			"\7B6" \
-	"\11MCOMMIT"	"\12WBNOINVD"	"\13B10"			 \
-	"\15IBPB"	"\16B13"	"\17IBRS"	"\20STIBP"	 \
-	"\21IBRS_ALWAYSON" "\22STIBP_ALWAYSON" "\23PREFER_IBRS"	"\24B19" \
+#define CPUID_CAPEX_CLZERO	   __BIT(0)  /* CLZERO instruction */
+#define CPUID_CAPEX_IRPERF	   __BIT(1)  /* InstRetCntMsr */
+#define CPUID_CAPEX_XSAVEERPTR	   __BIT(2)  /* RstrFpErrPtrs by XRSTOR */
+#define CPUID_CAPEX_RDPRU	   __BIT(4)  /* RDPRU instruction */
+#define CPUID_CAPEX_MCOMMIT	   __BIT(8)  /* MCOMMIT instruction */
+#define CPUID_CAPEX_WBNOINVD	   __BIT(9)  /* WBNOINVD instruction */
+#define CPUID_CAPEX_IBPB	   __BIT(12) /* Speculation Control IBPB */
+#define CPUID_CAPEX_IBRS	   __BIT(14) /* Speculation Control IBRS */
+#define CPUID_CAPEX_STIBP	   __BIT(15) /* Speculation Control STIBP */
+#define CPUID_CAPEX_IBRS_ALWAYSON  __BIT(16) /* IBRS always on mode */
+#define CPUID_CAPEX_STIBP_ALWAYSON __BIT(17) /* STIBP always on mode */
+#define CPUID_CAPEX_PREFER_IBRS	   __BIT(18) /* IBRS preferred */
+#define CPUID_CAPEX_SSBD	   __BIT(24) /* Speculation Control SSBD */
+#define CPUID_CAPEX_VIRT_SSBD	   __BIT(25) /* Virt Spec Control SSBD */
+#define CPUID_CAPEX_SSB_NO	   __BIT(26) /* SSBD not required */
+
+#define CPUID_CAPEX_FLAGS	"\20"	   \
+	"\1CLZERO"	"\2IRPERF"	"\3XSAVEERPTR"			   \
+	"\5RDPRU"			"\7B6"   \
+	"\11MCOMMIT"	"\12WBNOINVD"	"\13B10"			   \
+	"\15IBPB"	"\16B13"	"\17IBRS"	"\20STIBP"	   \
+	"\21IBRS_ALWAYSON" "\22STIBP_ALWAYSON" "\23PREFER_IBRS"	"\24B19"   \
 	"\31SSBD"	"\32VIRT_SSBD"	"\33SSB_NO"
 
 /* %ecx */



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

2022-01-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan 15 10:09:15 UTC 2022

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

Log Message:
Whitespace. No functional change.


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

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



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

2022-01-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan 15 09:58:23 UTC 2022

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

Log Message:
Move CPUID_CAPEX_FLAGS next to %eax because it's for %eax.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 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.183 src/sys/arch/x86/include/specialreg.h:1.184
--- src/sys/arch/x86/include/specialreg.h:1.183	Sat Jan 15 09:55:13 2022
+++ src/sys/arch/x86/include/specialreg.h	Sat Jan 15 09:58:23 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.183 2022/01/15 09:55:13 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.184 2022/01/15 09:58:23 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -797,11 +797,6 @@
 #define CPUID_CAPEX_VIRT_SSBD	__BIT(25)	/* Virt Spec Control SSBD */
 #define CPUID_CAPEX_SSB_NO	__BIT(26)	/* SSBD not required */
 
-/* %ecx */
-#define CPUID_CAPEX_PerfTscSize	__BITS(17,16)
-#define CPUID_CAPEX_ApicIdSize	__BITS(15,12)
-#define CPUID_CAPEX_NC		__BITS(7,0)
-
 #define CPUID_CAPEX_FLAGS	"\20"	 \
 	"\1CLZERO"	"\2IRPERF"	"\3XSAVEERPTR"			 \
 	"\5RDPRU"			"\7B6" \
@@ -810,6 +805,11 @@
 	"\21IBRS_ALWAYSON" "\22STIBP_ALWAYSON" "\23PREFER_IBRS"	"\24B19" \
 	"\31SSBD"	"\32VIRT_SSBD"	"\33SSB_NO"
 
+/* %ecx */
+#define CPUID_CAPEX_PerfTscSize	__BITS(17,16)
+#define CPUID_CAPEX_ApicIdSize	__BITS(15,12)
+#define CPUID_CAPEX_NC		__BITS(7,0)
+
 /*
  * AMD SVM Revision and Feature.
  * CPUID Fn8000_000a



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

2022-01-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan 15 09:58:23 UTC 2022

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

Log Message:
Move CPUID_CAPEX_FLAGS next to %eax because it's for %eax.


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

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



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

2022-01-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan 15 09:55:14 UTC 2022

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

Log Message:
No functional change.

 - Modify comment. Add comment. Fix typo. Mainly taken from dragonfly.
 - Use __BIT().


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 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.182 src/sys/arch/x86/include/specialreg.h:1.183
--- src/sys/arch/x86/include/specialreg.h:1.182	Fri Jan 14 15:46:41 2022
+++ src/sys/arch/x86/include/specialreg.h	Sat Jan 15 09:55:13 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.182 2022/01/14 15:46:41 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.183 2022/01/15 09:55:13 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -97,29 +97,29 @@
 /*
  * CR4
  */
-#define CR4_VME		0x0001 /* virtual 8086 mode extension enable */
-#define CR4_PVI		0x0002 /* protected mode virtual interrupt enable */
-#define CR4_TSD		0x0004 /* restrict RDTSC instruction to cpl 0 */
-#define CR4_DE		0x0008 /* debugging extension */
-#define CR4_PSE		0x0010 /* large (4MB) page size enable */
-#define CR4_PAE		0x0020 /* physical address extension enable */
-#define CR4_MCE		0x0040 /* machine check enable */
-#define CR4_PGE		0x0080 /* page global enable */
-#define CR4_PCE		0x0100 /* enable RDPMC instruction for all cpls */
-#define CR4_OSFXSR	0x0200 /* enable fxsave/fxrestor and SSE */
-#define CR4_OSXMMEXCPT	0x0400 /* enable unmasked SSE exceptions */
-#define CR4_UMIP	0x0800 /* user-mode instruction prevention */
+#define CR4_VME		0x0001 /* Virtual 8086 mode extension enable */
+#define CR4_PVI		0x0002 /* Protected mode virtual interrupt enable */
+#define CR4_TSD		0x0004 /* Restrict RDTSC instruction to cpl 0 */
+#define CR4_DE		0x0008 /* Debugging extension */
+#define CR4_PSE		0x0010 /* Large (4MB) page size enable */
+#define CR4_PAE		0x0020 /* Physical address extension enable */
+#define CR4_MCE		0x0040 /* Machine check enable */
+#define CR4_PGE		0x0080 /* Page global enable */
+#define CR4_PCE		0x0100 /* Enable RDPMC instruction for all cpls */
+#define CR4_OSFXSR	0x0200 /* Enable fxsave/fxrestor and SSE */
+#define CR4_OSXMMEXCPT	0x0400 /* Enable unmasked SSE exceptions */
+#define CR4_UMIP	0x0800 /* User Mode Instruction Prevention */
 #define CR4_LA57	0x1000 /* 57-bit linear addresses */
-#define CR4_VMXE	0x2000 /* enable VMX operations */
-#define CR4_SMXE	0x4000 /* enable SMX operations */
-#define CR4_FSGSBASE	0x0001 /* enable *FSBASE and *GSBASE instructions */
-#define CR4_PCIDE	0x0002 /* enable Process Context IDentifiers */
-#define CR4_OSXSAVE	0x0004 /* enable xsave and xrestore */
-#define CR4_SMEP	0x0010 /* enable SMEP support */
-#define CR4_SMAP	0x0020 /* enable SMAP support */
-#define CR4_PKE		0x0040 /* enable Protection Keys for user pages */
-#define CR4_CET		0x0080 /* enable CET */
-#define CR4_PKS		0x0100 /* enable Protection Keys for kern pages */
+#define CR4_VMXE	0x2000 /* Enable VMX operations */
+#define CR4_SMXE	0x4000 /* Enable SMX operations */
+#define CR4_FSGSBASE	0x0001 /* Enable *FSBASE and *GSBASE instructions */
+#define CR4_PCIDE	0x0002 /* Enable Process Context IDentifiers */
+#define CR4_OSXSAVE	0x0004 /* Enable xsave and xrestore */
+#define CR4_SMEP	0x0010 /* Enable SMEP support */
+#define CR4_SMAP	0x0020 /* Enable SMAP support */
+#define CR4_PKE		0x0040 /* Enable Protection Keys for user pages */
+#define CR4_CET		0x0080 /* Enable CET */
+#define CR4_PKS		0x0100 /* Enable Protection Keys for kern pages */
 
 /*
  * Extended Control Register XCR0
@@ -172,17 +172,17 @@
 #define XSAVE_MAX_COMPONENT XSAVE_Hi16_ZMM
 
 /*
- * CPUID "features" bits
+ * "features" bits.
+ * CPUID Fn0001
  */
-
-/* Fn0001 %edx features */
+/* %edx */
 #define CPUID_FPU	0x0001	/* processor has an FPU? */
 #define CPUID_VME	0x0002	/* has virtual mode (%cr4's VME/PVI) */
 #define CPUID_DE	0x0004	/* has debugging extension */
 #define CPUID_PSE	0x0008	/* has 4MB page size extension */
 #define CPUID_TSC	0x0010	/* has time stamp counter */
 #define CPUID_MSR	0x0020	/* has model specific registers */
-#define CPUID_PAE	0x0040	/* has phys address extension */
+#define CPUID_PAE	0x0040	/* has physical address extension */
 #define CPUID_MCE	0x0080	/* has machine check exception */
 #define CPUID_CX8	0x0100	/* has CMPXCHG8B instruction */
 #define CPUID_APIC	0x0200	/* has enabled APIC */
@@ -193,17 +193,17 @@
 #define CPUID_CMOV	0x8000	/* has CMOVcc instruction */
 #define CPUID_PAT	0x0001	/* Page 

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

2022-01-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan 15 09:55:14 UTC 2022

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

Log Message:
No functional change.

 - Modify comment. Add comment. Fix typo. Mainly taken from dragonfly.
 - Use __BIT().


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

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



CVS commit: src/sys/arch/mips/mips

2022-01-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 08:56:41 UTC 2022

Modified Files:
src/sys/arch/mips/mips: db_interface.c

Log Message:
sort


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/mips/mips/db_interface.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/mips/mips/db_interface.c
diff -u src/sys/arch/mips/mips/db_interface.c:1.94 src/sys/arch/mips/mips/db_interface.c:1.95
--- src/sys/arch/mips/mips/db_interface.c:1.94	Sun May 23 23:22:55 2021
+++ src/sys/arch/mips/mips/db_interface.c	Sat Jan 15 08:56:41 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.94 2021/05/23 23:22:55 dholland Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.95 2022/01/15 08:56:41 skrll Exp $	*/
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.94 2021/05/23 23:22:55 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.95 2022/01/15 08:56:41 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -87,9 +87,9 @@ static void db_unwatch_cmd(db_expr_t, bo
 static void db_mach_cpu_cmd(db_expr_t, bool, db_expr_t, const char *);
 #endif
 
-void db_tlbdump_cmd(db_expr_t, bool, db_expr_t, const char *);
-void db_kvtophys_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_cp0dump_cmd(db_expr_t, bool, db_expr_t, const char *);
+void db_kvtophys_cmd(db_expr_t, bool, db_expr_t, const char *);
+void db_tlbdump_cmd(db_expr_t, bool, db_expr_t, const char *);
 #ifdef MIPS64_XLS
 void db_mfcr_cmd(db_expr_t, bool, db_expr_t, const char *);
 void db_mtcr_cmd(db_expr_t, bool, db_expr_t, const char *);



CVS commit: src/sys/arch/mips/mips

2022-01-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 08:56:41 UTC 2022

Modified Files:
src/sys/arch/mips/mips: db_interface.c

Log Message:
sort


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/mips/mips/db_interface.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

2022-01-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 08:14:37 UTC 2022

Modified Files:
src/sys/arch/aarch64/include: pmap.h
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Remove unnecessary brackets


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/aarch64/include/pmap.h
cvs rdiff -u -r1.171 -r1.172 src/sys/arch/arm/include/arm32/pmap.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/aarch64/include/pmap.h
diff -u src/sys/arch/aarch64/include/pmap.h:1.50 src/sys/arch/aarch64/include/pmap.h:1.51
--- src/sys/arch/aarch64/include/pmap.h:1.50	Fri Jan 14 07:21:53 2022
+++ src/sys/arch/aarch64/include/pmap.h	Sat Jan 15 08:14:37 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.50 2022/01/14 07:21:53 skrll Exp $ */
+/* $NetBSD: pmap.h,v 1.51 2022/01/15 08:14:37 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 #define	PMAP_TLB_NEED_SHOOTDOWN		1
 #endif
 
-#define	PMAP_TLB_FLUSH_ASID_ON_RESET	(true)
+#define	PMAP_TLB_FLUSH_ASID_ON_RESET	true
 
 /* Maximum number of ASIDs. Some CPUs have less.*/
 #define	PMAP_TLB_NUM_PIDS		65536

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.171 src/sys/arch/arm/include/arm32/pmap.h:1.172
--- src/sys/arch/arm/include/arm32/pmap.h:1.171	Sat Oct 16 07:04:36 2021
+++ src/sys/arch/arm/include/arm32/pmap.h	Sat Jan 15 08:14:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.171 2021/10/16 07:04:36 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.172 2022/01/15 08:14:37 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -89,7 +89,7 @@
 #if PMAP_TLB_MAX > 1
 #define	PMAP_TLB_NEED_SHOOTDOWN		1
 #endif
-#define	PMAP_TLB_FLUSH_ASID_ON_RESET	(arm_has_tlbiasid_p)
+#define	PMAP_TLB_FLUSH_ASID_ON_RESET	arm_has_tlbiasid_p
 #define	PMAP_TLB_NUM_PIDS		256
 #define	cpu_set_tlb_info(ci, ti)((void)((ci)->ci_tlb_info = (ti)))
 #if PMAP_TLB_MAX > 1



CVS commit: src/sys/arch

2022-01-15 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 08:14:37 UTC 2022

Modified Files:
src/sys/arch/aarch64/include: pmap.h
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Remove unnecessary brackets


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/aarch64/include/pmap.h
cvs rdiff -u -r1.171 -r1.172 src/sys/arch/arm/include/arm32/pmap.h

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



CVS commit: src/sys/arch/aarch64/aarch64

2022-01-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 07:39:04 UTC 2022

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

Log Message:
The translations that need invalidation are always last level so remove
the (dubious) logic around tracking the level.  The "any level" TLB
invalidation maintenance operation are used, but this may change after
further testing.

before
==
1661.0u 420.2s 2:53.82 1197.3% 231+29k 10+33918io 102pf+0w
1646.8u 425.2s 2:52.96 1198.0% 232+29k 1+33937io 49pf+0w
1647.9u 425.7s 2:52.58 1201.6% 232+29k 0+33940io 32pf+0w

After
=
1602.5u 420.8s 2:49.09 1196.6% 238+30k 24+33893io 54pf+0w
1600.7u 421.3s 2:51.53 1178.8% 238+30k 1+33914io 33pf+0w
1597.5u 424.3s 2:50.46 1186.1% 238+30k 0+33915io 17pf+0w

LGTM from ryo@


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

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.123 src/sys/arch/aarch64/aarch64/pmap.c:1.124
--- src/sys/arch/aarch64/aarch64/pmap.c:1.123	Fri Jan 14 07:21:53 2022
+++ src/sys/arch/aarch64/aarch64/pmap.c	Sat Jan 15 07:39:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.123 2022/01/14 07:21:53 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.124 2022/01/15 07:39:04 skrll Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.123 2022/01/14 07:21:53 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.124 2022/01/15 07:39:04 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -160,21 +160,13 @@ PMAP_COUNTER(unwire_failure, "pmap_unwir
 
 /*
  * invalidate TLB entry for ASID and VA.
- * `ll' invalidates only the Last Level (usually L3) of TLB entry
  */
-#define AARCH64_TLBI_BY_ASID_VA(asid, va, ll)\
-	do {\
-		if ((ll)) {		\
-			if ((asid) == 0)\
-aarch64_tlbi_by_va_ll((va));		\
-			else		\
-aarch64_tlbi_by_asid_va_ll((asid), (va)); \
-		} else {		\
-			if ((asid) == 0)\
-aarch64_tlbi_by_va((va));		\
-			else		\
-aarch64_tlbi_by_asid_va((asid), (va));	\
-		}			\
+#define AARCH64_TLBI_BY_ASID_VA(asid, va)			\
+	do {			\
+		if ((asid) == 0)\
+			aarch64_tlbi_by_va((va));		\
+		else		\
+			aarch64_tlbi_by_asid_va((asid), (va));	\
 	} while (0/*CONSTCOND*/)
 
 /*
@@ -182,10 +174,10 @@ PMAP_COUNTER(unwire_failure, "pmap_unwir
  * change the pte to be accessible temporarily before cpu_icache_sync_range().
  * this macro modifies PTE (*ptep). need to update PTE after this.
  */
-#define PTE_ICACHE_SYNC_PAGE(pte, ptep, asid, va, ll)			\
+#define PTE_ICACHE_SYNC_PAGE(pte, ptep, asid, va)			\
 	do {\
 		atomic_swap_64((ptep), (pte) | LX_BLKPAG_AF);		\
-		AARCH64_TLBI_BY_ASID_VA((asid), (va), (ll));		\
+		AARCH64_TLBI_BY_ASID_VA((asid), (va));			\
 		cpu_icache_sync_range((va), PAGE_SIZE);			\
 	} while (0/*CONSTCOND*/)
 
@@ -202,7 +194,7 @@ static void _pmap_remove(struct pmap *, 
 struct pv_entry **);
 static int _pmap_enter(struct pmap *, vaddr_t, paddr_t, vm_prot_t, u_int, bool);
 static int _pmap_get_pdp(struct pmap *, vaddr_t, bool, int, paddr_t *,
-struct vm_page **, bool *);
+struct vm_page **);
 
 static struct pmap kernel_pmap __cacheline_aligned;
 
@@ -753,7 +745,6 @@ pmap_growkernel(vaddr_t maxkvaddr)
 {
 	struct pmap *pm = pmap_kernel();
 	struct vm_page *pg;
-	bool l3only = true;
 	int error;
 	vaddr_t va;
 	paddr_t pa;
@@ -764,7 +755,7 @@ pmap_growkernel(vaddr_t maxkvaddr)
 
 	mutex_enter(>pm_lock);
 	for (va = pmap_maxkvaddr & L2_FRAME; va <= maxkvaddr; va += L2_SIZE) {
-		error = _pmap_get_pdp(pm, va, false, 0, , , );
+		error = _pmap_get_pdp(pm, va, false, 0, , );
 		if (error != 0) {
 			panic("%s: cannot allocate L3 table error=%d",
 			__func__, error);
@@ -986,10 +977,10 @@ pmap_icache_sync_range(pmap_t pm, vaddr_
 			cpu_tlb_info(ci));
 
 			atomic_swap_64(ptep, pte | LX_BLKPAG_AF);
-			AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, va, true);
+			AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, va);
 			cpu_icache_sync_range(va, len);
 			atomic_swap_64(ptep, pte);
-			AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, va, true);
+			AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, va);
 		}
 	}
 
@@ -1311,8 +1302,7 @@ _pmap_protect_pv(struct pmap_page *pp, s
 	struct pmap * const pm = pv->pv_pmap;
 	struct pmap_asid_info * const pai = PMAP_PAI(pm, cpu_tlb_info(ci));
 
-	AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, trunc_page(pv->pv_va),
-	true);
+	AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, trunc_page(pv->pv_va));
 }
 
 void
@@ -1415,17 +1405,17 @@ pmap_protect(struct pmap *pm, vaddr_t sv
 
 			if (!l3pte_readable(pte)) {
 PTE_ICACHE_SYNC_PAGE(pte, ptep, pai->pai_asid,
-va, true);
+va);
 atomic_swap_64(ptep, pte);
-AARCH64_TLBI_BY_ASID_VA(pai->pai_asid, va, true);
+

CVS commit: src/sys/arch/aarch64/aarch64

2022-01-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan 15 07:39:04 UTC 2022

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

Log Message:
The translations that need invalidation are always last level so remove
the (dubious) logic around tracking the level.  The "any level" TLB
invalidation maintenance operation are used, but this may change after
further testing.

before
==
1661.0u 420.2s 2:53.82 1197.3% 231+29k 10+33918io 102pf+0w
1646.8u 425.2s 2:52.96 1198.0% 232+29k 1+33937io 49pf+0w
1647.9u 425.7s 2:52.58 1201.6% 232+29k 0+33940io 32pf+0w

After
=
1602.5u 420.8s 2:49.09 1196.6% 238+30k 24+33893io 54pf+0w
1600.7u 421.3s 2:51.53 1178.8% 238+30k 1+33914io 33pf+0w
1597.5u 424.3s 2:50.46 1186.1% 238+30k 0+33915io 17pf+0w

LGTM from ryo@


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/arch/aarch64/aarch64/pmap.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/x86/x86

2022-01-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan 14 15:48:51 UTC 2022

Modified Files:
src/sys/arch/x86/x86: procfs_machdep.c

Log Message:
Update for cpuid flags:

 - The table 11 was changed from CPUID 0x0f leaf 0 %edx to a Linux mapping.
 - The table 12 was changed from CPUID 0x0f leaf 1 %edx to CPUID 0x07 leaf 1
   %edx. Print avx_vnni and avx512_bf16.
 - Print cppc, enqcmd and arch_lbr.
 - Modify linux mapping. No used on NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 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.42 src/sys/arch/x86/x86/procfs_machdep.c:1.43
--- src/sys/arch/x86/x86/procfs_machdep.c:1.42	Thu Oct  7 12:52:27 2021
+++ src/sys/arch/x86/x86/procfs_machdep.c	Fri Jan 14 15:48:50 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_machdep.c,v 1.42 2021/10/07 12:52:27 msaitoh Exp $ */
+/*	$NetBSD: procfs_machdep.c,v 1.43 2022/01/14 15:48:50 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.42 2021/10/07 12:52:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.43 2022/01/14 15:48:50 msaitoh Exp $");
 
 #include 
 #include 
@@ -120,10 +120,8 @@ static const char * const x86_features[]
 	NULL, "ibrs", "ibpb", "stibp", NULL, NULL, NULL, NULL},
 
 	{ /* (8) Linux mapping */
-	"tpr_shadow", "vnmi", "flexpriority", "ept",
-	"vpid", "npt", "lbrv", "svm_lock",
-	"nrip_save", "tsc_scale", "vmcb_clean", "flushbyasid",
-	"decodeassists", "pausefilter", "pfthreshold", "vmmcall",
+	"tpr_shadow", "vnmi", "flexpriority", "ept", "vpid", NULL, NULL, NULL,
+	NULL, NULL, NULL, NULL, NULL, NULL, NULL, "vmmcall",
 	NULL, "ept_ad", NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
@@ -141,15 +139,16 @@ static const char * const x86_features[]
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
-	{ /* (11) 0x000f:0 edx */
-	NULL, "cqm_llc", NULL, NULL, NULL, NULL, NULL, NULL,
+	{ /* (11) Linux mapping */
+	"cqm_llc", "cqm_occup_llc", "cqm_mbm_total", "cqm_mbm_local",
+	NULL, NULL, "split_lock_detect", NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
-	{ /* (12) 0x000f:1 edx */
-	"cqm_occup_llc", "cqm_mbm_total", "cqm_mbm_local", NULL,
+	{ /* (12) Intel-defined 0x0007:1 eax */
 	NULL, NULL, NULL, NULL,
+	"avx_vnni", "avx512_bf16", NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
@@ -158,7 +157,7 @@ static const char * const x86_features[]
 	"clzero", "irperf", "xsaveerptr", NULL, "rdpru", NULL, NULL, NULL,
 	NULL, "wbnoinvd", NULL, NULL, NULL, NULL, NULL, NULL,
 	NULL, NULL, NULL, NULL, NULL, NULL, NULL, "ppin",
-	NULL, "virt_ssbd", NULL, NULL, NULL, NULL, NULL, NULL},
+	NULL, "virt_ssbd", NULL, "cppc", NULL, NULL, NULL, NULL},
 
 	{ /* (14) 0x0006 eax */
 	"dtherm", "ida", "arat", NULL, "pln", NULL, "pts", "hwp",
@@ -181,7 +180,8 @@ static const char * const x86_features[]
 	"gfni", "vaes", "vpclmulqdq", "avx512_vnni",
 	"avx512_bitalg", "tme", "avx512_vpopcntdq", NULL,
 	"la57", NULL, NULL, NULL, NULL, NULL, "rdpid", NULL,
-	NULL, "cldemote", NULL, "movdiri", "movdir64b", NULL, "sgx_lc", NULL},
+	NULL, "cldemote", NULL, "movdiri",
+	"movdir64b", "enqcmd", "sgx_lc", NULL},
 
 	{ /* (17) 0x8007 ebx */
 	"overflow_recov", "succor", NULL, "smca", NULL, NULL, NULL, NULL,
@@ -192,7 +192,8 @@ static const char * const x86_features[]
 	{ /* (18) Intel 0x0007 edx */
 	NULL, NULL, "avx512_4vnniw", "avx512_4fmaps", "fsrm", NULL, NULL, NULL,
 	"vp2intersect", NULL, "md_clear", NULL, NULL, NULL, "serialize", NULL,
-	"tsxldtrk", NULL, "pconfig", NULL, NULL, NULL, NULL, "avx512_fp16",
+	"tsxldtrk", NULL, "pconfig", "arch_lbr",
+	NULL, NULL, NULL, "avx512_fp16",
 	NULL, NULL, NULL, NULL,
 	"flush_l1d", "arch_capabilities", NULL, "ssbd"},
 
@@ -307,13 +308,10 @@ procfs_getonecpufeatures(struct cpu_info
 		diff = last - *left;
 	}
 
-	if (ci->ci_max_cpuid >= 0x0f) {
-		x86_cpuid2(0x0f, 0, descs);
-		procfs_getonefeatreg(descs[3], x86_features[11], p + diff,
-		left);
-		diff = last - *left;
+	/* x86_features[11] is Linux defined mapping */
 
-		x86_cpuid2(0x0f, 1, descs);
+	if (ci->ci_max_cpuid >= 0x07) {
+		x86_cpuid2(0x07, 1, descs);
 		procfs_getonefeatreg(descs[3], x86_features[12], p + diff,
 		left);
 		diff = last - *left;



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

2022-01-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan 14 15:48:51 UTC 2022

Modified Files:
src/sys/arch/x86/x86: procfs_machdep.c

Log Message:
Update for cpuid flags:

 - The table 11 was changed from CPUID 0x0f leaf 0 %edx to a Linux mapping.
 - The table 12 was changed from CPUID 0x0f leaf 1 %edx to CPUID 0x07 leaf 1
   %edx. Print avx_vnni and avx512_bf16.
 - Print cppc, enqcmd and arch_lbr.
 - Modify linux mapping. No used on NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 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: src/sys/arch/x86/include

2022-01-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan 14 15:46:41 UTC 2022

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

Log Message:
Add Architectural LBR and Linear Address Masking.


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

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



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

2022-01-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan 14 15:46:41 UTC 2022

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

Log Message:
Add Architectural LBR and Linear Address Masking.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 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.181 src/sys/arch/x86/include/specialreg.h:1.182
--- src/sys/arch/x86/include/specialreg.h:1.181	Fri Jan 14 15:45:53 2022
+++ src/sys/arch/x86/include/specialreg.h	Fri Jan 14 15:46:41 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.181 2022/01/14 15:45:53 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.182 2022/01/14 15:46:41 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -497,6 +497,7 @@
 #define CPUID_SEF_HYBRID	__BIT(15) /* Hybrid part */
 #define CPUID_SEF_TSXLDTRK	__BIT(16) /* TSX suspend load addr tracking */
 #define CPUID_SEF_PCONFIG	__BIT(18) /* Platform CONFIGuration */
+#define CPUID_SEF_ARCH_LBR	__BIT(19) /* Architectural LBR */
 #define CPUID_SEF_CET_IBT	__BIT(20) /* CET Indirect Branch Tracking */
 #define CPUID_SEF_IBRS		__BIT(26) /* IBRS / IBPB Speculation Control */
 #define CPUID_SEF_STIBP		__BIT(27) /* STIBP Speculation Control */
@@ -510,7 +511,7 @@
 	"\5" "FSREP_MOV"		  \
 	"\11VP2INTERSECT" "\12SRBDS_CTRL" "\13MD_CLEAR"			  \
 			"\16TSX_FORCE_ABORT" "\17SERIALIZE" "\20HYBRID"	  \
-	"\21" "TSXLDTRK"		"\23" "PCONFIG"			  \
+	"\21" "TSXLDTRK"		"\23" "PCONFIG"	"\24" "ARCH_LBR"  \
 	"\25" "CET_IBT"			  \
 	"\33" "IBRS"	"\34" "STIBP"	  \
 	"\35" "L1D_FLUSH" "\36" "ARCH_CAP" "\37CORE_CAP" "\40" "SSBD"
@@ -522,11 +523,14 @@
 #define CPUID_SEF_FSRSB		__BIT(11) /* fast short REP STOSB */
 #define CPUID_SEF_FSRCS		__BIT(12) /* fast short REP CMPSB, REP SCASB */
 #define CPUID_SEF_HRESET	__BIT(22) /* HREST & IA32_HRESET_ENABLE MSR */
+#define CPUID_SEF_LAM		__BIT(26) /* Linear Address Masking */
 
 #define CPUID_SEF1_FLAGS_A	"\20"	\
 	"\5" "AVXVNNI"	"\6" "AVX512_BF16"\
 	"\13" "FZLRMS"	"\14" "FSRSB"	\
-	"\15" "FSRCS"			"\27" "HRESET"
+	"\15" "FSRCS"			"\27" "HRESET"			\
+	"\31" "LAM"
+
 /* %ecx = 1, %ebx */
 #define CPUID_SEF_PPIN		__BIT(0)  /* IA32_PPIN & IA32_PPIN_CTL MSRs */
 



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

2022-01-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan 14 15:45:53 UTC 2022

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

Log Message:
Both Intel and AMD says the name of CPUID 0x01 %edx bit 19 is "CLFSH".


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

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



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

2022-01-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Jan 14 15:45:53 UTC 2022

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

Log Message:
Both Intel and AMD says the name of CPUID 0x01 %edx bit 19 is "CLFSH".


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 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.180 src/sys/arch/x86/include/specialreg.h:1.181
--- src/sys/arch/x86/include/specialreg.h:1.180	Thu Jan 13 16:03:38 2022
+++ src/sys/arch/x86/include/specialreg.h	Fri Jan 14 15:45:53 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.180 2022/01/13 16:03:38 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.181 2022/01/14 15:45:53 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -211,7 +211,7 @@
 	"\5" "TSC"	"\6" "MSR"	"\7" "PAE"	"\10" "MCE"	\
 	"\11" "CX8"	"\12" "APIC"	"\13" "B10"	"\14" "SEP"	\
 	"\15" "MTRR"	"\16" "PGE"	"\17" "MCA"	"\20" "CMOV"	\
-	"\21" "PAT"	"\22" "PSE36"	"\23" "PN"	"\24" "CLFLUSH" \
+	"\21" "PAT"	"\22" "PSE36"	"\23" "PN"	"\24" "CLFSH"	\
 	"\25" "B20"	"\26" "DS"	"\27" "ACPI"	"\30" "MMX"	\
 	"\31" "FXSR"	"\32" "SSE"	"\33" "SSE2"	"\34" "SS"	\
 	"\35" "HTT"	"\36" "TM"	"\37" "IA64"	"\40" "PBE"



CVS commit: src/sys/arch/aarch64

2022-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 14 07:21:53 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c
src/sys/arch/aarch64/include: pmap.h

Log Message:
Restore the previous pmap_remove_all behaviour as the new method meant
the n1sdp couldn't complete a build.

No noticeable change in kernel build performance.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/aarch64/include/pmap.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/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.122 src/sys/arch/aarch64/aarch64/pmap.c:1.123
--- src/sys/arch/aarch64/aarch64/pmap.c:1.122	Tue Jan  4 05:55:45 2022
+++ src/sys/arch/aarch64/aarch64/pmap.c	Fri Jan 14 07:21:53 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.122 2022/01/04 05:55:45 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.123 2022/01/14 07:21:53 skrll Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.122 2022/01/04 05:55:45 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.123 2022/01/14 07:21:53 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -1511,7 +1511,6 @@ pmap_create(void)
 
 	kcpuset_create(>pm_active, true);
 	kcpuset_create(>pm_onproc, true);
-	pm->pm_remove_all = false;
 
 	pm->pm_l0table_pa = pmap_alloc_pdp(pm, NULL, 0, true);
 	KASSERT(pm->pm_l0table_pa != POOL_PADDR_INVALID);
@@ -1531,9 +1530,8 @@ pmap_destroy(struct pmap *pm)
 	unsigned int refcnt;
 
 	UVMHIST_FUNC(__func__);
-	UVMHIST_CALLARGS(pmaphist,
-	"pm=%p, pm_l0table=%016lx, pm_remove_all=%jd, refcnt=%jd",
-	pm, pm->pm_l0table, pm->pm_remove_all, pm->pm_refcnt);
+	UVMHIST_CALLARGS(pmaphist, "pm=%p, pm_l0table=%016lx, refcnt=%jd",
+	pm, pm->pm_l0table, pm->pm_refcnt, 0);
 
 	if (pm == NULL)
 		return;
@@ -1541,16 +1539,12 @@ pmap_destroy(struct pmap *pm)
 	if (pm == pmap_kernel())
 		panic("cannot destroy kernel pmap");
 
-	if (pm->pm_remove_all) {
-		pmap_tlb_asid_release_all(pm);
-		pm->pm_remove_all = false;
-	}
-
 	refcnt = atomic_dec_uint_nv(>pm_refcnt);
 	if (refcnt > 0)
 		return;
 
 	KASSERT(LIST_EMPTY(>pm_pvlist));
+	pmap_tlb_asid_release_all(pm);
 
 	_pmap_free_pdp_all(pm, true);
 	mutex_destroy(>pm_lock);
@@ -2054,41 +2048,6 @@ pmap_enter(struct pmap *pm, vaddr_t va, 
 }
 
 
-
-void
-pmap_update(pmap_t pm)
-{
-
-	UVMHIST_FUNC(__func__);
-	UVMHIST_CALLARGS(maphist, "pm=%#jx remove_all %jd", (uintptr_t)pm,
-	pm->pm_remove_all, 0, 0);
-
-	kpreempt_disable();
-	/*
-	 * If pmap_remove_all was called, we deactivated ourselves and released
-	 * our ASID.  Now we have to reactivate ourselves.
-	 */
-	if (__predict_false(pm->pm_remove_all)) {
-		pm->pm_remove_all = false;
-
-		KASSERT(pm != pmap_kernel());
-
-		/* this calls tlb_set_asid which calls cpu_set_ttbr0 */
-		pmap_tlb_asid_acquire(pm, curlwp);
-
-		/* Enable translation table walks using TTBR0 */
-		uint64_t tcr = reg_tcr_el1_read();
-		reg_tcr_el1_write(tcr & ~TCR_EPD0);
-		isb();
-
-		pm->pm_activated = true;
-	}
-
-	kpreempt_enable();
-
-	UVMHIST_LOG(maphist, "  <-- done", 0, 0, 0, 0);
-}
-
 bool
 pmap_remove_all(struct pmap *pm)
 {
@@ -2102,23 +2061,6 @@ pmap_remove_all(struct pmap *pm)
 
 	KASSERT(pm != pmap_kernel());
 
-	struct cpu_info * const ci = curcpu();
-	// This should be the last CPU with this pmap onproc
-	KASSERT(!kcpuset_isotherset(pm->pm_onproc, cpu_index(ci)));
-	if (kcpuset_isset(pm->pm_onproc, cpu_index(ci))) {
-		/* Disable translation table walks using TTBR0 */
-		uint64_t tcr = reg_tcr_el1_read();
-		reg_tcr_el1_write(tcr | TCR_EPD0);
-		isb();
-
-		pmap_tlb_asid_deactivate(pm);
-	}
-
-	KASSERT(kcpuset_iszero(pm->pm_onproc));
-
-	pmap_tlb_asid_release_all(pm);
-	pm->pm_remove_all = true;
-
 	UVMHIST_LOG(pmaphist, "pm=%p, asid=%d", pm,
 	PMAP_PAI(pm, cpu_tlb_info(ci))->pai_asid, 0, 0);
 
@@ -2155,6 +2097,8 @@ pmap_remove_all(struct pmap *pm)
 	/* clear L0 page table page */
 	pmap_zero_page(pm->pm_l0table_pa);
 
+	aarch64_tlbi_by_asid(PMAP_PAI(pm, cpu_tlb_info(ci))->pai_asid);
+
 	/* free L1-L3 page table pages, but not L0 */
 	_pmap_free_pdp_all(pm, false);
 

Index: src/sys/arch/aarch64/include/pmap.h
diff -u src/sys/arch/aarch64/include/pmap.h:1.49 src/sys/arch/aarch64/include/pmap.h:1.50
--- src/sys/arch/aarch64/include/pmap.h:1.49	Sun Oct 10 07:15:25 2021
+++ src/sys/arch/aarch64/include/pmap.h	Fri Jan 14 07:21:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.49 2021/10/10 07:15:25 skrll Exp $ */
+/* $NetBSD: pmap.h,v 1.50 2022/01/14 07:21:53 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -125,7 +125,6 @@ struct pmap {
 
 	struct pmap_asid_info pm_pai[PMAP_TLB_MAX];
 	bool pm_activated;
-	bool pm_remove_all;
 };
 
 static inline paddr_t
@@ -384,6 +383,7 @@ aarch64_mmap_flags(paddr_t mdpgno)
 

CVS commit: src/sys/arch/aarch64

2022-01-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 14 07:21:53 UTC 2022

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c
src/sys/arch/aarch64/include: pmap.h

Log Message:
Restore the previous pmap_remove_all behaviour as the new method meant
the n1sdp couldn't complete a build.

No noticeable change in kernel build performance.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/aarch64/include/pmap.h

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



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

2022-01-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 13 16:03:38 UTC 2022

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

Log Message:
Add some CPUID bits from the latest Intel SDM.

 - Last Branch Record.
 - Thread Director.
 - AVX version of VNNI.
 - Fast short REP MOV.
 - HRESET.
 - PPIN.


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 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.179 src/sys/arch/x86/include/specialreg.h:1.180
--- src/sys/arch/x86/include/specialreg.h:1.179	Thu Jan 13 00:21:41 2022
+++ src/sys/arch/x86/include/specialreg.h	Thu Jan 13 16:03:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.179 2022/01/13 00:21:41 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.180 2022/01/13 16:03:38 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -137,13 +137,14 @@
 #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_FLAGS1	"\20"		  \
 	"\1" "x87"	"\2" "SSE"	"\3" "AVX"	"\4" "BNDREGS"	  \
 	"\5" "BNDCSR"	"\6" "Opmask"	"\7" "ZMM_Hi256" "\10" "Hi16_ZMM" \
 	"\11" "PT"	"\12" "PKRU"			"\14" "CET_U"	  \
-	"\15" "CET_S"	"\16" "HDC"	  \
+	"\15" "CET_S"	"\16" "HDC"			"\20" "LBR"	  \
 	"\21" "HWP"
 
 /*
@@ -370,6 +371,7 @@
 #define CPUID_DSPM_HWP_FAST   __BIT(18)	/* Fast access for IA32_HWP_REQUEST */
 #define CPUID_DSPM_HW_FEEDBACK __BIT(19) /* HW_FEEDBACK*, IA32_PACKAGE_TERM* */
 #define CPUID_DSPM_HWP_IGNIDL __BIT(20)	/* Ignore Idle Logical Processor HWP */
+#define CPUID_DSPM_TD	__BIT(23)	/* Thread Director */
 
 #define CPUID_DSPM_FLAGS	"\20"	  \
 	"\1" "DTS"	"\2" "IDA"	"\3" "ARAT" 			  \
@@ -377,7 +379,7 @@
 	"\11" "HWP_NOTIFY" "\12" "HWP_ACTWIN" "\13" "HWP_EPP" "\14" "HWP_PLR" \
 			"\16" "HDC"	"\17" "TBM3"	"\20" "HWP_CAP"   \
 	"\21" "HWP_PECI" "\22" "HWP_FLEX" "\23" "HWP_FAST" "\24HW_FEEDBACK"   \
-	"\25" "HWP_IGNIDL"
+	"\25" "HWP_IGNIDL""\30" "TD"
 
 /*
  * Intel/AMD Digital Thermal Sensor and
@@ -385,8 +387,11 @@
  */
 #define CPUID_DSPM_HWF	__BIT(0)	/* MSR_APERF/MSR_MPERF available */
 #define CPUID_DSPM_EPB	__BIT(3)	/* Energy Performance Bias */
+#define CPUID_DSPM_NTDC	__BITS(15, 8)	/* Number of Thread Director Classes */
 
-#define CPUID_DSPM_FLAGS1	"\20" "\1" "HWF" "\4" "EPB"
+#define CPUID_DSPM_FLAGS1	"\177\20"\
+	"b\0HWF\0"	"b\3EPB\0"	\
+	"f\10\10NTDC\0"
 
 /*
  * Intel/AMD Structured Extended Feature leaf Fn_0007
@@ -511,9 +516,23 @@
 	"\35" "L1D_FLUSH" "\36" "ARCH_CAP" "\37CORE_CAP" "\40" "SSBD"
 
 /* %ecx = 1, %eax */
+#define CPUID_SEF_AVXVNNI	__BIT(4)  /* AVX version of VNNI */
 #define CPUID_SEF_AVX512_BF16	__BIT(5)
-#define CPUID_SEF1_FLAGS_A	"\20"			\
-"\6" "AVX512_BF16"
+#define CPUID_SEF_FZLRMS	__BIT(10) /* fast zero-length REP MOVSB */
+#define CPUID_SEF_FSRSB		__BIT(11) /* fast short REP STOSB */
+#define CPUID_SEF_FSRCS		__BIT(12) /* fast short REP CMPSB, REP SCASB */
+#define CPUID_SEF_HRESET	__BIT(22) /* HREST & IA32_HRESET_ENABLE MSR */
+
+#define CPUID_SEF1_FLAGS_A	"\20"	\
+	"\5" "AVXVNNI"	"\6" "AVX512_BF16"\
+	"\13" "FZLRMS"	"\14" "FSRSB"	\
+	"\15" "FSRCS"			"\27" "HRESET"
+/* %ecx = 1, %ebx */
+#define CPUID_SEF_PPIN		__BIT(0)  /* IA32_PPIN & IA32_PPIN_CTL MSRs */
+
+#define CPUID_SEF1_FLAGS_B	"\20"\
+"\1" "PPIN"
+
 /*
  * Intel CPUID Architectural Performance Monitoring Fn000a
  *



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

2022-01-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 13 16:03:38 UTC 2022

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

Log Message:
Add some CPUID bits from the latest Intel SDM.

 - Last Branch Record.
 - Thread Director.
 - AVX version of VNNI.
 - Fast short REP MOV.
 - HRESET.
 - PPIN.


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

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



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

2022-01-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 13 00:21:41 UTC 2022

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

Log Message:
 Use __BIT(). KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.178 -r1.179 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.178 src/sys/arch/x86/include/specialreg.h:1.179
--- src/sys/arch/x86/include/specialreg.h:1.178	Thu Sep 30 15:54:55 2021
+++ src/sys/arch/x86/include/specialreg.h	Thu Jan 13 00:21:41 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.178 2021/09/30 15:54:55 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.179 2022/01/13 00:21:41 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -139,12 +139,12 @@
 #define XCR0_HDC	0x2000	/* Hardware Duty Cycle state */
 #define XCR0_HWP	0x0001	/* Hardware P-states */
 
-#define XCR0_FLAGS1	"\20" \
-	"\1" "x87"		"\2" "SSE"		"\3" "AVX"	\
-	"\4" "BNDREGS"		"\5" "BNDCSR"		"\6" "Opmask"	\
-	"\7" "ZMM_Hi256"	"\10" "Hi16_ZMM"	"\11" "PT"	\
-	"\12" "PKRU"		"\14" "CET_U"		"\15" "CET_S"	\
-	"\16" "HDC"		"\21" "HWP"
+#define XCR0_FLAGS1	"\20"		  \
+	"\1" "x87"	"\2" "SSE"	"\3" "AVX"	"\4" "BNDREGS"	  \
+	"\5" "BNDCSR"	"\6" "Opmask"	"\7" "ZMM_Hi256" "\10" "Hi16_ZMM" \
+	"\11" "PT"	"\12" "PKRU"			"\14" "CET_U"	  \
+	"\15" "CET_S"	"\16" "HDC"	  \
+	"\21" "HWP"
 
 /*
  * Known FPU bits, only these get enabled. The save area is sized for all the
@@ -205,14 +205,14 @@
 #define CPUID_TM	0x2000	/* thermal monitor (TCC) */
 #define CPUID_PBE	0x8000	/* Pending Break Enable */
 
-#define CPUID_FLAGS1	"\20" \
-	"\1" "FPU"	"\2" "VME"	"\3" "DE"	"\4" "PSE" \
-	"\5" "TSC"	"\6" "MSR"	"\7" "PAE"	"\10" "MCE" \
-	"\11" "CX8"	"\12" "APIC"	"\13" "B10"	"\14" "SEP" \
-	"\15" "MTRR"	"\16" "PGE"	"\17" "MCA"	"\20" "CMOV" \
+#define CPUID_FLAGS1	"\20"		\
+	"\1" "FPU"	"\2" "VME"	"\3" "DE"	"\4" "PSE"	\
+	"\5" "TSC"	"\6" "MSR"	"\7" "PAE"	"\10" "MCE"	\
+	"\11" "CX8"	"\12" "APIC"	"\13" "B10"	"\14" "SEP"	\
+	"\15" "MTRR"	"\16" "PGE"	"\17" "MCA"	"\20" "CMOV"	\
 	"\21" "PAT"	"\22" "PSE36"	"\23" "PN"	"\24" "CLFLUSH" \
-	"\25" "B20"	"\26" "DS"	"\27" "ACPI"	"\30" "MMX" \
-	"\31" "FXSR"	"\32" "SSE"	"\33" "SSE2"	"\34" "SS" \
+	"\25" "B20"	"\26" "DS"	"\27" "ACPI"	"\30" "MMX"	\
+	"\31" "FXSR"	"\32" "SSE"	"\33" "SSE2"	"\34" "SS"	\
 	"\35" "HTT"	"\36" "TM"	"\37" "IA64"	"\40" "PBE"
 
 /* Blacklists of CPUID flags - used to mask certain features */
@@ -259,14 +259,14 @@
 #define CPUID2_RDRAND	0x4000	/* RDRAND (hardware random number) */
 #define CPUID2_RAZ	0x8000	/* RAZ. Indicates guest state. */
 
-#define CPUID2_FLAGS1	"\20" \
-	"\1" "SSE3"	"\2" "PCLMULQDQ" "\3" "DTES64"	"\4" "MONITOR" \
-	"\5" "DS-CPL"	"\6" "VMX"	"\7" "SMX"	"\10" "EST" \
-	"\11" "TM2"	"\12" "SSSE3"	"\13" "CID"	"\14" "SDBG" \
-	"\15" "FMA"	"\16" "CX16"	"\17" "xTPR"	"\20" "PDCM" \
-	"\21" "B16"	"\22" "PCID"	"\23" "DCA"	"\24" "SSE41" \
-	"\25" "SSE42"	"\26" "X2APIC"	"\27" "MOVBE"	"\30" "POPCNT" \
-	"\31" "DEADLINE" "\32" "AES"	"\33" "XSAVE"	"\34" "OSXSAVE" \
+#define CPUID2_FLAGS1	"\20"		\
+	"\1" "SSE3"	"\2" "PCLMULQDQ" "\3" "DTES64"	"\4" "MONITOR"	\
+	"\5" "DS-CPL"	"\6" "VMX"	"\7" "SMX"	"\10" "EST"	\
+	"\11" "TM2"	"\12" "SSSE3"	"\13" "CID"	"\14" "SDBG"	\
+	"\15" "FMA"	"\16" "CX16"	"\17" "xTPR"	"\20" "PDCM"	\
+	"\21" "B16"	"\22" "PCID"	"\23" "DCA"	"\24" "SSE41"	\
+	"\25" "SSE42"	"\26" "X2APIC"	"\27" "MOVBE"	"\30" "POPCNT"	\
+	"\31" "DEADLINE" "\32" "AES"	"\33" "XSAVE"	"\34" "OSXSAVE"	\
 	"\35" "AVX"	"\36" "F16C"	"\37" "RDRAND"	"\40" "RAZ"
 
 /* CPUID Fn0001 %eax */
@@ -351,19 +351,19 @@
  * Intel/AMD Digital Thermal Sensor and
  * Power Management, Fn_0006 - %eax.
  */
-#define CPUID_DSPM_DTS	__BIT(0)	/* Digital Thermal Sensor */
-#define CPUID_DSPM_IDA	__BIT(1)	/* Intel Dynamic Acceleration */
-#define CPUID_DSPM_ARAT	__BIT(2)	/* Always Running APIC Timer */
-#define CPUID_DSPM_PLN	__BIT(4)	/* Power Limit Notification */
-#define CPUID_DSPM_ECMD	__BIT(5)	/* Clock Modulation Extension */
-#define CPUID_DSPM_PTM	__BIT(6)	/* Package Level Thermal Management */
-#define CPUID_DSPM_HWP	__BIT(7)	/* HWP */
+#define CPUID_DSPM_DTS	  __BIT(0)	/* Digital Thermal Sensor */
+#define CPUID_DSPM_IDA	  __BIT(1)	/* Intel Dynamic Acceleration */
+#define CPUID_DSPM_ARAT	  __BIT(2)	/* Always Running APIC Timer */
+#define CPUID_DSPM_PLN	  __BIT(4)	/* Power Limit Notification */
+#define CPUID_DSPM_ECMD	  __BIT(5)	/* Clock Modulation Extension */
+#define CPUID_DSPM_PTM	  __BIT(6)	/* Package Level Thermal Management */
+#define CPUID_DSPM_HWP	  __BIT(7)	/* HWP */
 #define CPUID_DSPM_HWP_NOTIFY __BIT(8)	/* HWP Notification */
-#define CPUID_DSPM_HWP_ACTWIN  __BIT(9)	/* HWP Activity Window */
-#define CPUID_DSPM_HWP_EPP __BIT(10)	/* HWP Energy Performance 

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

2022-01-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 13 00:21:41 UTC 2022

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

Log Message:
 Use __BIT(). KNF. No functional change.


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

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



CVS commit: src/sys/arch/sparc64

2022-01-10 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Mon Jan 10 20:14:54 UTC 2022

Modified Files:
src/sys/arch/sparc64/include: sparc64.h
src/sys/arch/sparc64/sparc64: ofw_machdep.c

Log Message:
sun4v: add function to retrieve hypervisor api version


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/sparc64/include/sparc64.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/sparc64/sparc64/ofw_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/sparc64/include/sparc64.h
diff -u src/sys/arch/sparc64/include/sparc64.h:1.14 src/sys/arch/sparc64/include/sparc64.h:1.15
--- src/sys/arch/sparc64/include/sparc64.h:1.14	Sat Jul  3 19:18:55 2021
+++ src/sys/arch/sparc64/include/sparc64.h	Mon Jan 10 20:14:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sparc64.h,v 1.14 2021/07/03 19:18:55 palle Exp $	*/
+/*	$NetBSD: sparc64.h,v 1.15 2022/01/10 20:14:54 palle Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -60,6 +60,7 @@ bool prom_has_stop_other(void);
 void prom_startcpu(u_int, void *, u_long);
 int prom_startcpu_by_cpuid(u_int, void *, u_long arg);
 uint64_t prom_set_sun4v_api_version(uint64_t, uint64_t, uint64_t, uint64_t *);
+uint64_t prom_get_sun4v_api_version(uint64_t, uint64_t *, uint64_t *);
 void prom_sun4v_soft_state_supported(void);
 
 #endif	/* _MACHINE_SPARC64_H_ */

Index: src/sys/arch/sparc64/sparc64/ofw_machdep.c
diff -u src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.47 src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.48
--- src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.47	Sat Jul  3 19:18:55 2021
+++ src/sys/arch/sparc64/sparc64/ofw_machdep.c	Mon Jan 10 20:14:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_machdep.c,v 1.47 2021/07/03 19:18:55 palle Exp $	*/
+/*	$NetBSD: ofw_machdep.c,v 1.48 2022/01/10 20:14:54 palle Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -34,7 +34,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.47 2021/07/03 19:18:55 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.48 2022/01/10 20:14:54 palle Exp $");
 
 #include 
 #include 
@@ -676,7 +676,35 @@ prom_set_sun4v_api_version(uint64_t api_
 	*supported_minor = args.supported_minor;
 	return (uint64_t)args.status;
 }
+#if 1
+uint64_t
+prom_get_sun4v_api_version(uint64_t api_group, uint64_t* major, uint64_t* minor)
+{
+	static struct {
+		cell_t  name;
+		cell_t  nargs;
+		cell_t  nreturns;
+		cell_t  api_group;
+		cell_t	status;
+		cell_t  major;
+		cell_t  minor;
+	} args;
 
+	args.name = ADR2CELL("SUNW,get-sun4v-api-version");
+	args.nargs = 1;
+	args.nreturns = 3;
+	args.api_group = api_group;
+	args.status = -1;
+	args.major = -1;
+	args.minor = -1;
+
+	openfirmware();
+
+	*major = args.major;
+	*minor = args.minor;
+	return (uint64_t)args.status;
+}
+#endif
 void
 prom_sun4v_soft_state_supported(void)
 {



CVS commit: src/sys/arch/sparc64

2022-01-10 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Mon Jan 10 20:14:54 UTC 2022

Modified Files:
src/sys/arch/sparc64/include: sparc64.h
src/sys/arch/sparc64/sparc64: ofw_machdep.c

Log Message:
sun4v: add function to retrieve hypervisor api version


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/sparc64/include/sparc64.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/sparc64/sparc64/ofw_machdep.c

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



CVS commit: src/sys/arch/sparc64/sparc64

2022-01-09 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sun Jan  9 20:30:04 UTC 2022

Modified Files:
src/sys/arch/sparc64/sparc64: intr.c

Log Message:
sun4v: enable sun4v_intr_xxx() function previously imported from OpenBSD. Note 
that the sun4v_intr_devino_to_sysino() function is adapted to match OpenBSD 
version 1.57 (the introduction of INTR_DEVINO is done in revision 1.58)


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/sparc64/sparc64/intr.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/sparc64/sparc64

2022-01-09 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sun Jan  9 20:30:04 UTC 2022

Modified Files:
src/sys/arch/sparc64/sparc64: intr.c

Log Message:
sun4v: enable sun4v_intr_xxx() function previously imported from OpenBSD. Note 
that the sun4v_intr_devino_to_sysino() function is adapted to match OpenBSD 
version 1.57 (the introduction of INTR_DEVINO is done in revision 1.58)


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/sparc64/sparc64/intr.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/sparc64/sparc64/intr.c
diff -u src/sys/arch/sparc64/sparc64/intr.c:1.70 src/sys/arch/sparc64/sparc64/intr.c:1.71
--- src/sys/arch/sparc64/sparc64/intr.c:1.70	Sat Jul  3 19:18:55 2021
+++ src/sys/arch/sparc64/sparc64/intr.c	Sun Jan  9 20:30:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.70 2021/07/03 19:18:55 palle Exp $ */
+/*	$NetBSD: intr.c,v 1.71 2022/01/09 20:30:04 palle Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.70 2021/07/03 19:18:55 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.71 2022/01/09 20:30:04 palle Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -368,22 +368,16 @@ softint_trigger(uintptr_t machdep)
 
 uint64_t sun4v_group_interrupt_major;
 
-#if 0
-XXX notyet
-wint64_t
+int64_t
 sun4v_intr_devino_to_sysino(uint64_t devhandle, uint64_t devino, uint64_t *ino)
 {
 	if (sun4v_group_interrupt_major < 3)
 		return hv_intr_devino_to_sysino(devhandle, devino, ino);
 
-	KASSERT(INTVEC(devino) == devino);
-	*ino = devino | INTR_DEVINO;
+	*ino = devino;
 	return H_EOK;
 }
-#endif
 
-#if 0
-XXX notyet		
 int64_t
 sun4v_intr_setcookie(uint64_t devhandle, uint64_t ino, uint64_t cookie_value)
 {
@@ -392,10 +386,7 @@ sun4v_intr_setcookie(uint64_t devhandle,
 	
 	return hv_vintr_setcookie(devhandle, ino, cookie_value);
 }
-#endif
 
-#if 0
-XXX notyet		
 int64_t
 sun4v_intr_setenabled(uint64_t devhandle, uint64_t ino, uint64_t intr_enabled)
 {
@@ -404,10 +395,7 @@ sun4v_intr_setenabled(uint64_t devhandle
 
 	return hv_vintr_setenabled(devhandle, ino, intr_enabled);
 }
-#endif
 
-#if 0
-XXX notyet		
 int64_t
 sun4v_intr_setstate(uint64_t devhandle, uint64_t ino, uint64_t intr_state)
 {
@@ -416,10 +404,7 @@ sun4v_intr_setstate(uint64_t devhandle, 
 
 	return hv_vintr_setstate(devhandle, ino, intr_state);
 }
-#endif
 
-#if 0
-XXX notyet		
 int64_t
 sun4v_intr_settarget(uint64_t devhandle, uint64_t ino, uint64_t cpuid)
 {
@@ -428,6 +413,5 @@ sun4v_intr_settarget(uint64_t devhandle,
 
 	return hv_vintr_settarget(devhandle, ino, cpuid);
 }
-#endif
 
 #endif



CVS commit: src/sys/arch/cats

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 09:02:47 UTC 2022

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c
src/sys/arch/cats/conf: files.cats

Log Message:
defflag FCOM_INIT_ARM


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/cats/cats/cats_machdep.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/cats/conf/files.cats

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



CVS commit: src/sys/arch/cats

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 09:02:47 UTC 2022

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c
src/sys/arch/cats/conf: files.cats

Log Message:
defflag FCOM_INIT_ARM


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/cats/cats/cats_machdep.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/cats/conf/files.cats

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/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.92 src/sys/arch/cats/cats/cats_machdep.c:1.93
--- src/sys/arch/cats/cats/cats_machdep.c:1.92	Fri Aug 27 09:29:05 2021
+++ src/sys/arch/cats/cats/cats_machdep.c	Sat Jan  8 09:02:47 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.92 2021/08/27 09:29:05 skrll Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.93 2022/01/08 09:02:47 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,9 +40,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.92 2021/08/27 09:29:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.93 2022/01/08 09:02:47 skrll Exp $");
 
 #include "opt_arm_debug.h"
+#include "opt_cats.h"
 #include "opt_ddb.h"
 #include "opt_modular.h"
 

Index: src/sys/arch/cats/conf/files.cats
diff -u src/sys/arch/cats/conf/files.cats:1.38 src/sys/arch/cats/conf/files.cats:1.39
--- src/sys/arch/cats/conf/files.cats:1.38	Fri Apr  4 07:33:53 2014
+++ src/sys/arch/cats/conf/files.cats	Sat Jan  8 09:02:47 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: files.cats,v 1.38 2014/04/04 07:33:53 skrll Exp $
+#	$NetBSD: files.cats,v 1.39 2022/01/08 09:02:47 skrll Exp $
 #
 # CATS-specific configuration info
 #
@@ -19,6 +19,7 @@ defflag	XSERVER
 # ABLE booting ELF kernels
 defflag ABLEELF
 
+defflag opt_cats.h	FCOM_INIT_ARM
 #
 # ISA and mixed ISA+EISA or ISA+PCI drivers
 #



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

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 09:01:00 UTC 2022

Modified Files:
src/sys/arch/arm/arm: undefined.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/arm/arm/undefined.c

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

Modified files:

Index: src/sys/arch/arm/arm/undefined.c
diff -u src/sys/arch/arm/arm/undefined.c:1.73 src/sys/arch/arm/arm/undefined.c:1.74
--- src/sys/arch/arm/arm/undefined.c:1.73	Sat Jan  8 09:00:23 2022
+++ src/sys/arch/arm/arm/undefined.c	Sat Jan  8 09:01:00 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: undefined.c,v 1.73 2022/01/08 09:00:23 skrll Exp $	*/
+/*	$NetBSD: undefined.c,v 1.74 2022/01/08 09:01:00 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Ben Harris.
@@ -50,14 +50,14 @@
 #include "opt_kgdb.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: undefined.c,v 1.73 2022/01/08 09:00:23 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: undefined.c,v 1.74 2022/01/08 09:01:00 skrll Exp $");
 
 #include 
 #include 
-#include 
 #ifdef KGDB
 #include 
 #endif
+#include 
 #include 
 #include 
 #include 



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

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 09:01:00 UTC 2022

Modified Files:
src/sys/arch/arm/arm: undefined.c

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/arm/arm/undefined.c

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



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

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 09:00:23 UTC 2022

Modified Files:
src/sys/arch/arm/arm: undefined.c

Log Message:
Make VERBOSE_ARM32 compile again and reduce #ifdefs while I'm here


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

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



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

2022-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jan  8 09:00:23 UTC 2022

Modified Files:
src/sys/arch/arm/arm: undefined.c

Log Message:
Make VERBOSE_ARM32 compile again and reduce #ifdefs while I'm here


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

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

Modified files:

Index: src/sys/arch/arm/arm/undefined.c
diff -u src/sys/arch/arm/arm/undefined.c:1.72 src/sys/arch/arm/arm/undefined.c:1.73
--- src/sys/arch/arm/arm/undefined.c:1.72	Sun Oct 31 16:23:47 2021
+++ src/sys/arch/arm/arm/undefined.c	Sat Jan  8 09:00:23 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: undefined.c,v 1.72 2021/10/31 16:23:47 skrll Exp $	*/
+/*	$NetBSD: undefined.c,v 1.73 2022/01/08 09:00:23 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001 Ben Harris.
@@ -50,7 +50,7 @@
 #include "opt_kgdb.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: undefined.c,v 1.72 2021/10/31 16:23:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: undefined.c,v 1.73 2022/01/08 09:00:23 skrll Exp $");
 
 #include 
 #include 
@@ -71,7 +71,9 @@ __KERNEL_RCSID(0, "$NetBSD: undefined.c,
 #include 
 #include 
 
+#ifdef VERBOSE_ARM32
 #include 
+#endif
 
 #ifdef DDB
 #include 
@@ -307,9 +309,6 @@ undefinedinstruction(trapframe_t *tf)
 	int coprocessor;
 	int user;
 	struct undefined_handler *uh;
-#ifdef VERBOSE_ARM32
-	int s;
-#endif
 
 	curcpu()->ci_und_ev.ev_count++;
 
@@ -441,7 +440,7 @@ undefinedinstruction(trapframe_t *tf)
 		ksiginfo_t ksi;
 
 #ifdef VERBOSE_ARM32
-		s = spltty();
+		int s = spltty();
 
 		if ((fault_instruction & 0x0f10) == 0x0e00) {
 			printf("CDP\n");



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

2022-01-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan  5 20:21:29 UTC 2022

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

Log Message:
remove DIAGNOSTIC so that function is defined for KASSERTMSG. Hope that the
compiler removes it.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/xen/x86/xen_ipi.c

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



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

2022-01-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan  5 20:21:29 UTC 2022

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

Log Message:
remove DIAGNOSTIC so that function is defined for KASSERTMSG. Hope that the
compiler removes it.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/xen/x86/xen_ipi.c

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

Modified files:

Index: src/sys/arch/xen/x86/xen_ipi.c
diff -u src/sys/arch/xen/x86/xen_ipi.c:1.39 src/sys/arch/xen/x86/xen_ipi.c:1.40
--- src/sys/arch/xen/x86/xen_ipi.c:1.39	Thu May  7 15:48:58 2020
+++ src/sys/arch/xen/x86/xen_ipi.c	Wed Jan  5 15:21:29 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.39 2020/05/07 19:48:58 bouyer Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.40 2022/01/05 20:21:29 christos Exp $ */
 
 /*-
  * Copyright (c) 2011, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  * Based on: x86/ipi.c
  */
 
-__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.39 2020/05/07 19:48:58 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.40 2022/01/05 20:21:29 christos Exp $");
 
 #include "opt_ddb.h"
 
@@ -151,7 +151,6 @@ xen_ipi_init(void)
 	hypervisor_unmask_event(evtchn);
 }
 
-#ifdef DIAGNOSTIC
 static inline bool /* helper */
 valid_ipimask(uint32_t ipimask)
 {
@@ -166,7 +165,6 @@ valid_ipimask(uint32_t ipimask)
 	}
 
 }
-#endif
 
 int
 xen_send_ipi(struct cpu_info *ci, uint32_t ipimask)



CVS commit: src/sys/arch/evbarm/hdl_g

2022-01-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 10:38:05 UTC 2022

Modified Files:
src/sys/arch/evbarm/hdl_g: hdlg_machdep.c

Log Message:
Fix DIAGNOSTIC fallout


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/hdl_g/hdlg_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/evbarm/hdl_g/hdlg_machdep.c
diff -u src/sys/arch/evbarm/hdl_g/hdlg_machdep.c:1.32 src/sys/arch/evbarm/hdl_g/hdlg_machdep.c:1.33
--- src/sys/arch/evbarm/hdl_g/hdlg_machdep.c:1.32	Sat Nov 20 08:48:55 2021
+++ src/sys/arch/evbarm/hdl_g/hdlg_machdep.c	Tue Jan  4 10:38:04 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: hdlg_machdep.c,v 1.32 2021/11/20 08:48:55 rin Exp $	*/
+/*	$NetBSD: hdlg_machdep.c,v 1.33 2022/01/04 10:38:04 skrll Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdlg_machdep.c,v 1.32 2021/11/20 08:48:55 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdlg_machdep.c,v 1.33 2022/01/04 10:38:04 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_console.h"
@@ -228,9 +228,7 @@ vaddr_t
 initarm(void *arg)
 {
 	extern vaddr_t xscale_cache_clean_addr;
-#ifdef DIAGNOSTIC
 	extern vsize_t xscale_minidata_clean_size;
-#endif
 	int loop;
 	int loop1;
 	u_int l1pagetable;



CVS commit: src/sys/arch/evbarm/hdl_g

2022-01-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 10:38:05 UTC 2022

Modified Files:
src/sys/arch/evbarm/hdl_g: hdlg_machdep.c

Log Message:
Fix DIAGNOSTIC fallout


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/hdl_g/hdlg_machdep.c

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



CVS commit: src/sys/arch/aarch64/aarch64

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 05:55:45 UTC 2022

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

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/aarch64/aarch64/pmap.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.121 src/sys/arch/aarch64/aarch64/pmap.c:1.122
--- src/sys/arch/aarch64/aarch64/pmap.c:1.121	Fri Dec 10 20:36:02 2021
+++ src/sys/arch/aarch64/aarch64/pmap.c	Tue Jan  4 05:55:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.121 2021/12/10 20:36:02 andvar Exp $	*/
+/*	$NetBSD: pmap.c,v 1.122 2022/01/04 05:55:45 skrll Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.121 2021/12/10 20:36:02 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.122 2022/01/04 05:55:45 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -2011,7 +2011,7 @@ _pmap_enter(struct pmap *pm, vaddr_t va,
 		if (!l3pte_readable(pte)) {
 			PTE_ICACHE_SYNC_PAGE(pte, ptep, asid, va, l3only);
 			atomic_swap_64(ptep, pte);
-			AARCH64_TLBI_BY_ASID_VA(asid, va ,true);
+			AARCH64_TLBI_BY_ASID_VA(asid, va, true);
 		} else {
 			atomic_swap_64(ptep, pte);
 			AARCH64_TLBI_BY_ASID_VA(asid, va, l3only);



CVS commit: src/sys/arch/aarch64/aarch64

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 05:55:45 UTC 2022

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

Log Message:
KNF


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/arch/aarch64/aarch64/pmap.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/mips/include

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 05:39:12 UTC 2022

Modified Files:
src/sys/arch/mips/include: pmap.h

Log Message:
consistency. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/mips/include/pmap.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/mips/include/pmap.h
diff -u src/sys/arch/mips/include/pmap.h:1.75 src/sys/arch/mips/include/pmap.h:1.76
--- src/sys/arch/mips/include/pmap.h:1.75	Sun Dec 20 16:38:25 2020
+++ src/sys/arch/mips/include/pmap.h	Tue Jan  4 05:39:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.75 2020/12/20 16:38:25 skrll Exp $	*/
+/*	$NetBSD: pmap.h,v 1.76 2022/01/04 05:39:12 skrll Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -100,7 +100,7 @@ struct vm_page_md;
 
 #define	PMAP_VIRTUAL_CACHE_ALIASES
 #define	PMAP_INVALID_SEGTAB_ADDRESS	((pmap_segtab_t *)NULL)
-#define	PMAP_TLB_NEED_SHOOTDOWN
+#define	PMAP_TLB_NEED_SHOOTDOWN		1
 #define	PMAP_TLB_FLUSH_ASID_ON_RESET	false
 #if UPAGES > 1
 #define	PMAP_TLB_WIRED_UPAGES		MIPS3_TLB_WIRED_UPAGES



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

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jan  4 05:39:12 UTC 2022

Modified Files:
src/sys/arch/mips/include: pmap.h

Log Message:
consistency. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/mips/include/pmap.h

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



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

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan  3 08:44:11 UTC 2022

Modified Files:
src/sys/arch/arm/apple: files.apple

Log Message:
sort


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

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/apple/files.apple
diff -u src/sys/arch/arm/apple/files.apple:1.1 src/sys/arch/arm/apple/files.apple:1.2
--- src/sys/arch/arm/apple/files.apple:1.1	Mon Aug 30 23:26:26 2021
+++ src/sys/arch/arm/apple/files.apple	Mon Jan  3 08:44:10 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: files.apple,v 1.1 2021/08/30 23:26:26 jmcneill Exp $
+#	$NetBSD: files.apple,v 1.2 2022/01/03 08:44:10 skrll Exp $
 #
 # Configuration info for Apple Silicon SoCs
 #
@@ -6,25 +6,25 @@
 
 file	arch/arm/apple/apple_platform.c		soc_apple
 
+# IOMMU
+device	appledart
+attach	appledart at fdt with apple_dart
+file	arch/arm/apple/apple_dart.c		apple_dart
+
 # Interrupt controller
 device	appleintc: pic, pic_splfuncs
 attach	appleintc at fdt with apple_intc
 file	arch/arm/apple/apple_intc.c		apple_intc
 
-# Watchdog timer
-device	applewdog: sysmon_wdog
-attach	applewdog at fdt with apple_wdog
-file	arch/arm/apple/apple_wdog.c		apple_wdog
-
 # PCIe controller
 device	applepcie: pcibus, pcihost_fdt
 attach	applepcie at fdt with apple_pcie
 file	arch/arm/apple/apple_pcie.c		apple_pcie
 
-# IOMMU
-device	appledart
-attach	appledart at fdt with apple_dart
-file	arch/arm/apple/apple_dart.c		apple_dart
+# Watchdog timer
+device	applewdog: sysmon_wdog
+attach	applewdog at fdt with apple_wdog
+file	arch/arm/apple/apple_wdog.c		apple_wdog
 
 # SOC parameters
 defflag	opt_soc.hSOC_APPLE



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

2022-01-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Jan  3 08:44:11 UTC 2022

Modified Files:
src/sys/arch/arm/apple: files.apple

Log Message:
sort


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

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



CVS commit: src/sys/arch/iyonix/iyonix

2022-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan  2 16:42:10 UTC 2022

Modified Files:
src/sys/arch/iyonix/iyonix: iyonix_machdep.c

Log Message:
fix the build.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/iyonix/iyonix/iyonix_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/iyonix/iyonix/iyonix_machdep.c
diff -u src/sys/arch/iyonix/iyonix/iyonix_machdep.c:1.30 src/sys/arch/iyonix/iyonix/iyonix_machdep.c:1.31
--- src/sys/arch/iyonix/iyonix/iyonix_machdep.c:1.30	Sat Apr 18 07:00:41 2020
+++ src/sys/arch/iyonix/iyonix/iyonix_machdep.c	Sun Jan  2 11:42:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: iyonix_machdep.c,v 1.30 2020/04/18 11:00:41 skrll Exp $	*/
+/*	$NetBSD: iyonix_machdep.c,v 1.31 2022/01/02 16:42:10 christos Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iyonix_machdep.c,v 1.30 2020/04/18 11:00:41 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iyonix_machdep.c,v 1.31 2022/01/02 16:42:10 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -583,7 +583,9 @@ initarm(void *arg)
 	valloc_pages(kernelstack, UPAGES);
 
 	/* Allocate enough pages for cleaning the Mini-Data cache. */
+#ifdef DIAGNOSTIC
 	KASSERT(xscale_minidata_clean_size <= PAGE_SIZE);
+#endif
 	valloc_pages(minidataclean, 1);
 
 #ifdef VERBOSE_INIT_ARM



CVS commit: src/sys/arch/iyonix/iyonix

2022-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan  2 16:42:10 UTC 2022

Modified Files:
src/sys/arch/iyonix/iyonix: iyonix_machdep.c

Log Message:
fix the build.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/iyonix/iyonix/iyonix_machdep.c

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



CVS commit: src/sys/arch/zaurus/zaurus

2022-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan  2 16:40:46 UTC 2022

Modified Files:
src/sys/arch/zaurus/zaurus: machdep.c

Log Message:
fix the build (KASSERT)


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/zaurus/zaurus/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/zaurus/zaurus/machdep.c
diff -u src/sys/arch/zaurus/zaurus/machdep.c:1.48 src/sys/arch/zaurus/zaurus/machdep.c:1.49
--- src/sys/arch/zaurus/zaurus/machdep.c:1.48	Tue Aug 17 18:00:31 2021
+++ src/sys/arch/zaurus/zaurus/machdep.c	Sun Jan  2 11:40:46 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.48 2021/08/17 22:00:31 andvar Exp $	*/
+/*	$NetBSD: machdep.c,v 1.49 2022/01/02 16:40:46 christos Exp $	*/
 /*	$OpenBSD: zaurus_machdep.c,v 1.25 2006/06/20 18:24:04 todd Exp $	*/
 
 /*
@@ -107,7 +107,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.48 2021/08/17 22:00:31 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.49 2022/01/02 16:40:46 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -856,7 +856,9 @@ initarm(void *arg)
 	valloc_pages(kernelstack, UPAGES);
 
 	/* Allocate enough pages for cleaning the Mini-Data cache. */
+#ifdef DIAGNOSTIC
 	KASSERT(xscale_minidata_clean_size <= PAGE_SIZE);
+#endif
 	valloc_pages(minidataclean, 1);
 
 #ifdef KLOADER



CVS commit: src/sys/arch/zaurus/zaurus

2022-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan  2 16:40:46 UTC 2022

Modified Files:
src/sys/arch/zaurus/zaurus: machdep.c

Log Message:
fix the build (KASSERT)


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/zaurus/zaurus/machdep.c

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



CVS commit: src/sys/arch/mips/mips

2022-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan  2 16:03:46 UTC 2022

Modified Files:
src/sys/arch/mips/mips: mips_fixup.c

Log Message:
fix KASSERT issue


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mips/mips/mips_fixup.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/mips/mips/mips_fixup.c
diff -u src/sys/arch/mips/mips/mips_fixup.c:1.22 src/sys/arch/mips/mips/mips_fixup.c:1.23
--- src/sys/arch/mips/mips/mips_fixup.c:1.22	Sat Oct  2 10:28:04 2021
+++ src/sys/arch/mips/mips/mips_fixup.c	Sun Jan  2 11:03:46 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_fixup.c,v 1.22 2021/10/02 14:28:04 skrll Exp $	*/
+/*	$NetBSD: mips_fixup.c,v 1.23 2022/01/02 16:03:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mips_fixup.c,v 1.22 2021/10/02 14:28:04 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_fixup.c,v 1.23 2022/01/02 16:03:46 christos Exp $");
 
 #include "opt_mips3_wired.h"
 #include "opt_multiprocessor.h"
@@ -120,6 +120,7 @@ mips_fixup_exceptions(mips_fixup_callbac
 			if (addr <= load_addr
 			&& load_addr < addr + size
 			&& base == lui_reg) {
+#if defined(DIAGNOSTIC) || defined(DEBUG_VERBOSE)
 KASSERT(rt == _R_K0 || rt == _R_K1);
 #ifdef DEBUG_VERBOSE
 printf("%s: %#x: insn %08x: %s r%zu, %%lo(%08x)(r%zu)\n",
@@ -130,6 +131,7 @@ mips_fixup_exceptions(mips_fixup_callbac
 	: INSN_SW_P(insn) ? "sw" : "sd",
 rt, load_addr, base);
 #endif
+#endif
 new_insns[0] = lui_insn;
 new_insns[1] = *insnp;
 if ((callback)(load_addr, new_insns, arg)) {



CVS commit: src/sys/arch/mips/mips

2022-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan  2 16:03:46 UTC 2022

Modified Files:
src/sys/arch/mips/mips: mips_fixup.c

Log Message:
fix KASSERT issue


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mips/mips/mips_fixup.c

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



CVS commit: src/sys/arch/arm

2022-01-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jan  2 11:20:03 UTC 2022

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

Log Message:
arm: Remove #ifdef DIAGNOSTIC now wrong after KASSERT change.

Objects in question aren't volatile here so access is flushable.


To generate a diff of this commit:
cvs rdiff -u -r1.431 -r1.432 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/arm/cortex/gic.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.431 src/sys/arch/arm/arm32/pmap.c:1.432
--- src/sys/arch/arm/arm32/pmap.c:1.431	Sat Jan  1 15:09:01 2022
+++ src/sys/arch/arm/arm32/pmap.c	Sun Jan  2 11:20:03 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.431 2022/01/01 15:09:01 christos Exp $	*/
+/*	$NetBSD: pmap.c,v 1.432 2022/01/02 11:20:03 riastradh Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -192,7 +192,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.431 2022/01/01 15:09:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.432 2022/01/02 11:20:03 riastradh Exp $");
 
 #include 
 #include 
@@ -3747,9 +3747,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v
 		PMAPCOUNT(kenter_remappings);
 #ifdef PMAP_CACHE_VIPT
 		opg = PHYS_TO_VM_PAGE(l2pte_pa(opte));
-#if !defined(ARM_MMU_EXTENDED) || defined(DIAGNOSTIC)
-		struct vm_page_md *omd __diagused = VM_PAGE_TO_MD(opg);
-#endif
+		struct vm_page_md *omd = VM_PAGE_TO_MD(opg);
 		if (opg && arm_cache_prefer_mask != 0) {
 			KASSERT(opg != pg);
 			KASSERT((omd->pvh_attrs & PVF_KMPAGE) == 0);

Index: src/sys/arch/arm/cortex/gic.c
diff -u src/sys/arch/arm/cortex/gic.c:1.51 src/sys/arch/arm/cortex/gic.c:1.52
--- src/sys/arch/arm/cortex/gic.c:1.51	Thu Oct 21 04:47:57 2021
+++ src/sys/arch/arm/cortex/gic.c	Sun Jan  2 11:20:03 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: gic.c,v 1.51 2021/10/21 04:47:57 skrll Exp $	*/
+/*	$NetBSD: gic.c,v 1.52 2022/01/02 11:20:03 riastradh Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gic.c,v 1.51 2021/10/21 04:47:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic.c,v 1.52 2022/01/02 11:20:03 riastradh Exp $");
 
 #include 
 #include 
@@ -321,10 +321,8 @@ armgic_irq_handler(void *tf)
 	struct cpu_info * const ci = curcpu();
 	struct armgic_softc * const sc = _softc;
 	const int old_ipl = ci->ci_cpl;
-#ifdef DIAGNOSTIC
 	const int old_mtx_count = ci->ci_mtx_count;
 	const int old_l_biglocks = ci->ci_curlwp->l_biglocks;
-#endif
 #ifdef DEBUG
 	size_t n = 0;
 #endif



CVS commit: src/sys/arch/arm

2022-01-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jan  2 11:20:03 UTC 2022

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

Log Message:
arm: Remove #ifdef DIAGNOSTIC now wrong after KASSERT change.

Objects in question aren't volatile here so access is flushable.


To generate a diff of this commit:
cvs rdiff -u -r1.431 -r1.432 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/arm/cortex/gic.c

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



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

2022-01-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jan  2 11:17:39 UTC 2022

Modified Files:
src/sys/arch/arm/pic: pic.c

Log Message:
arm: No #if DIAGNOSTIC needed any more.

Compiler can (and gcc does) flush call to strlen when the result is
unused, so no performance impact here.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/arm/pic/pic.c

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

Modified files:

Index: src/sys/arch/arm/pic/pic.c
diff -u src/sys/arch/arm/pic/pic.c:1.78 src/sys/arch/arm/pic/pic.c:1.79
--- src/sys/arch/arm/pic/pic.c:1.78	Tue Dec 21 07:11:02 2021
+++ src/sys/arch/arm/pic/pic.c	Sun Jan  2 11:17:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic.c,v 1.78 2021/12/21 07:11:02 skrll Exp $	*/
+/*	$NetBSD: pic.c,v 1.79 2022/01/02 11:17:39 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.78 2021/12/21 07:11:02 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.79 2022/01/02 11:17:39 riastradh Exp $");
 
 #include 
 #include 
@@ -575,9 +575,7 @@ pic_percpu_allocate(void *v0, void *v1, 
 	KASSERT(pcpu->pcpu_evs != NULL);
 
 #define	PCPU_NAMELEN	32
-#ifdef DIAGNOSTIC
 	const size_t namelen = strlen(pic->pic_name) + 4 + strlen(ci->ci_data.cpu_name);
-#endif
 
 	KASSERT(namelen < PCPU_NAMELEN);
 	pcpu->pcpu_name = kmem_alloc(PCPU_NAMELEN, KM_SLEEP);



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

2022-01-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jan  2 11:17:39 UTC 2022

Modified Files:
src/sys/arch/arm/pic: pic.c

Log Message:
arm: No #if DIAGNOSTIC needed any more.

Compiler can (and gcc does) flush call to strlen when the result is
unused, so no performance impact here.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/arm/pic/pic.c

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



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

2022-01-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan  1 15:09:01 UTC 2022

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

Log Message:
KASSERT now always uses the expression, so don't protect with DIAGNOSTIC


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

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.430 src/sys/arch/arm/arm32/pmap.c:1.431
--- src/sys/arch/arm/arm32/pmap.c:1.430	Thu Aug 26 04:56:21 2021
+++ src/sys/arch/arm/arm32/pmap.c	Sat Jan  1 10:09:01 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.430 2021/08/26 08:56:21 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.431 2022/01/01 15:09:01 christos Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -192,7 +192,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.430 2021/08/26 08:56:21 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.431 2022/01/01 15:09:01 christos Exp $");
 
 #include 
 #include 
@@ -529,13 +529,11 @@ pmap_release_page_lock(struct vm_page_md
 	mutex_exit(_lock);
 }
 
-#ifdef DIAGNOSTIC
 static inline int
 pmap_page_locked_p(struct vm_page_md *md)
 {
 	return mutex_owned(_lock);
 }
-#endif
 
 
 /*



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

2022-01-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan  1 15:09:01 UTC 2022

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

Log Message:
KASSERT now always uses the expression, so don't protect with DIAGNOSTIC


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

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



CVS commit: src/sys/arch

2022-01-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jan  1 13:47:20 UTC 2022

Modified Files:
src/sys/arch/arm/altera: cycv_rstmgr.c
src/sys/arch/arm/sunxi: sunxi_debe.c
src/sys/arch/bebox/stand/boot: siop.c

Log Message:
s/coudn/couldn/ and s/couln/couldn/ in comment and log messages.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/altera/cycv_rstmgr.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/sunxi/sunxi_debe.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/bebox/stand/boot/siop.c

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

Modified files:

Index: src/sys/arch/arm/altera/cycv_rstmgr.c
diff -u src/sys/arch/arm/altera/cycv_rstmgr.c:1.4 src/sys/arch/arm/altera/cycv_rstmgr.c:1.5
--- src/sys/arch/arm/altera/cycv_rstmgr.c:1.4	Wed Jan 27 03:10:18 2021
+++ src/sys/arch/arm/altera/cycv_rstmgr.c	Sat Jan  1 13:47:19 2022
@@ -1,9 +1,9 @@
-/* $NetBSD: cycv_rstmgr.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $ */
+/* $NetBSD: cycv_rstmgr.c,v 1.5 2022/01/01 13:47:19 andvar Exp $ */
 
 /* This file is in the public domain. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cycv_rstmgr.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cycv_rstmgr.c,v 1.5 2022/01/01 13:47:19 andvar Exp $");
 
 #include 
 #include 
@@ -111,7 +111,7 @@ cycv_rst_acquire(device_t dev, const voi
 
 	if (0) {
 err_decode:
-		aprint_debug_dev(dev, "couln't decode reset\n");
+		aprint_debug_dev(dev, "couldn't decode reset\n");
 	}
 	return reset;
 }

Index: src/sys/arch/arm/sunxi/sunxi_debe.c
diff -u src/sys/arch/arm/sunxi/sunxi_debe.c:1.15 src/sys/arch/arm/sunxi/sunxi_debe.c:1.16
--- src/sys/arch/arm/sunxi/sunxi_debe.c:1.15	Fri Aug 20 20:25:27 2021
+++ src/sys/arch/arm/sunxi/sunxi_debe.c	Sat Jan  1 13:47:19 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_debe.c,v 1.15 2021/08/20 20:25:27 andvar Exp $ */
+/* $NetBSD: sunxi_debe.c,v 1.16 2022/01/01 13:47:19 andvar Exp $ */
 
 /*-
  * Copyright (c) 2018 Manuel Bouyer 
@@ -38,7 +38,7 @@
 #define SUNXI_DEBE_CURMAX	64
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_debe.c,v 1.15 2021/08/20 20:25:27 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_debe.c,v 1.16 2022/01/01 13:47:19 andvar Exp $");
 
 #include 
 #include 
@@ -238,7 +238,7 @@ sunxi_debe_doreset(void)
 		error = clk_set_rate(sc->sc_clk_mod, 3);
 		if (error) {
 			aprint_error_dev(dev,
-			"couln't set mod clock rate (%d)\n", error);
+			"couldn't set mod clock rate (%d)\n", error);
 			return;
 		}
 

Index: src/sys/arch/bebox/stand/boot/siop.c
diff -u src/sys/arch/bebox/stand/boot/siop.c:1.7 src/sys/arch/bebox/stand/boot/siop.c:1.8
--- src/sys/arch/bebox/stand/boot/siop.c:1.7	Fri Dec 27 09:41:49 2019
+++ src/sys/arch/bebox/stand/boot/siop.c	Sat Jan  1 13:47:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: siop.c,v 1.7 2019/12/27 09:41:49 msaitoh Exp $	*/
+/*	$NetBSD: siop.c,v 1.8 2022/01/01 13:47:19 andvar Exp $	*/
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -854,7 +854,7 @@ scsi_request_sense(struct siop_adapter *
 		xs->error = XS_RESET;
 		return;
 	case EIO:
-		 /* request sense coudn't be performed */
+		 /* request sense couldn't be performed */
 		/*
 		 * XXX this isn't quite right but we don't have anything
 		 * better for now



CVS commit: src/sys/arch

2022-01-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Jan  1 13:47:20 UTC 2022

Modified Files:
src/sys/arch/arm/altera: cycv_rstmgr.c
src/sys/arch/arm/sunxi: sunxi_debe.c
src/sys/arch/bebox/stand/boot: siop.c

Log Message:
s/coudn/couldn/ and s/couln/couldn/ in comment and log messages.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/altera/cycv_rstmgr.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/sunxi/sunxi_debe.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/bebox/stand/boot/siop.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/sparc64/sparc64

2022-01-01 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sat Jan  1 11:56:15 UTC 2022

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

Log Message:
Remove an "#ifdef DIAGNOSTIC", KASSERT() always conumes its expression.


To generate a diff of this commit:
cvs rdiff -u -r1.312 -r1.313 src/sys/arch/sparc64/sparc64/pmap.c

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/pmap.c
diff -u src/sys/arch/sparc64/sparc64/pmap.c:1.312 src/sys/arch/sparc64/sparc64/pmap.c:1.313
--- src/sys/arch/sparc64/sparc64/pmap.c:1.312	Sat Mar 14 14:05:43 2020
+++ src/sys/arch/sparc64/sparc64/pmap.c	Sat Jan  1 11:56:15 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.312 2020/03/14 14:05:43 ad Exp $	*/
+/*	$NetBSD: pmap.c,v 1.313 2022/01/01 11:56:15 hannken Exp $	*/
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.312 2020/03/14 14:05:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.313 2022/01/01 11:56:15 hannken Exp $");
 
 #undef	NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define	HWREF
@@ -1537,9 +1537,7 @@ pmap_destroy(struct pmap *pm)
 
 	/* we could be a little smarter and leave pages zeroed */
 	while ((pg = TAILQ_FIRST(>pm_ptps)) != NULL) {
-#ifdef DIAGNOSTIC
 		struct vm_page_md *md = VM_PAGE_TO_MD(pg);
-#endif
 
 		TAILQ_REMOVE(>pm_ptps, pg, pageq.queue);
 		KASSERT(md->mdpg_pvh.pv_pmap == NULL);



CVS commit: src/sys/arch/sparc64/sparc64

2022-01-01 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sat Jan  1 11:56:15 UTC 2022

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

Log Message:
Remove an "#ifdef DIAGNOSTIC", KASSERT() always conumes its expression.


To generate a diff of this commit:
cvs rdiff -u -r1.312 -r1.313 src/sys/arch/sparc64/sparc64/pmap.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

2022-01-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan  1 11:45:37 UTC 2022

Modified Files:
src/sys/arch/amiga/dev: grf_cv.c grf_cv3d.c

Log Message:
s/frambuffer/framebuffer/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/amiga/dev/grf_cv.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/amiga/dev/grf_cv3d.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/grf_cv.c
diff -u src/sys/arch/amiga/dev/grf_cv.c:1.62 src/sys/arch/amiga/dev/grf_cv.c:1.63
--- src/sys/arch/amiga/dev/grf_cv.c:1.62	Sun Dec 26 16:08:19 2021
+++ src/sys/arch/amiga/dev/grf_cv.c	Sat Jan  1 11:45:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_cv.c,v 1.62 2021/12/26 16:08:19 andvar Exp $ */
+/*	$NetBSD: grf_cv.c,v 1.63 2022/01/01 11:45:37 msaitoh Exp $ */
 
 /*
  * Copyright (c) 1995 Michael Teske
@@ -33,7 +33,7 @@
 #include "opt_amigacons.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grf_cv.c,v 1.62 2021/12/26 16:08:19 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf_cv.c,v 1.63 2022/01/01 11:45:37 msaitoh Exp $");
 
 #include "grfcv.h"
 #include "ite.h"
@@ -404,7 +404,7 @@ cvintr(void *arg)
 }
 
 /*
- * Get frambuffer memory size.
+ * Get framebuffer memory size.
  * phase5 didn't provide the bit in CR36,
  * so we have to do it this way.
  * Return 0 for 2MB, 1 for 4MB

Index: src/sys/arch/amiga/dev/grf_cv3d.c
diff -u src/sys/arch/amiga/dev/grf_cv3d.c:1.37 src/sys/arch/amiga/dev/grf_cv3d.c:1.38
--- src/sys/arch/amiga/dev/grf_cv3d.c:1.37	Sun Dec 26 16:08:19 2021
+++ src/sys/arch/amiga/dev/grf_cv3d.c	Sat Jan  1 11:45:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_cv3d.c,v 1.37 2021/12/26 16:08:19 andvar Exp $ */
+/*	$NetBSD: grf_cv3d.c,v 1.38 2022/01/01 11:45:37 msaitoh Exp $ */
 
 /*
  * Copyright (c) 1995 Michael Teske
@@ -33,7 +33,7 @@
 #include "opt_amigacons.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grf_cv3d.c,v 1.37 2021/12/26 16:08:19 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf_cv3d.c,v 1.38 2022/01/01 11:45:37 msaitoh Exp $");
 
 #include "grfcv3d.h"
 #include "ite.h"
@@ -345,7 +345,7 @@ static struct cfdata *cfdata;
 #define CV3D_ULCURSOR	1	/* Underlined Cursor in textmode */
 
 /*
- * Get frambuffer memory size.
+ * Get framebuffer memory size.
  * phase5 didn't provide the bit in CR36,
  * so we have to do it this way.
  * Return 0 for 2MB, 1 for 4MB



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

2022-01-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan  1 11:45:37 UTC 2022

Modified Files:
src/sys/arch/amiga/dev: grf_cv.c grf_cv3d.c

Log Message:
s/frambuffer/framebuffer/ in comment.


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

2021-12-31 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Jan  1 01:15:12 UTC 2022

Modified Files:
src/sys/arch/powerpc/powerpc: fixup.c

Log Message:
more KASSERT vs. DIAGNOSTIC fallout


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

2021-12-31 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Jan  1 01:15:12 UTC 2022

Modified Files:
src/sys/arch/powerpc/powerpc: fixup.c

Log Message:
more KASSERT vs. DIAGNOSTIC fallout


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/powerpc/powerpc/fixup.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/powerpc/powerpc/fixup.c
diff -u src/sys/arch/powerpc/powerpc/fixup.c:1.12 src/sys/arch/powerpc/powerpc/fixup.c:1.13
--- src/sys/arch/powerpc/powerpc/fixup.c:1.12	Mon Jul  6 10:31:24 2020
+++ src/sys/arch/powerpc/powerpc/fixup.c	Sat Jan  1 01:15:11 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: fixup.c,v 1.12 2020/07/06 10:31:24 rin Exp $	*/
+/*	$NetBSD: fixup.c,v 1.13 2022/01/01 01:15:11 macallan Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fixup.c,v 1.12 2020/07/06 10:31:24 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fixup.c,v 1.13 2022/01/01 01:15:11 macallan Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ppcarch.h"
@@ -186,7 +186,9 @@ powerpc_fixup_stubs(uint32_t *start, uin
 break;
 			}
 			case OPC_STW: {
+#ifdef DIAGNOSTIC
 KASSERT((i.i_d.i_rs == r_lr || i.i_d.i_rs == 31) && i.i_d.i_ra == 1);
+#endif
 break;
 			}
 			case OPC_STWU: {
@@ -195,8 +197,10 @@ powerpc_fixup_stubs(uint32_t *start, uin
 break;
 			}
 			case OPC_branch_19: {
+#ifdef DIAGNOSTIC
 KASSERT(r_lr == -1 || i.i_int == 0x4e800421);
 KASSERT(r_lr != -1 || i.i_int == 0x4e800420);
+#endif
 if (ctr == 0) {
 	panic("%s: jump at %p to %p would "
 	"branch to 0", __func__, insnp,



CVS commit: src/sys/arch/hppa/hppa

2021-12-31 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Jan  1 01:03:50 UTC 2022

Modified Files:
src/sys/arch/hppa/hppa: vm_machdep.c

Log Message:
make this compile again by moving a KASSERT into the #ifdef DIAGNOSTIC block
it depends on


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/hppa/hppa/vm_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/hppa/hppa/vm_machdep.c
diff -u src/sys/arch/hppa/hppa/vm_machdep.c:1.55 src/sys/arch/hppa/hppa/vm_machdep.c:1.56
--- src/sys/arch/hppa/hppa/vm_machdep.c:1.55	Mon Apr 15 06:16:42 2019
+++ src/sys/arch/hppa/hppa/vm_machdep.c	Sat Jan  1 01:03:50 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.55 2019/04/15 06:16:42 skrll Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.56 2022/01/01 01:03:50 macallan Exp $	*/
 
 /*	$OpenBSD: vm_machdep.c,v 1.64 2008/09/30 18:54:26 miod Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.55 2019/04/15 06:16:42 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.56 2022/01/01 01:03:50 macallan Exp $");
 
 #include 
 #include 
@@ -62,9 +62,8 @@ cpu_activate_pcb(struct lwp *l)
 #ifdef DIAGNOSTIC
 	vaddr_t uarea = (vaddr_t)pcb;
 	vaddr_t maxsp = uarea + USPACE;
-#endif
 	KASSERT(tf == (void *)(uarea + PAGE_SIZE));
-
+#endif
 	/*
 	 * Stash the physical address of FP regs for later perusal
 	 */



CVS commit: src/sys/arch/hppa/hppa

2021-12-31 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Jan  1 01:03:50 UTC 2022

Modified Files:
src/sys/arch/hppa/hppa: vm_machdep.c

Log Message:
make this compile again by moving a KASSERT into the #ifdef DIAGNOSTIC block
it depends on


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/hppa/hppa/vm_machdep.c

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



CVS commit: src/sys/arch/i386/stand/lib

2021-12-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Dec 28 00:37:16 UTC 2021

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
In biosdisk_findpartition() check if part_name isn't NULL before
assigning *part_name.

Thanks to manu@ for the pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib

2021-12-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Dec 28 00:37:16 UTC 2021

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
In biosdisk_findpartition() check if part_name isn't NULL before
assigning *part_name.

Thanks to manu@ for the pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib/biosdisk.c
diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.56 src/sys/arch/i386/stand/lib/biosdisk.c:1.57
--- src/sys/arch/i386/stand/lib/biosdisk.c:1.56	Tue Dec 28 00:34:30 2021
+++ src/sys/arch/i386/stand/lib/biosdisk.c	Tue Dec 28 00:37:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosdisk.c,v 1.56 2021/12/28 00:34:30 simonb Exp $	*/
+/*	$NetBSD: biosdisk.c,v 1.57 2021/12/28 00:37:16 simonb Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998
@@ -1028,7 +1028,8 @@ biosdisk_findpartition(int biosdev, dadd
 {
 #if defined(NO_DISKLABEL) && defined(NO_GPT)
 	*partition = 0;
-	*part_name = NULL;
+	if (part_name)
+		*part_name = NULL;
 	return 0;
 #else
 	int i;
@@ -1047,7 +1048,8 @@ biosdisk_findpartition(int biosdev, dadd
 
 	/* default to first partition */
 	*partition = 0;
-	*part_name = NULL;
+	if (part_name)
+		*part_name = NULL;
 
 	/* Look for netbsd partition that is the dos boot one */
 	d = alloc_biosdisk(biosdev);



Re: CVS commit: src/sys/arch/i386/stand/efiboot

2021-12-27 Thread Simon Burge
Emmanuel Dreyfus wrote:

> In src/sys/arch/i386/stand/lib/biosdisk.c
> int
> biosdisk_findpartition(int biosdev, daddr_t sector,
>int *partition, const char **part_name)
> {
> (...)
> /* default ot first partition */
> *partition = 0;
> *part_name = NULL;
>
> part_name is NULL, *part_name crashes. How do you avoid that?

Aha, I have this elsewhere in my zfs tree:

*partition = 0;
-   *part_name = NULL;
+   if (part_name)
+   *part_name = NULL;

I'll commit that now (as well as the same check for the
NO_DISKLABEL && NO_GPT case.  Thanks for the digging!

Cheers,
Simon.


CVS commit: src/sys/arch/i386/stand/lib

2021-12-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Dec 28 00:34:30 UTC 2021

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
Fix a tyop.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib

2021-12-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Dec 28 00:34:30 UTC 2021

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
Fix a tyop.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib/biosdisk.c
diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.55 src/sys/arch/i386/stand/lib/biosdisk.c:1.56
--- src/sys/arch/i386/stand/lib/biosdisk.c:1.55	Sun May 30 05:59:23 2021
+++ src/sys/arch/i386/stand/lib/biosdisk.c	Tue Dec 28 00:34:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosdisk.c,v 1.55 2021/05/30 05:59:23 mlelstv Exp $	*/
+/*	$NetBSD: biosdisk.c,v 1.56 2021/12/28 00:34:30 simonb Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998
@@ -1045,7 +1045,7 @@ biosdisk_findpartition(int biosdev, dadd
 	printf("looking for partition device %x, sector %"PRId64"\n", biosdev, sector);
 #endif
 
-	/* default ot first partition */
+	/* default to first partition */
 	*partition = 0;
 	*part_name = NULL;
 



CVS commit: src/sys/arch/i386/stand/efiboot

2021-12-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Dec 27 12:19:27 UTC 2021

Modified Files:
src/sys/arch/i386/stand/efiboot: devopen.c

Log Message:
Revert rev 1.12 of devopen.c.  This had the unintented side effect
of breaking opens on non-root filesystems (eg trying to open/read
"esp:/EFI/NetBSD/boot.cfg" on the EFI system partition).

Ok manu@.  Original problem to be re-addressed.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/stand/efiboot/devopen.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/i386/stand/efiboot/devopen.c
diff -u src/sys/arch/i386/stand/efiboot/devopen.c:1.12 src/sys/arch/i386/stand/efiboot/devopen.c:1.13
--- src/sys/arch/i386/stand/efiboot/devopen.c:1.12	Thu Nov 18 16:18:13 2021
+++ src/sys/arch/i386/stand/efiboot/devopen.c	Mon Dec 27 12:19:27 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: devopen.c,v 1.12 2021/11/18 16:18:13 manu Exp $	 */
+/*	$NetBSD: devopen.c,v 1.13 2021/12/27 12:19:27 simonb Exp $	 */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -288,9 +288,8 @@ neterr:
 	 * biosdisk
 	 */
 	if (strcmp(devname, "esp") == 0) {
-		const char *part_name = NULL;
 		bios2dev(boot_biosdev, boot_biossector, , ,
-		, _name);
+		, NULL);
 		if (efidisk_get_efi_system_partition(boot_biosdev, ))
 			return ENXIO;
 	}



CVS commit: src/sys/arch/i386/stand/efiboot

2021-12-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Dec 27 12:19:27 UTC 2021

Modified Files:
src/sys/arch/i386/stand/efiboot: devopen.c

Log Message:
Revert rev 1.12 of devopen.c.  This had the unintented side effect
of breaking opens on non-root filesystems (eg trying to open/read
"esp:/EFI/NetBSD/boot.cfg" on the EFI system partition).

Ok manu@.  Original problem to be re-addressed.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/stand/efiboot/devopen.c

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



Re: CVS commit: src/sys/arch/i386/stand/efiboot

2021-12-27 Thread Simon Burge
Emmanuel Dreyfus wrote:

> On Mon, Dec 27, 2021 at 01:08:15PM +1100, Simon Burge wrote:
> > What crash did this fix?  All the use of part_name by the
> > called functions should check if it is NULL before trying
> > to assign anything to *part_name.
>
> I do not recall the details now, but I had a crash because
> of this. Please revert my change, I will get back to it when
> I find some time.

Thanks.  I'll revert that now.

If you have a way of preproducing this, I'm happy to have a look.

Cheers,
Simon.


Re: CVS commit: src/sys/arch/i386/stand/efiboot

2021-12-26 Thread Emmanuel Dreyfus
On Mon, Dec 27, 2021 at 01:08:15PM +1100, Simon Burge wrote:
> What crash did this fix?  All the use of part_name by the
> called functions should check if it is NULL before trying
> to assign anything to *part_name.

I do not recall the details now, but I had a crash because
of this. Please revert my change, I will get back to it when
I find some time.

-- 
Emmanuel Dreyfus
m...@netbsd.org


Re: CVS commit: src/sys/arch/i386/stand/efiboot

2021-12-26 Thread Simon Burge
Hi Emmanuel,

"Emmanuel Dreyfus" wrote:

> Module Name:  src
> Committed By: manu
> Date: Thu Nov 18 16:18:13 UTC 2021
>
> Modified Files:
>
>   src/sys/arch/i386/stand/efiboot: devopen.c
>
> Log Message:
>
> Fix crash because of NULL pointer reference

What crash did this fix?  All the use of part_name by the
called functions should check if it is NULL before trying
to assign anything to *part_name.

This change has broken loading boot.cfg via the EFI path
"esp:/EFI/NetBSD/boot.cfg" since the call to bios_boot() at
https://nxr.netbsd.org/xref/src/sys/arch/i386/stand/efiboot/devopen.c#292
with a non-NULL last argument means devname gets updated and
now points to the partition with a root filesystem rather
than the EFI system partition.

Cheers,
Simon.


CVS commit: src/sys/arch

2021-12-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 26 21:33:48 UTC 2021

Modified Files:
src/sys/arch/amd64/amd64: machdep.c
src/sys/arch/i386/i386: machdep.c
src/sys/arch/sparc64/sparc64: machdep.c

Log Message:
sys: Skip suspendsched on cpu_reboot if we're in ddb.

If we're in ddb, the scheduler and all other CPUs are quiesced
anyway.  But suspendsched will try to take an adaptive lock, which
causes it to crash and re-enter ddb, which isn't very useful for
rebooting.


To generate a diff of this commit:
cvs rdiff -u -r1.360 -r1.361 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.833 -r1.834 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.303 -r1.304 src/sys/arch/sparc64/sparc64/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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.360 src/sys/arch/amd64/amd64/machdep.c:1.361
--- src/sys/arch/amd64/amd64/machdep.c:1.360	Thu Oct 28 10:46:05 2021
+++ src/sys/arch/amd64/amd64/machdep.c	Sun Dec 26 21:33:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.360 2021/10/28 10:46:05 riastradh Exp $	*/
+/*	$NetBSD: machdep.c,v 1.361 2021/12/26 21:33:48 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.360 2021/10/28 10:46:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.361 2021/12/26 21:33:48 riastradh Exp $");
 
 #include "opt_modular.h"
 #include "opt_user_ldt.h"
@@ -700,8 +700,15 @@ cpu_reboot(int howto, char *bootstr)
 		   config_detach_all(boothowto) ||
 		   vfs_unmount_forceone(curlwp))
 			;	/* do nothing */
-	} else
-		suspendsched();
+	} else {
+		int ddb = 0;
+#ifdef DDB
+		extern int db_active; /* XXX */
+		ddb = db_active;
+#endif
+		if (!ddb)
+			suspendsched();
+	}
 
 	pmf_system_shutdown(boothowto);
 

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.833 src/sys/arch/i386/i386/machdep.c:1.834
--- src/sys/arch/i386/i386/machdep.c:1.833	Thu Oct 28 10:46:05 2021
+++ src/sys/arch/i386/i386/machdep.c	Sun Dec 26 21:33:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.833 2021/10/28 10:46:05 riastradh Exp $	*/
+/*	$NetBSD: machdep.c,v 1.834 2021/12/26 21:33:48 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.833 2021/10/28 10:46:05 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.834 2021/12/26 21:33:48 riastradh Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_freebsd.h"
@@ -766,8 +766,15 @@ cpu_reboot(int howto, char *bootstr)
 		   config_detach_all(boothowto) ||
 		   vfs_unmount_forceone(curlwp))
 			;	/* do nothing */
-	} else
-		suspendsched();
+	} else {
+		int ddb = 0;
+#ifdef DDB
+		extern int db_active; /* XXX */
+		ddb = db_active;
+#endif
+		if (!ddb)
+			suspendsched();
+	}
 
 	pmf_system_shutdown(boothowto);
 

Index: src/sys/arch/sparc64/sparc64/machdep.c
diff -u src/sys/arch/sparc64/sparc64/machdep.c:1.303 src/sys/arch/sparc64/sparc64/machdep.c:1.304
--- src/sys/arch/sparc64/sparc64/machdep.c:1.303	Sat Sep 11 10:09:55 2021
+++ src/sys/arch/sparc64/sparc64/machdep.c	Sun Dec 26 21:33:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.303 2021/09/11 10:09:55 riastradh Exp $ */
+/*	$NetBSD: machdep.c,v 1.304 2021/12/26 21:33:48 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2019 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.303 2021/09/11 10:09:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.304 2021/12/26 21:33:48 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -573,8 +573,15 @@ cpu_reboot(int howto, char *user_boot_st
 		   config_detach_all(boothowto) ||
 		   vfs_unmount_forceone(l))
 			;	/* do nothing */
-	} else
-		suspendsched();
+	} else {
+		int ddb = 0;
+#ifdef DDB
+		extern int db_active; /* XXX */
+		ddb = db_active;
+#endif
+		if (!ddb)
+			suspendsched();
+	}
 
 	pmf_system_shutdown(boothowto);
 



CVS commit: src/sys/arch

2021-12-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Dec 26 21:33:48 UTC 2021

Modified Files:
src/sys/arch/amd64/amd64: machdep.c
src/sys/arch/i386/i386: machdep.c
src/sys/arch/sparc64/sparc64: machdep.c

Log Message:
sys: Skip suspendsched on cpu_reboot if we're in ddb.

If we're in ddb, the scheduler and all other CPUs are quiesced
anyway.  But suspendsched will try to take an adaptive lock, which
causes it to crash and re-enter ddb, which isn't very useful for
rebooting.


To generate a diff of this commit:
cvs rdiff -u -r1.360 -r1.361 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.833 -r1.834 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.303 -r1.304 src/sys/arch/sparc64/sparc64/machdep.c

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



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

2021-12-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 26 08:41:29 UTC 2021

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

Log Message:
port-arm/50563: pool allocator corruption due to __MUTEX_PRIVATE

This file has moved on somewhat since the PR was raised, but nevertheless
let's add the CTASSERT "just in case".


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/include/mutex.h

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

Modified files:

Index: src/sys/arch/arm/include/mutex.h
diff -u src/sys/arch/arm/include/mutex.h:1.26 src/sys/arch/arm/include/mutex.h:1.27
--- src/sys/arch/arm/include/mutex.h:1.26	Wed Aug 25 04:13:41 2021
+++ src/sys/arch/arm/include/mutex.h	Sun Dec 26 08:41:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mutex.h,v 1.26 2021/08/25 04:13:41 thorpej Exp $	*/
+/*	$NetBSD: mutex.h,v 1.27 2021/12/26 08:41:29 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -82,4 +82,6 @@ struct kmutex {
 
 #endif	/* __MUTEX_PRIVATE */
 
+__CTASSERT(sizeof(struct kmutex) == sizeof(uintptr_t));
+
 #endif /* _ARM_MUTEX_H_ */



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

2021-12-26 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Dec 26 08:41:29 UTC 2021

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

Log Message:
port-arm/50563: pool allocator corruption due to __MUTEX_PRIVATE

This file has moved on somewhat since the PR was raised, but nevertheless
let's add the CTASSERT "just in case".


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/include/mutex.h

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



CVS commit: src/sys/arch

2021-12-23 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Dec 23 17:13:13 UTC 2021

Modified Files:
src/sys/arch/amd64/conf: ALL
src/sys/arch/i386/conf: ALL

Log Message:
Disable amdgpu as it uses floating point arithmetics and subr_kcov
doesnt handle it.

Ok: riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.168 -r1.169 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.499 -r1.500 src/sys/arch/i386/conf/ALL

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

Modified files:

Index: src/sys/arch/amd64/conf/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.168 src/sys/arch/amd64/conf/ALL:1.169
--- src/sys/arch/amd64/conf/ALL:1.168	Thu Nov 25 02:36:35 2021
+++ src/sys/arch/amd64/conf/ALL	Thu Dec 23 17:13:13 2021
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.168 2021/11/25 02:36:35 ryo Exp $
+# $NetBSD: ALL,v 1.169 2021/12/23 17:13:13 hannken Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.168 $"
+#ident		"ALL-$Revision: 1.169 $"
 
 maxusers	64		# estimated number of users
 
@@ -530,8 +530,9 @@ intelfb*	at intelfbbus?
 radeon* 	at pci? dev ? function ?
 radeondrmkmsfb* at radeonfbbus?
 
-amdgpu* 	at pci? dev ? function ?
-amdgpufb* 	at amdgpufbbus?
+# XXX disable amdgpu as it uses floating point arithmetics unsupported by KCOV.
+#amdgpu* 	at pci? dev ? function ?
+#amdgpufb* 	at amdgpufbbus?
 
 nouveau*	at pci? dev ? function ?
 nouveaufb*	at nouveaufbbus?

Index: src/sys/arch/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.499 src/sys/arch/i386/conf/ALL:1.500
--- src/sys/arch/i386/conf/ALL:1.499	Tue Jun 29 10:22:36 2021
+++ src/sys/arch/i386/conf/ALL	Thu Dec 23 17:13:13 2021
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.499 2021/06/29 10:22:36 nia Exp $
+# $NetBSD: ALL,v 1.500 2021/12/23 17:13:13 hannken Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.499 $"
+#ident		"ALL-$Revision: 1.500 $"
 
 maxusers	64		# estimated number of users
 
@@ -605,8 +605,9 @@ intelfb*	at intelfbbus?
 radeon* 	at pci? dev ? function ?
 radeondrmkmsfb* at radeonfbbus?
 
-amdgpu* 	at pci? dev ? function ?
-amdgpufb* 	at amdgpufbbus?
+# XXX disable amdgpu as it uses floating point arithmetics.
+#amdgpu* 	at pci? dev ? function ?
+#amdgpufb* 	at amdgpufbbus?
 
 nouveau*	at pci? dev ? function ?
 nouveaufb*	at nouveaufbbus?



CVS commit: src/sys/arch

2021-12-23 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Dec 23 17:13:13 UTC 2021

Modified Files:
src/sys/arch/amd64/conf: ALL
src/sys/arch/i386/conf: ALL

Log Message:
Disable amdgpu as it uses floating point arithmetics and subr_kcov
doesnt handle it.

Ok: riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.168 -r1.169 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.499 -r1.500 src/sys/arch/i386/conf/ALL

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



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

2021-12-22 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Dec 23 02:45:44 UTC 2021

Modified Files:
src/sys/arch/x86/x86: intr.c

Log Message:
Move the variable into the section that uses it


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/arch/x86/x86/intr.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/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.158 src/sys/arch/x86/x86/intr.c:1.159
--- src/sys/arch/x86/x86/intr.c:1.158	Thu Dec 23 02:10:53 2021
+++ src/sys/arch/x86/x86/intr.c	Thu Dec 23 02:45:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.158 2021/12/23 02:10:53 yamaguchi Exp $	*/
+/*	$NetBSD: intr.c,v 1.159 2021/12/23 02:45:43 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.158 2021/12/23 02:10:53 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.159 2021/12/23 02:45:43 yamaguchi Exp $");
 
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
@@ -508,7 +508,6 @@ intr_allocate_slot(struct pic *pic, int 
 	struct cpu_info *ci, *lci;
 	struct intrsource *isp;
 	int slot = 0, idtvec, error;
-	struct idt_vec *iv;
 
 	KASSERT(mutex_owned(_lock));
 
@@ -606,6 +605,8 @@ intr_allocate_slot(struct pic *pic, int 
 		 * are used by a device using MSI multiple vectors must be
 		 * continuous.
 		 */
+		struct idt_vec *iv;
+
 		iv = idt_vec_ref(>ci_idtvec);
 		idtvec = idt_vec_alloc(iv, APIC_LEVEL(level), IDT_INTR_HIGH);
 	}



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

2021-12-22 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Thu Dec 23 02:45:44 UTC 2021

Modified Files:
src/sys/arch/x86/x86: intr.c

Log Message:
Move the variable into the section that uses it


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/arch/x86/x86/intr.c

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



  1   2   3   4   5   6   7   8   9   10   >