From 58df49801d9d58e61cc2adc8fd1e6848b64d2453 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Wed, 21 Feb 2024 12:38:49 +0000 Subject: [PATCH] arm64: Fix the has_hyp check boot_el is now the CurrentEL.EL field value. Use the new macros to implement the has_hyp() check. Sponsored by: Arm Ltd --- sys/arm64/arm64/machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index c7f45154368..2716182ca44 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -212,7 +212,7 @@ has_hyp(void) * XXX The E2H check is wrong, but it's close enough for now. Needs to * be re-evaluated once we're running regularly in EL2. */ - return (boot_el == 2 && (hcr_el2 & HCR_E2H) == 0); + return (boot_el == CURRENTEL_EL_EL2 && (hcr_el2 & HCR_E2H) == 0); } bool