]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
KVM: arm64: Don't skip cache maintenance for read-only memslots
authorWill Deacon <will@kernel.org>
Wed, 29 Jul 2020 10:28:20 +0000 (11:28 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 30 Jul 2020 15:02:37 +0000 (16:02 +0100)
If a guest performs cache maintenance on a read-only memslot, we should
inform userspace rather than skip the instruction altogether.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Quentin Perret <qperret@google.com>
Link: https://lore.kernel.org/r/20200729102821.23392-4-will@kernel.org
arch/arm64/kvm/mmu.c

index 14c6a9df5c9f4cd5cf8d5d7fb7262ce725fde956..85b0ec9dd9ef20ae81bff99e1a45dd7263e00d49 100644 (file)
@@ -2121,7 +2121,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu, struct kvm_run *run)
                 * So let's assume that the guest is just being
                 * cautious, and skip the instruction.
                 */
-               if (kvm_vcpu_dabt_is_cm(vcpu)) {
+               if (kvm_is_error_hva(hva) && kvm_vcpu_dabt_is_cm(vcpu)) {
                        kvm_skip_instr(vcpu, kvm_vcpu_trap_il_is32bit(vcpu));
                        ret = 1;
                        goto out_unlock;