]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: Hoist MTE validation check out of MMU lock path
authorFuad Tabba <tabba@google.com>
Fri, 6 Mar 2026 14:02:31 +0000 (14:02 +0000)
committerMarc Zyngier <maz@kernel.org>
Sat, 28 Mar 2026 11:29:40 +0000 (11:29 +0000)
commit84699747aa554197f6d5b4f4c9d1bcb6cb28e21f
treef77977f41534a6eb9e2c2f656946840db5cd5cd0
parent3456943e8786d56aa2bd3f99e9ad2d735a9879c8
KVM: arm64: Hoist MTE validation check out of MMU lock path

Simplify the non-cacheable attributes assignment by using a ternary
operator. Additionally, hoist the MTE validation check (mte_allowed) out
of kvm_s2_fault_map() and into kvm_s2_fault_compute_prot(). This allows
us to fail faster and avoid acquiring the KVM MMU lock unnecessarily
when the VMM introduces a disallowed VMA for an MTE-enabled guest.

Signed-off-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/mmu.c