diff --git a/sys/arm64/arm64/genassym.c b/sys/arm64/arm64/genassym.c --- a/sys/arm64/arm64/genassym.c +++ b/sys/arm64/arm64/genassym.c @@ -42,7 +42,6 @@ ASSYM(BP_KERN_STACK, offsetof(struct arm64_bootparams, kern_stack)); ASSYM(BP_KERN_TTBR0, offsetof(struct arm64_bootparams, kern_ttbr0)); ASSYM(BP_BOOT_EL, offsetof(struct arm64_bootparams, boot_el)); -ASSYM(BP_HCR_EL2, offsetof(struct arm64_bootparams, hcr_el2)); ASSYM(PCPU_SIZE, sizeof(struct pcpu)); ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb)); diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -134,7 +134,6 @@ str x25, [x0, #BP_KERN_STACK] str x27, [x0, #BP_KERN_TTBR0] str x23, [x0, #BP_BOOT_EL] - str x4, [x0, #BP_HCR_EL2] #ifdef KASAN /* Save bootparams */ 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 @@ -131,7 +131,6 @@ int early_boot = 1; int cold = 1; static int boot_el; -static uint64_t hcr_el2; struct kva_md_info kmi; @@ -207,12 +206,7 @@ bool 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 == CURRENTEL_EL_EL2 && (hcr_el2 & HCR_E2H) == 0); + return (boot_el == CURRENTEL_EL_EL2); } bool @@ -905,7 +899,6 @@ TSRAW(&thread0, TS_ENTER, __func__, NULL); boot_el = abp->boot_el; - hcr_el2 = abp->hcr_el2; /* Parse loader or FDT boot parametes. Determine last used address. */ lastaddr = parse_boot_param(abp); diff --git a/sys/arm64/include/machdep.h b/sys/arm64/include/machdep.h --- a/sys/arm64/include/machdep.h +++ b/sys/arm64/include/machdep.h @@ -33,7 +33,6 @@ vm_offset_t modulep; vm_offset_t kern_stack; vm_paddr_t kern_ttbr0; - uint64_t hcr_el2; int boot_el; /* EL the kernel booted from */ int pad; };