Module Name:    src
Committed By:   jmcneill
Date:           Thu Jan 30 08:58:07 UTC 2025

Modified Files:
        src/sys/arch/aarch64/aarch64: locore_el2.S

Log Message:
Fix CNTHCTL_EL2 initialization when FEAT_ECV is present.

When FEAT_ECV is present, the ECV bit (and other ECV fields) reset to
an architecturally UNKNOWN value. As NetBSD does not use ECV today,
let's explicitly initialize all bits in CNTHCTL_EL2.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/aarch64/aarch64/locore_el2.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/aarch64/aarch64/locore_el2.S
diff -u src/sys/arch/aarch64/aarch64/locore_el2.S:1.9 src/sys/arch/aarch64/aarch64/locore_el2.S:1.10
--- src/sys/arch/aarch64/aarch64/locore_el2.S:1.9	Mon Aug 30 22:31:20 2021
+++ src/sys/arch/aarch64/aarch64/locore_el2.S	Thu Jan 30 08:58:07 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore_el2.S,v 1.9 2021/08/30 22:31:20 jmcneill Exp $	*/
+/*	$NetBSD: locore_el2.S,v 1.10 2025/01/30 08:58:07 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012-2014 Andrew Turner
@@ -32,7 +32,7 @@
 #include <aarch64/hypervisor.h>
 #include "assym.h"
 
-RCSID("$NetBSD: locore_el2.S,v 1.9 2021/08/30 22:31:20 jmcneill Exp $")
+RCSID("$NetBSD: locore_el2.S,v 1.10 2025/01/30 08:58:07 jmcneill Exp $")
 
 /*
  * For use in #include "locore_el2.S".
@@ -103,8 +103,7 @@ no_el2_host_mode:
 	msr	hstr_el2, xzr
 
 	/* Enable access to the physical timers at EL1. */
-	mrs	x2, cnthctl_el2
-	orr	x2, x2, #(CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN)
+	mov	x2, #(CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN)
 	msr	cnthctl_el2, x2
 
 	/* Set the counter offset to a known value. */

Reply via email to