[PATCH 10/27] iommu/arm-smmu-v3: Move the CD generation for SVA into a function

Jason Gunthorpe jgg at nvidia.com
Tue Oct 24 04:52:21 PDT 2023


On Tue, Oct 24, 2023 at 12:12:28PM +0800, Michael Shavit wrote:
> On Thu, Oct 12, 2023 at 7:26 AM Jason Gunthorpe <jgg at nvidia.com> wrote:
> >
> > Pull all the calculations for building the CD table entry for a mmu_struct
> > into arm_smmu_make_sva_cd().
> >
> > Call it in the two places installing the SVA CD table entry.
> >
> > Open code the last caller of arm_smmu_update_ctx_desc_devices() and remove
> > the function.
> >
> > Remove arm_smmu_write_ctx_desc() since all callers are gone.
> >
> > Remove quiet_cd since all users are gone, arm_smmu_make_sva_cd() creates
> > the same value.
> >
> > The behavior of quiet_cd changes slightly, the old implementation edited
> > the CD in place to set CTXDESC_CD_0_TCR_EPD0 assuming it was a SVA CD
> > entry. This version generates a full CD entry with a 0 TTB0 and relies on
> > arm_smmu_write_cd_entry() to install it hitlessly.
> >
> 
> Is this change observable? AFAICT this will behave the same way but
> with an extra CD sync operation to null TTB0 after setting EPD0.

AFAIK it should not be observable, setting EPD0 is the key operation.

If we want to drop the zeroing of unused fields is a decision we can
make globally in the step function..

None of this is a performance path so I've been inclined to keep the
explicit zeroing.

Jason



More information about the linux-arm-kernel mailing list