[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAF6AEGtFg2D=4RVQC=YT9OsqdNwwsuJCyi=hu8Box0A6psecQA@mail.gmail.com>
Date: Tue, 27 Aug 2024 09:54:29 -0700
From: Rob Clark <robdclark@...il.com>
To: Will Deacon <will@...nel.org>
Cc: iommu@...ts.linux.dev, Robin Murphy <robin.murphy@....com>,
Rob Clark <robdclark@...omium.org>, Joerg Roedel <joro@...tes.org>,
"moderated list:ARM SMMU DRIVERS" <linux-arm-kernel@...ts.infradead.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v8 2/4] iommu/io-pgtable-arm: Re-use the pgtable walk for iova_to_phys
On Tue, Aug 27, 2024 at 5:02 AM Will Deacon <will@...nel.org> wrote:
>
> On Mon, Aug 26, 2024 at 10:15:39AM -0700, Rob Clark wrote:
> > @@ -776,7 +775,7 @@ static int io_pgtable_visit(struct arm_lpae_io_pgtable *data,
> > return 0;
> > }
> >
> > - if (WARN_ON(!iopte_table(pte, lvl)))
> > + if (WARN_ON(!iopte_table(pte, lvl) && !selftest_running))
> > return -EINVAL;
> >
> > ptep = iopte_deref(pte, data);
>
> I still don't grok this hunk. If the selftest is running, we want to
> return -EINVAL here rather than dereference something that isn't a
> table, right?
>
> Suppressing the warning is one thing, but this seems to do more than
> that.
oh, that should be
if (!iopte_table(...)) {
WARN_ON(!selftest_running);
return -EINVAL;
}
I did boot with selftests enabled, and it didn't _seem_ to complain
about anything, so I overlooked that
BR,
-R
>
> Will
Powered by blists - more mailing lists