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

2024-06-17 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Jun 17 20:25:20 UTC 2024

Modified Files:
src/sys/arch/mips/mips: netbsd32_machdep_13.c netbsd32_machdep_16.c

Log Message:
Proteect #include of kernel options files with #ifdef _KERNEL_OPT

XXX Add to existing 10.0 and 9.0 tickets for kern/583346


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/mips/netbsd32_machdep_13.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/mips/netbsd32_machdep_16.c

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

Modified files:

Index: src/sys/arch/mips/mips/netbsd32_machdep_13.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep_13.c:1.3 src/sys/arch/mips/mips/netbsd32_machdep_13.c:1.4
--- src/sys/arch/mips/mips/netbsd32_machdep_13.c:1.3	Wed Nov 13 16:11:27 2019
+++ src/sys/arch/mips/mips/netbsd32_machdep_13.c	Mon Jun 17 20:25:20 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_13.c,v 1.3 2019/11/13 16:11:27 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_machdep_13.c,v 1.4 2024/06/17 20:25:20 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,9 +30,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_13.c,v 1.3 2019/11/13 16:11:27 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_13.c,v 1.4 2024/06/17 20:25:20 pgoyette Exp $");
 
+#ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
+#endif
 
 #include 
 #include 

Index: src/sys/arch/mips/mips/netbsd32_machdep_16.c
diff -u src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.7 src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.8
--- src/sys/arch/mips/mips/netbsd32_machdep_16.c:1.7	Sat Nov  6 20:42:56 2021
+++ src/sys/arch/mips/mips/netbsd32_machdep_16.c	Mon Jun 17 20:25:20 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep_16.c,v 1.7 2021/11/06 20:42:56 thorpej Exp $	*/
+/*	$NetBSD: netbsd32_machdep_16.c,v 1.8 2024/06/17 20:25:20 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,9 +30,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.7 2021/11/06 20:42:56 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.8 2024/06/17 20:25:20 pgoyette Exp $");
 
+#ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
+#endif
 
 #include 
 #include 



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

2024-06-17 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Jun 17 20:25:20 UTC 2024

Modified Files:
src/sys/arch/mips/mips: netbsd32_machdep_13.c netbsd32_machdep_16.c

Log Message:
Proteect #include of kernel options files with #ifdef _KERNEL_OPT

XXX Add to existing 10.0 and 9.0 tickets for kern/583346


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/mips/mips/netbsd32_machdep_13.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/mips/netbsd32_machdep_16.c

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



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

2024-06-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jun  4 20:43:58 UTC 2024

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

Log Message:
mips/bus_dma.c: KNF

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/mips/mips/bus_dma.c

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



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

2024-06-04 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jun  4 20:43:58 UTC 2024

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

Log Message:
mips/bus_dma.c: KNF

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/mips/mips/bus_dma.c

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

Modified files:

Index: src/sys/arch/mips/mips/bus_dma.c
diff -u src/sys/arch/mips/mips/bus_dma.c:1.47 src/sys/arch/mips/mips/bus_dma.c:1.48
--- src/sys/arch/mips/mips/bus_dma.c:1.47	Tue Jul 26 20:08:55 2022
+++ src/sys/arch/mips/mips/bus_dma.c	Tue Jun  4 20:43:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.47 2022/07/26 20:08:55 andvar Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.48 2024/06/04 20:43:58 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001, 2020 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.47 2022/07/26 20:08:55 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.48 2024/06/04 20:43:58 riastradh Exp $");
 
 #define _MIPS_BUS_DMA_PRIVATE
 
@@ -56,9 +56,12 @@ __KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 
 
 #include 
 
-const struct mips_bus_dmamap_ops mips_bus_dmamap_ops = _BUS_DMAMAP_OPS_INITIALIZER;
-const struct mips_bus_dmamem_ops mips_bus_dmamem_ops = _BUS_DMAMEM_OPS_INITIALIZER;
-const struct mips_bus_dmatag_ops mips_bus_dmatag_ops = _BUS_DMATAG_OPS_INITIALIZER;
+const struct mips_bus_dmamap_ops mips_bus_dmamap_ops =
+_BUS_DMAMAP_OPS_INITIALIZER;
+const struct mips_bus_dmamem_ops mips_bus_dmamem_ops =
+_BUS_DMAMEM_OPS_INITIALIZER;
+const struct mips_bus_dmatag_ops mips_bus_dmatag_ops =
+_BUS_DMATAG_OPS_INITIALIZER;
 
 static struct evcnt bus_dma_creates =
 	EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "busdma", "creates");
@@ -133,7 +136,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 		if (curaddr < t->_bounce_alloc_lo
 		|| (t->_bounce_alloc_hi != 0
 			&& curaddr >= t->_bounce_alloc_hi))
-			return (EINVAL);
+			return EINVAL;
 #if BUS_DMA_DEBUG
 		printf("dma: addr %#"PRIxPADDR" -> %#"PRIxPADDR"\n", curaddr,
 		(curaddr - t->_bounce_alloc_lo) + t->_wbase);
@@ -223,22 +226,22 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t,
 		 * If there is a chained window, we will automatically
 		 * fall back to it.
 		 */
-		return (EFBIG);		/* XXX better return value here? */
+		return EFBIG;		/* XXX better return value here? */
 	}
 
-	return (0);
+	return 0;
 }
 
 #ifdef _MIPS_NEED_BUS_DMA_BOUNCE
 static int _bus_dma_alloc_bouncebuf(bus_dma_tag_t t, bus_dmamap_t map,
-	bus_size_t size, int flags);
+bus_size_t size, int flags);
 static void _bus_dma_free_bouncebuf(bus_dma_tag_t t, bus_dmamap_t map);
 static int _bus_dma_uiomove(void *buf, struct uio *uio, size_t n,
-	int direction);
+int direction);
 
 static int
 _bus_dma_load_bouncebuf(bus_dma_tag_t t, bus_dmamap_t map, void *buf,
-	size_t buflen, int buftype, int flags)
+size_t buflen, int buftype, int flags)
 {
 	struct mips_bus_dma_cookie * const cookie = map->_dm_cookie;
 	struct vmspace * const vm = vmspace_kernel();
@@ -253,7 +256,7 @@ _bus_dma_load_bouncebuf(bus_dma_tag_t t,
 	if ((cookie->id_flags & _BUS_DMA_HAS_BOUNCE) == 0) {
 		error = _bus_dma_alloc_bouncebuf(t, map, buflen, flags);
 		if (error)
-			return (error);
+			return error;
 	}
 
 	/*
@@ -267,7 +270,7 @@ _bus_dma_load_bouncebuf(bus_dma_tag_t t,
 	error = _bus_dmamap_load_buffer(t, map, cookie->id_bouncebuf,
 	buflen, vm, flags, &seg, 0, true);
 	if (error)
-		return (error);
+		return error;
 
 	STAT_INCR(bounced_loads);
 	map->dm_mapsize = buflen;
@@ -332,7 +335,7 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 	 */
 	if ((mapstore = kmem_zalloc(_bus_dmamap_mapsize(nsegments),
 	 allocflags)) == NULL)
-		return (ENOMEM);
+		return ENOMEM;
 
 	map = mapstore;
 	map->_dm_size = size;
@@ -375,7 +378,7 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 	 * Allocate our cookie.
 	 */
 	if ((cookiestore = kmem_zalloc(_bus_dmamap_cookiesize(nsegments),
-	 allocflags)) == NULL) {
+		allocflags)) == NULL) {
 		error = ENOMEM;
 		goto out;
 	}
@@ -392,7 +395,7 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_
 	STAT_INCR(creates);
 #endif /* _MIPS_NEED_BUS_DMA_BOUNCE */
 
-	return (error);
+	return error;
 }
 
 /*
@@ -459,7 +462,7 @@ _bus_dmamap_load(bus_dma_tag_t t, bus_dm
 	KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz);
 
 	if (buflen > map->_dm_size)
-		return (EINVAL);
+		return EINVAL;
 
 	if (p != NULL) {
 		vm = p->p_vmspace;
@@ -488,20 +491,22 @@ _bus_dmamap_load(bus_dma_tag_t t, bus_dm
 		else if (MIPS_KSEG1_P(buf))
 			map->_dm_flags |= _BUS_DMAMAP_COHERENT;
 #ifdef _LP64
-		else if (MIPS_XKPHYS_P((vaddr_t)buf)
-		&& MIPS_XKPHYS_TO_CCA((vaddr_t)buf) == MIPS3_PG_TO_CCA(MIPS3_PG_UNCACHED))
+		else if (MIPS_XKPHYS_P((vaddr_t)buf) &&
+		(MIPS_XKPHYS_TO_CCA((vaddr_t)buf) ==
+			MIPS3_PG_TO_CCA(MIPS3_PG_UNCACHED)

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

2024-04-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Apr 14 07:56:45 UTC 2024

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

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/mips/mips/sig_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/mips/mips/sig_machdep.c
diff -u src/sys/arch/mips/mips/sig_machdep.c:1.24 src/sys/arch/mips/mips/sig_machdep.c:1.25
--- src/sys/arch/mips/mips/sig_machdep.c:1.24	Tue Nov 27 14:09:54 2018
+++ src/sys/arch/mips/mips/sig_machdep.c	Sun Apr 14 07:56:45 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: sig_machdep.c,v 1.24 2018/11/27 14:09:54 maxv Exp $	*/
+/*	$NetBSD: sig_machdep.c,v 1.25 2024/04/14 07:56:45 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,8 +30,8 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-	
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.24 2018/11/27 14:09:54 maxv Exp $"); 
+
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.25 2024/04/14 07:56:45 skrll Exp $");
 
 #include "opt_cputype.h"
 
@@ -48,12 +48,12 @@ __KERNEL_RCSID(0, "$NetBSD: sig_machdep.
 #include 
 #include 
 
-void *	
+void *
 getframe(struct lwp *l, int sig, int *onstack)
 {
 	struct proc * const p = l->l_proc;
 	struct trapframe * const tf = l->l_md.md_utf;
- 
+
 	/* Do we need to jump onto the signal stack? */
 	*onstack = (l->l_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0
 	&& (SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;



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

2024-04-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Apr 14 07:56:45 UTC 2024

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

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/mips/mips/sig_machdep.c

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



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

2024-01-05 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jan  6 07:27:35 UTC 2024

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

Log Message:
Remove funny blank line.


To generate a diff of this commit:
cvs rdiff -u -r1.305 -r1.306 src/sys/arch/mips/mips/mips_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/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.305 src/sys/arch/mips/mips/mips_machdep.c:1.306
--- src/sys/arch/mips/mips/mips_machdep.c:1.305	Sat Jan  6 07:27:05 2024
+++ src/sys/arch/mips/mips/mips_machdep.c	Sat Jan  6 07:27:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.305 2024/01/06 07:27:05 simonb Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.306 2024/01/06 07:27:35 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.305 2024/01/06 07:27:05 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.306 2024/01/06 07:27:35 simonb Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -2311,7 +2311,6 @@ mips_page_physload(vaddr_t vkernstart, v
 			 * Now we give this segment to uvm.
 			 */
 			printf("adding %#"PRIxPADDR" @ %#"PRIxPADDR" to freelist %d\n",
-
 			segend - segstart, segstart, freelist);
 			paddr_t first = atop(segstart);
 			paddr_t last = atop(segend);



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

2024-01-05 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jan  6 07:27:35 UTC 2024

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

Log Message:
Remove funny blank line.


To generate a diff of this commit:
cvs rdiff -u -r1.305 -r1.306 src/sys/arch/mips/mips/mips_machdep.c

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



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

2024-01-05 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jan  6 07:27:05 UTC 2024

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

Log Message:
Add Cavium CN68xx to list of known CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.304 -r1.305 src/sys/arch/mips/mips/mips_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/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.304 src/sys/arch/mips/mips/mips_machdep.c:1.305
--- src/sys/arch/mips/mips/mips_machdep.c:1.304	Sun Oct 23 06:10:09 2022
+++ src/sys/arch/mips/mips/mips_machdep.c	Sat Jan  6 07:27:05 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.304 2022/10/23 06:10:09 skrll Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.305 2024/01/06 07:27:05 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.304 2022/10/23 06:10:09 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.305 2024/01/06 07:27:05 simonb Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -671,6 +671,14 @@ static const struct pridtab cputab[] = {
 	  0,
 	  "CN50xx"		},
 
+	{ MIPS_PRID_CID_CAVIUM, MIPS_CN68XX, -1, -1, -1, 0,
+	  MIPS64_FLAGS | CPU_MIPS_D_CACHE_COHERENT | CPU_MIPS_NO_LLADDR,
+	  MIPS_CP0FL_USE |
+	  MIPS_CP0FL_CONFIG  | MIPS_CP0FL_CONFIG1 | MIPS_CP0FL_CONFIG2 |
+	  MIPS_CP0FL_CONFIG3 | MIPS_CP0FL_CONFIG4,
+	  0,
+	  "CN68xx"		},
+
 	{ MIPS_PRID_CID_CAVIUM, MIPS_CN70XX, -1, -1, -1, 0,
 	  MIPS64_FLAGS | CPU_MIPS_D_CACHE_COHERENT | CPU_MIPS_NO_LLADDR,
 	  MIPS_CP0FL_USE | MIPS_CP0FL_EBASE |



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

2024-01-05 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jan  6 07:27:05 UTC 2024

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

Log Message:
Add Cavium CN68xx to list of known CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.304 -r1.305 src/sys/arch/mips/mips/mips_machdep.c

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



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

2023-12-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec  5 17:38:40 UTC 2023

Modified Files:
src/sys/arch/mips/mips: lock_stubs_llsc.S

Log Message:
Add missing PTR_WORD command in front of 0.

Likely accidentally missed in the commit, since rev 1.9.

In theory needs pull-ups for netbsd-9, -10, but nobody noticed for 4 years...


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/mips/mips/lock_stubs_llsc.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/mips/mips/lock_stubs_llsc.S
diff -u src/sys/arch/mips/mips/lock_stubs_llsc.S:1.17 src/sys/arch/mips/mips/lock_stubs_llsc.S:1.18
--- src/sys/arch/mips/mips/lock_stubs_llsc.S:1.17	Sun Feb 27 19:22:29 2022
+++ src/sys/arch/mips/mips/lock_stubs_llsc.S	Tue Dec  5 17:38:40 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs_llsc.S,v 1.17 2022/02/27 19:22:29 riastradh Exp $	*/
+/*	$NetBSD: lock_stubs_llsc.S,v 1.18 2023/12/05 17:38:40 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #include 
 
-RCSID("$NetBSD: lock_stubs_llsc.S,v 1.17 2022/02/27 19:22:29 riastradh Exp $")
+RCSID("$NetBSD: lock_stubs_llsc.S,v 1.18 2023/12/05 17:38:40 andvar Exp $")
 
 #include "assym.h"
 
@@ -362,7 +362,7 @@ EXPORT_OBJECT(mips_llsc_locore_atomicvec
 #ifdef _LP64
 	PTR_WORD	llsc_ucas_64
 #else
-			0
+	PTR_WORD	0
 #endif /* _LP64 */
 #ifdef LOCKDEBUG
 	PTR_WORD	mutex_vector_enter



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

2023-12-05 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Dec  5 17:38:40 UTC 2023

Modified Files:
src/sys/arch/mips/mips: lock_stubs_llsc.S

Log Message:
Add missing PTR_WORD command in front of 0.

Likely accidentally missed in the commit, since rev 1.9.

In theory needs pull-ups for netbsd-9, -10, but nobody noticed for 4 years...


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

2023-10-24 Thread Andrius V
Thank you, I should pay attention to that.

On Wed, Oct 25, 2023 at 9:02 AM Nick Hudson  wrote:
>
> Module Name:src
> Committed By:   skrll
> Date:   Wed Oct 25 06:02:14 UTC 2023
>
> Modified Files:
> src/sys/arch/mips/mips: kgdb_machdep.c
>
> Log Message:
>  -> 
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.21 -r1.22 src/sys/arch/mips/mips/kgdb_machdep.c
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>


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

2023-10-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct 25 06:02:14 UTC 2023

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

Log Message:
 -> 


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/mips/mips/kgdb_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/mips/mips/kgdb_machdep.c
diff -u src/sys/arch/mips/mips/kgdb_machdep.c:1.21 src/sys/arch/mips/mips/kgdb_machdep.c:1.22
--- src/sys/arch/mips/mips/kgdb_machdep.c:1.21	Wed Oct 25 06:01:29 2023
+++ src/sys/arch/mips/mips/kgdb_machdep.c	Wed Oct 25 06:02:14 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kgdb_machdep.c,v 1.21 2023/10/25 06:01:29 skrll Exp $	*/
+/*	$NetBSD: kgdb_machdep.c,v 1.22 2023/10/25 06:02:14 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.21 2023/10/25 06:01:29 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.22 2023/10/25 06:02:14 skrll Exp $");
 
 #include "opt_ddb.h"
 
@@ -186,14 +186,14 @@ kgdb_getregs(db_regs_t *regs, kgdb_reg_t
 	gdb_regs[ 6] = regs->r_regs[_R_A2];	/* A2 */
 	gdb_regs[ 7] = regs->r_regs[_R_A3];	/* A3 */
 #if defined(__mips_n32) || defined(__mips_n64)
-gdb_regs[ 8] = regs->r_regs[_R_A4]; /* A4 */
-gdb_regs[ 9] = regs->r_regs[_R_A5]; /* A5 */
-gdb_regs[10] = regs->r_regs[_R_A6]; /* A6 */
-gdb_regs[11] = regs->r_regs[_R_A7]; /* A7 */
-gdb_regs[12] = regs->r_regs[_R_T0]; /* T0 */
-gdb_regs[13] = regs->r_regs[_R_T1]; /* T1 */
-gdb_regs[14] = regs->r_regs[_R_T2]; /* T2 */
-gdb_regs[15] = regs->r_regs[_R_T3]; /* T3 */
+	gdb_regs[ 8] = regs->r_regs[_R_A4];	/* A4 */
+	gdb_regs[ 9] = regs->r_regs[_R_A5];	/* A5 */
+	gdb_regs[10] = regs->r_regs[_R_A6];	/* A6 */
+	gdb_regs[11] = regs->r_regs[_R_A7];	/* A7 */
+	gdb_regs[12] = regs->r_regs[_R_T0];	/* T0 */
+	gdb_regs[13] = regs->r_regs[_R_T1];	/* T1 */
+	gdb_regs[14] = regs->r_regs[_R_T2];	/* T2 */
+	gdb_regs[15] = regs->r_regs[_R_T3];	/* T3 */
 #else
 	gdb_regs[ 8] = regs->r_regs[_R_T0];	/* T0 */
 	gdb_regs[ 9] = regs->r_regs[_R_T1];	/* T1 */



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

2023-10-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct 25 06:02:14 UTC 2023

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

Log Message:
 -> 


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

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



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

2023-10-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct 25 06:01:29 UTC 2023

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/mips/mips/kgdb_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/mips/mips/kgdb_machdep.c
diff -u src/sys/arch/mips/mips/kgdb_machdep.c:1.20 src/sys/arch/mips/mips/kgdb_machdep.c:1.21
--- src/sys/arch/mips/mips/kgdb_machdep.c:1.20	Tue Oct 24 22:04:24 2023
+++ src/sys/arch/mips/mips/kgdb_machdep.c	Wed Oct 25 06:01:29 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kgdb_machdep.c,v 1.20 2023/10/24 22:04:24 andvar Exp $	*/
+/*	$NetBSD: kgdb_machdep.c,v 1.21 2023/10/25 06:01:29 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.20 2023/10/24 22:04:24 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.21 2023/10/25 06:01:29 skrll Exp $");
 
 #include "opt_ddb.h"
 
@@ -100,7 +100,7 @@ kvacc(vaddr_t kva)
 {
 	if (pmap_md_direct_mapped_vaddr_p(kva))
 		return 1;
-	
+
 	if (kva < VM_MIN_KERNEL_ADDRESS || kva >= VM_MAX_KERNEL_ADDRESS)
 		return 0;
 
@@ -132,7 +132,7 @@ kgdb_acc(vaddr_t va, size_t len)
  * Translate a trap number into a unix compatible signal value.
  * (gdb only understands unix signal numbers).
  */
-int 
+int
 kgdb_signal(int type)
 {
 	switch (type) {
@@ -162,7 +162,7 @@ kgdb_signal(int type)
 	case T_FPE+T_USER:
 	case T_OVFLOW+T_USER:
 		return (SIGFPE);
-		
+
 	default:
 		return (SIGEMT);
 	}
@@ -233,7 +233,7 @@ void
 kgdb_setregs(db_regs_t *regs, kgdb_reg_t *gdb_regs)
 {
 	regs->r_regs[_R_PC] = gdb_regs[37];   /* PC */
-}	
+}
 
 /*
  * Trap into kgdb to wait for debugger to connect,



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

2023-10-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct 25 06:01:29 UTC 2023

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/mips/mips/kgdb_machdep.c

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



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

2023-10-24 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Oct 24 22:04:24 UTC 2023

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

Log Message:
add two blocks of db_regs_t to gdb translation, according to regnum.h
definitions and if either __mips_n32 or __mips_n64 is defined.

Fixes compilation of this file in case one those is defined.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/mips/mips/kgdb_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/mips/mips/kgdb_machdep.c
diff -u src/sys/arch/mips/mips/kgdb_machdep.c:1.19 src/sys/arch/mips/mips/kgdb_machdep.c:1.20
--- src/sys/arch/mips/mips/kgdb_machdep.c:1.19	Tue Oct 24 18:01:31 2023
+++ src/sys/arch/mips/mips/kgdb_machdep.c	Tue Oct 24 22:04:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kgdb_machdep.c,v 1.19 2023/10/24 18:01:31 andvar Exp $	*/
+/*	$NetBSD: kgdb_machdep.c,v 1.20 2023/10/24 22:04:24 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.19 2023/10/24 18:01:31 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.20 2023/10/24 22:04:24 andvar Exp $");
 
 #include "opt_ddb.h"
 
@@ -185,6 +185,16 @@ kgdb_getregs(db_regs_t *regs, kgdb_reg_t
 	gdb_regs[ 5] = regs->r_regs[_R_A1];	/* A1 */
 	gdb_regs[ 6] = regs->r_regs[_R_A2];	/* A2 */
 	gdb_regs[ 7] = regs->r_regs[_R_A3];	/* A3 */
+#if defined(__mips_n32) || defined(__mips_n64)
+gdb_regs[ 8] = regs->r_regs[_R_A4]; /* A4 */
+gdb_regs[ 9] = regs->r_regs[_R_A5]; /* A5 */
+gdb_regs[10] = regs->r_regs[_R_A6]; /* A6 */
+gdb_regs[11] = regs->r_regs[_R_A7]; /* A7 */
+gdb_regs[12] = regs->r_regs[_R_T0]; /* T0 */
+gdb_regs[13] = regs->r_regs[_R_T1]; /* T1 */
+gdb_regs[14] = regs->r_regs[_R_T2]; /* T2 */
+gdb_regs[15] = regs->r_regs[_R_T3]; /* T3 */
+#else
 	gdb_regs[ 8] = regs->r_regs[_R_T0];	/* T0 */
 	gdb_regs[ 9] = regs->r_regs[_R_T1];	/* T1 */
 	gdb_regs[10] = regs->r_regs[_R_T2];	/* T2 */
@@ -193,6 +203,7 @@ kgdb_getregs(db_regs_t *regs, kgdb_reg_t
 	gdb_regs[13] = regs->r_regs[_R_T5];	/* T5 */
 	gdb_regs[14] = regs->r_regs[_R_T6];	/* T6 */
 	gdb_regs[15] = regs->r_regs[_R_T7];	/* T7 */
+#endif /* __mips_n32 || __mips_n64 */
 	gdb_regs[16] = regs->r_regs[_R_S0];	/* S0 */
 	gdb_regs[17] = regs->r_regs[_R_S1];	/* S1 */
 	gdb_regs[18] = regs->r_regs[_R_S2];	/* S2 */



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

2023-10-24 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Oct 24 22:04:24 UTC 2023

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

Log Message:
add two blocks of db_regs_t to gdb translation, according to regnum.h
definitions and if either __mips_n32 or __mips_n64 is defined.

Fixes compilation of this file in case one those is defined.


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

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



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

2023-10-24 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Oct 24 18:08:16 UTC 2023

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

Log Message:
pass &tf->tf_registers instead of tf to db_set_ddb_regs().
use _R_PC definition instead of TF_EPC for tf->tf_regs[].
Changes were not adjusted with mips64 merge for kgdb code.

makes trap.c build with KGDB option enabled for mips archs.


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

2023-10-24 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Oct 24 18:08:16 UTC 2023

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

Log Message:
pass &tf->tf_registers instead of tf to db_set_ddb_regs().
use _R_PC definition instead of TF_EPC for tf->tf_regs[].
Changes were not adjusted with mips64 merge for kgdb code.

makes trap.c build with KGDB option enabled for mips archs.


To generate a diff of this commit:
cvs rdiff -u -r1.264 -r1.265 src/sys/arch/mips/mips/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/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.264 src/sys/arch/mips/mips/trap.c:1.265
--- src/sys/arch/mips/mips/trap.c:1.264	Thu Oct  5 19:41:04 2023
+++ src/sys/arch/mips/mips/trap.c	Tue Oct 24 18:08:16 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.264 2023/10/05 19:41:04 ad Exp $	*/
+/*	$NetBSD: trap.c,v 1.265 2023/10/24 18:08:16 andvar Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.264 2023/10/05 19:41:04 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.265 2023/10/24 18:08:16 andvar Exp $");
 
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 #include "opt_ddb.h"
@@ -282,10 +282,10 @@ trap(uint32_t status, uint32_t cause, va
 			 * that db_machdep.h macros will work with it, and
 			 * allow gdb to alter the PC.
 			 */
-			db_set_ddb_regs(type, tf);
+			db_set_ddb_regs(type, &tf->tf_registers);
 			PC_BREAK_ADVANCE(regs);
 			if (kgdb_trap(type, regs)) {
-tf->tf_regs[TF_EPC] = regs->r_regs[_R_PC];
+tf->tf_regs[_R_PC] = regs->r_regs[_R_PC];
 return;
 			}
 		}



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

2023-10-24 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Oct 24 18:01:31 UTC 2023

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

Log Message:
move locore.h include above pte.h, which uses some of its definitions.
fix typo in pte_valid_p() argument, *pte->*ptep.

makes this file build with KGDB option enabled on MIPS archs.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/mips/mips/kgdb_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/mips/mips/kgdb_machdep.c
diff -u src/sys/arch/mips/mips/kgdb_machdep.c:1.18 src/sys/arch/mips/mips/kgdb_machdep.c:1.19
--- src/sys/arch/mips/mips/kgdb_machdep.c:1.18	Mon Jul 11 16:15:36 2016
+++ src/sys/arch/mips/mips/kgdb_machdep.c	Tue Oct 24 18:01:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kgdb_machdep.c,v 1.18 2016/07/11 16:15:36 matt Exp $	*/
+/*	$NetBSD: kgdb_machdep.c,v 1.19 2023/10/24 18:01:31 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.18 2016/07/11 16:15:36 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.19 2023/10/24 18:01:31 andvar Exp $");
 
 #include "opt_ddb.h"
 
@@ -81,9 +81,9 @@ __KERNEL_RCSID(0, "$NetBSD: kgdb_machdep
 
 #include 
 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -105,7 +105,7 @@ kvacc(vaddr_t kva)
 		return 0;
 
 	const pt_entry_t * const ptep = pmap_pte_lookup(pmap_kernel(), kva);
-	return ptep != NULL && pte_valid_p(*pte);
+	return ptep != NULL && pte_valid_p(*ptep);
 }
 
 /*



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

2023-10-24 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Oct 24 18:01:31 UTC 2023

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

Log Message:
move locore.h include above pte.h, which uses some of its definitions.
fix typo in pte_valid_p() argument, *pte->*ptep.

makes this file build with KGDB option enabled on MIPS archs.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/mips/mips/kgdb_machdep.c

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



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

2023-09-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Sep 14 03:24:07 UTC 2023

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

Log Message:
mips/trap: Fix reversed ksi_code for SIGTRAP cases

It should be TRAP_TRACE and TRAP_BRKPT for software single stepping
and ``real'' break insn, respectively.


To generate a diff of this commit:
cvs rdiff -u -r1.262 -r1.263 src/sys/arch/mips/mips/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/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.262 src/sys/arch/mips/mips/trap.c:1.263
--- src/sys/arch/mips/mips/trap.c:1.262	Sun Mar 13 17:50:55 2022
+++ src/sys/arch/mips/mips/trap.c	Thu Sep 14 03:24:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.262 2022/03/13 17:50:55 andvar Exp $	*/
+/*	$NetBSD: trap.c,v 1.263 2023/09/14 03:24:07 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.262 2022/03/13 17:50:55 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.263 2023/09/14 03:24:07 rin Exp $");
 
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 #include "opt_ddb.h"
@@ -604,7 +604,7 @@ trap(uint32_t status, uint32_t cause, va
 			ksi.ksi_trap = type & ~T_USER;
 			ksi.ksi_signo = SIGTRAP;
 			ksi.ksi_addr = (void *)va;
-			ksi.ksi_code = TRAP_TRACE;
+			ksi.ksi_code = TRAP_BRKPT;
 
 			if ((insn.JType.op == OP_SPECIAL) &&
 			(insn.RType.func == OP_BREAK)) {
@@ -662,7 +662,7 @@ trap(uint32_t status, uint32_t cause, va
 		ksi.ksi_trap = type & ~T_USER;
 		ksi.ksi_signo = SIGTRAP;
 		ksi.ksi_addr = (void *)va;
-		ksi.ksi_code = TRAP_BRKPT;
+		ksi.ksi_code = TRAP_TRACE;
 		break; /* SIGNAL */
 	}
 	case T_DSP+T_USER:



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

2023-09-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Sep 14 03:24:07 UTC 2023

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

Log Message:
mips/trap: Fix reversed ksi_code for SIGTRAP cases

It should be TRAP_TRACE and TRAP_BRKPT for software single stepping
and ``real'' break insn, respectively.


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

2023-05-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May 22 06:50:52 UTC 2023

Modified Files:
src/sys/arch/mips/mips: spl.S

Log Message:
Fix a comment


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/mips/mips/spl.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/mips/mips/spl.S
diff -u src/sys/arch/mips/mips/spl.S:1.19 src/sys/arch/mips/mips/spl.S:1.20
--- src/sys/arch/mips/mips/spl.S:1.19	Sun Aug  9 09:23:17 2020
+++ src/sys/arch/mips/mips/spl.S	Mon May 22 06:50:52 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: spl.S,v 1.19 2020/08/09 09:23:17 skrll Exp $	*/
+/*	$NetBSD: spl.S,v 1.20 2023/05/22 06:50:52 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #include 
 #include 
 
-RCSID("$NetBSD: spl.S,v 1.19 2020/08/09 09:23:17 skrll Exp $")
+RCSID("$NetBSD: spl.S,v 1.20 2023/05/22 06:50:52 skrll Exp $")
 
 #include "assym.h"
 
@@ -350,7 +350,7 @@ STATIC_LEAF(_splsw_splintr)
 	and	v1, ta2# apply to pending bits
 
 1:
-	INT_L	ta2, (ta3)			# get SR bits for ipl in v0
+	INT_L	ta2, (ta3)			# get SR bits for ipl in ta2
 	NOP_L	# load delay
 	xor	ta2, MIPS_INT_MASK		# invert
 	and	ta2, v1# any match to pending intrs?



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

2023-05-21 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon May 22 06:50:52 UTC 2023

Modified Files:
src/sys/arch/mips/mips: spl.S

Log Message:
Fix a comment


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

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

Modified Files:
src/sys/arch/mips/mips: locore.S

Log Message:
mips: 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.229 -r1.230 src/sys/arch/mips/mips/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/mips/mips/locore.S
diff -u src/sys/arch/mips/mips/locore.S:1.229 src/sys/arch/mips/mips/locore.S:1.230
--- src/sys/arch/mips/mips/locore.S:1.229	Thu Feb 23 14:56:00 2023
+++ src/sys/arch/mips/mips/locore.S	Wed Mar  1 08:18:03 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.229 2023/02/23 14:56:00 riastradh Exp $	*/
+/*	$NetBSD: locore.S,v 1.230 2023/03/01 08:18:03 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -63,7 +63,7 @@
 #include 
 #include 
 
-RCSID("$NetBSD: locore.S,v 1.229 2023/02/23 14:56:00 riastradh Exp $")
+RCSID("$NetBSD: locore.S,v 1.230 2023/03/01 08:18:03 riastradh Exp $")
 
 #include "assym.h"
 
@@ -429,7 +429,13 @@ NESTED(softint_fast_dispatch, CALLFRAME_
 	nop	# patchable load delay slot
 	SYNC_PRODUCER /* XXX fixup */	/* for mutex_enter; see cpu_switchto */
 	PTR_S	MIPS_CURLWP, CPU_INFO_CURLWP(s1)	#...
-	SYNC_DEKKER /* XXX fixup */	/* 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.
+	 */
 	move	s2, sp	# remember sp
 	move	s3, t0	# remember curpcb
 



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

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

Modified Files:
src/sys/arch/mips/mips: locore.S

Log Message:
mips: 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.229 -r1.230 src/sys/arch/mips/mips/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/mips/mips

2023-02-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb 25 08:41:37 UTC 2023

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

Log Message:
Convert some assignments into KASSERTs.

l_md is zeroised by lwp_create with

 memset(&l2->l_startzero, 0, sizeof(*l2) -
offsetof(lwp_t, l_startzero));


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/mips/mips/vm_machdep.c

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

Modified files:

Index: src/sys/arch/mips/mips/vm_machdep.c
diff -u src/sys/arch/mips/mips/vm_machdep.c:1.165 src/sys/arch/mips/mips/vm_machdep.c:1.166
--- src/sys/arch/mips/mips/vm_machdep.c:1.165	Thu Sep 29 07:00:46 2022
+++ src/sys/arch/mips/mips/vm_machdep.c	Sat Feb 25 08:41:37 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.165 2022/09/29 07:00:46 skrll Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.166 2023/02/25 08:41:37 skrll Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.165 2022/09/29 07:00:46 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.166 2023/02/25 08:41:37 skrll Exp $");
 
 #include "opt_ddb.h"
 #include "opt_cputype.h"
@@ -93,9 +93,9 @@ cpu_lwp_fork(struct lwp *l1, struct lwp 
 
 	KASSERT(l1 == curlwp || l1 == &lwp0);
 
-	l2->l_md.md_ss_addr = 0;
-	l2->l_md.md_ss_instr = 0;
-	l2->l_md.md_astpending = 0;
+	KASSERT(l2->l_md.md_ss_addr == 0);
+	KASSERT(l2->l_md.md_ss_instr == 0);
+	KASSERT(l2->l_md.md_astpending == 0);
 
 	/* Copy the PCB from parent. */
 	*pcb2 = *pcb1;



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

2023-02-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Feb 25 08:41:37 UTC 2023

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

Log Message:
Convert some assignments into KASSERTs.

l_md is zeroised by lwp_create with

 memset(&l2->l_startzero, 0, sizeof(*l2) -
offsetof(lwp_t, l_startzero));


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/mips/mips/vm_machdep.c

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



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

2023-02-19 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sun Feb 19 11:19:51 UTC 2023

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

Log Message:
Adjust userspace comments in db_read_bytes() and db_write_bytes() to
match current reality.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/mips/mips/db_interface.c

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



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

2023-02-19 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sun Feb 19 11:19:51 UTC 2023

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

Log Message:
Adjust userspace comments in db_read_bytes() and db_write_bytes() to
match current reality.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/mips/mips/db_interface.c

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

Modified files:

Index: src/sys/arch/mips/mips/db_interface.c
diff -u src/sys/arch/mips/mips/db_interface.c:1.98 src/sys/arch/mips/mips/db_interface.c:1.99
--- src/sys/arch/mips/mips/db_interface.c:1.98	Sun Feb 19 10:48:06 2023
+++ src/sys/arch/mips/mips/db_interface.c	Sun Feb 19 11:19:51 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.98 2023/02/19 10:48:06 mlelstv Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.99 2023/02/19 11:19:51 simonb Exp $	*/
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.98 2023/02/19 10:48:06 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.99 2023/02/19 11:19:51 simonb Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -185,11 +185,7 @@ db_read_bytes(vaddr_t addr, size_t size,
 	const char *src = (char *)addr;
 	int err;
 
-	/*
-	 * If asked to fetch from userspace, do it safely.
-	 * Note that MIPS_KSEG0_START is the proper address for
-	 * both 32-bit and 64-bit kernels.
-	 */
+	/* If asked to fetch from userspace, do it safely */
 	if (addr < VM_MAXUSER_ADDRESS) {
 		err = copyin(src, data, size);
 		if (err) {
@@ -227,7 +223,7 @@ db_write_bytes(vaddr_t addr, size_t size
 	size_t n = size;
 	int err;
 
-	/* If asked to fetch from userspace, do it safely */
+	/* If asked to store to userspace, do it safely */
 	if (addr < VM_MAXUSER_ADDRESS) {
 		err = copyout(data, p, size);
 		if (err) {



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

2023-02-19 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Feb 19 10:48:06 UTC 2023

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

Log Message:
Only copyin/copyout from and to user addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/mips/mips/db_interface.c

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



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

2023-02-19 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Feb 19 10:48:06 UTC 2023

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

Log Message:
Only copyin/copyout from and to user addresses.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/mips/mips/db_interface.c

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

Modified files:

Index: src/sys/arch/mips/mips/db_interface.c
diff -u src/sys/arch/mips/mips/db_interface.c:1.97 src/sys/arch/mips/mips/db_interface.c:1.98
--- src/sys/arch/mips/mips/db_interface.c:1.97	Wed Oct 26 23:38:08 2022
+++ src/sys/arch/mips/mips/db_interface.c	Sun Feb 19 10:48:06 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.97 2022/10/26 23:38:08 riastradh Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.98 2023/02/19 10:48:06 mlelstv Exp $	*/
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.97 2022/10/26 23:38:08 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.98 2023/02/19 10:48:06 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
@@ -190,7 +190,7 @@ db_read_bytes(vaddr_t addr, size_t size,
 	 * Note that MIPS_KSEG0_START is the proper address for
 	 * both 32-bit and 64-bit kernels.
 	 */
-	if (addr < (vaddr_t)MIPS_KSEG0_START) {
+	if (addr < VM_MAXUSER_ADDRESS) {
 		err = copyin(src, data, size);
 		if (err) {
 #ifdef DDB
@@ -228,7 +228,7 @@ db_write_bytes(vaddr_t addr, size_t size
 	int err;
 
 	/* If asked to fetch from userspace, do it safely */
-	if (addr < (vaddr_t)MIPS_KSEG0_START) {
+	if (addr < VM_MAXUSER_ADDRESS) {
 		err = copyout(data, p, size);
 		if (err) {
 #ifdef DDB



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

2022-10-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 23 06:10:09 UTC 2022

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

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.303 -r1.304 src/sys/arch/mips/mips/mips_machdep.c

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



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

2022-10-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Oct 23 06:10:09 UTC 2022

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

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.303 -r1.304 src/sys/arch/mips/mips/mips_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/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.303 src/sys/arch/mips/mips/mips_machdep.c:1.304
--- src/sys/arch/mips/mips/mips_machdep.c:1.303	Mon Aug  9 21:38:04 2021
+++ src/sys/arch/mips/mips/mips_machdep.c	Sun Oct 23 06:10:09 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.303 2021/08/09 21:38:04 andvar Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.304 2022/10/23 06:10:09 skrll Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.303 2021/08/09 21:38:04 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.304 2022/10/23 06:10:09 skrll Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -2092,14 +2092,14 @@ mips_init_msgbuf(void)
 
 	paddr_t start = uvm_physseg_get_start(bank);
 	paddr_t end = uvm_physseg_get_end(bank);
-	
+
 	/* shrink so that it'll fit in the last segment */
 	if ((end - start) < atop(sz))
 		sz = ptoa(end - start);
 
 	end -= atop(sz);
 	uvm_physseg_unplug(end, atop(sz));
-	
+
 #ifdef _LP64
 	msgbufaddr = (void *) MIPS_PHYS_TO_XKPHYS_CACHED(ptoa(end));
 #else



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

2022-09-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep 29 06:59:12 UTC 2022

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/mips/mips/cpu_exec.c

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



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

2022-09-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep 29 06:59:12 UTC 2022

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/mips/mips/cpu_exec.c

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

Modified files:

Index: src/sys/arch/mips/mips/cpu_exec.c
diff -u src/sys/arch/mips/mips/cpu_exec.c:1.68 src/sys/arch/mips/mips/cpu_exec.c:1.69
--- src/sys/arch/mips/mips/cpu_exec.c:1.68	Sun May 23 23:24:45 2021
+++ src/sys/arch/mips/mips/cpu_exec.c	Thu Sep 29 06:59:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_exec.c,v 1.68 2021/05/23 23:24:45 mrg Exp $	*/
+/*	$NetBSD: cpu_exec.c,v 1.69 2022/09/29 06:59:12 skrll Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.68 2021/05/23 23:24:45 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.69 2022/09/29 06:59:12 skrll Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_ultrix.h"
@@ -201,7 +201,7 @@ coredump_elf32_setup(struct lwp *l, void
 		eh->e_flags |= EF_MIPS_ABI2;
 		break;
 	case _MIPS_BSD_API_O32:
-		eh->e_flags |= EF_MIPS_ABI_O32; 
+		eh->e_flags |= EF_MIPS_ABI_O32;
 		break;
 	}
 }



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

2022-07-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Jul 20 10:07:49 UTC 2022

Modified Files:
src/sys/arch/mips/mips: cpu_subr.c locore_octeon.S

Log Message:
mips: Fix cpuids synchronization at boot.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/mips/mips/cpu_subr.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mips/mips/locore_octeon.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/mips/mips/cpu_subr.c
diff -u src/sys/arch/mips/mips/cpu_subr.c:1.61 src/sys/arch/mips/mips/cpu_subr.c:1.62
--- src/sys/arch/mips/mips/cpu_subr.c:1.61	Mon Mar 28 12:38:58 2022
+++ src/sys/arch/mips/mips/cpu_subr.c	Wed Jul 20 10:07:49 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.61 2022/03/28 12:38:58 riastradh Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.62 2022/07/20 10:07:49 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.61 2022/03/28 12:38:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.62 2022/07/20 10:07:49 riastradh Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -273,10 +273,12 @@ cpu_attach_common(device_t self, struct 
 	if (ci != &cpu_info_store) {
 		/*
 		 * Tail insert this onto the list of cpu_info's.
+		 * atomic_store_release matches PTR_L/SYNC_ACQ in
+		 * locore_octeon.S (XXX what about non-Octeon?).
 		 */
 		KASSERT(cpuid_infos[ci->ci_cpuid] == NULL);
-		cpuid_infos[ci->ci_cpuid] = ci;
-		membar_producer();
+		atomic_store_release(&cpuid_infos[ci->ci_cpuid], ci);
+		membar_producer(); /* Cavium sync plunger */
 	}
 	KASSERT(cpuid_infos[ci->ci_cpuid] != NULL);
 	evcnt_attach_dynamic(&ci->ci_evcnt_synci_activate_rqst,

Index: src/sys/arch/mips/mips/locore_octeon.S
diff -u src/sys/arch/mips/mips/locore_octeon.S:1.13 src/sys/arch/mips/mips/locore_octeon.S:1.14
--- src/sys/arch/mips/mips/locore_octeon.S:1.13	Tue Jul 28 00:35:38 2020
+++ src/sys/arch/mips/mips/locore_octeon.S	Wed Jul 20 10:07:49 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore_octeon.S,v 1.13 2020/07/28 00:35:38 simonb Exp $	*/
+/*	$NetBSD: locore_octeon.S,v 1.14 2022/07/20 10:07:49 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-RCSID("$NetBSD: locore_octeon.S,v 1.13 2020/07/28 00:35:38 simonb Exp $")
+RCSID("$NetBSD: locore_octeon.S,v 1.14 2022/07/20 10:07:49 riastradh Exp $")
 
 #include "cpunode.h"			/* for NWDOG */
 #include "opt_cputype.h"
@@ -37,7 +37,7 @@ RCSID("$NetBSD: locore_octeon.S,v 1.13 2
 #include 
 #include 
 
-RCSID("$NetBSD: locore_octeon.S,v 1.13 2020/07/28 00:35:38 simonb Exp $")
+RCSID("$NetBSD: locore_octeon.S,v 1.14 2022/07/20 10:07:49 riastradh Exp $")
 
 #include "assym.h"
 
@@ -141,8 +141,10 @@ NESTED_NOPROFILE(octeon_cpu_spinup, 0, r
 	PTR_LA	a1, _C_LABEL(cpuid_infos)
 	dsll	v0, s0, PTR_SCALESHIFT	# cpunum -> array index
 	PTR_ADD	t0, a1, v0		# add to array start
-1:	sync
-	PTR_L	a1, (t0)		# get cpu_info pointer
+1:	PTR_L	a1, (t0)		# get cpu_info pointer
+	SYNC_ACQ			# PTR_L/SYNC_ACQ matches
+	#   atomic_store_release in
+	#   cpu_attach_common
 	beqz	a1, 1b			# loop until non-NULL
 	 nop
 



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

2022-07-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Jul 20 10:07:49 UTC 2022

Modified Files:
src/sys/arch/mips/mips: cpu_subr.c locore_octeon.S

Log Message:
mips: Fix cpuids synchronization at boot.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/mips/mips/cpu_subr.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mips/mips/locore_octeon.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/mips/mips

2022-03-13 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Mar 13 22:18:56 UTC 2022

Modified Files:
src/sys/arch/mips/mips: locore_mips1.S

Log Message:
s/entreed/entered/


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/mips/mips/locore_mips1.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/mips/mips/locore_mips1.S
diff -u src/sys/arch/mips/mips/locore_mips1.S:1.97 src/sys/arch/mips/mips/locore_mips1.S:1.98
--- src/sys/arch/mips/mips/locore_mips1.S:1.97	Sun Mar 13 17:50:55 2022
+++ src/sys/arch/mips/mips/locore_mips1.S	Sun Mar 13 22:18:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore_mips1.S,v 1.97 2022/03/13 17:50:55 andvar Exp $	*/
+/*	$NetBSD: locore_mips1.S,v 1.98 2022/03/13 22:18:56 andvar Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -57,7 +57,7 @@
 #include 
 #include 
 
-RCSID("$NetBSD: locore_mips1.S,v 1.97 2022/03/13 17:50:55 andvar Exp $")
+RCSID("$NetBSD: locore_mips1.S,v 1.98 2022/03/13 22:18:56 andvar Exp $")
 
 #include "assym.h"
 
@@ -1086,7 +1086,7 @@ END(MIPSX(tlb_mod_exception))
 #endif
 
 /*
- * Mark where code entreed from exception handler jumptable
+ * Mark where code entered from exception handler jumptable
  * ends, for stack traceback code.
  */
 



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

2022-03-13 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Mar 13 22:18:56 UTC 2022

Modified Files:
src/sys/arch/mips/mips: locore_mips1.S

Log Message:
s/entreed/entered/


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

2022-02-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 27 19:22:29 UTC 2022

Modified Files:
src/sys/arch/mips/mips: lock_stubs_llsc.S

Log Message:
mips: Issue a sync plunger at the end of mutex_spin_exit.

Same as mutex_exit.  Relevant only on cnMIPS where the store buffers
get clogged.  Recommended by the Cavium documentation.  No semantic
change, only performance -- this only adds a barrier in some cases
where there was none before, so it can't hurt correctness.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/mips/mips/lock_stubs_llsc.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/mips/mips/lock_stubs_llsc.S
diff -u src/sys/arch/mips/mips/lock_stubs_llsc.S:1.16 src/sys/arch/mips/mips/lock_stubs_llsc.S:1.17
--- src/sys/arch/mips/mips/lock_stubs_llsc.S:1.16	Sun Feb 27 19:22:02 2022
+++ src/sys/arch/mips/mips/lock_stubs_llsc.S	Sun Feb 27 19:22:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs_llsc.S,v 1.16 2022/02/27 19:22:02 riastradh Exp $	*/
+/*	$NetBSD: lock_stubs_llsc.S,v 1.17 2022/02/27 19:22:29 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #include 
 
-RCSID("$NetBSD: lock_stubs_llsc.S,v 1.16 2022/02/27 19:22:02 riastradh Exp $")
+RCSID("$NetBSD: lock_stubs_llsc.S,v 1.17 2022/02/27 19:22:29 riastradh Exp $")
 
 #include "assym.h"
 
@@ -342,10 +342,10 @@ LEAF(llsc_mutex_spin_exit)
 	 nop
 #endif
 	j	 _C_LABEL(splx)
-	 nop
+	 BDSYNC_PLUNGER
 1:
 	j	ra
-	 nop
+	 BDSYNC_PLUNGER
 #if defined(DIAGNOSTIC)
 2:
 	j	_C_LABEL(mutex_vector_exit)



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

2022-02-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 27 19:22:29 UTC 2022

Modified Files:
src/sys/arch/mips/mips: lock_stubs_llsc.S

Log Message:
mips: Issue a sync plunger at the end of mutex_spin_exit.

Same as mutex_exit.  Relevant only on cnMIPS where the store buffers
get clogged.  Recommended by the Cavium documentation.  No semantic
change, only performance -- this only adds a barrier in some cases
where there was none before, so it can't hurt correctness.


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

2022-02-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 27 19:21:44 UTC 2022

Modified Files:
src/sys/arch/mips/mips: lock_stubs_llsc.S

Log Message:
mips: Make sure that mutex_spin_exit works even if !DIAGNOSTIC.

The critical store has been under #ifdef DIAGNOSTIC since, uh, 2011.


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

2022-02-27 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 27 19:21:44 UTC 2022

Modified Files:
src/sys/arch/mips/mips: lock_stubs_llsc.S

Log Message:
mips: Make sure that mutex_spin_exit works even if !DIAGNOSTIC.

The critical store has been under #ifdef DIAGNOSTIC since, uh, 2011.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/mips/mips/lock_stubs_llsc.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/mips/mips/lock_stubs_llsc.S
diff -u src/sys/arch/mips/mips/lock_stubs_llsc.S:1.13 src/sys/arch/mips/mips/lock_stubs_llsc.S:1.14
--- src/sys/arch/mips/mips/lock_stubs_llsc.S:1.13	Sat Sep 26 08:21:27 2020
+++ src/sys/arch/mips/mips/lock_stubs_llsc.S	Sun Feb 27 19:21:44 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs_llsc.S,v 1.13 2020/09/26 08:21:27 simonb Exp $	*/
+/*	$NetBSD: lock_stubs_llsc.S,v 1.14 2022/02/27 19:21:44 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 
 #include 
 
-RCSID("$NetBSD: lock_stubs_llsc.S,v 1.13 2020/09/26 08:21:27 simonb Exp $")
+RCSID("$NetBSD: lock_stubs_llsc.S,v 1.14 2022/02/27 19:21:44 riastradh Exp $")
 
 #include "assym.h"
 
@@ -279,8 +279,8 @@ LEAF(llsc_mutex_spin_exit)
 	INT_L	t0, MTX_LOCK(a0)
 	beqz	t0, 2f
 	 nop
-	INT_S	zero, MTX_LOCK(a0)
 #endif
+	INT_S	zero, MTX_LOCK(a0)
 
 	/*
 	 * We need to grab this before the mutex count is incremented



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

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

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

Log Message:
Add 'mach cpuinfo' support


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/mips/mips/db_interface.c

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

Modified files:

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



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

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

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

Log Message:
Add 'mach cpuinfo' support


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/mips/mips/db_interface.c

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



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

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

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

Log Message:
sort


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/mips/mips/db_interface.c

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

Modified files:

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



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

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

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

Log Message:
sort


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/mips/mips/db_interface.c

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



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

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

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

Log Message:
fix KASSERT issue


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

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

Modified files:

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



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

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

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

Log Message:
fix KASSERT issue


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

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



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

2021-11-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Nov 16 06:15:48 UTC 2021

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

Log Message:
Use the register define MIPS_HWR_ULR instead of a magic number.


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

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

Modified files:

Index: src/sys/arch/mips/mips/mips_emul.c
diff -u src/sys/arch/mips/mips/mips_emul.c:1.30 src/sys/arch/mips/mips/mips_emul.c:1.31
--- src/sys/arch/mips/mips/mips_emul.c:1.30	Sat May 29 12:35:27 2021
+++ src/sys/arch/mips/mips/mips_emul.c	Tue Nov 16 06:15:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_emul.c,v 1.30 2021/05/29 12:35:27 simonb Exp $ */
+/*	$NetBSD: mips_emul.c,v 1.31 2021/11/16 06:15:48 simonb Exp $ */
 
 /*
  * Copyright (c) 1999 Shuichiro URATA.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mips_emul.c,v 1.30 2021/05/29 12:35:27 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_emul.c,v 1.31 2021/11/16 06:15:48 simonb Exp $");
 
 #include 
 #include 
@@ -461,7 +461,7 @@ mips_emul_special3(uint32_t inst, struct
 	}
 	case OP_RDHWR:
 		switch (instfmt.RType.rd) {
-		case 29:
+		case MIPS_HWR_ULR:
 			tf->tf_regs[instfmt.RType.rt] =
 			(mips_reg_t)(intptr_t)curlwp->l_private;
 			goto done;



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

2021-11-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Nov 16 06:15:48 UTC 2021

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

Log Message:
Use the register define MIPS_HWR_ULR instead of a magic number.


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

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



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

2021-11-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Nov  6 06:49:02 UTC 2021

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

Log Message:
Fix typo in comment. s/phyiscally/physically/


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

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

Modified files:

Index: src/sys/arch/mips/mips/cache_tx39.c
diff -u src/sys/arch/mips/mips/cache_tx39.c:1.8 src/sys/arch/mips/mips/cache_tx39.c:1.9
--- src/sys/arch/mips/mips/cache_tx39.c:1.8	Mon Jul 11 16:15:36 2016
+++ src/sys/arch/mips/mips/cache_tx39.c	Sat Nov  6 06:49:02 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache_tx39.c,v 1.8 2016/07/11 16:15:36 matt Exp $	*/
+/*	$NetBSD: cache_tx39.c,v 1.9 2021/11/06 06:49:02 msaitoh Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cache_tx39.c,v 1.8 2016/07/11 16:15:36 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cache_tx39.c,v 1.9 2021/11/06 06:49:02 msaitoh Exp $");
 
 #include 
 
@@ -50,7 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: cache_tx39.c
  *	- I-cache direct-mapped (TX3900) or 2-way set-associative (TX3920)
  *	- D-cache 2-way set-associative
  *	- Write-through (TX3900, TX3920) or write-back (TX3920)
- *	- Physically indexed, phyiscally tagged
+ *	- Physically indexed, physically tagged
  *
  * XXX THIS IS NOT YET COMPLETE.
  */



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

2021-11-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Nov  6 06:49:02 UTC 2021

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

Log Message:
Fix typo in comment. s/phyiscally/physically/


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

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



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

2021-10-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Oct 19 03:47:33 UTC 2021

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

Log Message:
Revert previous:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/mips/mips/vm_machdep.c#rev1.163

> cpu_uarea_alloc: For ILP32, do not try to allocate physical memory above
> pmap_limits.avail_end.
>
> Fix NULL dereference in uvm_pglistalloc_contig_aggressive().

"high" argument larger than pmap_limits.avail_end is just legal for
uvm_pglistalloc(); uvm_pglistalloc_contig_aggressive() and friends
allocate memory between uvm_physseg_get_avail_start() and
uvm_physseg_get_avail_end().

It turned out that the NULL dereference took place as PHYS_TO_VM_PAGE()
aka uvm_phys_to_vm_page() returns NULL for a valid pa. I've not figured
out why...

Thanks chs@ for correcting my misunderstanding.


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/arch/mips/mips/vm_machdep.c

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

Modified files:

Index: src/sys/arch/mips/mips/vm_machdep.c
diff -u src/sys/arch/mips/mips/vm_machdep.c:1.163 src/sys/arch/mips/mips/vm_machdep.c:1.164
--- src/sys/arch/mips/mips/vm_machdep.c:1.163	Thu Oct 14 02:22:25 2021
+++ src/sys/arch/mips/mips/vm_machdep.c	Tue Oct 19 03:47:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.163 2021/10/14 02:22:25 rin Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.164 2021/10/19 03:47:33 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.163 2021/10/14 02:22:25 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.164 2021/10/19 03:47:33 rin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_cputype.h"
@@ -176,13 +176,15 @@ cpu_uarea_alloc(bool system)
 #ifdef PMAP_MAP_POOLPAGE
 
 	struct pglist pglist;
+#ifdef _LP64
 	const paddr_t high = pmap_limits.avail_end;
-#ifndef _LP64
+#else
+	const paddr_t high = MIPS_KSEG1_START - MIPS_KSEG0_START;
 	/*
 	 * Don't allocate a direct mapped uarea if we aren't allocating for a
 	 * system lwp and we have memory that can't be mapped via KSEG0.
 	 */
-	if (!system && high > MIPS_KSEG1_START - MIPS_KSEG0_START)
+	if (!system && high < pmap_limits.avail_end)
 		return NULL;
 #endif
 	int error;



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

2021-10-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Oct 19 03:47:33 UTC 2021

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

Log Message:
Revert previous:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/mips/mips/vm_machdep.c#rev1.163

> cpu_uarea_alloc: For ILP32, do not try to allocate physical memory above
> pmap_limits.avail_end.
>
> Fix NULL dereference in uvm_pglistalloc_contig_aggressive().

"high" argument larger than pmap_limits.avail_end is just legal for
uvm_pglistalloc(); uvm_pglistalloc_contig_aggressive() and friends
allocate memory between uvm_physseg_get_avail_start() and
uvm_physseg_get_avail_end().

It turned out that the NULL dereference took place as PHYS_TO_VM_PAGE()
aka uvm_phys_to_vm_page() returns NULL for a valid pa. I've not figured
out why...

Thanks chs@ for correcting my misunderstanding.


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/arch/mips/mips/vm_machdep.c

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



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

2021-10-14 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Oct 14 02:22:25 UTC 2021

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

Log Message:
cpu_uarea_alloc: For ILP32, do not try to allocate physical memory above
pmap_limits.avail_end.

Fix NULL dereference in uvm_pglistalloc_contig_aggressive().


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/mips/mips/vm_machdep.c

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



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

2021-10-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Oct 14 02:22:25 UTC 2021

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

Log Message:
cpu_uarea_alloc: For ILP32, do not try to allocate physical memory above
pmap_limits.avail_end.

Fix NULL dereference in uvm_pglistalloc_contig_aggressive().


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/mips/mips/vm_machdep.c

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

Modified files:

Index: src/sys/arch/mips/mips/vm_machdep.c
diff -u src/sys/arch/mips/mips/vm_machdep.c:1.162 src/sys/arch/mips/mips/vm_machdep.c:1.163
--- src/sys/arch/mips/mips/vm_machdep.c:1.162	Sun Aug 23 10:23:38 2020
+++ src/sys/arch/mips/mips/vm_machdep.c	Thu Oct 14 02:22:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.162 2020/08/23 10:23:38 simonb Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.163 2021/10/14 02:22:25 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.162 2020/08/23 10:23:38 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.163 2021/10/14 02:22:25 rin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_cputype.h"
@@ -176,15 +176,13 @@ cpu_uarea_alloc(bool system)
 #ifdef PMAP_MAP_POOLPAGE
 
 	struct pglist pglist;
-#ifdef _LP64
 	const paddr_t high = pmap_limits.avail_end;
-#else
-	const paddr_t high = MIPS_KSEG1_START - MIPS_KSEG0_START;
+#ifndef _LP64
 	/*
 	 * Don't allocate a direct mapped uarea if we aren't allocating for a
 	 * system lwp and we have memory that can't be mapped via KSEG0.
 	 */
-	if (!system && high < pmap_limits.avail_end)
+	if (!system && high > MIPS_KSEG1_START - MIPS_KSEG0_START)
 		return NULL;
 #endif
 	int error;



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

2020-06-09 Thread Simon Burge
Simon Burge wrote:

> > > Module Name:  src
> > > Committed By: simonb
> > > Date: Tue Jun  9 06:18:01 UTC 2020
> > > 
> > > Modified Files:
> > >   src/sys/arch/mips/mips: mips_machdep.c
> > > 
> > > Log Message:
> > > If we are on a SiByte or Cavium CPU with an FPU, report as "built-in FPU"
> > > instead of saying it's an unknown FPU type.
> > > 
> > > XXX - add any other CPUs to this list?
> >
> > This seems to cause build errors for non mipsNN:
>
> Oops, will fix.  Thanks for reporting.

Fixed, thanks!

Cheers,
Simon.


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

2020-06-09 Thread Simon Burge
Izumi Tsutsui wrote:

> > Module Name:src
> > Committed By:   simonb
> > Date:   Tue Jun  9 06:18:01 UTC 2020
> > 
> > Modified Files:
> > src/sys/arch/mips/mips: mips_machdep.c
> > 
> > Log Message:
> > If we are on a SiByte or Cavium CPU with an FPU, report as "built-in FPU"
> > instead of saying it's an unknown FPU type.
> > 
> > XXX - add any other CPUs to this list?
>
> This seems to cause build errors for non mipsNN:

Oops, will fix.  Thanks for reporting.

Cheers,
Simon.


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

2020-06-09 Thread Izumi Tsutsui
> Module Name:  src
> Committed By: simonb
> Date: Tue Jun  9 06:18:01 UTC 2020
> 
> Modified Files:
>   src/sys/arch/mips/mips: mips_machdep.c
> 
> Log Message:
> If we are on a SiByte or Cavium CPU with an FPU, report as "built-in FPU"
> instead of saying it's an unknown FPU type.
> 
> XXX - add any other CPUs to this list?

This seems to cause build errors for non mipsNN:

---
#   compile  RAMDISK/mips_machdep.o
/s/cvs/src/obj.ews4800mips/tooldir.NetBSD-9.0-i386/bin/mipseb--netbsd-gcc -G 0 
-mno-abicalls -msoft-float -ffixed-24 -ffreestanding 
-fno-zero-initialized-in-bss -fno-delete-null-pointer-checks -Os -mmemcpy 
-fno-strict-aliasing -fno-common -std=gnu99 -Werror -Wall -Wno-main 
-Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes 
-Wstrict-prototypes -Wold-style-definition -Wswitch -Wshadow -Wcast-qual 
-Wwrite-strings -Wno-unreachable-code -Wno-pointer-sign -Wno-attributes 
-Wno-sign-compare -march=r4400 -mabi=32 
--sysroot=/s/cvs/src/obj.ews4800mips/destdir.ews4800mips -Dews4800mips -I. 
-I/s/cvs/src/sys/external/bsd/libnv/dist 
-I/s/cvs/src/sys/../common/lib/libx86emu 
-I/s/cvs/src/sys/../common/lib/libc/misc -I/s/cvs/src/sys/../common/include 
-I/s/cvs/src/sys/arch -I/s/cvs/src/sys -nostdinc -DCOMPAT_UTILS -DMIPS3 
-DMIPS3_ENABLE_CLOCK_INTR -DCOMPAT_44 -D_KERNEL -D_KERNEL_OPT -std=gnu99 
-I/s/cvs/src/sys/lib/libkern/../../../common/lib/libc/quad 
-I/s/cvs/src/sys/lib/libkern/../!
 ../../common/lib/libc/string 
-I/s/cvs/src/sys/lib/libkern/../../../common/lib/libc/arch/mips/string 
-I/s/cvs/src/sys/lib/libkern/../../../common/lib/libc/hash/sha3 
-I/s/cvs/src/sys/external/bsd/libnv/dist -c 
/s/cvs/src/sys/arch/mips/mips/mips_machdep.c -o mips_machdep.o
/s/cvs/src/sys/arch/mips/mips/mips_machdep.c: In function 'cpu_identify':
/s/cvs/src/sys/arch/mips/mips/mips_machdep.c:1508:11: error: implicit 
declaration of function 'mipsNN_cp0_config1_read'; did you mean 
'mips3_cp0_config_read'? [-Werror=implicit-function-declaration]
cfg1 = mipsNN_cp0_config1_read();
   ^~~
   mips3_cp0_config_read
/s/cvs/src/sys/arch/mips/mips/mips_machdep.c:1509:15: error: 'MIPSNN_CFG1_FP' 
undeclared (first use in this function); did you mean 'MIPS_CR_IP'?
if (cfg1 & MIPSNN_CFG1_FP)
   ^~
   MIPS_CR_IP
/s/cvs/src/sys/arch/mips/mips/mips_machdep.c:1509:15: note: each undeclared 
identifier is reported only once for each function it appears in
cc1: all warnings being treated as errors

*** Failed target:  mips_machdep.o
*** Failed command: echo '# ' "compile RAMDISK/mips_machdep.o" && echo 
/s/cvs/src/obj.ews4800mips/tooldir.NetBSD-9.0-i386/bin/mipseb--netbsd-gcc -G 0 
-mno-abicalls -msoft-float -ffixed-24 -ffreestanding 
-fno-zero-initialized-in-bss -fno-delete-null-pointer-checks -Os -mmemcpy 
-fno-strict-aliasing -fno-common -std=gnu99 -Werror -Wall -Wno-main 
-Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes 
-Wstrict-prototypes -Wold-style-definition -Wswitch -Wshadow -Wcast-qual 
-Wwrite-strings -Wno-unreachable-code -Wno-pointer-sign -Wno-attributes 
-Wno-sign-compare -march=r4400 -mabi=32 
--sysroot=/s/cvs/src/obj.ews4800mips/destdir.ews4800mips -Dews4800mips -I. 
-I/s/cvs/src/sys/external/bsd/libnv/dist 
-I/s/cvs/src/sys/../common/lib/libx86emu 
-I/s/cvs/src/sys/../common/lib/libc/misc -I/s/cvs/src/sys/../common/include 
-I/s/cvs/src/sys/arch -I/s/cvs/src/sys -nostdinc -DCOMPAT_UTILS -DMIPS3 
-DMIPS3_ENABLE_CLOCK_INTR -DCOMPAT_44 -D_KERNEL -D_KERNEL_OPT -std=gnu99 
-I/s/cvs/src/sys/lib!
 /libkern/../../../common/lib/libc/quad 
-I/s/cvs/src/sys/lib/libkern/../../../common/lib/libc/string 
-I/s/cvs/src/sys/lib/libkern/../../../common/lib/libc/arch/mips/string 
-I/s/cvs/src/sys/lib/libkern/../../../common/lib/libc/hash/sha3 
-I/s/cvs/src/sys/external/bsd/libnv/dist -c 
/s/cvs/src/sys/arch/mips/mips/mips_machdep.c -o mips_machdep.o && 
/s/cvs/src/obj.ews4800mips/tooldir.NetBSD-9.0-i386/bin/mipseb--netbsd-gcc -G 0 
-mno-abicalls -msoft-float -ffixed-24 -ffreestanding 
-fno-zero-initialized-in-bss -fno-delete-null-pointer-checks -Os -mmemcpy 
-fno-strict-aliasing -fno-common -std=gnu99 -Werror -Wall -Wno-main 
-Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes 
-Wstrict-prototypes -Wold-style-definition -Wswitch -Wshadow -Wcast-qual 
-Wwrite-strings -Wno-unreachable-code -Wno-pointer-sign -Wno-attributes 
-Wno-sign-compare -march=r4400 -mabi=32 
--sysroot=/s/cvs/src/obj.ews4800mips/destdir.ews4800mips -Dews4800mips -I. 
-I/s/cvs/src/sys/external/bsd/libnv/dist -I/s/cv!
 s/src/sys/../common/lib/libx86emu -I/s/cvs/src/sys/../common/l!
 ib/libc/misc -I/s/cvs/src/sys/../common/include -I/s/cvs/src/sys/arch 
-I/s/cvs/src/sys -nostdinc -DCOMPAT_UTILS -DMIPS3 -DMIPS3_ENABLE_CLOCK_INTR 
-DCOMPAT_44 -D_KERNEL -D_KERNEL_OPT -std=gnu99 
-I/s/cvs/src/sys/lib/libkern/../../../common/lib/libc/quad 
-I/s/cvs/src/sys/lib/libkern/../../../common/lib/libc/string 
-I/s/cvs/src/sys/lib/libkern/../../../common/lib/libc/a

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

2020-03-13 Thread Christos Zoulas

> On Mar 13, 2020, at 12:25 PM, Jason Thorpe  wrote:
> 
> 
>> On Mar 13, 2020, at 9:11 AM, Christos Zoulas  wrote:
>> 
>> I think this is better done in the driver, as other ports
>> do the same check and it catches bugs.
> 
> x86 *explcitly* checks for 0 to skip work.  If you want to find bugs, change 
> the most-often-used implementation maybe?
> 
> -- thorpej

I remembered wrong then.

christos



signature.asc
Description: Message signed with OpenPGP


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

2020-03-13 Thread Jason Thorpe


> On Mar 13, 2020, at 9:11 AM, Christos Zoulas  wrote:
> 
> I think this is better done in the driver, as other ports
> do the same check and it catches bugs.

x86 *explcitly* checks for 0 to skip work.  If you want to find bugs, change 
the most-often-used implementation maybe?

-- thorpej



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

2020-03-13 Thread Christos Zoulas
In article <20200313034939.553d5f...@cvs.netbsd.org>,
Jason R Thorpe  wrote:
>-=-=-=-=-=-
>
>Module Name:   src
>Committed By:  thorpej
>Date:  Fri Mar 13 03:49:39 UTC 2020
>
>Modified Files:
>   src/sys/arch/mips/mips: bus_dma.c
>
>Log Message:
>Allow len == 0 in bus_dmamap_sync().

I think this is better done in the driver, as other ports
do the same check and it catches bugs.

christos



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

2020-03-12 Thread Nick Hudson

On 13/03/2020 03:49, Jason R Thorpe wrote:

Module Name:src
Committed By:   thorpej
Date:   Fri Mar 13 03:49:39 UTC 2020

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

Log Message:
Allow len == 0 in bus_dmamap_sync().

XXX pullup-9


The assertion that len is not 0 in arm bus_dma.c has found several bugs
over the years.

Just saying.

Nick


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

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 15:37:39 UTC 2019

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

Log Message:
Typo.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/mips/mips/cpu_subr.c

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



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

2019-11-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Nov 24 15:37:39 UTC 2019

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

Log Message:
Typo.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/mips/mips/cpu_subr.c

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

Modified files:

Index: src/sys/arch/mips/mips/cpu_subr.c
diff -u src/sys/arch/mips/mips/cpu_subr.c:1.36 src/sys/arch/mips/mips/cpu_subr.c:1.37
--- src/sys/arch/mips/mips/cpu_subr.c:1.36	Sat Nov 23 19:40:35 2019
+++ src/sys/arch/mips/mips/cpu_subr.c	Sun Nov 24 15:37:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.36 2019/11/23 19:40:35 ad Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.37 2019/11/24 15:37:39 ad Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.36 2019/11/23 19:40:35 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.37 2019/11/24 15:37:39 ad Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -495,7 +495,7 @@ cpu_need_resched(struct cpu_info *ci, st
 #endif
 		return;
 	}
-	if ((flags & RESSCHED_REMOTE) != 0) {
+	if ((flags & RESCHED_REMOTE) != 0) {
 #ifdef MULTIPROCESSOR
 		cpu_send_ipi(ci, IPI_AST);
 #endif



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

2019-09-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep  5 15:48:13 UTC 2019

Modified Files:
src/sys/arch/mips/mips: locore.S

Log Message:
Fix a maya fix so that cobalt boots again.

Set MIPS_COP_0_CAUSE to zero before the rest of the initialisation


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/arch/mips/mips/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/mips/mips/locore.S
diff -u src/sys/arch/mips/mips/locore.S:1.219 src/sys/arch/mips/mips/locore.S:1.220
--- src/sys/arch/mips/mips/locore.S:1.219	Fri Sep  7 21:14:45 2018
+++ src/sys/arch/mips/mips/locore.S	Thu Sep  5 15:48:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.219 2018/09/07 21:14:45 macallan Exp $	*/
+/*	$NetBSD: locore.S,v 1.220 2019/09/05 15:48:13 skrll Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -63,7 +63,7 @@
 #include 
 #include 
 
-RCSID("$NetBSD: locore.S,v 1.219 2018/09/07 21:14:45 macallan Exp $")
+RCSID("$NetBSD: locore.S,v 1.220 2019/09/05 15:48:13 skrll Exp $")
 
 #include "assym.h"
 
@@ -73,10 +73,10 @@ RCSID("$NetBSD: locore.S,v 1.219 2018/09
 	.globl	_C_LABEL(kernel_text)		# libkvm refers this
 start:
 _C_LABEL(kernel_text):
+	/* First disable the interrupts only, for safety */
 	mfc0	k0, MIPS_COP_0_STATUS
 	MFC0_HAZARD
 
-	/* First disable the interrupts only, for safety */
 	and	k0, ~MIPS_SR_INT_IE
 	mtc0	k0, MIPS_COP_0_STATUS
 	COP0_SYNC
@@ -85,6 +85,7 @@ _C_LABEL(kernel_text):
 	/* Leaving TS | RE alone (for emips) */
 	and	k0, MIPS_SR_TS | MIPS3_SR_RE
 	mtc0	k0, MIPS_COP_0_STATUS
+	mtc0	zero, MIPS_COP_0_CAUSE
 	COP0_SYNC
 
 #if defined(_LP64) 



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

2019-09-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep  5 15:48:13 UTC 2019

Modified Files:
src/sys/arch/mips/mips: locore.S

Log Message:
Fix a maya fix so that cobalt boots again.

Set MIPS_COP_0_CAUSE to zero before the rest of the initialisation


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

2019-07-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jul 14 09:31:33 UTC 2019

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

Log Message:
Use PV_ISKENTER_P. NFCI.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mips/mips/pmap_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/mips/mips/pmap_machdep.c
diff -u src/sys/arch/mips/mips/pmap_machdep.c:1.23 src/sys/arch/mips/mips/pmap_machdep.c:1.24
--- src/sys/arch/mips/mips/pmap_machdep.c:1.23	Mon Sep  3 16:29:26 2018
+++ src/sys/arch/mips/mips/pmap_machdep.c	Sun Jul 14 09:31:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_machdep.c,v 1.23 2018/09/03 16:29:26 riastradh Exp $	*/
+/*	$NetBSD: pmap_machdep.c,v 1.24 2019/07/14 09:31:33 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.23 2018/09/03 16:29:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_machdep.c,v 1.24 2019/07/14 09:31:33 skrll Exp $");
 
 /*
  *	Manages physical address maps.
@@ -945,7 +945,7 @@ pmap_md_vca_add(struct vm_page *pg, vadd
 	KASSERT(pv->pv_pmap != NULL);
 	bool ret = false;
 	for (pv_entry_t npv = pv; npv && npv->pv_pmap;) {
-		if (npv->pv_va & PV_KENTER) {
+		if (PV_ISKENTER_P(npv)) {
 			npv = npv->pv_next;
 			continue;
 		}



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

2019-07-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jul 14 09:31:33 UTC 2019

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

Log Message:
Use PV_ISKENTER_P. NFCI.


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

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



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

2019-06-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun 25 21:26:04 UTC 2019

Modified Files:
src/sys/arch/mips/mips: mipsX_subr.S

Log Message:
s/cpulwp/curlwp/


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/mips/mips/mipsX_subr.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/mips/mips/mipsX_subr.S
diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.104 src/sys/arch/mips/mips/mipsX_subr.S:1.105
--- src/sys/arch/mips/mips/mipsX_subr.S:1.104	Sun Aug 20 09:47:13 2017
+++ src/sys/arch/mips/mips/mipsX_subr.S	Tue Jun 25 21:26:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mipsX_subr.S,v 1.104 2017/08/20 09:47:13 maya Exp $	*/
+/*	$NetBSD: mipsX_subr.S,v 1.105 2019/06/25 21:26:04 skrll Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -1659,7 +1659,7 @@ NESTED_NOPROFILE(MIPSX(systemcall), CALL
 	 * Save all the registers but kernel temporaries onto the stack.
 	 */
 	KERN_ENTRY_ERRATA
-	/* k1 already contains cpulwp */
+	/* k1 already contains curlwp */
 	PTR_L	k0, L_PCB(k1)			# XXXuvm_lwp_getuarea
 	PTR_ADDU k0, USPACE - TF_SIZ - CALLFRAME_SIZ
 	#REG_S	AT, CALLFRAME_SIZ+TF_REG_AST(k0)



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

2019-06-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Jun 25 21:26:04 UTC 2019

Modified Files:
src/sys/arch/mips/mips: mipsX_subr.S

Log Message:
s/cpulwp/curlwp/


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

2018-09-07 Thread maya
On Fri, Sep 07, 2018 at 09:29:27PM +, Christos Zoulas wrote:
> In article <20180907211445.dbf47f...@cvs.netbsd.org>,
> Michael Lorenz  wrote:
> >-=-=-=-=-=-
> >
> >Module Name: src
> >Committed By:macallan
> >Date:Fri Sep  7 21:14:45 UTC 2018
> >
> >Modified Files:
> > src/sys/arch/mips/mips: locore.S
> >
> >Log Message:
> >re-enable 64bit addressing in n32 kernels
> >Now these work again, at least on my Indy.
> 
> Isn't there only one line different?
> 
> christos
> 

yeah, but I find it more readable this way, too.
sorry for the breakage btw.


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

2018-09-07 Thread Christos Zoulas
In article <20180907211445.dbf47f...@cvs.netbsd.org>,
Michael Lorenz  wrote:
>-=-=-=-=-=-
>
>Module Name:   src
>Committed By:  macallan
>Date:  Fri Sep  7 21:14:45 UTC 2018
>
>Modified Files:
>   src/sys/arch/mips/mips: locore.S
>
>Log Message:
>re-enable 64bit addressing in n32 kernels
>Now these work again, at least on my Indy.

Isn't there only one line different?

christos



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

2018-08-08 Thread matthew green
m...@netbsd.org writes:
> Can we use aprint_debug instead?

it's not an autoconf message, so, please don't use aprint*().


.mrg.

> On Wed, Aug 08, 2018 at 07:50:13AM +, Simon Burge wrote:
> > Module Name:src
> > Committed By:   simonb
> > Date:   Wed Aug  8 07:50:12 UTC 2018
> > 
> > Modified Files:
> > src/sys/arch/mips/mips: cpu_exec.c
> > 
> > Log Message:
> > Make change of ABI printf()s #ifdef DEBUG_EXEC.


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

2018-08-08 Thread maya
On Wed, Aug 08, 2018 at 10:22:33PM +1000, Simon Burge wrote:
> Martin Husemann wrote:
> 
> > On Wed, Aug 08, 2018 at 12:11:39PM +, m...@netbsd.org wrote:
> > > On Wed, Aug 08, 2018 at 01:59:46PM +0200, Martin Husemann wrote:
> > > > On Wed, Aug 08, 2018 at 11:49:21AM +, m...@netbsd.org wrote:
> > > > > Can we use aprint_debug instead?
> > > > 
> > > > It is not even usefull for general debugging IMHO.
> > > > 
> > > > Martin
> > > 
> > > I like the idea of removing the messages entirely. The code was hard to
> > > read when I had to do it, and I didn't find those messages helpful.
> >
> > I meant: I like the way Simon changed it - it will not show up unless
> > you are explicitly debugging exec stuff.
> 
> On top of what Martin said, there's a DEBUG_EXEC already in
> sys/kern/kern_exec.c .  Do these messages still serve a purpose
> now that the compat stuff is working?  I can't answer that!

I can, because I fixed the compat stuff.


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

2018-08-08 Thread Paul Goyette

On Wed, 8 Aug 2018, Martin Husemann wrote:


On Wed, Aug 08, 2018 at 12:11:39PM +, m...@netbsd.org wrote:

On Wed, Aug 08, 2018 at 01:59:46PM +0200, Martin Husemann wrote:

On Wed, Aug 08, 2018 at 11:49:21AM +, m...@netbsd.org wrote:

Can we use aprint_debug instead?


It is not even usefull for general debugging IMHO.

Martin


I like the idea of removing the messages entirely. The code was hard to
read when I had to do it, and I didn't find those messages helpful.


I meant: I like the way Simon changed it - it will not show up unless
you are explicitly debugging exec stuff.


Well, it could remain conditional, and in addition use aprint_debug() 
instead of printf().  So even if you've compiled it in, you don't see 
anything unless you also boot with debug (ie, boot -x).




+--+--++
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:  |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+--+--++


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

2018-08-08 Thread Simon Burge
Martin Husemann wrote:

> On Wed, Aug 08, 2018 at 12:11:39PM +, m...@netbsd.org wrote:
> > On Wed, Aug 08, 2018 at 01:59:46PM +0200, Martin Husemann wrote:
> > > On Wed, Aug 08, 2018 at 11:49:21AM +, m...@netbsd.org wrote:
> > > > Can we use aprint_debug instead?
> > > 
> > > It is not even usefull for general debugging IMHO.
> > > 
> > > Martin
> > 
> > I like the idea of removing the messages entirely. The code was hard to
> > read when I had to do it, and I didn't find those messages helpful.
>
> I meant: I like the way Simon changed it - it will not show up unless
> you are explicitly debugging exec stuff.

On top of what Martin said, there's a DEBUG_EXEC already in
sys/kern/kern_exec.c .  Do these messages still serve a purpose
now that the compat stuff is working?  I can't answer that!

Cheers,
Simon.


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

2018-08-08 Thread Martin Husemann
On Wed, Aug 08, 2018 at 12:11:39PM +, m...@netbsd.org wrote:
> On Wed, Aug 08, 2018 at 01:59:46PM +0200, Martin Husemann wrote:
> > On Wed, Aug 08, 2018 at 11:49:21AM +, m...@netbsd.org wrote:
> > > Can we use aprint_debug instead?
> > 
> > It is not even usefull for general debugging IMHO.
> > 
> > Martin
> 
> I like the idea of removing the messages entirely. The code was hard to
> read when I had to do it, and I didn't find those messages helpful.

I meant: I like the way Simon changed it - it will not show up unless
you are explicitly debugging exec stuff.

Martin


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

2018-08-08 Thread maya
On Wed, Aug 08, 2018 at 01:59:46PM +0200, Martin Husemann wrote:
> On Wed, Aug 08, 2018 at 11:49:21AM +, m...@netbsd.org wrote:
> > Can we use aprint_debug instead?
> 
> It is not even usefull for general debugging IMHO.
> 
> Martin

I like the idea of removing the messages entirely. The code was hard to
read when I had to do it, and I didn't find those messages helpful.


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

2018-08-08 Thread Martin Husemann
On Wed, Aug 08, 2018 at 11:49:21AM +, m...@netbsd.org wrote:
> Can we use aprint_debug instead?

It is not even usefull for general debugging IMHO.

Martin


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

2018-08-08 Thread maya
Can we use aprint_debug instead?

On Wed, Aug 08, 2018 at 07:50:13AM +, Simon Burge wrote:
> Module Name:  src
> Committed By: simonb
> Date: Wed Aug  8 07:50:12 UTC 2018
> 
> Modified Files:
>   src/sys/arch/mips/mips: cpu_exec.c
> 
> Log Message:
> Make change of ABI printf()s #ifdef DEBUG_EXEC.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.65 -r1.66 src/sys/arch/mips/mips/cpu_exec.c
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

> Modified files:
> 
> Index: src/sys/arch/mips/mips/cpu_exec.c
> diff -u src/sys/arch/mips/mips/cpu_exec.c:1.65 
> src/sys/arch/mips/mips/cpu_exec.c:1.66
> --- src/sys/arch/mips/mips/cpu_exec.c:1.65Sun Oct 16 10:57:58 2016
> +++ src/sys/arch/mips/mips/cpu_exec.c Wed Aug  8 07:50:12 2018
> @@ -1,4 +1,4 @@
> -/*   $NetBSD: cpu_exec.c,v 1.65 2016/10/16 10:57:58 maxv Exp $   */
> +/*   $NetBSD: cpu_exec.c,v 1.66 2018/08/08 07:50:12 simonb Exp $ */
>  
>  /*
>   * Copyright (c) 1992, 1993
> @@ -35,7 +35,7 @@
>   */
>  
>  #include 
> -__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.65 2016/10/16 10:57:58 maxv Exp 
> $");
> +__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.66 2018/08/08 07:50:12 simonb Exp 
> $");
>  
>  #include "opt_compat_netbsd.h"
>  #include "opt_compat_ultrix.h"
> @@ -96,7 +96,9 @@ mips_netbsd_elf32_probe(struct lwp *l, s
>  {
>   struct proc * const p = l->l_proc;
>   const Elf32_Ehdr * const eh = eh0;
> +#ifdef DEBUG_EXEC
>   int old_abi = p->p_md.md_abi;
> +#endif /* DEBUG_EXEC */
>   const char *itp_suffix = NULL;
>  
>   /*
> @@ -138,8 +140,10 @@ mips_netbsd_elf32_probe(struct lwp *l, s
>   case EF_MIPS_ABI2:
>   itp_suffix = "n32";
>   p->p_md.md_abi = _MIPS_BSD_API_N32;
> +#ifdef DEBUG_EXEC
>   if (old_abi != p->p_md.md_abi)
>   printf("pid %d(%s): ABI set to N32 (e_flags=%#x)\n", 
> p->p_pid, p->p_comm, eh->e_flags);
> +#endif /* DEBUG_EXEC */
>   break;
>  #endif
>  #ifdef COMPAT_16
> @@ -150,9 +154,11 @@ mips_netbsd_elf32_probe(struct lwp *l, s
>   case EF_MIPS_ABI_O32:
>   itp_suffix = "o32";
>   p->p_md.md_abi = _MIPS_BSD_API_O32;
> +#ifdef DEBUG_EXEC
>   if (old_abi != p->p_md.md_abi)
>   printf("pid %d(%s): ABI set to O32 (e_flags=%#x)\n", 
> p->p_pid, p->p_comm, eh->e_flags);
>   break;
> +#endif /* DEBUG_EXEC */
>   default:
>   return ENOEXEC;
>   }
> @@ -208,7 +214,9 @@ mips_netbsd_elf64_probe(struct lwp *l, s
>  {
>   struct proc * const p = l->l_proc;
>   const Elf64_Ehdr * const eh = eh0;
> +#ifdef DEBUG_EXEC
>   int old_abi = p->p_md.md_abi;
> +#endif /* DEBUG_EXEC */
>   const char *itp_suffix = NULL;
>  
>   switch (eh->e_flags & EF_MIPS_ARCH) {
> @@ -247,14 +255,18 @@ mips_netbsd_elf64_probe(struct lwp *l, s
>   case 0:
>   itp_suffix = "64";
>   p->p_md.md_abi = _MIPS_BSD_API_N64;
> +#ifdef DEBUG_EXEC
>   if (old_abi != p->p_md.md_abi)
>   printf("pid %d(%s): ABI set to N64 (e_flags=%#x)\n", 
> p->p_pid, p->p_comm, eh->e_flags);
> +#endif /* DEBUG_EXEC */
>   break;
>   case EF_MIPS_ABI_O64:
>   itp_suffix = "o64";
>   p->p_md.md_abi = _MIPS_BSD_API_O64;
> +#ifdef DEBUG_EXEC
>   if (old_abi != p->p_md.md_abi)
>   printf("pid %d(%s): ABI set to O64 (e_flags=%#x)\n", 
> p->p_pid, p->p_comm, eh->e_flags);
> +#endif /* DEBUG_EXEC */
>   break;
>   default:
>   return ENOEXEC;
> 



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

2017-08-20 Thread coypu
spoiler alert: we can dedup a lot more

> @@ -1288,10 +1295,7 @@ NESTED_NOPROFILE(MIPSX(user_reserved_ins
>   /*
>* Save a minimum of registers to see if this is rdhwr $3,$29
>*/
> -#ifdef MIPS3_LOONGSON2
> - li  k0, MIPS_DIAG_BTB_CLEAR | MIPS_DIAG_RAS_DISABLE
> - mtc0k0, MIPS_COP_0_DIAG
> -#endif
> + KERN_ENTRY_ERRATA
>   /* K1 already has CURLWP */
>   PTR_L   k0, L_PCB(k1)   # XXXuvm_lwp_getuarea
>   PTR_ADDU k0, USPACE - TF_SIZ - CALLFRAME_SIZ
> @@ -1353,10 +1357,7 @@ NESTED_NOPROFILE(MIPSX(user_gen_exceptio
>   /*
>* Save all the registers except the kernel temporaries onto the stack.
>*/
> -#ifdef MIPS3_LOONGSON2
> - li  k0, MIPS_DIAG_BTB_CLEAR | MIPS_DIAG_RAS_DISABLE
> - mtc0k0, MIPS_COP_0_DIAG
> -#endif
> + KERN_ENTRY_ERRATA
>   /* K1 already has CURLWP */
>   PTR_L   k0, L_PCB(k1)   # XXXuvm_lwp_getuarea
>   PTR_ADDU k0, USPACE - TF_SIZ - CALLFRAME_SIZ
> @@ -1468,10 +1469,7 @@ NESTED_NOPROFILE(MIPSX(user_intr), CALLF
>   * Save the relevant user registers onto the kernel stack.
>   * We don't need to save s0 - s8 because the compiler does it for us.
>   */
> -#ifdef MIPS3_LOONGSON2
> - li  k0, MIPS_DIAG_BTB_CLEAR | MIPS_DIAG_RAS_DISABLE
> - mtc0k0, MIPS_COP_0_DIAG
> -#endif
> + KERN_ENTRY_ERRATA
>   /* k1 contains curlwp */
>   PTR_L   k0, L_PCB(k1)   # XXXuvm_lwp_getuarea
>   PTR_ADDU k0, USPACE - TF_SIZ - CALLFRAME_SIZ
> @@ -1660,10 +1658,7 @@ NESTED_NOPROFILE(MIPSX(systemcall), CALL
>   /*
>* Save all the registers but kernel temporaries onto the stack.
>*/
> -#ifdef MIPS3_LOONGSON2
> - li  k0, MIPS_DIAG_BTB_CLEAR | MIPS_DIAG_RAS_DISABLE
> - mtc0k0, MIPS_COP_0_DIAG
> -#endif
> + KERN_ENTRY_ERRATA
>   /* k1 already contains cpulwp */
>   PTR_L   k0, L_PCB(k1)   # XXXuvm_lwp_getuarea
>   PTR_ADDU k0, USPACE - TF_SIZ - CALLFRAME_SIZ
> 



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

2016-06-30 Thread Izumi Tsutsui
skrll@ wrote:

> > (i.e. reverting removed lines is not "fix" but workaround).
> 
> Not sure what you mean here, but as bad cache aliases can happen my 
> change is valid.

Well, I have been waitng proper description about the new UVM design
for VIPT cache systems (i.e. what's the "right" thing) for >5 years,
as mentioned in the PR...

If it doesn't work as expected, I think it would be better to remove
all useless COLORMATCH code.

---
Izumi Tsutsui


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

2016-06-30 Thread Nick Hudson

On 06/30/16 15:59, Izumi Tsutsui wrote:

skrll@ wrote:


Module Name:src
Committed By:   skrll
Date:   Thu Jun 30 12:57:35 UTC 2016

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

Log Message:
Fix MIPS3_NO_PV_UNCACHED alias handling by looping through the pv_list
looking for bad aliases and removing the bad entries.  That is, revert
to the code before the matt-mips64 merge.

  :

Fixes the following two PRs

  :

Hmm.

This means current implementation of UVM_KMF_COLORMATCH
and UVM_FLAG_COLORMATCH is completely broken


Probably :)


(i.e. reverting removed lines is not "fix" but workaround).


Not sure what you mean here, but as bad cache aliases can happen my 
change is valid.




See PR/45746

---
Izumi Tsutsui


Nick


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

2016-06-30 Thread Izumi Tsutsui
skrll@ wrote:

> Module Name:  src
> Committed By: skrll
> Date: Thu Jun 30 12:57:35 UTC 2016
> 
> Modified Files:
>   src/sys/arch/mips/mips: pmap.c
> 
> Log Message:
> Fix MIPS3_NO_PV_UNCACHED alias handling by looping through the pv_list
> looking for bad aliases and removing the bad entries.  That is, revert
> to the code before the matt-mips64 merge.
 :
> Fixes the following two PRs
 :

Hmm.

This means current implementation of UVM_KMF_COLORMATCH
and UVM_FLAG_COLORMATCH is completely broken
(i.e. reverting removed lines is not "fix" but workaround).

See PR/45746

---
Izumi Tsutsui


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

2016-06-27 Thread Nick Hudson

On 06/27/16 08:12, Nick Hudson wrote:

Module Name:src
Committed By:   skrll
Date:   Mon Jun 27 07:12:18 UTC 2016

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

Log Message:
Fix a bug introduced by me in 1.214 where unmanaged mappings would be
affected by calls to pmap_page_protect which is wrong.  Now PV_KENTER
mappings are left intact.

Thanks to chuq for spotting my mistake and reviewing this diff.


mrg@ was a big help as well... hi phone!

Nick


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

2014-05-07 Thread Izumi Tsutsui
skrll@ wrote:

> How about the attached?

If it's tested on the target CPUs using mips/bus_dma.c,
I have no objection.
(the orignal code was tested only on R4400/R5000/Rm5200)

---
Izumi Tsutsui


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

2014-05-06 Thread Nick Hudson

On 05/02/14 15:39, Izumi Tsutsui wrote:

skrll@ wrote:

[snip]

- BUS_DMASYNC_PREREAD seems incomplete

I think it's complete, but not as well optimized as, for example, the
cobalt one.

Probably depends on the definition of "complete."
(as a person who modified the cobalt one)


How about the attached?


---
Izumi Tsutsui


Index: sys/arch/mips/mips/bus_dma.c
===
RCS file: /cvsroot/src/sys/arch/mips/mips/bus_dma.c,v
retrieving revision 1.30
diff -u -p -r1.30 bus_dma.c
--- sys/arch/mips/mips/bus_dma.c5 Feb 2014 19:09:06 -   1.30
+++ sys/arch/mips/mips/bus_dma.c6 May 2014 07:28:13 -
@@ -856,13 +856,27 @@ _bus_dmamap_sync(bus_dma_tag_t t, bus_dm
mips_dcache_wbinv_range(vaddr, minlen);
break;
 
-   case BUS_DMASYNC_PREREAD:
-#if 1
-   mips_dcache_wbinv_range(vaddr, minlen);
-#else
-   mips_dcache_inv_range(vaddr, minlen);
-#endif
+   case BUS_DMASYNC_PREREAD: {
+   struct mips_cache_info * const mci = &mips_cache_info;
+   vaddr_t start = vaddr;
+   vaddr_t end = vaddr + minlen;
+   vaddr_t preboundary, firstboundary, lastboundary;
+
+   preboundary = start & ~mci->mci_dcache_align_mask;
+   firstboundary = (start + mci->mci_dcache_align_mask)
+   & ~mci->mci_dcache_align_mask;
+   lastboundary = end & ~mci->mci_dcache_align_mask;
+   if (preboundary < start && preboundary < lastboundary)
+   mips_dcache_wbinv_range(preboundary,
+   mci->mci_dcache_align);
+   if (firstboundary < lastboundary)
+   mips_dcache_inv_range(firstboundary,
+   lastboundary - firstboundary);
+   if (lastboundary < end)
+   mips_dcache_wbinv_range(lastboundary,
+   mci->mci_dcache_align);
break;
+   }
 
case BUS_DMASYNC_PREWRITE:
mips_dcache_wb_range(vaddr, minlen);


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

2014-05-02 Thread Nick Hudson

On 05/02/14 15:39, Izumi Tsutsui wrote:

skrll@ wrote:


On 04/30/14 17:35, Izumi Tsutsui wrote:

they should also switch to the common mips bus space/dma files.

- does it handle MIPS1?

don't know about this one.

See pmax/bus_dma.c.


- BUS_DMASYNC_PREREAD seems incomplete

I think it's complete, but not as well optimized as, for example, the
cobalt one.

Probably depends on the definition of "complete."
(as a person who modified the cobalt one)


Should be simple for you to copy across the optimisation then :)


---
Izumi Tsutsui



Nick


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

2014-05-02 Thread Izumi Tsutsui
> Should be simple for you to copy across the optimisation then :)

Sorry, I have no motivation for current mips ports.

---
Izumi Tsutsui


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

2014-05-02 Thread Izumi Tsutsui
skrll@ wrote:

> On 04/30/14 17:35, Izumi Tsutsui wrote:
> >> they should also switch to the common mips bus space/dma files.
> > - does it handle MIPS1?
> don't know about this one.

See pmax/bus_dma.c.

> > - BUS_DMASYNC_PREREAD seems incomplete
> 
> I think it's complete, but not as well optimized as, for example, the 
> cobalt one.

Probably depends on the definition of "complete."
(as a person who modified the cobalt one)

---
Izumi Tsutsui


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

2014-05-02 Thread Nick Hudson

On 04/30/14 17:35, Izumi Tsutsui wrote:

they should also switch to the common mips bus space/dma files.

- does it handle MIPS1?

don't know about this one.

- BUS_DMASYNC_PREREAD seems incomplete


I think it's complete, but not as well optimized as, for example, the 
cobalt one.




---
Izumi Tsutsui




Nick


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

2014-05-01 Thread Izumi Tsutsui
macallan@ wrote:

> On Loongson ( which uses mips/bus_dma.c IIRC ) I see corruption only
> when writing via nfs, on sgimips it's apparently any file access, but
> it takes a lot longer to trigger.

I also wonder if sokvaalloc() (which is enabled by nfsd_use_loan and
depends on UVM_KMF_COLORMATCH) in sys/nfs/nfs_serv.c is safe or not.
(though it's used on the NFS server, not clients)

---
Izumi Tsutsui


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

2014-05-01 Thread Michael
Hello,

On Thu, 1 May 2014 01:14:37 +0900
Izumi Tsutsui  wrote:

> skrll@ wrote:
> 
> > I'm still seeing issues with my cobalt, but I'll keep hunting.
> 
> Probably all mips port MD bus_dma.c
> (in arc, cobalt, emips, ews4800mips, hpcmips, mipsco, pmax, sgimips)
> need the similar fix as mips/bus_dma.c rev 1.28.
> (only algor, evbmips and sbmips use mips/bus_dma.c)

Hmm, the data corruption when piping stuff between processes seems to
be gone, but I still see occasional corruption when accessing files, so
bus_dma is definitely a reasonable suspect.
On Loongson ( which uses mips/bus_dma.c IIRC ) I see corruption only
when writing via nfs, on sgimips it's apparently any file access, but
it takes a lot longer to trigger.

have fun
Michael


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

2014-04-30 Thread Nick Hudson

On 04/30/14 17:14, Izumi Tsutsui wrote:

skrll@ wrote:


I'm still seeing issues with my cobalt, but I'll keep hunting.

Probably all mips port MD bus_dma.c
(in arc, cobalt, emips, ews4800mips, hpcmips, mipsco, pmax, sgimips)
need the similar fix as mips/bus_dma.c rev 1.28.
yeah, they'll need that fix, but there are still cache aliasing bugs in 
the pmap, I think.

(only algor, evbmips and sbmips use mips/bus_dma.c)

---
Izumi Tsutsui




  1   2   >