Skip to content

Conversation

@vijayanandjitta-oss
Copy link

iommu-map entries may contain either 4 or 5 cells based on the Iommu provider's #iommu-cells value (1 or 2). JSON-schema cannot validate this repeating variable-sized tuples in a flat array representation.

So, drop strict 4-tuple enforcement and document the supported formats instead.

Linux kernel patchset:
https://lore.kernel.org/all/[email protected]/

iommu-map entries may contain either 4 or 5 cells based on the
Iommu provider's #iommu-cells value (1 or 2). JSON-schema cannot
validate this repeating variable-sized tuples in a flat array
representation.

So, drop strict 4-tuple enforcement and document the supported
formats instead.

Linux kernel patchset:
https://lore.kernel.org/all/[email protected]/
Signed-off-by: Vijayanand Jitta <[email protected]>
the listed IOMMU, with the IOMMU specifier (r - rid-base + iommu-base).
The property is an arbitrary number of tuples in one of following format
- 4 cells: (rid-base, iommu, iommu-base, length)
- 5 cells: (rid-base, iommu, iommu-base, iommu-mask, length).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is that iommu-base is a specifier in whatever format the target iommu node's binding declares it to be per that node's #iommu-cells - it's not for this binding to declare details of what that might be and what may or may not be optional. All we can really say here is that we expect the simple offset arithmetic for length > 1 to be valid when iommu-base does consist of 1 cell (or indeed 0 cells, where there's no actual ID mapping as such but we can still associate a range of input devices with an IOMMU node via a single map entry) - which still represents somewhat of a usage constraint since in general it would be quite possible to have a 1-cell binding where that isn't true (i.e. the cell is something other than a numeric ID). Any map entry where length > 1 and the target #iommu-cells > 1 simply requires interpretation in the context of the target binding (which probably applies just as much to other *-map properties too.)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comments. I agree that it's not up to this binding to describe the specific iommu-map fields.

I will remove explicit 4/5 cell formats and iommu-mask descriptions, and instead use this generic description:

" The property is an arbitrary number of tuples of
(rid-base, iommu, iommu-specifier, rid-length).

The length of the iommu-specifier is determined by the #iommu-cells property of the associated IOMMU node."

Does this look fine ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants