[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240830132009.GB8615@willie-the-truck>
Date: Fri, 30 Aug 2024 14:20:10 +0100
From: Will Deacon <will@...nel.org>
To: Rob Clark <robdclark@...il.com>
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 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?
Will
Powered by blists - more mailing lists