Re: [PATCH v11 06/11] iommu/arm-smmu-v3: Add ARM_SMMU_OPT_KDUMP_ADOPT for kdump kernel

From: Nicolin Chen

Date: Tue Oct 20 2026 - 13:52:25 EST


On Tue, Oct 20, 2026 at 10:36:04AM -0700, Nicolin Chen wrote:
> On Tue, Oct 20, 2026 at 11:38:21AM +0000, Mostafa Saleh wrote:
> > On Mon, Oct 05, 2026 at 12:30:49PM -0700, Nicolin Chen wrote:
> > > + /*
> > > + * According to spec (6.3.24), HW aligns the base down to the table size
> > > + * and ignores the low bits, so an unaligned base would make this kernel
> > > + * read a different table.
> > > + */
> > > + if (!IS_ALIGNED(base, size)) {
> > > + dev_err(smmu->dev, "unaligned stream table base %pa\n", &base);
> >
> > I understand these are best effort, but what happens if the address
> > corrupted and happens to be aligned?
>
> This is a basic sanity so HW wouldn't immediately fail. A corrupted
> address would be trickier to test out; also we don't have a perfect
> way to do that. Earlier versions had some address range check. I've
> dropped it, following Jason's comments.
>
> This is also in the kdocs of the whole smmu kdump functions:
>
> * - Only a coherent SMMU (ARM_SMMU_FEAT_COHERENCY) is supported, as the stream
> * table adoption is done by memremap with MEMREMAP_WB, which is verified on
> * the real hardware. Callers of these functions are responsible for gating
> * ARM_SMMU_FEAT_COHERENCY once during the probe.
> */

Oops. I copied a wrong paragraph. Should be:

* - Values read from the crashed kernel's registers get structural validation
* only (format, size, span, alignment, and ID range); the physical addresses
* are not vetted, as the kdump kernel has no record of which pages held the
* tables.

Thanks
Nicolin