From 2c05ff981ae74ec77db31df2ffd435e54265c818 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Tue, 29 Mar 2022 16:56:10 +0100 Subject: [PATCH] ANDROID: KVM: arm64: iommu: No powered check in DABT handler The IOMMU DABT handler currently checks if the device is considered powered by hyp before resolving the request. If the power tracking does not reflect reality, the IOMMU may trigger issues in the host but the incorrect state prevents it from diagnosing the issue. Drop the powered check from the generic IOMMU code. The host accessing the device's SFR means that it assumes it is powered, and individual drivers can choose to reject that DABT request. Bug: 224891559 Bug: 190463801 Signed-off-by: David Brazdil Change-Id: I1c132c4030a61a90be4675867c9658e3bc696118 --- arch/arm64/kvm/hyp/nvhe/iommu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp/nvhe/iommu.c b/arch/arm64/kvm/hyp/nvhe/iommu.c index 9ad3e8079e03..3c0d2327a839 100644 --- a/arch/arm64/kvm/hyp/nvhe/iommu.c +++ b/arch/arm64/kvm/hyp/nvhe/iommu.c @@ -467,7 +467,8 @@ bool pkvm_iommu_host_dabt_handler(struct kvm_cpu_context *host_ctxt, u32 esr, if (pa < dev->pa || pa >= dev->pa + dev->size) continue; - if (!dev->powered || !dev->ops->host_dabt_handler || + /* No 'powered' check - the host assumes it is powered. */ + if (!dev->ops->host_dabt_handler || !dev->ops->host_dabt_handler(dev, host_ctxt, esr, pa - dev->pa)) return false;