[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF6AEGuLFsGtE1LQNge_WRxdYwYnHAgkbcL5Xh4HUxx2XuzNLQ@mail.gmail.com>
Date: Fri, 30 Aug 2024 07:32:02 -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>, Jason Gunthorpe <jgg@...pe.ca>,
Joao Martins <joao.m.martins@...cle.com>, Kevin Tian <kevin.tian@...el.com>,
Steven Price <steven.price@....com>, Lu Baolu <baolu.lu@...ux.intel.com>,
Boris Brezillon <boris.brezillon@...labora.com>,
"moderated list:ARM SMMU DRIVERS" <linux-arm-kernel@...ts.infradead.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v9 3/4] iommu/io-pgtable-arm: Add way to debug pgtable walk
On Fri, Aug 30, 2024 at 6:20 AM Will Deacon <will@...nel.org> wrote:
>
> On Tue, Aug 27, 2024 at 11:17:11AM -0700, Rob Clark wrote:
> > From: Rob Clark <robdclark@...omium.org>
> >
> > Add an io-pgtable method to walk the pgtable returning the raw PTEs that
> > would be traversed for a given iova access.
> >
> > Signed-off-by: Rob Clark <robdclark@...omium.org>
> > ---
> > drivers/iommu/io-pgtable-arm.c | 25 +++++++++++++++++++++++++
> > include/linux/io-pgtable.h | 15 +++++++++++++++
> > 2 files changed, 40 insertions(+)
> >
> > diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
> > index efed8e519111..11af49119f37 100644
> > --- a/drivers/iommu/io-pgtable-arm.c
> > +++ b/drivers/iommu/io-pgtable-arm.c
> > @@ -759,6 +759,30 @@ static phys_addr_t arm_lpae_iova_to_phys(struct io_pgtable_ops *ops,
> > return iopte_to_paddr(d.pte, data) | iova;
> > }
> >
> > +static int visit_pgtable_walk(struct io_pgtable_walk_data *walk_data, int lvl,
> > + arm_lpae_iopte *ptep, size_t size)
> > +{
> > + struct arm_lpae_io_pgtable_walk_data *data = walk_data->data;
> > + data->ptes[data->level++] = *ptep;
> > + return 0;
> > +}
>
> I'm struggling to see how this works given that the ->visit() callback
> is only called for leaf entries in the page-table. What am I missing?
Yeah, we should just go back to my v6 before I tried to re-use the
arm_lpae_read_and_clear_dirty() walker.. addressing review comments is
just making it worse since then
BR,
-R
Powered by blists - more mailing lists