From 40435b13b0686f425df79aeb912a168da29d6339 Mon Sep 17 00:00:00 2001 From: kettenis Date: Sun, 23 Jun 2024 10:17:16 +0000 Subject: [PATCH] Enable EPAN if it is available. ok patrick@ --- sys/arch/arm64/arm64/cpu.c | 4 +++- sys/arch/arm64/include/armreg.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/arch/arm64/arm64/cpu.c b/sys/arch/arm64/arm64/cpu.c index c61be5e1ecb..a350d11a843 100644 --- a/sys/arch/arm64/arm64/cpu.c +++ b/sys/arch/arm64/arm64/cpu.c @@ -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 @@ -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); } diff --git a/sys/arch/arm64/include/armreg.h b/sys/arch/arm64/include/armreg.h index 5ace1affed7..ed7b5301795 100644 --- a/sys/arch/arm64/include/armreg.h +++ b/sys/arch/arm64/include/armreg.h @@ -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 @@ -705,6 +705,7 @@ #define SCTLR_EnIA 0x0000000080000000 #define SCTLR_BT0 0x0000000800000000 #define SCTLR_BT1 0x0000001000000000 +#define SCTLR_EPAN 0x0200000000000000 /* SPSR_EL1 */ /* -- 2.20.1