Commit 70a5ce4e authored by Marc Zyngier's avatar Marc Zyngier
Browse files

KVM: arm64: Force trap of GMID_EL1 when the guest doesn't have MTE



If our host has MTE, but the guest doesn't, make sure we set HCR_EL2.TID5
to force GMID_EL1 being trapped. Such trap will be handled by the
FEAT_IDST handling.

Reviewed-by: default avatarJoey Gouly <joey.gouly@arm.com>
Reviewed-by: default avatarYuan Yao <yaoyuan@linux.alibaba.com>
Link: https://patch.msgid.link/20260108173233.2911955-7-maz@kernel.org


Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
parent f07ef1be
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -5576,6 +5576,8 @@ static void vcpu_set_hcr(struct kvm_vcpu *vcpu)

	if (kvm_has_mte(vcpu->kvm))
		vcpu->arch.hcr_el2 |= HCR_ATA;
	else
		vcpu->arch.hcr_el2 |= HCR_TID5;

	/*
	 * In the absence of FGT, we cannot independently trap TLBI