From 1de666a9e26e3cf629aac24c4effb119c4e3bd22 Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Mon, 21 Jun 2021 19:00:50 +0100 Subject: [PATCH] ANDROID: KVM: arm64: Plumb MMIO checking into the fault handling Plumb the MMIO checking code into the MMIO fault handling code. Any fault hitting outside of an MMIO region will now report an invalid syndrome, and won't leak any data from the guest. Bug: 209580772 Change-Id: I68bef2d0211a804aa1e598aeaa0c85dc4098f61e Signed-off-by: Marc Zyngier Signed-off-by: Fuad Tabba --- arch/arm64/kvm/hyp/nvhe/hyp-main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-main.c b/arch/arm64/kvm/hyp/nvhe/hyp-main.c index 94d81b094182..b4719b3db2f9 100644 --- a/arch/arm64/kvm/hyp/nvhe/hyp-main.c +++ b/arch/arm64/kvm/hyp/nvhe/hyp-main.c @@ -319,11 +319,7 @@ static void handle_pvm_exit_dabt(struct pkvm_hyp_vcpu *hyp_vcpu) { struct kvm_vcpu *host_vcpu = hyp_vcpu->host_vcpu; - /* - * For now, we treat all data aborts as MMIO since we have no knowledge - * of the memslot configuration at EL2. - */ - hyp_vcpu->vcpu.mmio_needed = true; + hyp_vcpu->vcpu.mmio_needed = __pkvm_check_ioguard_page(hyp_vcpu); if (hyp_vcpu->vcpu.mmio_needed) { /* r0 as transfer register between the guest and the host. */