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

2024-06-10 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Mon Jun 10 19:54:24 UTC 2024

Modified Files:
src/sys/arch/sparc64/dev: vdsk.c

Log Message:
sun4v: add incomplete implementation of the CD-specific READ_DISCINFO and 
READ_TRACKINFO - probably needs some more work though...


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc64/dev/vdsk.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/dev/vdsk.c
diff -u src/sys/arch/sparc64/dev/vdsk.c:1.12 src/sys/arch/sparc64/dev/vdsk.c:1.13
--- src/sys/arch/sparc64/dev/vdsk.c:1.12	Sun Jun  9 19:13:54 2024
+++ src/sys/arch/sparc64/dev/vdsk.c	Mon Jun 10 19:54:24 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vdsk.c,v 1.12 2024/06/09 19:13:54 palle Exp $	*/
+/*	$NetBSD: vdsk.c,v 1.13 2024/06/10 19:54:24 palle Exp $	*/
 /*	$OpenBSD: vdsk.c,v 1.46 2015/01/25 21:42:13 kettenis Exp $	*/
 /*
  * Copyright (c) 2009, 2011 Mark Kettenis
@@ -219,6 +219,8 @@ void	vdsk_scsi_inquiry(struct vdsk_softc
 void	vdsk_scsi_capacity(struct vdsk_softc *sc, struct scsipi_xfer *);
 void	vdsk_scsi_capacity16(struct vdsk_softc *sc, struct scsipi_xfer *);
 void	vdsk_scsi_report_luns(struct vdsk_softc *sc, struct scsipi_xfer *);
+void	vdsk_scsi_read_discinfo(struct vdsk_softc *sc, struct scsipi_xfer *);
+void	vdsk_scsi_read_trackinfo(struct vdsk_softc *sc, struct scsipi_xfer *);
 void	vdsk_scsi_done(struct scsipi_xfer *, int);
 
 int
@@ -1049,6 +1051,14 @@ vdsk_scsi_cmd(struct vdsk_softc *sc, str
 			vdsk_scsi_report_luns(sc, xs);
 			return;
 			
+		case READ_DISCINFO:
+			vdsk_scsi_read_discinfo(sc, xs);
+			return;
+
+		case READ_TRACKINFO:
+			vdsk_scsi_read_trackinfo(sc, xs);
+			return;
+			
 		case SCSI_TEST_UNIT_READY:
 		case START_STOP:
 		case SCSI_PREVENT_ALLOW_MEDIUM_REMOVAL:
@@ -1340,6 +1350,32 @@ vdsk_scsi_report_luns(struct vdsk_softc 
 }
 
 void
+vdsk_scsi_read_discinfo(struct vdsk_softc *sc, struct scsipi_xfer *xs)
+{
+	DPRINTF(("%s()\n", __FUNCTION__));
+
+	struct scsipi_read_discinfo_data read_discinfo_data;
+	bzero(_discinfo_data, sizeof(read_discinfo_data));
+
+	bcopy(_discinfo_data, xs->data, MIN(sizeof(read_discinfo_data), xs->datalen));
+	
+	vdsk_scsi_done(xs, XS_NOERROR);
+}
+
+void
+vdsk_scsi_read_trackinfo(struct vdsk_softc *sc, struct scsipi_xfer *xs)
+{
+	DPRINTF(("%s()\n", __FUNCTION__));
+
+	struct scsipi_read_trackinfo_data read_trackinfo_data;
+	bzero(_trackinfo_data, sizeof(read_trackinfo_data));
+
+	bcopy(_trackinfo_data, xs->data, MIN(sizeof(read_trackinfo_data), xs->datalen));
+	
+	vdsk_scsi_done(xs, XS_NOERROR);
+}
+
+void
 vdsk_scsi_done(struct scsipi_xfer *xs, int error)
 {
 	xs->error = error;



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

2024-06-10 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Mon Jun 10 19:54:24 UTC 2024

Modified Files:
src/sys/arch/sparc64/dev: vdsk.c

Log Message:
sun4v: add incomplete implementation of the CD-specific READ_DISCINFO and 
READ_TRACKINFO - probably needs some more work though...


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

2024-06-09 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sun Jun  9 19:13:54 UTC 2024

Modified Files:
src/sys/arch/sparc64/dev: vdsk.c

Log Message:
sun4v: fix vdsk so an iso image exported by the ldom virtual disk service is 
correctly detected as a cd device + some whitespace fixes


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

2024-06-09 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sun Jun  9 19:13:54 UTC 2024

Modified Files:
src/sys/arch/sparc64/dev: vdsk.c

Log Message:
sun4v: fix vdsk so an iso image exported by the ldom virtual disk service is 
correctly detected as a cd device + some whitespace fixes


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sparc64/dev/vdsk.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/dev/vdsk.c
diff -u src/sys/arch/sparc64/dev/vdsk.c:1.11 src/sys/arch/sparc64/dev/vdsk.c:1.12
--- src/sys/arch/sparc64/dev/vdsk.c:1.11	Tue Dec 12 21:34:34 2023
+++ src/sys/arch/sparc64/dev/vdsk.c	Sun Jun  9 19:13:54 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vdsk.c,v 1.11 2023/12/12 21:34:34 andvar Exp $	*/
+/*	$NetBSD: vdsk.c,v 1.12 2024/06/09 19:13:54 palle Exp $	*/
 /*	$OpenBSD: vdsk.c,v 1.46 2015/01/25 21:42:13 kettenis Exp $	*/
 /*
  * Copyright (c) 2009, 2011 Mark Kettenis
@@ -788,7 +788,6 @@ vdsk_rx_vio_dring_data(struct vdsk_softc
 void
 vdsk_ldc_reset(struct ldc_conn *lc)
 {
-
 	struct vdsk_softc *sc = lc->lc_sc;
 
 	sc->sc_vio_state = 0;
@@ -797,7 +796,6 @@ vdsk_ldc_reset(struct ldc_conn *lc)
 void
 vdsk_ldc_start(struct ldc_conn *lc)
 {
-
 	struct vdsk_softc *sc = lc->lc_sc;
 
 	vdsk_send_ver_info(sc, VDSK_MAJOR, VDSK_MINOR);
@@ -806,7 +804,6 @@ vdsk_ldc_start(struct ldc_conn *lc)
 void
 vdsk_sendmsg(struct vdsk_softc *sc, void *msg, size_t len)
 {
-
 	struct ldc_conn *lc = >sc_lc;
 	int err;
 
@@ -818,7 +815,6 @@ vdsk_sendmsg(struct vdsk_softc *sc, void
 void
 vdsk_send_ver_info(struct vdsk_softc *sc, uint16_t major, uint16_t minor)
 {
-
 	struct vio_ver_info vi;
 
 	/* Allocate new session ID. */
@@ -1255,14 +1251,12 @@ vdsk_complete_cmd(struct vdsk_softc *sc,
 void
 vdsk_scsi_inq(struct vdsk_softc *sc, struct scsipi_xfer *xs)
 {
-
 	vdsk_scsi_inquiry(sc, xs);
 }
 
 void
 vdsk_scsi_inquiry(struct vdsk_softc *sc, struct scsipi_xfer *xs)
 {
-
 	struct scsipi_inquiry_data inq;
 	char buf[5];
 
@@ -1272,20 +1266,21 @@ vdsk_scsi_inquiry(struct vdsk_softc *sc,
 		case VD_MEDIA_TYPE_CD:
 		case VD_MEDIA_TYPE_DVD:
 			inq.device = T_CDROM;
+			inq.dev_qual2 = SID_REMOVABLE;
+			bcopy("Virtual CDROM", inq.product, sizeof(inq.product));
 			break;
-
 		case VD_MEDIA_TYPE_FIXED:
-		default:
 			inq.device = T_DIRECT;
+			bcopy("Virtual Disk", inq.product, sizeof(inq.product));
 			break;
+		default:
+			panic("Unhandled media type %d\n", sc->sc_vd_mtype);
 	}
-
 	inq.version = 0x05; /* SPC-3 */
 	inq.response_format = 2;
 	inq.additional_length = 32;
 	inq.flags3 |= SID_CmdQue;
 	bcopy("SUN ", inq.vendor, sizeof(inq.vendor));
-	bcopy("Virtual Disk", inq.product, sizeof(inq.product));
 	snprintf(buf, sizeof(buf), "%u.%u ", sc->sc_major, sc->sc_minor);
 	bcopy(buf, inq.revision, sizeof(inq.revision));
 
@@ -1297,7 +1292,6 @@ vdsk_scsi_inquiry(struct vdsk_softc *sc,
 void
 vdsk_scsi_capacity(struct vdsk_softc *sc, struct scsipi_xfer *xs)
 {
-
 	struct scsipi_read_capacity_10_data rcd;
 	uint64_t capacity;
 
@@ -1321,7 +1315,6 @@ vdsk_scsi_capacity(struct vdsk_softc *sc
 void
 vdsk_scsi_capacity16(struct vdsk_softc *sc, struct scsipi_xfer *xs)
 {
-
 	struct scsipi_read_capacity_16_data rcd;
 	uint64_t capacity;
 
@@ -1349,7 +1342,6 @@ vdsk_scsi_report_luns(struct vdsk_softc 
 void
 vdsk_scsi_done(struct scsipi_xfer *xs, int error)
 {
-
 	xs->error = error;
 
 	scsipi_done(xs);



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

2024-02-17 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Feb 17 19:36:07 UTC 2024

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
Ensure that the size of the stack is properly specified (2*USPACE) so it 
matches the allocation of stack pages done in pmap_bootstrap(). If this is not 
properly in sync, then the stack pointer may end up in the redzone right before 
the stack causing mmu faults. This issue has been observed on a T2000 (sun4v) 
system while probing the devices (pci/ebus/com) during bootstrap


To generate a diff of this commit:
cvs rdiff -u -r1.433 -r1.434 src/sys/arch/sparc64/sparc64/locore.s

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



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

2024-02-17 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Feb 17 19:36:07 UTC 2024

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
Ensure that the size of the stack is properly specified (2*USPACE) so it 
matches the allocation of stack pages done in pmap_bootstrap(). If this is not 
properly in sync, then the stack pointer may end up in the redzone right before 
the stack causing mmu faults. This issue has been observed on a T2000 (sun4v) 
system while probing the devices (pci/ebus/com) during bootstrap


To generate a diff of this commit:
cvs rdiff -u -r1.433 -r1.434 src/sys/arch/sparc64/sparc64/locore.s

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.433 src/sys/arch/sparc64/sparc64/locore.s:1.434
--- src/sys/arch/sparc64/sparc64/locore.s:1.433	Wed Mar  1 08:18:39 2023
+++ src/sys/arch/sparc64/sparc64/locore.s	Sat Feb 17 19:36:07 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.433 2023/03/01 08:18:39 riastradh Exp $	*/
+/*	$NetBSD: locore.s,v 1.434 2024/02/17 19:36:07 palle Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -5471,7 +5471,7 @@ ENTRY_NOPROFILE(cpu_initialize)	/* for c
 	!! and already accessible here)
 	flushw
 	LDPTR	[%l7 + CI_CPCB], %l0		! load PCB/uarea pointer
-	set	USPACE - TF_SIZE - CC64FSZ, %l1
+	set	2*USPACE - TF_SIZE - CC64FSZ, %l1
  	add	%l1, %l0, %l0
 #ifdef _LP64
 	andn	%l0, 0x0f, %l0			! Needs to be 16-byte aligned



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

2024-01-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 15 08:13:45 UTC 2024

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

Log Message:
Fix typos in trap types and one log message.

OpenBSD fixed those over 20 years ago.


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

2024-01-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Jan 15 08:13:45 UTC 2024

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

Log Message:
Fix typos in trap types and one log message.

OpenBSD fixed those over 20 years ago.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/sparc64/sparc64/intr.c
cvs rdiff -u -r1.196 -r1.197 src/sys/arch/sparc64/sparc64/trap.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.71 src/sys/arch/sparc64/sparc64/intr.c:1.72
--- src/sys/arch/sparc64/sparc64/intr.c:1.71	Sun Jan  9 20:30:04 2022
+++ src/sys/arch/sparc64/sparc64/intr.c	Mon Jan 15 08:13:45 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.71 2022/01/09 20:30:04 palle Exp $ */
+/*	$NetBSD: intr.c,v 1.72 2024/01/15 08:13:45 andvar Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.71 2022/01/09 20:30:04 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.72 2024/01/15 08:13:45 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -108,7 +108,7 @@ strayintr(const struct trapframe64 *fp, 
 
 	snprintb(buf, sizeof(buf), PSTATE_BITS,
 	(fp->tf_tstate>>TSTATE_PSTATE_SHIFT));
-	printf("stray interrupt ipl %u pc=%llx npc=%llx pstate=%s vecttored=%d\n",
+	printf("stray interrupt ipl %u pc=%llx npc=%llx pstate=%s vectored=%d\n",
 	fp->tf_pil, (unsigned long long)fp->tf_pc,
 	(unsigned long long)fp->tf_npc,  buf, vectored);
 

Index: src/sys/arch/sparc64/sparc64/trap.c
diff -u src/sys/arch/sparc64/sparc64/trap.c:1.196 src/sys/arch/sparc64/sparc64/trap.c:1.197
--- src/sys/arch/sparc64/sparc64/trap.c:1.196	Mon Jan  8 19:33:49 2024
+++ src/sys/arch/sparc64/sparc64/trap.c	Mon Jan 15 08:13:45 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.196 2024/01/08 19:33:49 palle Exp $ */
+/*	$NetBSD: trap.c,v 1.197 2024/01/15 08:13:45 andvar Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.196 2024/01/08 19:33:49 palle Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.197 2024/01/15 08:13:45 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -342,7 +342,7 @@ const char *trap_type[] = {
 	T, T, T, T, T, T, T, T, /* 128..12f */
 	T, T,			/* 130..131 */
 	"get condition codes",	/* 132 */
-	"set condision codes",	/* 133 */
+	"set condition codes",	/* 133 */
 	T, T, T, T,		/* 134..137 */
 	T, T, T, T, T, T, T, T, /* 138..13f */
 	T, T, T, T, T, T, T, T, /* 140..147 */
@@ -352,7 +352,7 @@ const char *trap_type[] = {
 	T, T, T, T,		/* 160..163 */
 	"SVID syscall64",	/* 164 */
 	"SPARC Intl syscall64",	/* 165 */
-	"OS vedor spec syscall",/* 166 */
+	"OS vendor spec syscall",	/* 166 */
 	"HW OEM syscall",	/* 167 */
 	"ret from deferred trap",	/* 168 */
 };



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

2024-01-08 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Mon Jan  8 19:33:49 UTC 2024

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

Log Message:
sun4v: only DFA (Data fault address) and DFA (Datafault context) are valid when 
a mem_address_not_aligned fault is triggered, so ajust debug printout to this


To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/sys/arch/sparc64/sparc64/trap.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/trap.c
diff -u src/sys/arch/sparc64/sparc64/trap.c:1.195 src/sys/arch/sparc64/sparc64/trap.c:1.196
--- src/sys/arch/sparc64/sparc64/trap.c:1.195	Thu Oct  5 19:41:06 2023
+++ src/sys/arch/sparc64/sparc64/trap.c	Mon Jan  8 19:33:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.195 2023/10/05 19:41:06 ad Exp $ */
+/*	$NetBSD: trap.c,v 1.196 2024/01/08 19:33:49 palle Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.195 2023/10/05 19:41:06 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.196 2024/01/08 19:33:49 palle Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -747,20 +747,8 @@ dopanic:
 		  
 			printf("Alignment error: pid=%d.%d comm=%s pc=%lx\n",
 			   l->l_proc->p_pid, l->l_lid, l->l_proc->p_comm, pc);
-			paddr_t mmufsa_ift_addr = cpus->ci_mmufsa + offsetof(struct mmufsa, ift);
-			paddr_t mmufsa_ifa_addr = cpus->ci_mmufsa + offsetof(struct mmufsa, ifa);
-			paddr_t mmufsa_ifc_addr = cpus->ci_mmufsa + offsetof(struct mmufsa, ifc);
-			paddr_t mmufsa_dft_addr = cpus->ci_mmufsa + offsetof(struct mmufsa, dft);
 			paddr_t mmufsa_dfa_addr = cpus->ci_mmufsa + offsetof(struct mmufsa, dfa);
 			paddr_t mmufsa_dfc_addr = cpus->ci_mmufsa + offsetof(struct mmufsa, dfc);
-			int64_t ift = ldxa(mmufsa_ift_addr, ASI_PHYS_CACHED);
-			printf("ift = %016lx\n", ift);
-			int64_t ifa = ldxa(mmufsa_ifa_addr, ASI_PHYS_CACHED);
-			printf("ifa = %016lx\n", ifa);
-			int64_t ifc = ldxa(mmufsa_ifc_addr, ASI_PHYS_CACHED);
-			printf("ifc = %016lx\n", ifc);
-			int64_t dft = ldxa(mmufsa_dft_addr, ASI_PHYS_CACHED);
-			printf("dft = %016lx\n", dft);
 			int64_t dfa = ldxa(mmufsa_dfa_addr, ASI_PHYS_CACHED);
 			printf("dfa = %016lx\n", dfa);
 			int64_t dfc = ldxa(mmufsa_dfc_addr, ASI_PHYS_CACHED);



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

2024-01-08 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Mon Jan  8 19:33:49 UTC 2024

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

Log Message:
sun4v: only DFA (Data fault address) and DFA (Datafault context) are valid when 
a mem_address_not_aligned fault is triggered, so ajust debug printout to this


To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/sys/arch/sparc64/sparc64/trap.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/conf

2023-12-20 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Dec 20 19:43:51 UTC 2023

Removed Files:
src/sys/arch/sparc64/conf: NONPLUS NONPLUS64

Log Message:
Remove NONPLUS(64) kernel configs, which are not part of autobuild configs,
unmaintained and fail to build.

Approved by eeh (who committed them originally) by email and martin.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r0 src/sys/arch/sparc64/conf/NONPLUS
cvs rdiff -u -r1.59 -r0 src/sys/arch/sparc64/conf/NONPLUS64

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

2023-12-20 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Dec 20 19:43:51 UTC 2023

Removed Files:
src/sys/arch/sparc64/conf: NONPLUS NONPLUS64

Log Message:
Remove NONPLUS(64) kernel configs, which are not part of autobuild configs,
unmaintained and fail to build.

Approved by eeh (who committed them originally) by email and martin.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r0 src/sys/arch/sparc64/conf/NONPLUS
cvs rdiff -u -r1.59 -r0 src/sys/arch/sparc64/conf/NONPLUS64

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

2023-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Dec 20 05:33:59 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: auxio.c auxio_ebus.c auxio_sbus.c ffb.c gfb.c
iommu.c ldc.c mkclock.c pci_machdep.c tadpmu.c
src/sys/arch/sparc64/sparc64: autoconf.c mdesc.c pmap.c sunos_machdep.c

Log Message:
Remove unnecessary .


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/sparc64/dev/auxio.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/dev/auxio_ebus.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sparc64/dev/auxio_sbus.c
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/sparc64/dev/ffb.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sparc64/dev/gfb.c
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/sparc64/dev/iommu.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sparc64/dev/ldc.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc64/dev/mkclock.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/sparc64/dev/pci_machdep.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/dev/tadpmu.c
cvs rdiff -u -r1.239 -r1.240 src/sys/arch/sparc64/sparc64/autoconf.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/sparc64/mdesc.c
cvs rdiff -u -r1.317 -r1.318 src/sys/arch/sparc64/sparc64/pmap.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/sparc64/sparc64/sunos_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/dev/auxio.c
diff -u src/sys/arch/sparc64/dev/auxio.c:1.26 src/sys/arch/sparc64/dev/auxio.c:1.27
--- src/sys/arch/sparc64/dev/auxio.c:1.26	Fri Oct 14 11:33:08 2016
+++ src/sys/arch/sparc64/dev/auxio.c	Wed Dec 20 05:33:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: auxio.c,v 1.26 2016/10/14 11:33:08 mlelstv Exp $	*/
+/*	$NetBSD: auxio.c,v 1.27 2023/12/20 05:33:58 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001, 2015 Matthew R. Green
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auxio.c,v 1.26 2016/10/14 11:33:08 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auxio.c,v 1.27 2023/12/20 05:33:58 thorpej Exp $");
 
 #include "opt_auxio.h"
 
@@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: auxio.c,v 1.
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 

Index: src/sys/arch/sparc64/dev/auxio_ebus.c
diff -u src/sys/arch/sparc64/dev/auxio_ebus.c:1.6 src/sys/arch/sparc64/dev/auxio_ebus.c:1.7
--- src/sys/arch/sparc64/dev/auxio_ebus.c:1.6	Tue Oct  6 16:40:36 2015
+++ src/sys/arch/sparc64/dev/auxio_ebus.c	Wed Dec 20 05:33:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: auxio_ebus.c,v 1.6 2015/10/06 16:40:36 martin Exp $	*/
+/*	$NetBSD: auxio_ebus.c,v 1.7 2023/12/20 05:33:58 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001, 2015 Matthew R. Green
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auxio_ebus.c,v 1.6 2015/10/06 16:40:36 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auxio_ebus.c,v 1.7 2023/12/20 05:33:58 thorpej Exp $");
 
 #include "opt_auxio.h"
 
@@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: auxio_ebus.c
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 

Index: src/sys/arch/sparc64/dev/auxio_sbus.c
diff -u src/sys/arch/sparc64/dev/auxio_sbus.c:1.1 src/sys/arch/sparc64/dev/auxio_sbus.c:1.2
--- src/sys/arch/sparc64/dev/auxio_sbus.c:1.1	Tue Oct  6 16:40:36 2015
+++ src/sys/arch/sparc64/dev/auxio_sbus.c	Wed Dec 20 05:33:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: auxio_sbus.c,v 1.1 2015/10/06 16:40:36 martin Exp $	*/
+/*	$NetBSD: auxio_sbus.c,v 1.2 2023/12/20 05:33:58 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001, 2015 Matthew R. Green
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auxio_sbus.c,v 1.1 2015/10/06 16:40:36 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auxio_sbus.c,v 1.2 2023/12/20 05:33:58 thorpej Exp $");
 
 #include "opt_auxio.h"
 
@@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: auxio_sbus.c
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 

Index: src/sys/arch/sparc64/dev/ffb.c
diff -u src/sys/arch/sparc64/dev/ffb.c:1.67 src/sys/arch/sparc64/dev/ffb.c:1.68
--- src/sys/arch/sparc64/dev/ffb.c:1.67	Sat Aug  7 16:19:05 2021
+++ src/sys/arch/sparc64/dev/ffb.c	Wed Dec 20 05:33:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffb.c,v 1.67 2021/08/07 16:19:05 thorpej Exp $	*/
+/*	$NetBSD: ffb.c,v 1.68 2023/12/20 05:33:58 thorpej Exp $	*/
 /*	$OpenBSD: creator.c,v 1.20 2002/07/30 19:48:15 jason Exp $	*/
 
 /*
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.67 2021/08/07 16:19:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.68 2023/12/20 05:33:58 thorpej Exp $");
 
 #include 
 #include 
@@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.67
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 

Index: src/sys/arch/sparc64/dev/gfb.c
diff -u src/sys/arch/sparc64/dev/gfb.c:1.11 src/sys/arch/sparc64/dev/gfb.c:1.12
--- src/sys/arch/sparc64/dev/gfb.c:1.11	Sat Aug  7 16:19:05 2021
+++ src/sys/arch/sparc64/dev/gfb.c	Wed Dec 20 05:33:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: gfb.c,v 1.11 

CVS commit: src/sys/arch/sparc64

2023-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Dec 20 05:33:59 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: auxio.c auxio_ebus.c auxio_sbus.c ffb.c gfb.c
iommu.c ldc.c mkclock.c pci_machdep.c tadpmu.c
src/sys/arch/sparc64/sparc64: autoconf.c mdesc.c pmap.c sunos_machdep.c

Log Message:
Remove unnecessary .


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/sparc64/dev/auxio.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/dev/auxio_ebus.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sparc64/dev/auxio_sbus.c
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/sparc64/dev/ffb.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sparc64/dev/gfb.c
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/sparc64/dev/iommu.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sparc64/dev/ldc.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc64/dev/mkclock.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/sparc64/dev/pci_machdep.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/dev/tadpmu.c
cvs rdiff -u -r1.239 -r1.240 src/sys/arch/sparc64/sparc64/autoconf.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/sparc64/mdesc.c
cvs rdiff -u -r1.317 -r1.318 src/sys/arch/sparc64/sparc64/pmap.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/sparc64/sparc64/sunos_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

2023-12-14 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Dec 14 20:17:19 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: vnet.c
src/sys/arch/sparc64/sparc64: netbsd32_machdep_13.c

Log Message:
Use console_debugger() vs Debugger() which allows to avoid #ifdef DDB blocks.

>From uwe@


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc64/dev/vnet.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.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/dev/vnet.c
diff -u src/sys/arch/sparc64/dev/vnet.c:1.9 src/sys/arch/sparc64/dev/vnet.c:1.10
--- src/sys/arch/sparc64/dev/vnet.c:1.9	Wed Dec 13 23:11:35 2023
+++ src/sys/arch/sparc64/dev/vnet.c	Thu Dec 14 20:17:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnet.c,v 1.9 2023/12/13 23:11:35 andvar Exp $	*/
+/*	$NetBSD: vnet.c,v 1.10 2023/12/14 20:17:18 andvar Exp $	*/
 /*	$OpenBSD: vnet.c,v 1.62 2020/07/10 13:26:36 patrick Exp $	*/
 /*
  * Copyright (c) 2009, 2015 Mark Kettenis
@@ -441,9 +441,7 @@ vnet_rx_intr(void *arg)
 	default:
 		DPRINTF(("%s: unhandled type %0x02/%0x02/%0x02\n",
  __func__, lp->type, lp->stype, lp->ctrl));
-#ifdef DDB
-		Debugger();
-#endif
+		console_debugger();
 		ldc_reset(lc);
 		break;
 	}

Index: src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.c
diff -u src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.c:1.4 src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.c:1.5
--- src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.c:1.4	Wed Dec 13 23:11:35 2023
+++ src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.c	Thu Dec 14 20:17:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_13.c,v 1.4 2023/12/13 23:11:35 andvar Exp $	*/
+/*	$NetBSD: netbsd32_machdep_13.c,v 1.5 2023/12/14 20:17:18 andvar Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_13.c,v 1.4 2023/12/13 23:11:35 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_13.c,v 1.5 2023/12/14 20:17:18 andvar Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -105,9 +105,7 @@ compat_13_netbsd32_sigreturn(struct lwp 
 #ifdef DEBUG
 		printf("%s: rwindow_save(%p) failed, sending SIGILL\n",
 		__func__, p);
-#ifdef DDB
-		Debugger();
-#endif
+		console_debugger();
 #endif
 		mutex_enter(p->p_lock);
 		sigexit(l, SIGILL);
@@ -116,9 +114,7 @@ compat_13_netbsd32_sigreturn(struct lwp 
 	if (sigdebug & SDB_FOLLOW) {
 		printf("%s: %s[%d], sigcntxp %u\n", __func__,
 		p->p_comm, p->p_pid, SCARG(uap, sigcntxp));
-#ifdef DDB
-		if (sigdebug & SDB_DDB) Debugger();
-#endif
+		if (sigdebug & SDB_DDB) console_debugger();
 	}
 #endif
 	scp = (struct netbsd32_sigcontext13 *)(u_long)SCARG(uap, sigcntxp);
@@ -126,9 +122,7 @@ compat_13_netbsd32_sigreturn(struct lwp 
 	{
 #ifdef DEBUG
 		printf("%s: copyin failed\n", __func__);
-#ifdef DDB
-		Debugger();
-#endif
+		console_debugger();
 #endif
 		return (EINVAL);
 	}
@@ -145,9 +139,7 @@ compat_13_netbsd32_sigreturn(struct lwp 
 	{
 		printf("%s: pc %d or npc %d invalid\n",
 		   __func__, sc.sc_pc, sc.sc_npc);
-#ifdef DDB
-		Debugger();
-#endif
+		console_debugger();
 		return (EINVAL);
 	}
 #else
@@ -164,9 +156,7 @@ compat_13_netbsd32_sigreturn(struct lwp 
 	if (sigdebug & SDB_FOLLOW) {
 		printf("%s: return trapframe pc=%d sp=%d tstate=%x\n", __func__,
 		   (int)tf->tf_pc, (int)tf->tf_out[6], (int)tf->tf_tstate);
-#ifdef DDB
-		if (sigdebug & SDB_DDB) Debugger();
-#endif
+		if (sigdebug & SDB_DDB) console_debugger();
 	}
 #endif
 	mutex_enter(p->p_lock);



CVS commit: src/sys/arch/sparc64

2023-12-14 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Dec 14 20:17:19 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: vnet.c
src/sys/arch/sparc64/sparc64: netbsd32_machdep_13.c

Log Message:
Use console_debugger() vs Debugger() which allows to avoid #ifdef DDB blocks.

>From uwe@


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc64/dev/vnet.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.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/sparc64

2023-12-14 Thread Andrius V
Hi,

Will check and adjust. Thanks for the tip.

On Thu, Dec 14, 2023 at 2:12 AM Valery Ushakov  wrote:
>
> On Wed, Dec 13, 2023 at 23:11:35 +, Andrius Varanavicius wrote:
>
> > Module Name:  src
> > Committed By: andvar
> > Date: Wed Dec 13 23:11:35 UTC 2023
> >
> > Modified Files:
> >   src/sys/arch/sparc64/dev: vnet.c
> >   src/sys/arch/sparc64/sparc64: netbsd32_machdep_13.c
> >
> > Log Message:
> > Add #ifdef DDB blocks around Debugger(); calls to make kernel build without 
> > DDB.
>
> May be use console_debugger() that from a quick look seems to do the
> right thing already (including db_fromconsole guard)?
>
> -uwe
>


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

2023-12-13 Thread Valery Ushakov
On Wed, Dec 13, 2023 at 23:11:35 +, Andrius Varanavicius wrote:

> Module Name:  src
> Committed By: andvar
> Date: Wed Dec 13 23:11:35 UTC 2023
> 
> Modified Files:
>   src/sys/arch/sparc64/dev: vnet.c
>   src/sys/arch/sparc64/sparc64: netbsd32_machdep_13.c
> 
> Log Message:
> Add #ifdef DDB blocks around Debugger(); calls to make kernel build without 
> DDB.

May be use console_debugger() that from a quick look seems to do the
right thing already (including db_fromconsole guard)?

-uwe



CVS commit: src/sys/arch/sparc64

2023-12-13 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Dec 13 23:11:35 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: vnet.c
src/sys/arch/sparc64/sparc64: netbsd32_machdep_13.c

Log Message:
Add #ifdef DDB blocks around Debugger(); calls to make kernel build without DDB.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc64/dev/vnet.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.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/dev/vnet.c
diff -u src/sys/arch/sparc64/dev/vnet.c:1.8 src/sys/arch/sparc64/dev/vnet.c:1.9
--- src/sys/arch/sparc64/dev/vnet.c:1.8	Wed Dec 13 22:53:04 2023
+++ src/sys/arch/sparc64/dev/vnet.c	Wed Dec 13 23:11:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnet.c,v 1.8 2023/12/13 22:53:04 andvar Exp $	*/
+/*	$NetBSD: vnet.c,v 1.9 2023/12/13 23:11:35 andvar Exp $	*/
 /*	$OpenBSD: vnet.c,v 1.62 2020/07/10 13:26:36 patrick Exp $	*/
 /*
  * Copyright (c) 2009, 2015 Mark Kettenis
@@ -441,7 +441,9 @@ vnet_rx_intr(void *arg)
 	default:
 		DPRINTF(("%s: unhandled type %0x02/%0x02/%0x02\n",
  __func__, lp->type, lp->stype, lp->ctrl));
+#ifdef DDB
 		Debugger();
+#endif
 		ldc_reset(lc);
 		break;
 	}

Index: src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.c
diff -u src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.c:1.3 src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.c:1.4
--- src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.c:1.3	Wed Jan 30 10:11:11 2019
+++ src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.c	Wed Dec 13 23:11:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_13.c,v 1.3 2019/01/30 10:11:11 hannken Exp $	*/
+/*	$NetBSD: netbsd32_machdep_13.c,v 1.4 2023/12/13 23:11:35 andvar Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_13.c,v 1.3 2019/01/30 10:11:11 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_13.c,v 1.4 2023/12/13 23:11:35 andvar Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -105,8 +105,10 @@ compat_13_netbsd32_sigreturn(struct lwp 
 #ifdef DEBUG
 		printf("%s: rwindow_save(%p) failed, sending SIGILL\n",
 		__func__, p);
+#ifdef DDB
 		Debugger();
 #endif
+#endif
 		mutex_enter(p->p_lock);
 		sigexit(l, SIGILL);
 	}
@@ -114,7 +116,9 @@ compat_13_netbsd32_sigreturn(struct lwp 
 	if (sigdebug & SDB_FOLLOW) {
 		printf("%s: %s[%d], sigcntxp %u\n", __func__,
 		p->p_comm, p->p_pid, SCARG(uap, sigcntxp));
+#ifdef DDB
 		if (sigdebug & SDB_DDB) Debugger();
+#endif
 	}
 #endif
 	scp = (struct netbsd32_sigcontext13 *)(u_long)SCARG(uap, sigcntxp);
@@ -122,8 +126,10 @@ compat_13_netbsd32_sigreturn(struct lwp 
 	{
 #ifdef DEBUG
 		printf("%s: copyin failed\n", __func__);
+#ifdef DDB
 		Debugger();
 #endif
+#endif
 		return (EINVAL);
 	}
 	scp = 
@@ -139,7 +145,9 @@ compat_13_netbsd32_sigreturn(struct lwp 
 	{
 		printf("%s: pc %d or npc %d invalid\n",
 		   __func__, sc.sc_pc, sc.sc_npc);
+#ifdef DDB
 		Debugger();
+#endif
 		return (EINVAL);
 	}
 #else
@@ -156,7 +164,9 @@ compat_13_netbsd32_sigreturn(struct lwp 
 	if (sigdebug & SDB_FOLLOW) {
 		printf("%s: return trapframe pc=%d sp=%d tstate=%x\n", __func__,
 		   (int)tf->tf_pc, (int)tf->tf_out[6], (int)tf->tf_tstate);
+#ifdef DDB
 		if (sigdebug & SDB_DDB) Debugger();
+#endif
 	}
 #endif
 	mutex_enter(p->p_lock);



CVS commit: src/sys/arch/sparc64

2023-12-13 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Dec 13 23:11:35 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: vnet.c
src/sys/arch/sparc64/sparc64: netbsd32_machdep_13.c

Log Message:
Add #ifdef DDB blocks around Debugger(); calls to make kernel build without DDB.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc64/dev/vnet.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sparc64/sparc64/netbsd32_machdep_13.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/dev

2023-12-13 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Dec 13 22:53:04 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: vnet.c

Log Message:
Make NBPFILTER build by adopting NetBSD's bpf_mtap() interface and definitions.
Condition is also not needed, since this check is performed inside function.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/sparc64/dev/vnet.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/dev/vnet.c
diff -u src/sys/arch/sparc64/dev/vnet.c:1.7 src/sys/arch/sparc64/dev/vnet.c:1.8
--- src/sys/arch/sparc64/dev/vnet.c:1.7	Sun Sep 18 13:31:08 2022
+++ src/sys/arch/sparc64/dev/vnet.c	Wed Dec 13 22:53:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnet.c,v 1.7 2022/09/18 13:31:08 thorpej Exp $	*/
+/*	$NetBSD: vnet.c,v 1.8 2023/12/13 22:53:04 andvar Exp $	*/
 /*	$OpenBSD: vnet.c,v 1.62 2020/07/10 13:26:36 patrick Exp $	*/
 /*
  * Copyright (c) 2009, 2015 Mark Kettenis
@@ -1206,12 +1206,9 @@ vnet_start(struct ifnet *ifp)
 		 * If BPF is listening on this interface, let it see the
 		 * packet before we commit it to the wire.
 		 */
-		if (ifp->if_bpf)
-		{
-			DPRINTF(("%s: before bpf\n", __func__));
-			bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
-			DPRINTF(("%s: after bpf\n", __func__));
-		}
+		DPRINTF(("%s: before bpf\n", __func__));
+		bpf_mtap(ifp, m, BPF_D_OUT);
+		DPRINTF(("%s: after bpf\n", __func__));
 #endif
 
 		pmap_extract(pmap_kernel(), (vaddr_t)buf, );
@@ -1286,8 +1283,7 @@ vnet_start_desc(struct ifnet *ifp)
 		 * If BPF is listening on this interface, let it see the
 		 * packet before we commit it to the wire.
 		 */
-		if (ifp->if_bpf)
-			bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT);
+		bpf_mtap(ifp, m, BPF_D_OUT);
 #endif
 
 		pmap_extract(pmap_kernel(), (vaddr_t)buf, );



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

2023-12-13 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed Dec 13 22:53:04 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: vnet.c

Log Message:
Make NBPFILTER build by adopting NetBSD's bpf_mtap() interface and definitions.
Condition is also not needed, since this check is performed inside function.


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

2023-12-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec 12 21:34:34 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: vdsk.c

Log Message:
extract capacity variable to make VDSK_DEBUG enabled code build.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sparc64/dev/vdsk.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/dev/vdsk.c
diff -u src/sys/arch/sparc64/dev/vdsk.c:1.10 src/sys/arch/sparc64/dev/vdsk.c:1.11
--- src/sys/arch/sparc64/dev/vdsk.c:1.10	Mon May 16 17:13:28 2022
+++ src/sys/arch/sparc64/dev/vdsk.c	Tue Dec 12 21:34:34 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vdsk.c,v 1.10 2022/05/16 17:13:28 palle Exp $	*/
+/*	$NetBSD: vdsk.c,v 1.11 2023/12/12 21:34:34 andvar Exp $	*/
 /*	$OpenBSD: vdsk.c,v 1.46 2015/01/25 21:42:13 kettenis Exp $	*/
 /*
  * Copyright (c) 2009, 2011 Mark Kettenis
@@ -1323,10 +1323,13 @@ vdsk_scsi_capacity16(struct vdsk_softc *
 {
 
 	struct scsipi_read_capacity_16_data rcd;
+	uint64_t capacity;
 
 	bzero(, sizeof(rcd));
 
-	_lto8b(sc->sc_vdisk_size - 1, rcd.addr);
+	capacity = sc->sc_vdisk_size - 1;
+
+	_lto8b(capacity, rcd.addr);
 	_lto4b(sc->sc_vdisk_block_size, rcd.length);
 
 	DPRINTF(("%s() capacity %lu  block size %u\n",



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

2023-12-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec 12 21:34:34 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: vdsk.c

Log Message:
extract capacity variable to make VDSK_DEBUG enabled code build.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sparc64/dev/vdsk.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

2023-12-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec 12 20:24:00 UTC 2023

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

Log Message:
s/maked/marked/


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 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.47 src/sys/arch/sparc64/doc/TODO:1.48
--- src/sys/arch/sparc64/doc/TODO:1.47	Sat Jan 15 18:45:13 2022
+++ src/sys/arch/sparc64/doc/TODO	Tue Dec 12 20:24:00 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO,v 1.47 2022/01/15 18:45:13 palle Exp $ */
+/* $NetBSD: TODO,v 1.48 2023/12/12 20:24:00 andvar Exp $ */
 
 Things to be done:
 
@@ -41,7 +41,7 @@ sun4v:
 - interrupts not handled properly (com at ebus only...)
 - mpt(4) complains: mpt0: Phy 0: Link Status Unknown
 - man pages for drivers imported from OpenBSD lke vpci, vbus, cbus, vdsk, ldc etc.
-- vdsk and ldc drivers: code maked with OPENBSD_BUSDMA - make the bus_dma stuff work properly
+- vdsk and ldc drivers: code marked with OPENBSD_BUSDMA - make the bus_dma stuff work properly
 - vbus.c: handle prom_getprop() memory leaks
 - locore.s: rft_user (sun4v specific manual fill) - seems to work, but is it good enough (compared to openbsds rft_user?
 - openfirmware interface



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

2023-12-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec 12 20:24:00 UTC 2023

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

Log Message:
s/maked/marked/


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 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/sparc64/dev

2023-12-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Dec  8 17:19:11 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: iommu.c

Log Message:
Change one vmem_free() in an error path that should be vmem_xfree().


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/sparc64/dev/iommu.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/dev/iommu.c
diff -u src/sys/arch/sparc64/dev/iommu.c:1.117 src/sys/arch/sparc64/dev/iommu.c:1.118
--- src/sys/arch/sparc64/dev/iommu.c:1.117	Fri Dec  1 06:47:59 2023
+++ src/sys/arch/sparc64/dev/iommu.c	Fri Dec  8 17:19:11 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: iommu.c,v 1.117 2023/12/01 06:47:59 thorpej Exp $	*/
+/*	$NetBSD: iommu.c,v 1.118 2023/12/08 17:19:11 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.117 2023/12/01 06:47:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.118 2023/12/08 17:19:11 thorpej Exp $");
 
 #include "opt_ddb.h"
 
@@ -1073,7 +1073,7 @@ iommu_dvmamap_load_raw(bus_dma_tag_t t, 
 	return (0);
 
 fail:
-	vmem_free(is->is_dvmamap, map->_dm_dvmastart, sgsize);
+	vmem_xfree(is->is_dvmamap, map->_dm_dvmastart, sgsize);
 	map->_dm_dvmastart = 0;
 	map->_dm_dvmasize = 0;
 	return (EFBIG);



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

2023-12-08 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Dec  8 17:19:11 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: iommu.c

Log Message:
Change one vmem_free() in an error path that should be vmem_xfree().


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/arch/sparc64/dev/iommu.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/dev

2023-12-02 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec  2 21:02:53 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: sbus.c

Log Message:
Use vmem_xalloc_addr() to reserve the first Sbus DVMA page.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/sparc64/dev/sbus.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/dev/sbus.c
diff -u src/sys/arch/sparc64/dev/sbus.c:1.105 src/sys/arch/sparc64/dev/sbus.c:1.106
--- src/sys/arch/sparc64/dev/sbus.c:1.105	Fri Dec  1 06:47:59 2023
+++ src/sys/arch/sparc64/dev/sbus.c	Sat Dec  2 21:02:53 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbus.c,v 1.105 2023/12/01 06:47:59 thorpej Exp $ */
+/*	$NetBSD: sbus.c,v 1.106 2023/12/02 21:02:53 thorpej Exp $ */
 
 /*
  * Copyright (c) 1999-2002 Eduardo Horvath
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.105 2023/12/01 06:47:59 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbus.c,v 1.106 2023/12/02 21:02:53 thorpej Exp $");
 
 #include "opt_ddb.h"
 
@@ -268,19 +268,9 @@ sbus_attach(device_t parent, device_t se
 	 * NULL DMA pointer will be translated by the first page of the IOTSB.
 	 * To avoid bugs we'll alloc and ignore the first entry in the IOTSB.
 	 */
-	{
-		vmem_addr_t dummy;
-
-		if (vmem_xalloc(sc->sc_is.is_dvmamap, PAGE_SIZE,
-0,		/* alignment */
-0,		/* phase */
-0,		/* nocross */
-sc->sc_is.is_dvmabase,
-sc->sc_is.is_dvmabase + PAGE_SIZE - 1,
-VM_BESTFIT | VM_NOSLEEP,
-) != 0) {
-			panic("sbus iommu: can't toss first dvma page");
-		}
+	if (vmem_xalloc_addr(sc->sc_is.is_dvmamap, sc->sc_is.is_dvmabase,
+			PAGE_SIZE, VM_NOSLEEP) != 0) {
+		panic("sbus iommu: can't toss first dvma page");
 	}
 
 	/*



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

2023-12-02 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec  2 21:02:53 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: sbus.c

Log Message:
Use vmem_xalloc_addr() to reserve the first Sbus DVMA page.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/sparc64/dev/sbus.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/dev

2023-11-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Dec  1 06:47:59 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: iommu.c iommuvar.h sbus.c

Log Message:
Use vmem(9) rather than extent(9) to manage DVMA mappings.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/sparc64/dev/iommu.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sparc64/dev/iommuvar.h
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/sparc64/dev/sbus.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/dev/iommu.c
diff -u src/sys/arch/sparc64/dev/iommu.c:1.116 src/sys/arch/sparc64/dev/iommu.c:1.117
--- src/sys/arch/sparc64/dev/iommu.c:1.116	Mon Apr 26 07:18:01 2021
+++ src/sys/arch/sparc64/dev/iommu.c	Fri Dec  1 06:47:59 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: iommu.c,v 1.116 2021/04/26 07:18:01 mrg Exp $	*/
+/*	$NetBSD: iommu.c,v 1.117 2023/12/01 06:47:59 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.116 2021/04/26 07:18:01 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.117 2023/12/01 06:47:59 thorpej Exp $");
 
 #include "opt_ddb.h"
 
@@ -212,13 +212,17 @@ iommu_init(char *name, struct iommu_stat
 	aprint_debug("IOTSB: %llx to %llx\n",
 		(unsigned long long)is->is_ptsb,
 		(unsigned long long)(is->is_ptsb + size - 1));
-	is->is_dvmamap = extent_create(name,
-	is->is_dvmabase, is->is_dvmaend,
-	0, 0, EX_NOWAIT);
-	if (!is->is_dvmamap)
-		panic("iommu_init: extent_create() failed");
-	  
-	mutex_init(>is_lock, MUTEX_DEFAULT, IPL_HIGH);
+	is->is_dvmamap = vmem_create(name,
+ is->is_dvmabase,
+ (is->is_dvmaend + 1) - is->is_dvmabase,
+ PAGE_SIZE,		/* quantum */
+ NULL,		/* importfn */
+ NULL,		/* releasefn */
+ NULL,		/* source */
+ 0,			/* qcache_max */
+ VM_SLEEP,
+ IPL_VM);
+	KASSERT(is->is_dvmamap != NULL);
 
 	/*
 	 * Set the TSB size.  The relevant bits were moved to the TSB
@@ -554,7 +558,8 @@ iommu_dvmamap_load(bus_dma_tag_t t, bus_
 	int err, needsflush;
 	bus_size_t sgsize;
 	paddr_t curaddr;
-	u_long dvmaddr, sgstart, sgend, bmask;
+	u_long sgstart, sgend, bmask;
+	vmem_addr_t dvmaddr;
 	bus_size_t align, boundary, len;
 	vaddr_t vaddr = (vaddr_t)buf;
 	int seg;
@@ -596,12 +601,15 @@ iommu_dvmamap_load(bus_dma_tag_t t, bus_
 	 * If our segment size is larger than the boundary we need to
 	 * split the transfer up int little pieces ourselves.
 	 */
-	KASSERT(is->is_dvmamap);
-	mutex_enter(>is_lock);
-	err = extent_alloc(is->is_dvmamap, sgsize, align,
-	(sgsize > boundary) ? 0 : boundary,
-	EX_NOWAIT|EX_BOUNDZERO, );
-	mutex_exit(>is_lock);
+	KASSERT(is->is_dvmamap != NULL);
+	err = vmem_xalloc(is->is_dvmamap, sgsize,
+			  align,		/* alignment */
+			  0,			/* phase */
+			  (sgsize > boundary) ? 0 : boundary,
+			  VMEM_ADDR_MIN,	/* minaddr */
+			  VMEM_ADDR_MAX,	/* maxaddr */
+			  VM_NOSLEEP | VM_BESTFIT,
+			  );
 
 #ifdef DEBUG
 	if (err || (dvmaddr == (u_long)-1)) {
@@ -649,15 +657,9 @@ iommu_dvmamap_load(bus_dma_tag_t t, bus_
 			/* Too many segments.  Fail the operation. */
 			DPRINTF(IDB_INFO, ("iommu_dvmamap_load: "
 			"too many segments %d\n", seg));
-			mutex_enter(>is_lock);
-			err = extent_free(is->is_dvmamap,
-			dvmaddr, sgsize, EX_NOWAIT);
+			vmem_xfree(is->is_dvmamap, dvmaddr, sgsize);
 			map->_dm_dvmastart = 0;
 			map->_dm_dvmasize = 0;
-			mutex_exit(>is_lock);
-			if (err != 0)
-printf("warning: %s: %" PRId64
-" of DVMA space lost\n", __func__, sgsize);
 			return (EFBIG);
 		}
 		sgstart += len;
@@ -741,8 +743,6 @@ iommu_dvmamap_unload(bus_dma_tag_t t, bu
 {
 	struct strbuf_ctl *sb = (struct strbuf_ctl *)map->_dm_cookie;
 	struct iommu_state *is = sb->sb_is;
-	int error;
-	bus_size_t sgsize = map->_dm_dvmasize;
 
 	/* Flush the iommu */
 	if (!map->_dm_dvmastart)
@@ -763,15 +763,9 @@ iommu_dvmamap_unload(bus_dma_tag_t t, bu
 		bus_dmamap_unload(t->_parent, map);
 	}
 
-	mutex_enter(>is_lock);
-	error = extent_free(is->is_dvmamap, map->_dm_dvmastart,
-		map->_dm_dvmasize, EX_NOWAIT);
+	vmem_xfree(is->is_dvmamap, map->_dm_dvmastart, map->_dm_dvmasize);
 	map->_dm_dvmastart = 0;
 	map->_dm_dvmasize = 0;
-	mutex_exit(>is_lock);
-	if (error != 0)
-		printf("warning: %s: %" PRId64 " of DVMA space lost\n",
-		__func__, sgsize);
 
 	/* Clear the map */
 }
@@ -833,17 +827,21 @@ iommu_dvmamap_load_raw(bus_dma_tag_t t, 
 	}
 	sgsize = round_page(sgsize);
 
-	mutex_enter(>is_lock);
 	/*
 	 * If our segment size is larger than the boundary we need to
 	 * split the transfer up into little pieces ourselves.
 	 */
-	err = extent_alloc(is->is_dvmamap, sgsize, align,
-		(sgsize > boundary) ? 0 : boundary,
-		((flags & BUS_DMA_NOWAIT) == 0 ? EX_WAITOK : EX_NOWAIT) |
-		EX_BOUNDZERO, );
-	mutex_exit(>is_lock);
+	const vm_flag_t vmflags = VM_BESTFIT |
+	((flags & 

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

2023-11-30 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Dec  1 06:47:59 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: iommu.c iommuvar.h sbus.c

Log Message:
Use vmem(9) rather than extent(9) to manage DVMA mappings.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/sparc64/dev/iommu.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sparc64/dev/iommuvar.h
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/sparc64/dev/sbus.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

2023-09-01 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Sat Sep  2 05:51:57 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: fdc.c
src/sys/arch/sparc64/include: intr.h psl.h
src/sys/arch/sparc64/sparc64: autoconf.c

Log Message:
sparc64: fix interrupt level mapping for disk and and parallel devices
on SBUS-based machines
Change the mapping from PIL_SCSI to PIL_BIO, so that they interrupt above
the highest soft interrupt (softserial)
Remove unused PIL_SCSI, PIL_FDSOFT, PIL_AUSOFT and fix the printf in fdc.c
Add "socal" and "SUNW,bpp" to the interrupt map.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/sparc64/dev/fdc.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sparc64/include/intr.h
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/sparc64/include/psl.h
cvs rdiff -u -r1.238 -r1.239 src/sys/arch/sparc64/sparc64/autoconf.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

2023-09-01 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Sat Sep  2 05:51:57 UTC 2023

Modified Files:
src/sys/arch/sparc64/dev: fdc.c
src/sys/arch/sparc64/include: intr.h psl.h
src/sys/arch/sparc64/sparc64: autoconf.c

Log Message:
sparc64: fix interrupt level mapping for disk and and parallel devices
on SBUS-based machines
Change the mapping from PIL_SCSI to PIL_BIO, so that they interrupt above
the highest soft interrupt (softserial)
Remove unused PIL_SCSI, PIL_FDSOFT, PIL_AUSOFT and fix the printf in fdc.c
Add "socal" and "SUNW,bpp" to the interrupt map.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/sparc64/dev/fdc.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sparc64/include/intr.h
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/sparc64/include/psl.h
cvs rdiff -u -r1.238 -r1.239 src/sys/arch/sparc64/sparc64/autoconf.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/dev/fdc.c
diff -u src/sys/arch/sparc64/dev/fdc.c:1.51 src/sys/arch/sparc64/dev/fdc.c:1.52
--- src/sys/arch/sparc64/dev/fdc.c:1.51	Sat Aug  7 16:19:05 2021
+++ src/sys/arch/sparc64/dev/fdc.c	Sat Sep  2 05:51:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdc.c,v 1.51 2021/08/07 16:19:05 thorpej Exp $	*/
+/*	$NetBSD: fdc.c,v 1.52 2023/09/02 05:51:57 jdc Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdc.c,v 1.51 2021/08/07 16:19:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdc.c,v 1.52 2023/09/02 05:51:57 jdc Exp $");
 
 #include "opt_ddb.h"
 #include "opt_md.h"
@@ -825,7 +825,7 @@ fdcattach(struct fdc_softc *fdc, int pri
 #ifdef SUN4
 	printf(" softpri %d: chip 8207%c\n", IPL_SOFTFDC, code);
 #elif SUN4U
-	printf(" softpri %d: chip 8207%c", PIL_FDSOFT, code);
+	printf(" softpri %d: chip 8207%c", IPL_BIO, code);
 	if (fdc->sc_flags & FDC_NOEJECT)
 		printf(": manual eject");
 	printf("\n");

Index: src/sys/arch/sparc64/include/intr.h
diff -u src/sys/arch/sparc64/include/intr.h:1.31 src/sys/arch/sparc64/include/intr.h:1.32
--- src/sys/arch/sparc64/include/intr.h:1.31	Fri Jul 27 05:36:12 2012
+++ src/sys/arch/sparc64/include/intr.h	Sat Sep  2 05:51:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.31 2012/07/27 05:36:12 matt Exp $ */
+/*	$NetBSD: intr.h,v 1.32 2023/09/02 05:51:57 jdc Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -54,7 +54,6 @@
 #define	IPL_HIGH	PIL_HIGH	/* everything */
 #define	IPL_HALT	5		/* cpu stop-self */
 #define	IPL_PAUSE	13		/* pause cpu */
-#define	IPL_FDSOFT	PIL_FDSOFT	/* floppy */
 
 /*
  * IPL_SAFEPRI is a safe priority for sleep to set for a spin-wait

Index: src/sys/arch/sparc64/include/psl.h
diff -u src/sys/arch/sparc64/include/psl.h:1.63 src/sys/arch/sparc64/include/psl.h:1.64
--- src/sys/arch/sparc64/include/psl.h:1.63	Tue Jul 11 11:02:07 2023
+++ src/sys/arch/sparc64/include/psl.h	Sat Sep  2 05:51:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.63 2023/07/11 11:02:07 martin Exp $ */
+/*	$NetBSD: psl.h,v 1.64 2023/09/02 05:51:57 jdc Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -73,9 +73,6 @@
 #define PSR_BITS "\20\16EC\15EF\10S\7PS\6ET"
 
 /* Interesting spl()s */
-#define PIL_SCSI	3
-#define PIL_FDSOFT	4
-#define PIL_AUSOFT	4
 #define PIL_BIO		5
 #define PIL_VIDEO	5
 #define PIL_TTY		6
@@ -514,12 +511,6 @@ SPLHOLD(splsoftint, 1)
 
 SPLHOLD(splsoftserial, 4)
 
-/* audio software interrupts are at software level 4 */
-SPLHOLD(splausoft, PIL_AUSOFT)
-
-/* floppy software interrupts are at software level 4 too */
-SPLHOLD(splfdsoft, PIL_FDSOFT)
-
 /*
  * Memory allocation (must be as high as highest network, tty, or disk device)
  */

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.238 src/sys/arch/sparc64/sparc64/autoconf.c:1.239
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.238	Sat Jan 22 11:49:17 2022
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Sat Sep  2 05:51:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.238 2022/01/22 11:49:17 thorpej Exp $ */
+/*	$NetBSD: autoconf.c,v 1.239 2023/09/02 05:51:57 jdc Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.238 2022/01/22 11:49:17 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.239 2023/09/02 05:51:57 jdc Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -165,19 +165,22 @@ int kernel_dtlb_slots;
 int kernel_itlb_slots;
 
 /* Global interrupt mappings for all device types.  Match against the OBP
- * 'device_type' property. 
+ * 'device_type' property.  Note, that the resulting PIL must be higher than
+ * the highest soft interrupt level (IPL_SOFTSERIAL).
  */
 struct intrmap intrmap[] = {
 	{ "block",	PIL_FD },	/* Floppy disk */
 	{ "serial",	PIL_SER },	/* zs */
-	{ "scsi",	PIL_SCSI },
-	{ "scsi-2",	PIL_SCSI },
+	{ "scsi",	PIL_BIO },
+	{ "scsi-2",	PIL_BIO },
 	{ "network",	

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

2023-08-29 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Tue Aug 29 20:17:02 UTC 2023

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

Log Message:
Update the horizontal sync offset based on the Naturetech video timing.
While here, correct the spelling of "Naturetech" in the data.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sparc64/sparc64/static_edid.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/static_edid.c
diff -u src/sys/arch/sparc64/sparc64/static_edid.c:1.1 src/sys/arch/sparc64/sparc64/static_edid.c:1.2
--- src/sys/arch/sparc64/sparc64/static_edid.c:1.1	Sun Oct 11 19:39:22 2020
+++ src/sys/arch/sparc64/sparc64/static_edid.c	Tue Aug 29 20:17:02 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: static_edid.c,v 1.1 2020/10/11 19:39:22 jdc Exp $ */
+/*	$NetBSD: static_edid.c,v 1.2 2023/08/29 20:17:02 jdc Exp $ */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: static_edid.c,v 1.1 2020/10/11 19:39:22 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: static_edid.c,v 1.2 2023/08/29 20:17:02 jdc Exp $");
 #include 
 
 /* EDID blocks for some known hardware that doesn't provide its own */
@@ -46,13 +46,13 @@ uint8_t edid_meso999[128] = {
 /* 20 */	0x16, 0x50, 0x54, 0xa5, 0x4a, 0x80, 0x81, 0x40,
 /* 28 */	0x81, 0x80, 0x81, 0x8f, 0x95, 0x00, 0x01, 0x01,
 /* 30 */	0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xab, 0x22,
-/* 38 */	0xa0, 0xa0, 0x50, 0x84, 0x1a, 0x30, 0x38, 0x20,
+/* 38 */	0xa0, 0xa0, 0x50, 0x84, 0x1a, 0x30, 0x30, 0x20,
 /* 40 */	0x36, 0x00, 0x9a, 0x01, 0x11, 0x00, 0x00, 0x1a,
 /* 48 */	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 /* 50 */	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 /* 58 */	0x00, 0x01, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x4e,
-/* 60 */	0x41, 0x74, 0x75, 0x72, 0x65, 0x74, 0x65, 0x63,
+/* 60 */	0x61, 0x74, 0x75, 0x72, 0x65, 0x74, 0x65, 0x63,
 /* 68 */	0x68, 0x0a, 0x20, 0x20, 0x00, 0x00, 0x00, 0xfe,
 /* 70 */	0x00, 0x4d, 0x65, 0x73, 0x6f, 0x20, 0x39, 0x39,
-/* 78 */	0x39, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x00, 0xed
+/* 78 */	0x39, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x00, 0xd5
 };



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

2023-08-29 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Tue Aug 29 20:17:02 UTC 2023

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

Log Message:
Update the horizontal sync offset based on the Naturetech video timing.
While here, correct the spelling of "Naturetech" in the data.


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

2023-07-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 11 11:02:07 UTC 2023

Modified Files:
src/sys/arch/sparc64/include: psl.h

Log Message:
Move the definition of ipl_cookie_t out of the kernel-only sections,
some _KMEMUSER applications need it.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/sparc64/include/psl.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/sparc64/include/psl.h
diff -u src/sys/arch/sparc64/include/psl.h:1.62 src/sys/arch/sparc64/include/psl.h:1.63
--- src/sys/arch/sparc64/include/psl.h:1.62	Tue Nov  2 11:26:04 2021
+++ src/sys/arch/sparc64/include/psl.h	Tue Jul 11 11:02:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.62 2021/11/02 11:26:04 ryo Exp $ */
+/*	$NetBSD: psl.h,v 1.63 2023/07/11 11:02:07 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -282,6 +282,14 @@
 #define SPARC64_BLOCK_SIZE	64
 #define SPARC64_BLOCK_ALIGN	0x3f
 
+
+#if (defined(_KERNEL) || defined(_KMEMUSER)) && !defined(_LOCORE)
+typedef uint8_t ipl_t;
+typedef struct {
+	ipl_t _ipl;
+} ipl_cookie_t;
+#endif /* _KERNEL|_KMEMUSER&!_LOCORE */
+
 #if defined(_KERNEL) && !defined(_LOCORE)
 
 #if defined(_KERNEL_OPT)
@@ -474,11 +482,6 @@ static __inline __always_inline int name
 }
 #endif
 
-typedef uint8_t ipl_t;
-typedef struct {
-	ipl_t _ipl;
-} ipl_cookie_t;
-
 static __inline ipl_cookie_t
 makeiplcookie(ipl_t ipl)
 {



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

2023-07-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 11 11:02:07 UTC 2023

Modified Files:
src/sys/arch/sparc64/include: psl.h

Log Message:
Move the definition of ipl_cookie_t out of the kernel-only sections,
some _KMEMUSER applications need it.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/sparc64/include/psl.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/include

2023-07-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 11 09:34:34 UTC 2023

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

Log Message:
Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc64/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/sparc64/include/mutex.h
diff -u src/sys/arch/sparc64/include/mutex.h:1.8 src/sys/arch/sparc64/include/mutex.h:1.9
--- src/sys/arch/sparc64/include/mutex.h:1.8	Sun Jul  9 17:03:10 2023
+++ src/sys/arch/sparc64/include/mutex.h	Tue Jul 11 09:34:34 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: mutex.h,v 1.8 2023/07/09 17:03:10 riastradh Exp $	*/
+/*	$NetBSD: mutex.h,v 1.9 2023/07/11 09:34:34 martin Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -35,6 +35,7 @@
 #ifdef __MUTEX_PRIVATE
 #include 
 #include 
+#include 
 #endif
 
 struct kmutex {



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

2023-07-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 11 09:34:34 UTC 2023

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

Log Message:
Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE


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

2023-03-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar  1 08:18:39 UTC 2023

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
sparc64: Optimization: Omit needless membar when triggering softint.

When we are triggering a softint, it can't already hold any mutexes.
So any path to mutex_exit(mtx) must go via mutex_enter(mtx), which is
always done with atomic r/m/w, and we need not issue any explicit
barrier between ci->ci_curlwp = softlwp and a potential load of
mtx->mtx_owner in mutex_exit.

PR kern/57240

XXX pullup-8
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.432 -r1.433 src/sys/arch/sparc64/sparc64/locore.s

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.432 src/sys/arch/sparc64/sparc64/locore.s:1.433
--- src/sys/arch/sparc64/sparc64/locore.s:1.432	Thu Feb 23 14:56:56 2023
+++ src/sys/arch/sparc64/sparc64/locore.s	Wed Mar  1 08:18:39 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.432 2023/02/23 14:56:56 riastradh Exp $	*/
+/*	$NetBSD: locore.s,v 1.433 2023/03/01 08:18:39 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -6847,7 +6847,13 @@ ENTRY(softint_fastintr)
 	or	%o3, %lo(USPACE - TF_SIZE - CC64FSZ - STKB), %o3
 	membar	#StoreStore		/* for mutex_enter; see cpu_switchto */
 	STPTR	%i0, [%l7 + %lo(CURLWP)]
-	membar	#StoreLoad		/* for mutex_enter; see cpu_switchto */
+	/*
+	 * No need for barrier after ci->ci_curlwp = softlwp -- when we
+	 * enter a softint lwp, it can't be holding any mutexes, so it
+	 * can't release any until after it has acquired them, so we
+	 * need not participate in the protocol with mutex_vector_enter
+	 * barriers here.
+	 */
 	add	%l1, %o3, %i6
 	STPTR	%l1, [%l6 + %lo(CPCB)]
 	stx	%i6, [%l1 + PCB_SP]



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

2023-03-01 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Mar  1 08:18:39 UTC 2023

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
sparc64: Optimization: Omit needless membar when triggering softint.

When we are triggering a softint, it can't already hold any mutexes.
So any path to mutex_exit(mtx) must go via mutex_enter(mtx), which is
always done with atomic r/m/w, and we need not issue any explicit
barrier between ci->ci_curlwp = softlwp and a potential load of
mtx->mtx_owner in mutex_exit.

PR kern/57240

XXX pullup-8
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.432 -r1.433 src/sys/arch/sparc64/sparc64/locore.s

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



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

2023-02-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Feb 23 14:56:56 UTC 2023

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
sparc64: Add missing barriers in cpu_switchto.

Details in comments.

PR kern/57240

XXX pullup-8
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.431 -r1.432 src/sys/arch/sparc64/sparc64/locore.s

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.431 src/sys/arch/sparc64/sparc64/locore.s:1.432
--- src/sys/arch/sparc64/sparc64/locore.s:1.431	Tue Jul  5 20:15:40 2022
+++ src/sys/arch/sparc64/sparc64/locore.s	Thu Feb 23 14:56:56 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.431 2022/07/05 20:15:40 andvar Exp $	*/
+/*	$NetBSD: locore.s,v 1.432 2023/02/23 14:56:56 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -6731,9 +6731,28 @@ ENTRY(cpu_switchto)
 	 * Load the new lwp.  To load, we must change stacks and
 	 * alter cpcb and the window control registers, hence we must
 	 * keep interrupts disabled.
+	 *
+	 * Issue barriers to coordinate mutex_exit on this CPU with
+	 * mutex_vector_enter on another CPU.
+	 *
+	 * 1. Any prior mutex_exit by oldlwp must be visible to other
+	 *CPUs before we set ci_curlwp := newlwp on this one,
+	 *requiring a store-before-store barrier.
+	 *
+	 * 2. ci_curlwp := newlwp must be visible on all other CPUs
+	 *before any subsequent mutex_exit by newlwp can even test
+	 *whether there might be waiters, requiring a
+	 *store-before-load barrier.
+	 *
+	 * See kern_mutex.c for details -- this is necessary for
+	 * adaptive mutexes to detect whether the lwp is on the CPU in
+	 * order to safely block without requiring atomic r/m/w in
+	 * mutex_exit.
 	 */
 
+	membar	#StoreStore
 	STPTR	%i1, [%l7 + %lo(CURLWP)]	! curlwp = l;
+	membar	#StoreLoad
 	STPTR	%l1, [%l6 + %lo(CPCB)]		! cpcb = newpcb;
 
 	ldx	[%l1 + PCB_SP], %i6
@@ -6826,7 +6845,9 @@ ENTRY(softint_fastintr)
 	sethi	%hi(USPACE - TF_SIZE - CC64FSZ - STKB), %o3
 	LDPTR	[%i0 + L_PCB], %l1		! l1 = softint pcb
 	or	%o3, %lo(USPACE - TF_SIZE - CC64FSZ - STKB), %o3
+	membar	#StoreStore		/* for mutex_enter; see cpu_switchto */
 	STPTR	%i0, [%l7 + %lo(CURLWP)]
+	membar	#StoreLoad		/* for mutex_enter; see cpu_switchto */
 	add	%l1, %o3, %i6
 	STPTR	%l1, [%l6 + %lo(CPCB)]
 	stx	%i6, [%l1 + PCB_SP]
@@ -6839,7 +6860,9 @@ ENTRY(softint_fastintr)
 
 	/* switch back to interrupted lwp */
 	ldx	[%l5 + PCB_SP], %i6
+	membar	#StoreStore		/* for mutex_enter; see cpu_switchto */
 	STPTR	%l0, [%l7 + %lo(CURLWP)]
+	membar	#StoreLoad		/* for mutex_enter; see cpu_switchto */
 	STPTR	%l5, [%l6 + %lo(CPCB)]
 
 	restore	! rewind register window



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

2023-02-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Feb 23 14:56:56 UTC 2023

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
sparc64: Add missing barriers in cpu_switchto.

Details in comments.

PR kern/57240

XXX pullup-8
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.431 -r1.432 src/sys/arch/sparc64/sparc64/locore.s

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

2023-02-20 Thread Valery Ushakov
On Mon, Feb 20, 2023 at 15:41:04 +0100, Martin Husemann wrote:

> On Mon, Feb 20, 2023 at 05:15:33PM +0300, Valery Ushakov wrote:
> > them up, b/c you cannot amend that comment.  To add to the fun, I
> > think releng scripts just clone the commit message on pull ups, so
> > that comment gets splattered all over the target branches too.
> 
> Yes - I try to manually remove them (which is easy if they are at the
> end of the last commit log in the batch) durint the pullup.

Data point:

  $ hg log -b netbsd-9 | grep 'XXX.*pullup.*9' | wc -l
  74

-uwe


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

2023-02-20 Thread Valery Ushakov
On Mon, Feb 20, 2023 at 22:35:40 +0700, Robert Elz wrote:

> Date:Mon, 20 Feb 2023 16:47:01 +0300
> From:Valery Ushakov 
> Message-ID:  
> 
>   | I wonder if we should stop abusing commit messages as pull-up
>   | reminders.  These XXX will not convey any useful information a few
>   | months down the line...
> 
> I think they're useful (if only I remembered to add them all the
> times I should) - it allows someone looking at the commit log to
> easily determine that the change is also intended for another branch.
> Then one can check and see if it happened or not, and if not, send
> a reminder if it is important/needed.
> 
> If the pullup annotation is missing, I tend to assume that the change
> is not intended to be pulled up - either it isn't applicable, or is
> something new that isn't appropriate for older releases.
> 
> That's why I will sometimes even include pullup annotations for ancient
> versions of NetBSD, even though I know they will never happen (never get
> submitted, much less acted upon) - just as an indication that the problem
> being fixed exists from long ago.

In that case they have no business being "XXX" :)

-uwe


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

2023-02-20 Thread Robert Elz
Date:Mon, 20 Feb 2023 16:47:01 +0300
From:Valery Ushakov 
Message-ID:  

  | I wonder if we should stop abusing commit messages as pull-up
  | reminders.  These XXX will not convey any useful information a few
  | months down the line...

I think they're useful (if only I remembered to add them all the
times I should) - it allows someone looking at the commit log to
easily determine that the change is also intended for another branch.
Then one can check and see if it happened or not, and if not, send
a reminder if it is important/needed.

If the pullup annotation is missing, I tend to assume that the change
is not intended to be pulled up - either it isn't applicable, or is
something new that isn't appropriate for older releases.

That's why I will sometimes even include pullup annotations for ancient
versions of NetBSD, even though I know they will never happen (never get
submitted, much less acted upon) - just as an indication that the problem
being fixed exists from long ago.

kre



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

2023-02-20 Thread Martin Husemann
On Mon, Feb 20, 2023 at 05:15:33PM +0300, Valery Ushakov wrote:
> them up, b/c you cannot amend that comment.  To add to the fun, I
> think releng scripts just clone the commit message on pull ups, so
> that comment gets splattered all over the target branches too.

Yes - I try to manually remove them (which is easy if they are at the
end of the last commit log in the batch) durint the pullup.

Martin


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

2023-02-20 Thread Valery Ushakov
On Mon, Feb 20, 2023 at 13:57:32 +, Taylor R Campbell wrote:

> > > XXX pullup-8
> > > XXX pullup-9
> > > XXX pullup-10
> > 
> > I wonder if we should stop abusing commit messages as pull-up
> > reminders.  These XXX will not convey any useful information a few
> > months down the line...
> 
> Happy to try a better mechanism if you have suggestions, but this is
> the best one I've found so far!  If I don't mark commits this way, I'm
> almost guaranteed not to pull them up.

I'm not sure any exists even with modern VCS.  May be something like a
branch that is not closed until it is merged (pulled-up) to all the
intended destination (but then the very notion of the closed branch
requires something more modern than CVS).  The problem with the XXX in
the commit message is that you don't easily know if you _did_ pull
them up, b/c you cannot amend that comment.  To add to the fun, I
think releng scripts just clone the commit message on pull ups, so
that comment gets splattered all over the target branches too.

-uwe


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

2023-02-20 Thread Taylor R Campbell
> Date: Mon, 20 Feb 2023 16:47:01 +0300
> From: Valery Ushakov 
> 
> On Mon, Feb 20, 2023 at 13:30:23 +, Taylor R Campbell wrote:
> 
> > Module Name:src
> > Committed By:   riastradh
> > Date:   Mon Feb 20 13:30:23 UTC 2023
> > 
> > Modified Files:
> > src/sys/arch/sparc64/sparc64: lock_stubs.s
> > 
> > Log Message:
> > sparc64: Add missing LoadStore ordering for mutex_enter stub.
> > 
> > XXX pullup-8
> > XXX pullup-9
> > XXX pullup-10
> 
> I wonder if we should stop abusing commit messages as pull-up
> reminders.  These XXX will not convey any useful information a few
> months down the line...

Happy to try a better mechanism if you have suggestions, but this is
the best one I've found so far!  If I don't mark commits this way, I'm
almost guaranteed not to pull them up.


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

2023-02-20 Thread Valery Ushakov
On Mon, Feb 20, 2023 at 13:30:23 +, Taylor R Campbell wrote:

> Module Name:  src
> Committed By: riastradh
> Date: Mon Feb 20 13:30:23 UTC 2023
> 
> Modified Files:
>   src/sys/arch/sparc64/sparc64: lock_stubs.s
> 
> Log Message:
> sparc64: Add missing LoadStore ordering for mutex_enter stub.
> 
> XXX pullup-8
> XXX pullup-9
> XXX pullup-10

I wonder if we should stop abusing commit messages as pull-up
reminders.  These XXX will not convey any useful information a few
months down the line...

-uwe


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

2023-02-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 20 13:30:36 UTC 2023

Modified Files:
src/sys/arch/sparc64/sparc64: lock_stubs.s

Log Message:
sparc64: Rename internal barrier macros to be clearer.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc64/sparc64/lock_stubs.s

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/lock_stubs.s
diff -u src/sys/arch/sparc64/sparc64/lock_stubs.s:1.12 src/sys/arch/sparc64/sparc64/lock_stubs.s:1.13
--- src/sys/arch/sparc64/sparc64/lock_stubs.s:1.12	Mon Feb 20 13:30:22 2023
+++ src/sys/arch/sparc64/sparc64/lock_stubs.s	Mon Feb 20 13:30:36 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.s,v 1.12 2023/02/20 13:30:22 riastradh Exp $	*/
+/*	$NetBSD: lock_stubs.s,v 1.13 2023/02/20 13:30:36 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006 The NetBSD Foundation, Inc.
@@ -41,11 +41,11 @@
 #define	CURLWP	(CPUINFO_VA+CI_CURLWP)
 
 #if defined(MULTIPROCESSOR)
-#define	MB_READ	membar #LoadLoad | #LoadStore
-#define	MB_MEM	membar #LoadStore | #StoreStore
+#define	MB_ACQ	membar #LoadLoad | #LoadStore
+#define	MB_REL	membar #LoadStore | #StoreStore
 #else
-#define	MB_READ	/* nothing */
-#define	MB_MEM	/* nothing */
+#define	MB_ACQ	/* nothing */
+#define	MB_REL	/* nothing */
 #endif
 
 #if !defined(LOCKDEBUG)
@@ -58,7 +58,7 @@ ENTRY(mutex_enter)
 	sethi	%hi(CURLWP), %o1
 	LDPTR	[%o1 + %lo(CURLWP)], %o1	! current thread
 	CASPTR	[%o0], %g0, %o1			! compare-and-swap
-	MB_READ
+	MB_ACQ
 	brnz,pn	%o1, 1f! lock was unowned?
 	 nop
 	retl	! - yes, done
@@ -76,7 +76,7 @@ ENTRY(mutex_exit)
 	sethi	%hi(CURLWP), %o1
 	LDPTR	[%o1 + %lo(CURLWP)], %o1	! current thread
 	clr	%o2! new value (0)
-	MB_MEM
+	MB_REL
 	CASPTR	[%o0], %o1, %o2			! compare-and-swap
 	cmp	%o1, %o2
 	bne,pn	CCCR, 1f			! nope, hard case



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

2023-02-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 20 13:30:36 UTC 2023

Modified Files:
src/sys/arch/sparc64/sparc64: lock_stubs.s

Log Message:
sparc64: Rename internal barrier macros to be clearer.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc64/sparc64/lock_stubs.s

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



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

2023-02-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 20 13:30:23 UTC 2023

Modified Files:
src/sys/arch/sparc64/sparc64: lock_stubs.s

Log Message:
sparc64: Add missing LoadStore ordering for mutex_enter stub.

XXX pullup-8
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sparc64/sparc64/lock_stubs.s

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/lock_stubs.s
diff -u src/sys/arch/sparc64/sparc64/lock_stubs.s:1.11 src/sys/arch/sparc64/sparc64/lock_stubs.s:1.12
--- src/sys/arch/sparc64/sparc64/lock_stubs.s:1.11	Wed Apr  6 22:47:57 2022
+++ src/sys/arch/sparc64/sparc64/lock_stubs.s	Mon Feb 20 13:30:22 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.s,v 1.11 2022/04/06 22:47:57 riastradh Exp $	*/
+/*	$NetBSD: lock_stubs.s,v 1.12 2023/02/20 13:30:22 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 #define	CURLWP	(CPUINFO_VA+CI_CURLWP)
 
 #if defined(MULTIPROCESSOR)
-#define	MB_READ	membar #LoadLoad
+#define	MB_READ	membar #LoadLoad | #LoadStore
 #define	MB_MEM	membar #LoadStore | #StoreStore
 #else
 #define	MB_READ	/* nothing */



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

2023-02-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Feb 20 13:30:23 UTC 2023

Modified Files:
src/sys/arch/sparc64/sparc64: lock_stubs.s

Log Message:
sparc64: Add missing LoadStore ordering for mutex_enter stub.

XXX pullup-8
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/sparc64/sparc64/lock_stubs.s

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



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

2023-02-07 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Tue Feb  7 14:11:16 UTC 2023

Modified Files:
src/sys/arch/sparc64/include: vmparam.h

Log Message:
Avoid using (1<<64)-1 for VM_MAX{,USER}_ADDRESS as rounding that up to
the next page boundary gives 0 and instead make the VA space end one
page earlier.

Fixes PR sparc64/57219.


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

2023-02-07 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Tue Feb  7 14:11:16 UTC 2023

Modified Files:
src/sys/arch/sparc64/include: vmparam.h

Log Message:
Avoid using (1<<64)-1 for VM_MAX{,USER}_ADDRESS as rounding that up to
the next page boundary gives 0 and instead make the VA space end one
page earlier.

Fixes PR sparc64/57219.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/sparc64/include/vmparam.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/sparc64/include/vmparam.h
diff -u src/sys/arch/sparc64/include/vmparam.h:1.42 src/sys/arch/sparc64/include/vmparam.h:1.43
--- src/sys/arch/sparc64/include/vmparam.h:1.42	Fri Feb 26 02:01:16 2021
+++ src/sys/arch/sparc64/include/vmparam.h	Tue Feb  7 14:11:16 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.42 2021/02/26 02:01:16 simonb Exp $ */
+/*	$NetBSD: vmparam.h,v 1.43 2023/02/07 14:11:16 hgutch Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -176,8 +176,8 @@
  * User/kernel map constants.
  */
 #define VM_MIN_ADDRESS		((vaddr_t)0)
-#define VM_MAX_ADDRESS		((vaddr_t)-1)
-#define VM_MAXUSER_ADDRESS	((vaddr_t)-1)
+#define VM_MAX_ADDRESS		(((vaddr_t)(-1))&~PGOFSET)
+#define VM_MAXUSER_ADDRESS	VM_MAX_ADDRESS
 #define VM_MAXUSER_ADDRESS32	((vaddr_t)(0xL&~PGOFSET))
 
 #define VM_MIN_KERNEL_ADDRESS	((vaddr_t)KERNBASE)



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

2023-01-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jan 24 23:23:31 UTC 2023

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

Log Message:
sparc64/db_trace.c: Don't dereference; use db_read_bytes.

Makes crash(8) and ddb match, and avoids crashing in ddb when you
feed in a bad lwp pointer!


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/sparc64/sparc64/db_trace.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/db_trace.c
diff -u src/sys/arch/sparc64/sparc64/db_trace.c:1.56 src/sys/arch/sparc64/sparc64/db_trace.c:1.57
--- src/sys/arch/sparc64/sparc64/db_trace.c:1.56	Tue Jan 24 23:23:12 2023
+++ src/sys/arch/sparc64/sparc64/db_trace.c	Tue Jan 24 23:23:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_trace.c,v 1.56 2023/01/24 23:23:12 riastradh Exp $ */
+/*	$NetBSD: db_trace.c,v 1.57 2023/01/24 23:23:31 riastradh Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.56 2023/01/24 23:23:12 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.57 2023/01/24 23:23:31 riastradh Exp $");
 
 #include 
 #include 
@@ -127,12 +127,8 @@ db_stack_trace_print(db_expr_t addr, boo
 			}
 			(*pr)("lid %d ", l.l_lid);
 			pcb = lwp_getpcb();
-#ifndef _KERNEL
 			db_read_bytes((db_addr_t)>pcb_sp,
 			sizeof(frame), (char *));
-#else
-			frame = (vaddr_t)pcb->pcb_sp;
-#endif
 			(*pr)("at %p\n", frame);
 		} else {
 			frame = (vaddr_t)addr;



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

2023-01-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jan 24 23:23:31 UTC 2023

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

Log Message:
sparc64/db_trace.c: Don't dereference; use db_read_bytes.

Makes crash(8) and ddb match, and avoids crashing in ddb when you
feed in a bad lwp pointer!


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

2023-01-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jan 24 23:23:12 UTC 2023

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

Log Message:
sparc64/db_trace.c: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/sparc64/sparc64/db_trace.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/db_trace.c
diff -u src/sys/arch/sparc64/sparc64/db_trace.c:1.55 src/sys/arch/sparc64/sparc64/db_trace.c:1.56
--- src/sys/arch/sparc64/sparc64/db_trace.c:1.55	Sun May 31 11:28:52 2020
+++ src/sys/arch/sparc64/sparc64/db_trace.c	Tue Jan 24 23:23:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_trace.c,v 1.55 2020/05/31 11:28:52 martin Exp $ */
+/*	$NetBSD: db_trace.c,v 1.56 2023/01/24 23:23:12 riastradh Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.55 2020/05/31 11:28:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.56 2023/01/24 23:23:12 riastradh Exp $");
 
 #include 
 #include 
@@ -57,7 +57,7 @@ void db_print_window(uint64_t);
 #endif
 
 #ifdef _KERNEL
-#define	KLOAD(x)	probeget((paddr_t)(u_long)&(x), ASI_PRIMARY, sizeof(x))	
+#define	KLOAD(x)	probeget((paddr_t)(u_long)&(x), ASI_PRIMARY, sizeof(x))
 #else
 static long
 kload(db_addr_t addr)
@@ -153,12 +153,12 @@ db_stack_trace_print(db_expr_t addr, boo
 		if (frame & 1) {
 			f64 = (struct frame64 *)(frame + BIAS);
 			pc = (db_addr_t)KLOAD(f64->fr_pc);
-		
+
 			frame = KLOAD(f64->fr_fp);
 		} else {
 			f32 = (struct frame32 *)(frame);
 			pc = (db_addr_t)KLOAD(f32->fr_pc);
-		
+
 			frame = (long)KLOAD(f32->fr_fp);
 		}
 
@@ -175,13 +175,13 @@ db_stack_trace_print(db_expr_t addr, boo
 		if (!INKERNEL(frame))
 			break;
 #endif
-		
+
 		db_find_sym_and_offset(pc, , );
 		if (name == NULL)
 			name = "?";
-		
+
 		(*pr)("%s(", name);
-		
+
 		/*
 		 * Print %i0..%i5; hope these still reflect the
 		 * actual arguments somewhat...
@@ -216,7 +216,7 @@ db_dump_window(db_expr_t addr, bool have
 
 	/* Traverse window stack */
 	for (i=0; ifr_fp;
 		else frame = (uint64_t)((struct frame32 *)(u_long)frame)->fr_fp;
 	}
@@ -226,13 +226,13 @@ db_dump_window(db_expr_t addr, bool have
 }
 #endif
 
-void 
+void
 db_print_window(uint64_t frame)
 {
 	if (frame & 1) {
 		struct frame64* f = (struct frame64*)(u_long)(frame + BIAS);
 
-		db_printf("frame64 %p locals, ins:\n", f);		
+		db_printf("frame64 %p locals, ins:\n", f);
 		if (INKERNEL(f)) {
 			db_printf("%llx %llx %llx %llx ",
   (unsigned long long)f->fr_local[0],
@@ -245,12 +245,12 @@ db_print_window(uint64_t frame)
   (unsigned long long)f->fr_local[6],
   (unsigned long long)f->fr_local[7]);
 			db_printf("%llx %llx %llx %llx ",
-  (unsigned long long)f->fr_arg[0],	
+  (unsigned long long)f->fr_arg[0],
   (unsigned long long)f->fr_arg[1],
   (unsigned long long)f->fr_arg[2],
   (unsigned long long)f->fr_arg[3]);
 			db_printf("%llx %llx %llx=sp %llx=pc:",
-  (unsigned long long)f->fr_arg[4],	
+  (unsigned long long)f->fr_arg[4],
   (unsigned long long)f->fr_arg[5],
   (unsigned long long)f->fr_fp,
   (unsigned long long)f->fr_pc);
@@ -276,7 +276,7 @@ db_print_window(uint64_t frame)
   (unsigned long long)f->fr_arg[5],
   (unsigned long long)f->fr_fp,
   (unsigned long long)f->fr_pc);
-			db_printf("\n");	 
+			db_printf("\n");
 		}
 	} else {
 		struct frame32* f = (struct frame32*)(u_long)frame;
@@ -297,14 +297,14 @@ db_print_window(uint64_t frame)
 			if (copyin(f, , sizeof(fr))) return;
 			f = 
 			db_printf("%8x %8x %8x %8x %8x %8x %8x %8x\n",
-  f->fr_local[0], f->fr_local[1], 
+  f->fr_local[0], f->fr_local[1],
   f->fr_local[2], f->fr_local[3],
-  f->fr_local[4], f->fr_local[5], 
+  f->fr_local[4], f->fr_local[5],
   f->fr_local[6], f->fr_local[7]);
 			db_printf("%8x %8x %8x %8x %8x %8x %8x=sp %8x=pc\n",
-  f->fr_arg[0], f->fr_arg[1], 
+  f->fr_arg[0], f->fr_arg[1],
   f->fr_arg[2], f->fr_arg[3],
-  f->fr_arg[4], f->fr_arg[5], 
+  f->fr_arg[4], f->fr_arg[5],
   f->fr_fp, f->fr_pc);
 		}
 	}
@@ -391,7 +391,7 @@ db_dump_trap(db_expr_t addr, bool have_a
 		  tf, (unsigned long long)tf->tf_tstate,
 		  (unsigned long long)tf->tf_pc,
 		  (unsigned long long)tf->tf_npc);
-	db_printf("y: %x\tpil: %d\toldpil: %d\tfault: %llx\ttt: %x\tGlobals:\n", 
+	db_printf("y: %x\tpil: %d\toldpil: %d\tfault: %llx\ttt: %x\tGlobals:\n",
 		  (int)tf->tf_y, (int)tf->tf_pil, (int)tf->tf_oldpil,
 		  (unsigned long long)tf->tf_fault, (int)tf->tf_tt);
 	db_printf("%016llx %016llx %016llx %016llx\n",



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

2023-01-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jan 24 23:23:12 UTC 2023

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

Log Message:
sparc64/db_trace.c: Nix trailing whitespace.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/sparc64/sparc64/db_trace.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/dev

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:59:56 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: zs.c

Log Message:
sparc64/zs(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/sparc64/dev/zs.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/dev/zs.c
diff -u src/sys/arch/sparc64/dev/zs.c:1.79 src/sys/arch/sparc64/dev/zs.c:1.80
--- src/sys/arch/sparc64/dev/zs.c:1.79	Wed Oct 26 23:38:08 2022
+++ src/sys/arch/sparc64/dev/zs.c	Wed Oct 26 23:59:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.79 2022/10/26 23:38:08 riastradh Exp $	*/
+/*	$NetBSD: zs.c,v 1.80 2022/10/26 23:59:56 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.79 2022/10/26 23:38:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.80 2022/10/26 23:59:56 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -541,8 +541,8 @@ zssoft(void *arg)
 	struct zsc_softc *zsc = arg;
 
 #if 0 /* not yet */
-	/* Make sure we call the tty layer with tty_lock held. */
-	mutex_spin_enter(_lock);
+	/* Make sure we call the tty layer with ttylock held. */
+	ttylock(tp);
 #endif
 	(void)zsc_intr_soft(zsc);
 #ifdef TTY_DEBUG
@@ -558,7 +558,7 @@ zssoft(void *arg)
 	}
 #endif
 #if 0 /* not yet */
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 #endif
 }
 



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

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:59:56 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: zs.c

Log Message:
sparc64/zs(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/sparc64/dev/zs.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/dev

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:59:36 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: sab.c

Log Message:
sparc64/sab(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/sparc64/dev/sab.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/dev/sab.c
diff -u src/sys/arch/sparc64/dev/sab.c:1.57 src/sys/arch/sparc64/dev/sab.c:1.58
--- src/sys/arch/sparc64/dev/sab.c:1.57	Sat Aug  7 16:19:05 2021
+++ src/sys/arch/sparc64/dev/sab.c	Wed Oct 26 23:59:36 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sab.c,v 1.57 2021/08/07 16:19:05 thorpej Exp $	*/
+/*	$NetBSD: sab.c,v 1.58 2022/10/26 23:59:36 riastradh Exp $	*/
 /*	$OpenBSD: sab.c,v 1.7 2002/04/08 17:49:42 jason Exp $	*/
 
 /*
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.57 2021/08/07 16:19:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sab.c,v 1.58 2022/10/26 23:59:36 riastradh Exp $");
 
 #include "opt_kgdb.h"
 #include 
@@ -693,7 +693,7 @@ sabopen(dev_t dev, int flags, int mode, 
 	if (kauth_authorize_device_tty(l->l_cred, KAUTH_DEVICE_TTY_OPEN, tp))
 		return (EBUSY);
 
-	mutex_spin_enter(_lock);
+	ttylock(tp);
 	if (!ISSET(tp->t_state, TS_ISOPEN) && tp->t_wopen == 0) {
 		ttychars(tp);
 		tp->t_iflag = TTYDEF_IFLAG;
@@ -744,24 +744,24 @@ sabopen(dev_t dev, int flags, int mode, 
 
 			error = ttysleep(tp, >t_rawcv, true, 0);
 			if (error != 0) {
-mutex_spin_exit(_lock);
+ttyunlock(tp);
 return (error);
 			}
 		}
 	}
 
-	mutex_spin_exit(_lock);
+	ttyunlock(tp);
 
 	s = (*tp->t_linesw->l_open)(dev, tp);
 	if (s != 0) {
-		mutex_spin_enter(_lock);
+		ttylock(tp);
 		if (tp->t_state & TS_ISOPEN) {
-			mutex_spin_exit(_lock);
+			ttyunlock(tp);
 			return (s);
 		}
 		if (tp->t_cflag & HUPCL) {
 			sabtty_mdmctrl(sc, 0, DMSET);
-			cv_wait(, _lock);
+			ttysleep(tp, NULL, /*catch_p*/false, hz);
 		}
 
 		if ((sc->sc_flags & (SABTTYF_CONS_IN | SABTTYF_CONS_OUT)) == 0) {
@@ -769,7 +769,7 @@ sabopen(dev_t dev, int flags, int mode, 
 			sabtty_flush(sc);
 			sabtty_reset(sc);
 		}
-		mutex_spin_exit(_lock);
+		ttyunlock(tp);
 	}
 	return (s);
 }



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

2022-10-26 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Oct 26 23:59:36 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: sab.c

Log Message:
sparc64/sab(4): Convert to ttylock/ttyunlock.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/sparc64/dev/sab.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/dev

2022-10-01 Thread Charlotte Koch
Module Name:src
Committed By:   charlotte
Date:   Sat Oct  1 07:59:25 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: pci_machdep.c

Log Message:
Don't try to make a tag based on node 0


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/sparc64/dev/pci_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/dev/pci_machdep.c
diff -u src/sys/arch/sparc64/dev/pci_machdep.c:1.78 src/sys/arch/sparc64/dev/pci_machdep.c:1.79
--- src/sys/arch/sparc64/dev/pci_machdep.c:1.78	Mon Sep  3 16:29:27 2018
+++ src/sys/arch/sparc64/dev/pci_machdep.c	Sat Oct  1 07:59:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.78 2018/09/03 16:29:27 riastradh Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.79 2022/10/01 07:59:25 charlotte Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.78 2018/09/03 16:29:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.79 2022/10/01 07:59:25 charlotte Exp $");
 
 #include 
 #include 
@@ -116,7 +116,7 @@ pci_make_tag(pci_chipset_tag_t pc, int b
 	struct ofw_pci_register reg;
 	pcitag_t tag;
 	int (*valid)(void *);
-	int node, len;
+	int node, new_node, len;
 #ifdef DEBUG
 	char name[80];
 	memset(name, 0, sizeof(name));
@@ -193,8 +193,11 @@ pci_make_tag(pci_chipset_tag_t pc, int b
 break;
 			if (len != 2 || b < busrange[0] || b > busrange[1])
 break;
-			/* Go down 1 level */
-			node = prom_firstchild(node);
+			/* Go down 1 level, as long as we're able */
+			new_node = prom_firstchild(node);
+			if (new_node == 0)
+break;
+			node = new_node;
 			DPRINTF(SPDB_PROBE, ("going down to node %x %s\n", node,
 			prom_getpropstringA(node, "name", name,
 sizeof(name;



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

2022-10-01 Thread Charlotte Koch
Module Name:src
Committed By:   charlotte
Date:   Sat Oct  1 07:59:25 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: pci_machdep.c

Log Message:
Don't try to make a tag based on node 0


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/sparc64/dev/pci_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/dev

2022-09-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Sep 18 13:31:08 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: vnet.c

Log Message:
Eliminate use of IFF_OACTIVE.


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

2022-09-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Sep 18 13:31:08 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: vnet.c

Log Message:
Eliminate use of IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/dev/vnet.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/dev/vnet.c
diff -u src/sys/arch/sparc64/dev/vnet.c:1.6 src/sys/arch/sparc64/dev/vnet.c:1.7
--- src/sys/arch/sparc64/dev/vnet.c:1.6	Fri Feb 11 23:49:28 2022
+++ src/sys/arch/sparc64/dev/vnet.c	Sun Sep 18 13:31:08 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnet.c,v 1.6 2022/02/11 23:49:28 riastradh Exp $	*/
+/*	$NetBSD: vnet.c,v 1.7 2022/09/18 13:31:08 thorpej Exp $	*/
 /*	$OpenBSD: vnet.c,v 1.62 2020/07/10 13:26:36 patrick Exp $	*/
 /*
  * Copyright (c) 2009, 2015 Mark Kettenis
@@ -695,7 +695,6 @@ vnet_rx_vio_rdx(struct vnet_softc *sc, s
 		vnet_setmulti(sc, 1);
 
 		KERNEL_LOCK(1, curlwp);
-		ifp->if_flags &= ~IFF_OACTIVE;
 		vnet_start(ifp);
 		KERNEL_UNLOCK_ONE(curlwp);
 	}
@@ -951,8 +950,6 @@ vnet_rx_vio_dring_data(struct vnet_softc
 			vnet_send_dring_data(sc, cons);
 
 		KERNEL_LOCK(1, curlwp);
-		if (count < (sc->sc_vd->vd_nentries - 1))
-			ifp->if_flags &= ~IFF_OACTIVE;
 		if (count == 0)
 			ifp->if_timer = 0;
 
@@ -1138,11 +1135,6 @@ vnet_start(struct ifnet *ifp)
 		DPRINTF(("%s: not in RUNNING state\n", __func__));
 		return;
 	}
-	if (ifp->if_flags & IFF_OACTIVE)
-	{
-		DPRINTF(("%s: already active\n", __func__));
-		return;
-	}
 
 	if (IFQ_IS_EMPTY(>if_snd))
 	{
@@ -1175,7 +1167,6 @@ vnet_start(struct ifnet *ifp)
 	tx_tail += sizeof(struct ldc_pkt);
 	tx_tail &= ((lc->lc_txq->lq_nentries * sizeof(struct ldc_pkt)) - 1);
 	if (tx_tail == tx_head) {
-		ifp->if_flags |= IFF_OACTIVE;
 		{
 			DPRINTF(("%s: tail equals head\n", __func__));
 			return;
@@ -1194,14 +1185,12 @@ vnet_start(struct ifnet *ifp)
 		if (count >= (sc->sc_vd->vd_nentries - 1) ||
 		map->lm_count >= map->lm_nentries) {
 			DPRINTF(("%s: count issue\n", __func__));
-			ifp->if_flags |= IFF_OACTIVE;
 			break;
 		}
 
 		buf = pool_get(>sc_pool, PR_NOWAIT|PR_ZERO);
 		if (buf == NULL) {
 			DPRINTF(("%s: buff is NULL\n", __func__));
-			ifp->if_flags |= IFF_OACTIVE;
 			break;
 		}
 		IFQ_DEQUEUE(>if_snd, m);
@@ -1275,13 +1264,11 @@ vnet_start_desc(struct ifnet *ifp)
 		count = sc->sc_tx_prod - sc->sc_tx_cons;
 		if (count >= (sc->sc_vd->vd_nentries - 1) ||
 		map->lm_count >= map->lm_nentries) {
-			ifp->if_flags |= IFF_OACTIVE;
 			return;
 		}
 
 		buf = pool_get(>sc_pool, PR_NOWAIT|PR_ZERO);
 		if (buf == NULL) {
-			ifp->if_flags |= IFF_OACTIVE;
 			return;
 		}
 
@@ -1548,7 +1535,6 @@ vnet_stop(struct ifnet *ifp, int disable
 	struct ldc_conn *lc = >sc_lc;
 
 	ifp->if_flags &= ~IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 	ifp->if_timer = 0;
 
 	cbus_intr_setenabled(sc->sc_bustag, sc->sc_tx_ino, INTR_DISABLED);



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

2022-05-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon May 16 21:28:06 UTC 2022

Modified Files:
src/sys/arch/sparc64/sparc64: cache.h locore.s trap.c

Log Message:
try to handle ultrasparc III* "fast ecc error" traps.

i had a sunblade 2500 reset with this trap recently, and the
manual says it should have been recoverable.  in particular,
the US IIIv2 manual says in section 12.4.4.2 that the i-cache
won't see this data ever (so nothing needed there), and that
the d-cache needs to be disabled, and all the entries flushed,
and then re-enabled.

tested with a "trap 0x70" from kernel space, that trap.c
converted the "0x170" back to "0x70" (with an ADVANCE).  this
code not commited.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/sparc64/sparc64/cache.h
cvs rdiff -u -r1.427 -r1.428 src/sys/arch/sparc64/sparc64/locore.s
cvs rdiff -u -r1.193 -r1.194 src/sys/arch/sparc64/sparc64/trap.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/cache.h
diff -u src/sys/arch/sparc64/sparc64/cache.h:1.30 src/sys/arch/sparc64/sparc64/cache.h:1.31
--- src/sys/arch/sparc64/sparc64/cache.h:1.30	Sat Dec 11 19:24:21 2021
+++ src/sys/arch/sparc64/sparc64/cache.h	Mon May 16 21:28:05 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache.h,v 1.30 2021/12/11 19:24:21 mrg Exp $ */
+/*	$NetBSD: cache.h,v 1.31 2022/05/16 21:28:05 mrg Exp $ */
 
 /*
  * Copyright (c) 2011 Matthew R. Green
@@ -93,6 +93,7 @@ extern	int	icache_size;
 void 	dcache_flush_page_us(paddr_t);	/* flush page from D$ */
 void 	dcache_flush_page_usiii(paddr_t); /* flush page from D$ */
 void 	sp_blast_dcache(int, int);	/* Clear entire D$ */
+void 	sp_blast_dcache_disabled(int, int); /* Above with D$ disable. */
 void 	blast_icache_us(void);		/* Clear entire I$ */
 void 	blast_icache_usiii(void);	/* Clear entire I$ */
 

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.427 src/sys/arch/sparc64/sparc64/locore.s:1.428
--- src/sys/arch/sparc64/sparc64/locore.s:1.427	Sat Apr  3 17:01:24 2021
+++ src/sys/arch/sparc64/sparc64/locore.s	Mon May 16 21:28:05 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.427 2021/04/03 17:01:24 palle Exp $	*/
+/*	$NetBSD: locore.s,v 1.428 2022/05/16 21:28:05 mrg Exp $	*/
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -6193,8 +6193,10 @@ ENTRY(sp_tlb_flush_all_usiii)
 
 /*
  * sp_blast_dcache(int dcache_size, int dcache_line_size)
+ * sp_blast_dcache_disabled(int dcache_size, int dcache_line_size)
  *
- * Clear out all of D$ regardless of contents
+ * Clear out all of D$ regardless of contents.  The latter one also
+ * disables the D$ while doing so.
  */
 	.align 8
 ENTRY(sp_blast_dcache)
@@ -6227,6 +6229,46 @@ ENTRY(sp_blast_dcache)
 	 wrpr	%o3, %pstate
 #endif
 
+	.align 8
+ENTRY(sp_blast_dcache_disabled)
+/*
+ * We turn off interrupts for the duration to prevent RED exceptions.
+ */
+#ifdef PROF
+	save	%sp, -CC64FSZ, %sp
+#endif
+
+	rdpr	%pstate, %o3
+	sub	%o0, %o1, %o0
+	andn	%o3, PSTATE_IE, %o4			! Turn off PSTATE_IE bit
+	wrpr	%o4, 0, %pstate
+
+	ldxa[%g0] ASI_MCCR, %o5
+	andn	%o5, MCCR_DCACHE_EN, %o4		! Turn off the D$
+	stxa	%o4, [%g0] ASI_MCCR
+	flush 	%g0
+
+1:
+	stxa	%g0, [%o0] ASI_DCACHE_TAG
+	membar	#Sync
+	brnz,pt	%o0, 1b
+	 sub	%o0, %o1, %o0
+
+	sethi	%hi(KERNBASE), %o2
+	flush	%o2
+	membar	#Sync
+
+	stxa	%o5, [%g0] ASI_MCCR			! Restore the D$
+	flush 	%g0
+#ifdef PROF
+	wrpr	%o3, %pstate
+	ret
+	 restore
+#else
+	retl
+	 wrpr	%o3, %pstate
+#endif
+
 #ifdef MULTIPROCESSOR
 /*
  * void sparc64_ipi_blast_dcache(int dcache_size, int dcache_line_size)

Index: src/sys/arch/sparc64/sparc64/trap.c
diff -u src/sys/arch/sparc64/sparc64/trap.c:1.193 src/sys/arch/sparc64/sparc64/trap.c:1.194
--- src/sys/arch/sparc64/sparc64/trap.c:1.193	Tue Feb  2 08:18:42 2021
+++ src/sys/arch/sparc64/sparc64/trap.c	Mon May 16 21:28:05 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.193 2021/02/02 08:18:42 martin Exp $ */
+/*	$NetBSD: trap.c,v 1.194 2022/05/16 21:28:05 mrg Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.193 2021/02/02 08:18:42 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.194 2022/05/16 21:28:05 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -561,6 +561,11 @@ trap(struct trapframe64 *tf, unsigned in
 		} else if (type == T_ECCERR) {
 			ecc_corrected_error(type, pc);
 			return;
+		} else if (type == T_FAST_ECC_ERROR) {
+			/* Disable D$, clear error, enable D$, continue. */
+			membar_Sync();
+			sp_blast_dcache_disabled(dcache_size, dcache_line_size);
+			return;
 		}
 		goto dopanic;
 	}



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

2022-05-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon May 16 21:28:06 UTC 2022

Modified Files:
src/sys/arch/sparc64/sparc64: cache.h locore.s trap.c

Log Message:
try to handle ultrasparc III* "fast ecc error" traps.

i had a sunblade 2500 reset with this trap recently, and the
manual says it should have been recoverable.  in particular,
the US IIIv2 manual says in section 12.4.4.2 that the i-cache
won't see this data ever (so nothing needed there), and that
the d-cache needs to be disabled, and all the entries flushed,
and then re-enabled.

tested with a "trap 0x70" from kernel space, that trap.c
converted the "0x170" back to "0x70" (with an ADVANCE).  this
code not commited.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/sparc64/sparc64/cache.h
cvs rdiff -u -r1.427 -r1.428 src/sys/arch/sparc64/sparc64/locore.s
cvs rdiff -u -r1.193 -r1.194 src/sys/arch/sparc64/sparc64/trap.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/dev

2022-05-16 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Mon May 16 17:13:28 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: vdsk.c

Log Message:
sun4v/vdsk: add handling of SCSI_REPORT_LUNS


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc64/dev/vdsk.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/dev/vdsk.c
diff -u src/sys/arch/sparc64/dev/vdsk.c:1.9 src/sys/arch/sparc64/dev/vdsk.c:1.10
--- src/sys/arch/sparc64/dev/vdsk.c:1.9	Sat Dec  4 13:23:03 2021
+++ src/sys/arch/sparc64/dev/vdsk.c	Mon May 16 17:13:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vdsk.c,v 1.9 2021/12/04 13:23:03 andvar Exp $	*/
+/*	$NetBSD: vdsk.c,v 1.10 2022/05/16 17:13:28 palle Exp $	*/
 /*	$OpenBSD: vdsk.c,v 1.46 2015/01/25 21:42:13 kettenis Exp $	*/
 /*
  * Copyright (c) 2009, 2011 Mark Kettenis
@@ -218,6 +218,7 @@ void	vdsk_scsi_inq(struct vdsk_softc *sc
 void	vdsk_scsi_inquiry(struct vdsk_softc *sc, struct scsipi_xfer *);
 void	vdsk_scsi_capacity(struct vdsk_softc *sc, struct scsipi_xfer *);
 void	vdsk_scsi_capacity16(struct vdsk_softc *sc, struct scsipi_xfer *);
+void	vdsk_scsi_report_luns(struct vdsk_softc *sc, struct scsipi_xfer *);
 void	vdsk_scsi_done(struct scsipi_xfer *, int);
 
 int
@@ -1048,6 +1049,10 @@ vdsk_scsi_cmd(struct vdsk_softc *sc, str
 			vdsk_scsi_capacity16(sc, xs);
 			return;
 
+		case SCSI_REPORT_LUNS:
+			vdsk_scsi_report_luns(sc, xs);
+			return;
+			
 		case SCSI_TEST_UNIT_READY:
 		case START_STOP:
 		case SCSI_PREVENT_ALLOW_MEDIUM_REMOVAL:
@@ -1333,6 +1338,12 @@ vdsk_scsi_capacity16(struct vdsk_softc *
 }
 
 void
+vdsk_scsi_report_luns(struct vdsk_softc *sc, struct scsipi_xfer *xs)
+{
+	vdsk_scsi_done(xs, XS_NOERROR);
+}
+
+void
 vdsk_scsi_done(struct scsipi_xfer *xs, int error)
 {
 



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

2022-05-16 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Mon May 16 17:13:28 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: vdsk.c

Log Message:
sun4v/vdsk: add handling of SCSI_REPORT_LUNS


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc64/dev/vdsk.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-04-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  6 22:48:22 UTC 2022

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

Log Message:
sparc64/pmap: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.314 -r1.315 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.314 src/sys/arch/sparc64/sparc64/pmap.c:1.315
--- src/sys/arch/sparc64/sparc64/pmap.c:1.314	Sat Mar 12 15:32:31 2022
+++ src/sys/arch/sparc64/sparc64/pmap.c	Wed Apr  6 22:48:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.314 2022/03/12 15:32:31 riastradh Exp $	*/
+/*	$NetBSD: pmap.c,v 1.315 2022/04/06 22:48:21 riastradh Exp $	*/
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.314 2022/03/12 15:32:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.315 2022/04/06 22:48:21 riastradh Exp $");
 
 #undef	NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define	HWREF
@@ -163,6 +163,7 @@ static void ctx_free(struct pmap *, stru
 static __inline void
 dmmu_set_secondary_context(uint ctx)
 {
+
 	if (!CPU_ISSUN4V)
 		__asm volatile(
 			"stxa %0,[%1]%2;	"
@@ -175,7 +176,6 @@ dmmu_set_secondary_context(uint ctx)
 			"membar #Sync		"
 			: : "r" (ctx), "r" (CTX_SECONDARY), "n" (ASI_MMU_CONTEXTID)
 			: "memory");
-		
 }
 
 /*
@@ -564,7 +564,7 @@ pmap_mp_init(void)
 			if (CPU_ISSUN4V)
 tp[i].data |= SUN4V_TLB_X;
 		}
-			
+
 		DPRINTF(PDB_BOOT1, ("xtlb[%d]: Tag: %" PRIx64 " Data: %"
 PRIx64 "\n", i, tp[i].tag, tp[i].data));
 	}



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

2022-04-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  6 22:48:22 UTC 2022

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

Log Message:
sparc64/pmap: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.314 -r1.315 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/sparc64/dev

2022-02-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 11 23:49:28 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: vnet.c

Log Message:
sparc64/vnet(4): device_t/softc split


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/dev/vnet.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/dev/vnet.c
diff -u src/sys/arch/sparc64/dev/vnet.c:1.5 src/sys/arch/sparc64/dev/vnet.c:1.6
--- src/sys/arch/sparc64/dev/vnet.c:1.5	Mon Mar 15 18:44:04 2021
+++ src/sys/arch/sparc64/dev/vnet.c	Fri Feb 11 23:49:28 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnet.c,v 1.5 2021/03/15 18:44:04 palle Exp $	*/
+/*	$NetBSD: vnet.c,v 1.6 2022/02/11 23:49:28 riastradh Exp $	*/
 /*	$OpenBSD: vnet.c,v 1.62 2020/07/10 13:26:36 patrick Exp $	*/
 /*
  * Copyright (c) 2009, 2015 Mark Kettenis
@@ -128,7 +128,7 @@ struct vnet_soft_desc {
 };
 
 struct vnet_softc {
-	struct device	sc_dv;
+	device_t	sc_dv;
 	bus_space_tag_t	sc_bustag;
 	bus_dma_tag_t	sc_dmatag;
 
@@ -247,6 +247,7 @@ vnet_attach(struct device *parent, struc
 	struct ldc_conn *lc;
 	struct ifnet *ifp;
 
+	sc->sc_dv = self;
 	sc->sc_bustag = ca->ca_bustag;
 	sc->sc_dmatag = ca->ca_dmatag;
 	sc->sc_tx_ino = ca->ca_tx_ino;
@@ -304,8 +305,10 @@ vnet_attach(struct device *parent, struc
 	/*
 	 * Each interface gets its own pool.
 	 */
-	pool_init(>sc_pool, 2048, 0, 0, 0, sc->sc_dv.dv_xname, NULL, IPL_NET);
- 
+	pool_init(>sc_pool, /*size*/2048, /*align*/0, /*align_offset*/0,
+	/*flags*/0, /*wchan*/device_xname(sc->sc_dv), /*palloc*/NULL,
+	IPL_NET);
+
 	ifp = >sc_ethercom.ec_if;
 	ifp->if_softc = sc;
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
@@ -1392,7 +1395,7 @@ vnet_watchdog(struct ifnet *ifp)
 
 	struct vnet_softc *sc = ifp->if_softc;
 
-	printf("%s: watchdog timeout\n", sc->sc_dv.dv_xname);
+	printf("%s: watchdog timeout\n", device_xname(sc->sc_dv));
 }
 
 int



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

2022-02-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 11 23:49:28 UTC 2022

Modified Files:
src/sys/arch/sparc64/dev: vnet.c

Log Message:
sparc64/vnet(4): device_t/softc split


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sparc64/dev/vnet.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/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/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/sparc64/doc

2021-09-23 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Thu Sep 23 17:51:52 UTC 2021

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

Log Message:
sun4v: update TODO with current status when running on a T5-based system


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 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.44 src/sys/arch/sparc64/doc/TODO:1.45
--- src/sys/arch/sparc64/doc/TODO:1.44	Mon Jul  5 16:59:54 2021
+++ src/sys/arch/sparc64/doc/TODO	Thu Sep 23 17:51:52 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: TODO,v 1.44 2021/07/05 16:59:54 palle Exp $ */
+/* $NetBSD: TODO,v 1.45 2021/09/23 17:51:52 palle Exp $ */
 
 Things to be done:
 
@@ -13,15 +13,12 @@ sun4u:
 sun4v:
  - current status
  T5 ldom with 2 VCPU and 4GB  (primary ldom is Solaris 11.4 SRU30)::
-   - kernel boots from miniroot.fs via ldom fisk (vdsk)
+   - kernel boots from miniroot.fs via ldom disk (vdsk)
 	   - ldom virtual network interface (vnet) is working
 	 (verified by exiting sysinst and issuing a ping command)
-	   - the sysinst tool starts, disk setup is working,
-	 but the process crashes when selecting network installation method.
-		 The %i,%l and %o registers are corrupted, after a call to the libcurses
-		 wrefresh() function.
-		 If the sysinst insallation source is local directory, the sets are properly
-		 unpacked, but the system hangs afterwards when running the makedev script.
+	   - the sysinst tool starts, disk setup is working, network configuration is working,
+	 but after the selected (minimal) sets have been downloaded and installed
+		 the 'sh MAKEDEV all' comand hangs.
 	 T2000 ldom with 8 VCPU and 4GB:
 	   - crashes in /sbin/init doing an access() call where %o0 is corrupted (zero)
 	 S7 ldom with 8 VCPU and 16GB (primary ldom is Solaris 11.4 SRU33):



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

2021-09-23 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Thu Sep 23 17:51:52 UTC 2021

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

Log Message:
sun4v: update TODO with current status when running on a T5-based system


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 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.



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

2020-10-24 Thread Julian Coleman
Hi Tobias,

> If you're interested there is an older version[1] of envctrl in the
> Attic that might be relevant to use for reference. It supported fan
> speed controls on E450. IIRC I got some of the magic constants from
> OpenSolaris. Sadly I don't own an E450 any more.
> 
> [1] 
> cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/arch/sparc64/dev/Attic/envctrl.c?rev=1.11=text/plain_with_tag=MAIN

Thank you - that's useful information!

Related to the magic offsets, I noticed that the value read from the sensor
was always lower than the value written.  However, it doesn't appear to be
a constant difference (I see about 15 for most values, but only 5 for the
minimum).  I think that it's OK to keep the higher value - it'll mean that
we run the fans slightly faster.  The CPU temperature on my E250 doesn't
reach the minimum threshold where the fan speed actually increases, so I
don't think that this will have any impact.

The GPIO values there helps to see what values I should be checking for too.

It would be good to merge this with the current code, but I only have an
E250 to test on, so I'll need to find a volunteer.

Regards,

Julian


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

2020-10-24 Thread Tobias Nygren
On Sat, 24 Oct 2020 15:16:39 +
Julian Coleman  wrote:

> Module Name:  src
> Committed By: jdc
> Date: Sat Oct 24 15:16:39 UTC 2020
> 
> Modified Files:
>   src/sys/arch/sparc64/dev: pcf8591_envctrl.c
> 
> Log Message:
> Add support for automatically changing the CPU fan speed on the E250 in a
> similar way to the SB1000/SB2000.
> The fan control information was determined by experiment, as it's only
> partially available in OFW.
> Hardcode the missing information for E250 fan control into the driver
> (it should be possible to support the E450 in future too).

If you're interested there is an older version[1] of envctrl in the
Attic that might be relevant to use for reference. It supported fan
speed controls on E450. IIRC I got some of the magic constants from
OpenSolaris. Sadly I don't own an E450 any more.

[1] 
cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/arch/sparc64/dev/Attic/envctrl.c?rev=1.11=text/plain_with_tag=MAIN


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

2019-11-19 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Tue Nov 19 20:07:30 UTC 2019

Modified Files:
src/sys/arch/sparc64/dev: vdsk.c

Log Message:
sun4v: added support for handling of opcode SCSI_MAINTENANCE_IN when using ldom 
based virtual disk


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sparc64/dev/vdsk.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/dev/vdsk.c
diff -u src/sys/arch/sparc64/dev/vdsk.c:1.4 src/sys/arch/sparc64/dev/vdsk.c:1.5
--- src/sys/arch/sparc64/dev/vdsk.c:1.4	Tue Oct  1 18:00:07 2019
+++ src/sys/arch/sparc64/dev/vdsk.c	Tue Nov 19 20:07:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vdsk.c,v 1.4 2019/10/01 18:00:07 chs Exp $	*/
+/*	$NetBSD: vdsk.c,v 1.5 2019/11/19 20:07:30 palle Exp $	*/
 /*	$OpenBSD: vdsk.c,v 1.46 2015/01/25 21:42:13 kettenis Exp $	*/
 /*
  * Copyright (c) 2009, 2011 Mark Kettenis
@@ -1049,6 +1049,7 @@ vdsk_scsi_cmd(struct vdsk_softc *sc, str
 		case START_STOP:
 		case SCSI_PREVENT_ALLOW_MEDIUM_REMOVAL:
 		case SCSI_MODE_SENSE_6:
+		case SCSI_MAINTENANCE_IN:
 			vdsk_scsi_done(xs, XS_NOERROR);
 			return;
 



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

2019-11-19 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Tue Nov 19 20:07:30 UTC 2019

Modified Files:
src/sys/arch/sparc64/dev: vdsk.c

Log Message:
sun4v: added support for handling of opcode SCSI_MAINTENANCE_IN when using ldom 
based virtual disk


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/sparc64/dev/vdsk.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/include

2019-11-13 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Wed Nov 13 10:06:39 UTC 2019

Modified Files:
src/sys/arch/sparc64/include: ctlreg.h psl.h

Log Message:
Revert workarounds for clang.
In-tree clang can now handle the "r" asm constraint for 64-bit values properly.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/sparc64/include/ctlreg.h
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/sparc64/include/psl.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/sparc64/include/ctlreg.h
diff -u src/sys/arch/sparc64/include/ctlreg.h:1.66 src/sys/arch/sparc64/include/ctlreg.h:1.67
--- src/sys/arch/sparc64/include/ctlreg.h:1.66	Fri Apr  5 23:09:18 2019
+++ src/sys/arch/sparc64/include/ctlreg.h	Wed Nov 13 10:06:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ctlreg.h,v 1.66 2019/04/05 23:09:18 nakayama Exp $ */
+/*	$NetBSD: ctlreg.h,v 1.67 2019/11/13 10:06:38 nakayama Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -485,13 +485,12 @@
 #ifdef __arch64__
 
 /* 64-bit kernel, non-constant */
-#define SPARC64_LD_NONCONST(ld, type)	\
+#define SPARC64_LD_NONCONST(ld)	\
 	__asm volatile(			\
 		"wr %2,%%g0,%%asi;	"\
 		#ld " [%1]%%asi,%0	"\
 		: "=r" (_v)		\
-		: "r" ((__uintptr_t)(loc)), "r" (asi),			\
-		  "m" (*(type *)(__uintptr_t)(loc)))
+		: "r" ((__uintptr_t)(loc)), "r" (asi))
 
 #if defined(__GNUC__) && defined(__OPTIMIZE__)
 #define SPARC64_LD_DEF(ld, type, vtype)	\
@@ -502,10 +501,9 @@ static __inline type ld(paddr_t loc, int
 		__asm volatile(		\
 			#ld " [%1]%2,%0		"			\
 			: "=r" (_v)	\
-			: "r" ((__uintptr_t)(loc)), "n" (asi),		\
-			  "m" (*(type *)(__uintptr_t)(loc)));		\
+			: "r" ((__uintptr_t)(loc)), "n" (asi));		\
 	else\
-		SPARC64_LD_NONCONST(ld, type);\
+		SPARC64_LD_NONCONST(ld);\
 	return _v;			\
 }
 #else
@@ -513,7 +511,7 @@ static __inline type ld(paddr_t loc, int
 static __inline type ld(paddr_t loc, int asi)\
 {	\
 	vtype _v;			\
-	SPARC64_LD_NONCONST(ld, type);	\
+	SPARC64_LD_NONCONST(ld);	\
 	return _v;			\
 }
 #endif
@@ -679,12 +677,12 @@ SPARC64_LD_DEF64(ldxa, uint64_t)
 #ifdef __arch64__
 
 /* 64-bit kernel, non-constant */
-#define SPARC64_ST_NONCONST(st, type)	\
+#define SPARC64_ST_NONCONST(st)	\
 	__asm volatile(			\
-		"wr %3,%%g0,%%asi;	"\
-		#st " %1,[%2]%%asi	"\
-		: "=m" (*(type *)(__uintptr_t)(loc))			\
-		: "r" (value), "r" ((__uintptr_t)(loc)), "r" (asi))
+		"wr %2,%%g0,%%asi;	"\
+		#st " %0,[%1]%%asi	"\
+		: : "r" (value), "r" ((__uintptr_t)(loc)),		\
+		"r" (asi))
 
 #if defined(__GNUC__) && defined(__OPTIMIZE__)
 #define SPARC64_ST_DEF(st, type)	\
@@ -692,18 +690,17 @@ static __inline void st(paddr_t loc, int
 {	\
 	if (__builtin_constant_p(asi))	\
 		__asm volatile(		\
-			#st " %1,[%2]%3		"			\
-			: "=m" (*(type *)(__uintptr_t)(loc))		\
-			: "r" (value), "r" ((__uintptr_t)(loc)),	\
-			  "n" (asi));	\
+			#st " %0,[%1]%2		"			\
+			: : "r" (value), "r" ((__uintptr_t)(loc)),	\
+			"n" (asi));	\
 	else\
-		SPARC64_ST_NONCONST(st, type);\
+		SPARC64_ST_NONCONST(st);\
 }
 #else
 #define SPARC64_ST_DEF(st, type)	\
 static __inline void st(paddr_t loc, int asi, type value)		\
 {	\
-	SPARC64_ST_NONCONST(st, type);	\
+	SPARC64_ST_NONCONST(st);	\
 }
 #endif
 #define SPARC64_ST_DEF64(st, type)	SPARC64_ST_DEF(st, type)

Index: src/sys/arch/sparc64/include/psl.h
diff -u src/sys/arch/sparc64/include/psl.h:1.60 src/sys/arch/sparc64/include/psl.h:1.61
--- src/sys/arch/sparc64/include/psl.h:1.60	Sat Apr  6 21:40:15 2019
+++ src/sys/arch/sparc64/include/psl.h	Wed Nov 13 10:06:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.60 2019/04/06 21:40:15 nakayama Exp $ */
+/*	$NetBSD: psl.h,v 1.61 2019/11/13 10:06:38 nakayama Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -322,13 +322,11 @@ static __inline void set##name(type _val
 	__asm volatile(#wr " %0,0,%" #reg : : "r" (_val) : "memory");	\
 }
 
-/*
- * XXX: clang's "r" constraint cannot handle 64-bit,
- * so use 32-bit kernel code as a workaround.
- */
-#if defined(__arch64__) && !defined(__clang__)
+#ifdef __arch64__
 #define SPARC64_RDCONST64_DEF(rd, name, reg) \
 	SPARC64_RDCONST_DEF(rd, name, reg, uint64_t)
+#define SPARC64_RD64_DEF(rd, name, reg) SPARC64_RD_DEF(rd, name, reg, uint64_t)
+#define SPARC64_WR64_DEF(wr, name, reg) SPARC64_WR_DEF(wr, name, reg, uint64_t)
 #else
 #define SPARC64_RDCONST64_DEF(rd, name, reg)\
 static __inline __constfunc uint64_t get##name(void)			\
@@ -338,12 +336,6 @@ static __inline __constfunc uint64_t get
 		: "=r" (_hi), "=r" (_lo) : : constasm_clobbers);	\
 	return ((uint64_t)_hi << 32) | _lo;\
 }
-#endif
-
-#ifdef __arch64__
-#define SPARC64_RD64_DEF(rd, name, reg) SPARC64_RD_DEF(rd, name, reg, uint64_t)
-#define SPARC64_WR64_DEF(wr, name, reg) SPARC64_WR_DEF(wr, name, reg, uint64_t)
-#else
 #define 

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

2019-11-13 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Wed Nov 13 10:06:39 UTC 2019

Modified Files:
src/sys/arch/sparc64/include: ctlreg.h psl.h

Log Message:
Revert workarounds for clang.
In-tree clang can now handle the "r" asm constraint for 64-bit values properly.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/sparc64/include/ctlreg.h
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/sparc64/include/psl.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/conf

2019-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov  5 12:59:55 UTC 2019

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

Log Message:
Add GPT wedge autodiscovery


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/sys/arch/sparc64/conf/GENERIC

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

Modified files:

Index: src/sys/arch/sparc64/conf/GENERIC
diff -u src/sys/arch/sparc64/conf/GENERIC:1.217 src/sys/arch/sparc64/conf/GENERIC:1.218
--- src/sys/arch/sparc64/conf/GENERIC:1.217	Tue Nov  5 12:28:23 2019
+++ src/sys/arch/sparc64/conf/GENERIC	Tue Nov  5 12:59:54 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.217 2019/11/05 12:28:23 martin Exp $
+# $NetBSD: GENERIC,v 1.218 2019/11/05 12:59:54 martin Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/sparc64/conf/std.sparc64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.217 $"
+#ident		"GENERIC-$Revision: 1.218 $"
 
 maxusers	64
 
@@ -138,6 +138,14 @@ options 	COMPAT_NETBSD32	# NetBSD/sparc 
 options 	EXEC_AOUT	# execve(2) support for a.out binaries
 options 	EXEC_ELF32	# Exec module for SunOS 5.x binaries.
 
+# Wedge support
+options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
+options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
+#options 	DKWEDGE_METHOD_BSDLABEL	# Support disklabel entries as wedges
+#options 	DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
+#options 	DKWEDGE_METHOD_APPLE	# Support Apple partitions as wedges
+#options 	DKWEDGE_METHOD_RDB	# Support RDB partitions as wedges
+
 ## File systems.
 include "conf/filesystems.config"
 



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

2019-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov  5 12:59:55 UTC 2019

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

Log Message:
Add GPT wedge autodiscovery


To generate a diff of this commit:
cvs rdiff -u -r1.217 -r1.218 src/sys/arch/sparc64/conf/GENERIC

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



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

2019-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov  5 12:28:23 UTC 2019

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

Log Message:
Add siisata* at pci (no idea why it was missing)


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/sys/arch/sparc64/conf/GENERIC

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

Modified files:

Index: src/sys/arch/sparc64/conf/GENERIC
diff -u src/sys/arch/sparc64/conf/GENERIC:1.216 src/sys/arch/sparc64/conf/GENERIC:1.217
--- src/sys/arch/sparc64/conf/GENERIC:1.216	Mon May  6 02:24:37 2019
+++ src/sys/arch/sparc64/conf/GENERIC	Tue Nov  5 12:28:23 2019
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.216 2019/05/06 02:24:37 sevan Exp $
+# $NetBSD: GENERIC,v 1.217 2019/11/05 12:28:23 martin Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/sparc64/conf/std.sparc64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.216 $"
+#ident		"GENERIC-$Revision: 1.217 $"
 
 maxusers	64
 
@@ -353,6 +353,7 @@ optiide* at pci? dev ? function ?	# Opti
 pdcide* at pci? dev ? function ?	# Promise IDE controllers
 pdcsata* at pci? dev ? function ?	# Promise SATA150 controllers
 satalink* at pci? dev ? function ?	# SiI SATALink controllers
+siisata* at pci? dev ? function ?	# SiI SteelVine controllers
 siside* at pci? dev ? function ?	# SiS IDE controllers
 slide*	at pci? dev ? function ?	# Symphony Labs IDE controllers
 viaide* at pci? dev ? function ?	# VIA/AMD/Nvidia IDE controllers



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

2019-11-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Nov  5 12:28:23 UTC 2019

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

Log Message:
Add siisata* at pci (no idea why it was missing)


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/sys/arch/sparc64/conf/GENERIC

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



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

2019-07-18 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Thu Jul 18 18:21:45 UTC 2019

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
sun4v: added some missing comments to the code in pcbspill


To generate a diff of this commit:
cvs rdiff -u -r1.420 -r1.421 src/sys/arch/sparc64/sparc64/locore.s

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



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

2019-05-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May 22 15:10:13 UTC 2019

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

Log Message:
Add missing include to fix the crash(8) build, from Tobias Ulmer, PR 
port-sparc64/54221


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/sparc64/sparc64/db_trace.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/db_trace.c
diff -u src/sys/arch/sparc64/sparc64/db_trace.c:1.52 src/sys/arch/sparc64/sparc64/db_trace.c:1.53
--- src/sys/arch/sparc64/sparc64/db_trace.c:1.52	Wed May 22 07:40:09 2019
+++ src/sys/arch/sparc64/sparc64/db_trace.c	Wed May 22 15:10:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_trace.c,v 1.52 2019/05/22 07:40:09 martin Exp $ */
+/*	$NetBSD: db_trace.c,v 1.53 2019/05/22 15:10:13 martin Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.52 2019/05/22 07:40:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.53 2019/05/22 15:10:13 martin Exp $");
 
 #include 
 #include 
@@ -36,6 +36,7 @@ __KERNEL_RCSID(0, "$NetBSD: db_trace.c,v
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 



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

2019-05-22 Thread Tobias Ulmer
Oh, should've tested that. Survived kernels and distribution:

diff --git a/sys/arch/sparc64/sparc64/db_trace.c 
b/sys/arch/sparc64/sparc64/db_trace.c
index f5e35e79dd51..d94e5eb2d2ef 100644
--- a/sys/arch/sparc64/sparc64/db_trace.c
+++ b/sys/arch/sparc64/sparc64/db_trace.c
@@ -36,6 +36,7 @@ __KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.52 2019/05/22 
07:40:09 martin Exp $")
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 


On Wed, May 22, 2019 at 03:02:13PM +0200, J. Hannken-Illjes wrote:
> This breaks the build of usr.sbin/crash:
> 
> /work/build/src/usr.sbin/crash/../../sys/arch/sparc64/sparc64/db_trace.c: In 
> function 'db_stack_trace_print':
> /work/build/src/usr.sbin/crash/../../sys/arch/sparc64/sparc64/db_trace.c:166:37:
>  error: 'VM_MAX_KERNEL_ADDRESS' undeclared (first use in this function); did 
> you mean 'VM_MAXADDRESS'?
> if (frame < KERNBASE || frame >= VM_MAX_KERNEL_ADDRESS)
>  ^
>  VM_MAXADDRESS
> /work/build/src/usr.sbin/crash/../../sys/arch/sparc64/sparc64/db_trace.c:166:37:
>  note: each undeclared identifier is reported only once for each function it 
> appears in
> 
> --
> J. Hannken-Illjes - hann...@eis.cs.tu-bs.de - TU Braunschweig
> 
> > On 22. May 2019, at 09:40, Martin Husemann  wrote:
> > 
> > Module Name:src
> > Committed By:   martin
> > Date:   Wed May 22 07:40:09 UTC 2019
> > 
> > Modified Files:
> > src/sys/arch/sparc64/sparc64: db_trace.c
> > 
> > Log Message:
> > Fix previous and use the original patch from PR port-sparc64/54221
> > instead (XXX should fix comments in param.h)
> > 
> > 
> > To generate a diff of this commit:
> > cvs rdiff -u -r1.51 -r1.52 src/sys/arch/sparc64/sparc64/db_trace.c
> > 
> > Please note that diffs are not public domain; they are subject to the
> > copyright notices on the relevant files.
> > 
> 




  1   2   3   >