]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: arm64: Remove stage 2 read fault check
authorWei-Lin Chang <r09922117@csie.ntu.edu.tw>
Mon, 8 Sep 2025 06:48:06 +0000 (14:48 +0800)
committerOliver Upton <oliver.upton@linux.dev>
Wed, 10 Sep 2025 09:56:20 +0000 (02:56 -0700)
In the non-NV case, read permission is always granted when mapping
stage-2, so checking for it doesn't bring much. On the other hand,
shadow stage-2 for NV guests could potentially have non-readable
mappings when we align the permissions with those that L1 set for L2, we
shouldn't be checking for read faults in this case either.

So just remove this check.

Suggested-by: Oliver Upton <oliver.upton@linux.dev>
Suggested-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Wei-Lin Chang <r09922117@csie.ntu.edu.tw>
Link: https://lore.kernel.org/r/20250908064806.4093081-1-r09922117@csie.ntu.edu.tw
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/mmu.c

index 0f4271458a079e4d1b0845c4b2f7f3ed46175f36..e78ffcb4bfe900774364e42a9214db2ea7b07b88 100644 (file)
@@ -1545,11 +1545,6 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
        exec_fault = kvm_vcpu_trap_is_exec_fault(vcpu);
        VM_BUG_ON(write_fault && exec_fault);
 
-       if (fault_is_perm && !write_fault && !exec_fault) {
-               kvm_err("Unexpected L2 read permission error\n");
-               return -EFAULT;
-       }
-
        if (!is_protected_kvm_enabled())
                memcache = &vcpu->arch.mmu_page_cache;
        else