All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
	iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>,
	Justin Stitt <justinstitt@google.com>,
	Kevin Tian <kevin.tian@intel.com>,
	linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org,
	llvm@lists.linux.dev, Bill Wendling <morbo@google.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Miguel Ojeda <ojeda@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Shuah Khan <shuah@kernel.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Will Deacon <will@kernel.org>, Alexey Kardashevskiy <aik@amd.com>,
	Alejandro Jimenez <alejandro.j.jimenez@oracle.com>,
	James Gowans <jgowans@amazon.com>,
	Michael Roth <michael.roth@amd.com>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	patches@lists.linux.dev
Subject: Re: [PATCH v4 01/15] genpt: Generic Page Table base API
Date: Fri, 29 Aug 2025 15:51:24 -0300	[thread overview]
Message-ID: <20250829185124.GE79520@nvidia.com> (raw)
In-Reply-To: <bdbd466f-01d3-40ac-abca-81527dbfb901@infradead.org>

On Wed, Aug 27, 2025 at 12:11:40AM -0700, Randy Dunlap wrote:
> > +/**
> > + * pt_entry_num_contig_lg2() - Number of contiguous items for this leaf entry
> > + * @pts: Entry to query
> > + *
> > + * Returns the number of contiguous items this leaf entry spans. If the entry is
> 
>  * Returns:

I think I prefer to leave many of these as is, putting the entire body
in a Returns: block seems too weird. I did the ones that seemed to fit
that pattern.

Most of these descriptions are entirely talking about the return value
since that is the only thing the function does.

> > + * If true the caller use at level 0 pt_install_leaf_entry(PAGE_SHIFT). This is
> 
>                          uses
> ?
> although it might just be missing a word or two? I can't tell.

 * If true the caller can use, at level 0, pt_install_leaf_entry(PAGE_SHIFT).
 * This is useful to create optimized paths for common cases of PAGE_SIZE
 * mappings.

> > + * Otherwise the bit in position pt_table_item_lg2sz() should be set indicating
> > + * that a non-contigous singe item leaf entry is supported. The following
> 
>              non-contiguous
> Also, is that               single
> ?
> or is "singe" a real word here? (IDK.)

 * Otherwise the bit in position pt_table_item_lg2sz() should be set indicating
 * that a non-contiguous single item leaf entry is supported. The following

> > +enum {
> > +	PT_VADDR_MAX = sizeof(pt_vaddr_t) == 8 ? U64_MAX : U32_MAX,
> > +	PT_VADDR_MAX_LG2 = sizeof(pt_vaddr_t) == 8 ? 64 : 32,
> > +	PT_OADDR_MAX = sizeof(pt_oaddr_t) == 8 ? U64_MAX : U32_MAX,
> > +	PT_OADDR_MAX_LG2 = sizeof(pt_oaddr_t) == 8 ? 64 : 32,
> > +};
> 
> Hm, duplicated enum entry values?
> Interesting.

Nope one letter different, pt_vaddr_t != pt_oaddr_t in all cases.

> > + *  start/end
> > + *     An open range, eg [0,0) refers to no VA.
> 
> 	                 e.g.,
> 
> and is a half-open (or right-open) range or interval, not open.
> 
> Open would be (0, 0).
> Closed would be [0, 0].
> I used to think that was "clopen" but now I read that clopen refers
> to sets and not intervals.

Ok

> > +/*
> > + * Add index_count_lg2 number of entries to pts's VA and index. The va will be
> 
> s/VA/va/ for consistency?
> since it ("va") is defined in Generic Page Table Language.

I changed the language section to be upper case and fixed the lower
case versions I noticed. There are more upper case versions than
lower..

Got everything else, thanks a lot!

Jason

  reply	other threads:[~2025-08-29 18:51 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26 17:18 [PATCH v4 00/15] Consolidate iommu page table implementations (AMD) Jason Gunthorpe
2025-08-26 17:18 ` [PATCH v4 01/15] genpt: Generic Page Table base API Jason Gunthorpe
2025-08-27  7:11   ` Randy Dunlap
2025-08-29 18:51     ` Jason Gunthorpe [this message]
2025-08-29 22:50       ` Randy Dunlap
2025-08-26 17:18 ` [PATCH v4 02/15] genpt: Add Documentation/ files Jason Gunthorpe
2025-08-27  1:07   ` Randy Dunlap
2025-08-29 18:57     ` Jason Gunthorpe
2025-08-26 17:18 ` [PATCH v4 03/15] iommupt: Add the basic structure of the iommu implementation Jason Gunthorpe
2025-08-27  5:03   ` Randy Dunlap
2025-08-29 19:05     ` Jason Gunthorpe
2025-08-29 19:25       ` Randy Dunlap
2025-08-26 17:18 ` [PATCH v4 04/15] iommupt: Add the AMD IOMMU v1 page table format Jason Gunthorpe
2025-08-27  0:03   ` Randy Dunlap
2025-08-29 19:06     ` Jason Gunthorpe
2025-08-26 17:18 ` [PATCH v4 05/15] iommupt: Add iova_to_phys op Jason Gunthorpe
2025-08-26 17:18 ` [PATCH v4 06/15] iommupt: Add unmap_pages op Jason Gunthorpe
2025-08-26 20:44   ` Randy Dunlap
2025-08-29 17:55     ` Jason Gunthorpe
2025-08-26 17:18 ` [PATCH v4 07/15] iommupt: Add map_pages op Jason Gunthorpe
2025-08-26 23:20   ` Randy Dunlap
2025-08-29 19:23     ` Jason Gunthorpe
2025-08-29 19:27       ` Randy Dunlap
2025-08-26 17:18 ` [PATCH v4 08/15] iommupt: Add read_and_clear_dirty op Jason Gunthorpe
2025-08-26 20:47   ` Randy Dunlap
2025-08-29 17:55     ` Jason Gunthorpe
2025-08-26 17:18 ` [PATCH v4 09/15] iommupt: Add a kunit test for Generic Page Table Jason Gunthorpe
2025-08-26 17:18 ` [PATCH v4 10/15] iommupt: Add a mock pagetable format for iommufd selftest to use Jason Gunthorpe
2025-08-26 17:18 ` [PATCH v4 11/15] iommufd: Change the selftest to use iommupt instead of xarray Jason Gunthorpe
2025-08-26 23:33   ` Randy Dunlap
2025-08-29 17:56     ` Jason Gunthorpe
2025-08-26 17:18 ` [PATCH v4 12/15] iommupt: Add the x86 64 bit page table format Jason Gunthorpe
2025-08-26 23:38   ` Randy Dunlap
2025-08-29 17:58     ` Jason Gunthorpe
2025-08-26 17:18 ` [PATCH v4 13/15] iommu/amd: Use the generic iommu page table Jason Gunthorpe
2025-08-26 17:18 ` [PATCH v4 14/15] iommu/amd: Remove AMD io_pgtable support Jason Gunthorpe
2025-08-26 17:18 ` [PATCH v4 15/15] iommupt: Add a kunit test for the IOMMU implementation Jason Gunthorpe

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=20250829185124.GE79520@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=aik@amd.com \
    --cc=alejandro.j.jimenez@oracle.com \
    --cc=corbet@lwn.net \
    --cc=iommu@lists.linux.dev \
    --cc=jgowans@amazon.com \
    --cc=joro@8bytes.org \
    --cc=justinstitt@google.com \
    --cc=kevin.tian@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=michael.roth@amd.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=patches@lists.linux.dev \
    --cc=rdunlap@infradead.org \
    --cc=robin.murphy@arm.com \
    --cc=shuah@kernel.org \
    --cc=suravee.suthikulpanit@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.