Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: arm64: Use kvm_has_mte() in pKVM trap initialization

When initializing HCR traps in protected mode, use kvm_has_mte() to
check for MTE support rather than kvm_has_feat(kvm, ID_AA64PFR1_EL1,
MTE, IMP).

kvm_has_mte() provides a more comprehensive check:
- kvm_has_feat() only checks if MTE is in the guest's ID register view
(i.e., what we advertise to the guest)
- kvm_has_mte() checks both system_supports_mte() AND whether
KVM_ARCH_FLAG_MTE_ENABLED is set for this VM instance

Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260122112218.531948-5-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>

authored by

Fuad Tabba and committed by
Marc Zyngier
230b0806 5ee8ad69

+1 -1
+1 -1
arch/arm64/kvm/hyp/nvhe/pkvm.c
··· 82 82 if (!kvm_has_feat(kvm, ID_AA64PFR0_EL1, AMU, IMP)) 83 83 val &= ~(HCR_AMVOFFEN); 84 84 85 - if (!kvm_has_feat(kvm, ID_AA64PFR1_EL1, MTE, IMP)) { 85 + if (!kvm_has_mte(kvm)) { 86 86 val |= HCR_TID5; 87 87 val &= ~(HCR_DCT | HCR_ATA); 88 88 }