[PATCH rc v4 5/5] iommu/arm-smmu-v3: Detect ARM_SMMU_OPT_KDUMP_ADOPT in probe()
Tian, Kevin
kevin.tian at intel.com
Fri May 8 00:47:22 PDT 2026
> From: Nicolin Chen <nicolinc at nvidia.com>
> Sent: Wednesday, April 29, 2026 3:21 PM
>
> arm_smmu_device_hw_probe() runs before arm_smmu_init_structures(), so
> it's
> natural to decide whether the kdump kernel must adopt the crashed kernel's
> stream table.
>
> Given that memremap is used to adopt the old stream table, set this option
> only on a coherent SMMU.
>
> And make sure SMMU isn't in Service Failure Mode.
>
> Fixes: b63b3439b856 ("iommu/arm-smmu-v3: Abort all transactions if SMMU
> is enabled in kdump kernel")
> Cc: stable at vger.kernel.org # v6.12+
> Signed-off-by: Nicolin Chen <nicolinc at nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian at intel.com>, with nits:
>
> +static void arm_smmu_device_hw_probe_kdump(struct arm_smmu_device
> *smmu)
> +{
> + u32 gerror, gerrorn, active;
> +
> + /*
> + * If SMMU is already active in kdump case, there could be in-flight
> DMA
> + * from devices initiated by the crashed kernel.
> + */
> + if (!(readl_relaxed(smmu->base + ARM_SMMU_CR0) &
> CR0_SMMUEN))
> + return;
Above comment is for the entire function. for the check here the comment
should be that no in-fly DMA to require adoption due to SMMU disabled.
> +
> + /* For now, only support a coherent SMMU that works with
> MEMREMAP_WB */
> + if (!(smmu->features & ARM_SMMU_FEAT_COHERENCY)) {
> + dev_warn(smmu->dev,
> + "kdump: non-coherent SMMU can't adopt stream
> table\n");
"can't adopt stream table so SMMU will be reset to block all DMAs"
More information about the linux-arm-kernel
mailing list