git: c98aa51be91a - stable/15 - arm64/vmm: Add HYP_FEAT_FGT{,2}
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 09 Feb 2026 16:28:45 UTC
The branch stable/15 has been updated by andrew:
URL: https://cgit.FreeBSD.org/src/commit/?id=c98aa51be91a2146f2d4fb10723bc8032f58084b
commit c98aa51be91a2146f2d4fb10723bc8032f58084b
Author: Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2026-02-03 17:14:26 +0000
Commit: Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2026-02-09 14:52:00 +0000
arm64/vmm: Add HYP_FEAT_FGT{,2}
Add the macros and detection for Fine-grained traps (FEAT_FGT and
FEAT_FGT2).
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D54686
(cherry picked from commit 095a7871f4320e7667a644e6e34a27e1f526b053)
---
sys/arm64/vmm/arm64.h | 2 ++
sys/arm64/vmm/vmm_arm64.c | 12 ++++++++++++
2 files changed, 14 insertions(+)
diff --git a/sys/arm64/vmm/arm64.h b/sys/arm64/vmm/arm64.h
index f530dab05331..1b8762545925 100644
--- a/sys/arm64/vmm/arm64.h
+++ b/sys/arm64/vmm/arm64.h
@@ -131,6 +131,8 @@ struct hyp {
uint64_t feats; /* Which features are enabled */
#define HYP_FEAT_HCX (0x1ul << 0)
#define HYP_FEAT_ECV_POFF (0x1ul << 1)
+#define HYP_FEAT_FGT (0x1ul << 2)
+#define HYP_FEAT_FGT2 (0x1ul << 3)
bool vgic_attached;
struct vgic_v3 *vgic;
struct hypctx *ctx[];
diff --git a/sys/arm64/vmm/vmm_arm64.c b/sys/arm64/vmm/vmm_arm64.c
index aa1361049f49..5a7654ab250f 100644
--- a/sys/arm64/vmm/vmm_arm64.c
+++ b/sys/arm64/vmm/vmm_arm64.c
@@ -525,6 +525,18 @@ vmmops_init(struct vm *vm, pmap_t pmap)
if (get_kernel_reg(ID_AA64MMFR0_EL1, &idreg)) {
if (ID_AA64MMFR0_ECV_VAL(idreg) >= ID_AA64MMFR0_ECV_POFF)
hyp->feats |= HYP_FEAT_ECV_POFF;
+
+ switch (ID_AA64MMFR0_FGT_VAL(idreg)) {
+ case ID_AA64MMFR0_FGT_NONE:
+ break;
+ default:
+ case ID_AA64MMFR0_FGT_8_9:
+ hyp->feats |= HYP_FEAT_FGT2;
+ /* FALLTHROUGH */
+ case ID_AA64MMFR0_FGT_8_6:
+ hyp->feats |= HYP_FEAT_FGT;
+ break;
+ }
}
if (get_kernel_reg(ID_AA64MMFR1_EL1, &idreg)) {