[PATCH v4 13/15] uapi: hyperv: Add mshv driver headers defining hypervisor ABIs

Greg KH gregkh at linuxfoundation.org
Fri Sep 29 23:09:19 PDT 2023


On Fri, Sep 29, 2023 at 11:01:39AM -0700, Nuno Das Neves wrote:
> These must be in uapi because they will be used in the mshv ioctl API.
> 
> Version numbers for each file:
> hvhdk.h		25212
> hvhdk_mini.h	25294
> hvgdk.h		25125
> hvgdk_mini.h	25294

what are version numbers?

> These are unstable interfaces and as such must be compiled independently
> from published interfaces found in hyperv-tlfs.h.

uapi files can NOT be unstable, that's the opposite of an api :(

> Signed-off-by: Nuno Das Neves <nunodasneves at linux.microsoft.com>
> Acked-by: Wei Liu <wei.liu at kernel.org>
> ---
>  include/uapi/hyperv/hvgdk.h      |   41 +
>  include/uapi/hyperv/hvgdk_mini.h | 1076 ++++++++++++++++++++++++
>  include/uapi/hyperv/hvhdk.h      | 1342 ++++++++++++++++++++++++++++++
>  include/uapi/hyperv/hvhdk_mini.h |  160 ++++
>  4 files changed, 2619 insertions(+)
>  create mode 100644 include/uapi/hyperv/hvgdk.h
>  create mode 100644 include/uapi/hyperv/hvgdk_mini.h
>  create mode 100644 include/uapi/hyperv/hvhdk.h
>  create mode 100644 include/uapi/hyperv/hvhdk_mini.h
> 
> diff --git a/include/uapi/hyperv/hvgdk.h b/include/uapi/hyperv/hvgdk.h
> new file mode 100644
> index 000000000000..9bcbb7d902b2
> --- /dev/null
> +++ b/include/uapi/hyperv/hvgdk.h
> @@ -0,0 +1,41 @@
> +/* SPDX-License-Identifier: MIT */

That's usually not a good license for a new uapi .h file, why did you
choose this one?

> +/* Define connection identifier type. */
> +union hv_connection_id {
> +	__u32 asu32;
> +	struct {
> +		__u32 id:24;
> +		__u32 reserved:8;
> +	} __packed u;

bitfields will not work properly in uapi .h files, please never do that.

thanks,

greg k-h



More information about the linux-arm-kernel mailing list