summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2020-07-29 12:28:20 +0200
committerMarc Zyngier <maz@kernel.org>2020-07-30 17:02:37 +0200
commit54dc0d2404dd7aa0dd4e4f388a65622b68c6eaff (patch)
tree7e9e3662ffc46a7bbfd4a8840df5b15b0a1e74f9 /arch
parentKVM: arm64: Handle data and instruction external aborts the same way (diff)
downloadlinux-54dc0d2404dd7aa0dd4e4f388a65622b68c6eaff.tar.xz
linux-54dc0d2404dd7aa0dd4e4f388a65622b68c6eaff.zip
KVM: arm64: Don't skip cache maintenance for read-only memslots
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
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/kvm/mmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
index 14c6a9df5c9f..85b0ec9dd9ef 100644
--- a/arch/arm64/kvm/mmu.c
+++ b/arch/arm64/kvm/mmu.c
@@ -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;