Module Name:    src
Committed By:   jmcneill
Date:           Thu Sep 12 09:05:28 UTC 2019

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

Log Message:
Do not attempt to change coherency_unit at runtime. Instead, if the
required coherency unit is greater than COHERENCY_UNIT in a MULTIPROCESSOR
kernel, just panic instead.

This makes non-MULTIPROCESSOR kernels work again.


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

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/cpufunc.c
diff -u src/sys/arch/aarch64/aarch64/cpufunc.c:1.5 src/sys/arch/aarch64/aarch64/cpufunc.c:1.6
--- src/sys/arch/aarch64/aarch64/cpufunc.c:1.5	Fri Dec 21 08:01:01 2018
+++ src/sys/arch/aarch64/aarch64/cpufunc.c	Thu Sep 12 09:05:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.5 2018/12/21 08:01:01 ryo Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.6 2019/09/12 09:05:28 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <r...@nerv.org>
@@ -26,8 +26,10 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "opt_multiprocessor.h"
+
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.5 2018/12/21 08:01:01 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.6 2019/09/12 09:05:28 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -135,9 +137,12 @@ aarch64_getcacheinfo(void)
 		arm_dcache_align = sizeof(int) << arm_dcache_maxline;
 		arm_dcache_align_mask = arm_dcache_align - 1;
 	}
-	/* update coherency_unit (in param.h) */
+
+#ifdef MULTIPROCESSOR
 	if (coherency_unit < arm_dcache_align)
-		coherency_unit = arm_dcache_align;
+		panic("coherency_unit %ld < arm_dcache_align %d; increase COHERENCY_UNIT",
+		    coherency_unit, arm_dcache_align);
+#endif
 
 	/*
 	 * CLIDR -  Cache Level ID Register

Reply via email to