The branch main has been updated by andrew:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=eba385011bfed4c7b536eb22913dff979f36f128

commit eba385011bfed4c7b536eb22913dff979f36f128
Author:     Andrew Turner <and...@freebsd.org>
AuthorDate: 2025-07-02 09:49:15 +0000
Commit:     Andrew Turner <and...@freebsd.org>
CommitDate: 2025-07-02 09:49:15 +0000

    arm64: Use CHECK_CPU_FEAT to check for VHE
    
    Now we have a macro to check if a feature is supported in an ID
    register we can use it to see if VHE is supported.
    
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D51102
---
 sys/arm64/arm64/locore.S | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S
index 2f549a527f43..3c75feaa685b 100644
--- a/sys/arm64/arm64/locore.S
+++ b/sys/arm64/arm64/locore.S
@@ -373,9 +373,8 @@ LENTRY(enter_kernel_el)
        ldr     x2, =INIT_SCTLR_EL1
        msr     sctlr_el1, x2
 
-       /* Check if the E2H flag is set */
-       tst     x4, #HCR_E2H
-       b.eq    .Lno_vhe
+       /* Check for VHE */
+       CHECK_CPU_FEAT(x2, ID_AA64MMFR1, VH, .Lno_vhe)
 
        /*
         * The kernel will be running in EL2, route exceptions here rather

Reply via email to