[PATCH 04/19] iommu/arm-smmu-v3: Make STE programming independent of the callers
Jason Gunthorpe
jgg at nvidia.com
Wed Jan 3 07:49:32 PST 2024
On Wed, Jan 03, 2024 at 11:42:50PM +0800, Michael Shavit wrote:
> On Wed, Dec 27, 2023 at 11:46 PM Jason Gunthorpe <jgg at nvidia.com> wrote:
> >
> > } else { // hweight8 == 0
> > set(qword_start=0,qword_end=N);
> > }
> About this branch: wouldn't it be more clear to explicitly do nothing
> or warn if any of the bits differ? We shouldn't ever expect to see the
> STE differ in unused-bits position.
Right, it should be impossible considering the used consistency check,
but if we do hit this case for some future bug the right thing to do
is fix it up and keep going. A WARN_ONCE would be good
If we get here and set does actually make a change it will be to
change an unused bit which is 1 to a 0, and we've already taken the
position in this logic that is something we want to correct.
As before since set should skip the sync if no bits change this is
effectively a NOP.
Jason
More information about the linux-arm-kernel
mailing list