linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Mostafa Saleh <smostafa@google.com>,
	iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: will@kernel.org, joro@8bytes.org, jgg@ziepe.ca, praan@google.com,
	Jason Gunthorpe <jgg@nvidia.com>
Subject: Re: [PATCH v5 1/4] iommu/io-pgtable-arm: Simplify error prints for selftests
Date: Tue, 14 Oct 2025 12:09:56 +0100	[thread overview]
Message-ID: <526186fa-d17a-4b79-b51d-83492b19c941@arm.com> (raw)
In-Reply-To: <20250929155001.3287719-2-smostafa@google.com>

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.)

Thanks,
Robin.
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> Reviewed-by: Pranjal Shrivastava <praan@google.com>
> Signed-off-by: Mostafa Saleh <smostafa@google.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)	({						\



  reply	other threads:[~2025-10-14 11:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-29 15:49 [PATCH v5 0/4] Move io-pgtable-arm selftest to KUnit Mostafa Saleh
2025-09-29 15:49 ` [PATCH v5 1/4] iommu/io-pgtable-arm: Simplify error prints for selftests Mostafa Saleh
2025-10-14 11:09   ` Robin Murphy [this message]
2025-10-15  9:41     ` Mostafa Saleh
2025-09-29 15:49 ` [PATCH v5 2/4] iommu/io-pgtable-arm: Move selftests to a separate file Mostafa Saleh
2025-09-29 15:49 ` [PATCH v5 3/4] iommu/io-pgtable-arm-selftests: Modularize the test Mostafa Saleh
2025-09-29 15:49 ` [PATCH v5 4/4] iommu/io-pgtable-arm-selftests: Use KUnit Mostafa Saleh
2025-10-14 13:43   ` Robin Murphy
2025-10-15  9:53     ` Mostafa Saleh
2025-10-15 13:51       ` Robin Murphy
2025-10-15 15:10         ` Jason Gunthorpe
2025-10-16 17:17           ` Robin Murphy
2025-10-16 17:25             ` Jason Gunthorpe
2025-10-17 13:04               ` Mostafa Saleh
2025-10-17 14:13                 ` Jason Gunthorpe
2025-10-17 17:59                   ` Mostafa Saleh
2025-10-13  9:32 ` [PATCH v5 0/4] Move io-pgtable-arm selftest to KUnit Mostafa Saleh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=526186fa-d17a-4b79-b51d-83492b19c941@arm.com \
    --to=robin.murphy@arm.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=praan@google.com \
    --cc=smostafa@google.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).