aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKajetan Puchalski <kajetan.puchalski@arm.com>2026-09-15 16:17:56 +0000
committerAndrew Turner <andrew@FreeBSD.org>2026-09-18 19:07:49 +0000
commit334f81f411857ad7b3cdeaec20b44316dde01ae8 (patch)
tree8d117a091f00b7c991808d7c626e9c565e165724
parent6f3445006aa05550f14af65b04276c3d25169941 (diff)
arm64/vmm: Fix translation regime in s2_tlbi_range
s2_tlbi_range under VHE is supposed to clear HCR_EL2.TGE, but it erroneously clears an unrelated bit 27 in TCR_EL2 (HWU61). Since HCR_TGE determines which translation regime will be used by a tlbi, the instruction targets the wrong regime when it is not cleared. Fix the register accessed by the function to actually clear HCR_EL2.TGE. Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com> Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://github.com/freebsd/freebsd-src/pull/2435
-rw-r--r--sys/arm64/vmm/vmm_hyp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arm64/vmm/vmm_hyp.c b/sys/arm64/vmm/vmm_hyp.c
index 6eb1208e4fb5..99a5b3728192 100644
--- a/sys/arm64/vmm/vmm_hyp.c
+++ b/sys/arm64/vmm/vmm_hyp.c
@@ -835,7 +835,7 @@ VMM_HYP_FUNC(s2_tlbi_range)(uint64_t vttbr, vm_offset_t sva, vm_offset_t eva,
uint64_t end, r, start;
uint64_t host_vttbr;
#ifdef VMM_VHE
- uint64_t host_tcr;
+ uint64_t host_hcr;
#endif
dsb(ishst);
@@ -852,8 +852,8 @@ VMM_HYP_FUNC(s2_tlbi_range)(uint64_t vttbr, vm_offset_t sva, vm_offset_t eva,
isb();
#ifdef VMM_VHE
- host_tcr = READ_SPECIALREG(tcr_el2);
- WRITE_SPECIALREG(tcr_el2, host_tcr & ~HCR_TGE);
+ host_hcr = READ_SPECIALREG(hcr_el2);
+ WRITE_SPECIALREG(hcr_el2, host_hcr & ~HCR_TGE);
isb();
#endif
@@ -882,7 +882,7 @@ VMM_HYP_FUNC(s2_tlbi_range)(uint64_t vttbr, vm_offset_t sva, vm_offset_t eva,
isb();
#ifdef VMM_VHE
- WRITE_SPECIALREG(tcr_el2, host_tcr);
+ WRITE_SPECIALREG(hcr_el2, host_hcr);
isb();
#endif