[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aO9sUNYmOg9W2Vru@google.com>
Date: Wed, 15 Oct 2025 09:41:36 +0000
From: Mostafa Saleh <smostafa@...gle.com>
To: Robin Murphy <robin.murphy@....com>
Cc: iommu@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, will@...nel.org, joro@...tes.org,
jgg@...pe.ca, praan@...gle.com, Jason Gunthorpe <jgg@...dia.com>
Subject: Re: [PATCH v5 1/4] iommu/io-pgtable-arm: Simplify error prints for
selftests
On Tue, Oct 14, 2025 at 12:09:56PM +0100, Robin Murphy wrote:
> On 2025-09-29 4:49 pm, Mostafa Saleh wrote:
> > At the moment, if the self test fails it prints a lot of information
> > about the page table (size, levels...) this requires access to many
> > internals, which has to be exposed in the next patch moving the
> > tests out.
> >
> > Instead, we can simplify the print, using ias, oas, pgsize_bitmap
> > and fmt is enough to identify the failed case, and the rest can
> > be deduced from the code.
>
> That is the same cfg information already logged at the start of the test, so
> if it's not useful to dump the actual internal details of the ops then just
> remove the whole function and make life even simpler. (Otherwise export it
> or turn it into a callback.)
I see, I think it's better to just remove the whole function.
Thanks,
Mostafa
>
> Thanks,
> Robin.
> > Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
> > Reviewed-by: Pranjal Shrivastava <praan@...gle.com>
> > Signed-off-by: Mostafa Saleh <smostafa@...gle.com>
> > ---
> > drivers/iommu/io-pgtable-arm.c | 10 +++-------
> > 1 file changed, 3 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
> > index 7e8e2216c294..00218af5d5f7 100644
> > --- a/drivers/iommu/io-pgtable-arm.c
> > +++ b/drivers/iommu/io-pgtable-arm.c
> > @@ -1299,14 +1299,10 @@ static const struct iommu_flush_ops dummy_tlb_ops __initconst = {
> > static void __init arm_lpae_dump_ops(struct io_pgtable_ops *ops)
> > {
> > - struct arm_lpae_io_pgtable *data = io_pgtable_ops_to_data(ops);
> > - struct io_pgtable_cfg *cfg = &data->iop.cfg;
> > + struct io_pgtable_cfg *cfg = &io_pgtable_ops_to_pgtable(ops)->cfg;
> > - pr_err("cfg: pgsize_bitmap 0x%lx, ias %u-bit\n",
> > - cfg->pgsize_bitmap, cfg->ias);
> > - pr_err("data: %d levels, 0x%zx pgd_size, %u pg_shift, %u bits_per_level, pgd @ %p\n",
> > - ARM_LPAE_MAX_LEVELS - data->start_level, ARM_LPAE_PGD_SIZE(data),
> > - ilog2(ARM_LPAE_GRANULE(data)), data->bits_per_level, data->pgd);
> > + pr_err("cfg: pgsize_bitmap 0x%lx, ias %u-bit oas %u-bit\n",
> > + cfg->pgsize_bitmap, cfg->ias, cfg->oas);
> > }
> > #define __FAIL(ops, i) ({ \
>
Powered by blists - more mailing lists