Re: [PATCH v2 1/3] iommu/uapi: Define uapi version and capabilities

From: Christoph Hellwig
Date: Tue Apr 14 2020 - 04:15:20 EST


On Mon, Apr 13, 2020 at 04:21:29PM -0600, Alex Williamson wrote:
> Is the objection to a global version or to any version fields? I don't
> really understand the global version, I'd think a mechanism to check
> extensions plus a per structure flags/version would be preferred. The
> former should resolve how userspace can test support for features
> requiring multiple interfaces. A global version also implies that
> we're only ever adding features and never removing. For example,
> feature Foo is added in version 4, but it's replaced by feature Bar in
> version 5, now userspace can't simply test version >= 4 must include
> feature Foo.

The objection is to versions vs the much more sensible struct size +
capability flags. Making it global just increases the problems with
a version for all of the above reasons.

> It seems to me that version and flags can also be complimentary, for
> example a field might be defined by a version but a flag could indicate
> if it's implemented. With only the flag, we'd infer the field from the
> flag, with only the version we'd need to assume the field is always
> implemented. So I have a hard time making a blanket statement that all
> versions fields should be avoided.

s/version/struct size/, but otherwise agreed.