Enable EPAN if it is available.
authorkettenis <kettenis@openbsd.org>
Sun, 23 Jun 2024 10:17:16 +0000 (10:17 +0000)
committerkettenis <kettenis@openbsd.org>
Sun, 23 Jun 2024 10:17:16 +0000 (10:17 +0000)
ok patrick@

sys/arch/arm64/arm64/cpu.c
sys/arch/arm64/include/armreg.h

index c61be5e..a350d11 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: cpu.c,v 1.120 2024/06/21 01:52:17 jsg Exp $   */
+/*     $OpenBSD: cpu.c,v 1.121 2024/06/23 10:17:16 kettenis Exp $      */
 
 /*
  * Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
@@ -1174,6 +1174,8 @@ cpu_init(void)
        if (ID_AA64MMFR1_PAN(id_aa64mmfr1) >= ID_AA64MMFR1_PAN_IMPL) {
                sctlr = READ_SPECIALREG(sctlr_el1);
                sctlr &= ~SCTLR_SPAN;
+               if (ID_AA64MMFR1_PAN(id_aa64mmfr1) >= ID_AA64MMFR1_PAN_EPAN)
+                       sctlr |= SCTLR_EPAN;
                WRITE_SPECIALREG(sctlr_el1, sctlr);
        }
 
index 5ace1af..ed7b530 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: armreg.h,v 1.34 2024/05/27 06:20:59 kettenis Exp $ */
+/* $OpenBSD: armreg.h,v 1.35 2024/06/23 10:17:16 kettenis Exp $ */
 /*-
  * Copyright (c) 2013, 2014 Andrew Turner
  * Copyright (c) 2015 The FreeBSD Foundation
 #define        SCTLR_EnIA      0x0000000080000000
 #define        SCTLR_BT0       0x0000000800000000
 #define        SCTLR_BT1       0x0000001000000000
+#define        SCTLR_EPAN      0x0200000000000000
 
 /* SPSR_EL1 */
 /*