diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -178,7 +178,8 @@ { uint64_t id_aa64mfr1; - id_aa64mfr1 = READ_SPECIALREG(id_aa64mmfr1_el1); + if (!get_kernel_reg(ID_AA64MMFR1_EL1, &id_aa64mfr1)) + return (FEAT_ALWAYS_DISABLE); if (ID_AA64MMFR1_PAN_VAL(id_aa64mfr1) == ID_AA64MMFR1_PAN_NONE) return (FEAT_ALWAYS_DISABLE); @@ -209,7 +210,7 @@ CPU_FEAT(feat_pan, "Privileged access never", pan_check, NULL, pan_enable, - CPU_FEAT_EARLY_BOOT | CPU_FEAT_PER_CPU); + CPU_FEAT_AFTER_DEV | CPU_FEAT_PER_CPU); bool has_hyp(void)