Re: [PATCH v5 02/15] genpt: Add Documentation/ files

Nicolin Chen
2025-09-11T04:24:14Z

On Wed, Sep 03, 2025 at 02:46:29PM -0300, Jason Gunthorpe wrote:
> +For this to work the .c file for each compilation unit will include both the
> +format headers and the generic code for the implementation. For instance in an
> +implementation compilation unit the headers would normally be included as
> +follows::
> +
> + #include <linux/generic_pt/common.h>
> + #include "fmt/defs_amdv1.h"
> + #include "pt_defs.h"
> + #include "fmt/amdv1.h"
> + #include "pt_common.h"
> + #include "pt_iter.h"
> + #include "IOMMUt_pt.h" /* The IOMMU implementation */

Should the last one be "iommu_pt.h" that's mentioned below?

> +iommu_pt.h includes definitions that will generate the operations functions for
> +map/unmap/etc. using the definitions provided by AMDv1. The resulting module
> +will have exported symbols named like pt_iommu_amdv1_init().
-----

> +Refer to drivers/iommu/generic-pt/fmt/iommu_template.h for an example of how the
> +IOMMU implementation uses multi-compilation to generate per-format ops structs
> +pointers.

It should be "generic_pt" in the path, instead of "generic-pt".

> diff --git a/drivers/iommu/generic_pt/pt_iter.h b/drivers/iommu/generic_pt/pt_iter.h
> index 6bd84f96f5ad6e..0956c8a45646c9 100644
> --- a/drivers/iommu/generic_pt/pt_iter.h
> +++ b/drivers/iommu/generic_pt/pt_iter.h
> @@ -21,7 +21,7 @@
> * pt_check_range() - Validate the range can be iterated
> * @range: Range to validate
> *
> - * Check that va and last_va fall within the permitted range of VAs. If the
> + * Check that VA and last_va fall within the permitted range of VAs. If the
> * format is using PT_FEAT_SIGN_EXTEND then this also checks the sign extension
> * is correct.

I suppose it should be squashed into the previous patch :)

Thanks
Nicolin