Re: [PATCH rc v2 1/5] iommu/arm-smmu-v3: Add arm_smmu_adopt_strtab() for kdump

Jason Gunthorpe
2026-04-24T16:56:28Z

On Wed, Apr 15, 2026 at 02:17:36PM -0700, Nicolin Chen wrote:
> +static int arm_smmu_adopt_strtab_2lvl(struct arm_smmu_device *smmu, u32 cfg_reg,
> + dma_addr_t dma)
> +{
> + u32 log2size = FIELD_GET(STRTAB_BASE_CFG_LOG2SIZE, cfg_reg);
> + u32 split = FIELD_GET(STRTAB_BASE_CFG_SPLIT, cfg_reg);
> + struct arm_smmu_strtab_cfg *cfg = &smmu->strtab_cfg;
> + u32 num_l1_ents;
> + int i;
> +
> + if (log2size < split) {
> + dev_err(smmu->dev, "kdump: invalid log2size %u < split %u\n",
> + log2size, split);
> + return -EINVAL;
> + }
> +
> + if (split != STRTAB_SPLIT) {
> + dev_err(smmu->dev,
> + "kdump: unsupported STRTAB_SPLIT %u (expected %u)\n",
> + split, STRTAB_SPLIT);
> + return -EINVAL;
> + }
> +
> + num_l1_ents = 1 << (log2size - split);
> + cfg->l2.l1_dma = dma;
> + cfg->l2.num_l1_ents = num_l1_ents;
> + cfg->l2.l1tab = devm_memremap(
> + smmu->dev, dma, num_l1_ents * sizeof(struct arm_smmu_strtab_l1),
> + MEMREMAP_WB);

WB shouldn't be unconditional? If the SMMU is working non-coherently
we need to map it NC. Same remark everwhere

Jason