From 44a1d317ab83c46bb630cef8559a3c6585c70eae Mon Sep 17 00:00:00 2001 From: Wenkai Lin Date: Thu, 7 Dec 2023 16:52:57 +0800 Subject: [PATCH] iommu/arm-smmu-v3: disable stall for quiet_cd hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8MCHF CVE: NA Reference: https://lore.kernel.org/all/20231206005517.46005-1-zhangfei.gao@linaro.org/#r -------------------------------- In the stall model, invalid transactions were expected to be stalled and aborted by the IOPF handler. However, when killing a test case with a huge amount of data, the accelerator streamline can not stop until all data is consumed even if the page fault handler reports errors. As a result, the kill may take a long time, about 10 seconds with numerous iopf interrupts. So disable stall for quiet_cd in the non-force stall model, since force stall model (STALL_MODEL==0b10) requires CD.S must be 1. Signed-off-by: Zhangfei Gao Signed-off-by: Wenkai Lin Suggested-by: Jean-Philippe Brucker Signed-off-by: Chen Jun (cherry picked from commit dc65d1d094cf07e3702d75c4ee8d9f2960b57a99) --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index 45aad67e58b0..49e4e6ef465a 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -1273,6 +1273,8 @@ int arm_smmu_write_ctx_desc(struct arm_smmu_domain *smmu_domain, int ssid, if (!cd) { /* (5) */ val = 0; } else if (cd == &quiet_cd) { /* (4) */ + if (!(smmu->features & ARM_SMMU_FEAT_STALL_FORCE)) + val &= ~(CTXDESC_CD_0_S | CTXDESC_CD_0_R); val |= CTXDESC_CD_0_TCR_EPD0; } else if (cd_live) { /* (3) */ val &= ~CTXDESC_CD_0_ASID; -- Gitee