mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Si-Wei Liu <si-wei.liu@oracle.com>
Cc: jasowang@redhat.com, parav@nvidia.com, elic@nvidia.com,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/7] virtio: VIRTIO_DEVICE_F_MASK for all per-device features
Date: Thu, 2 Feb 2023 12:29:54 -0500	[thread overview]
Message-ID: <20230202122851-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1675207345-22328-5-git-send-email-si-wei.liu@oracle.com>

On Tue, Jan 31, 2023 at 03:22:22PM -0800, Si-Wei Liu wrote:
> Introduce VIRTIO_DEVICE_F_MASK bitmask used for identification
> of per-device features. Feature bits VIRTIO_TRANSPORT_F_START
> through VIRTIO_TRANSPORT_F_END are reserved for transport
> features hence are not counted as per-device features against
> the 64bit feature space.
> 
> Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
> ---
>  include/uapi/linux/virtio_config.h | 8 ++++++++
>  1 file changed, 8 insertions(+)

Pls don't add this in uapi, people tend to depend on this and then
things fail when we extend virtio. For example this won't work with >64
feature bits.

> 
> diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h
> index 3c05162..3bdc7ed 100644
> --- a/include/uapi/linux/virtio_config.h
> +++ b/include/uapi/linux/virtio_config.h
> @@ -54,6 +54,14 @@
>  #define VIRTIO_TRANSPORT_F_START	28
>  #define VIRTIO_TRANSPORT_F_END		41
>  
> +/*
> + * Bitmask for all per-device features: feature bits VIRTIO_TRANSPORT_F_START
> + * through VIRTIO_TRANSPORT_F_END are unset, i.e. 0xfffffc000fffffff for
> + * all 64bit features
> + */
> +#define VIRTIO_DEVICE_F_MASK (~0ULL << (VIRTIO_TRANSPORT_F_END + 1) | \
> +			      ((1ULL << VIRTIO_TRANSPORT_F_START) - 1))
> +
>  #ifndef VIRTIO_CONFIG_NO_LEGACY
>  /* Do we get callbacks when the ring is completely used, even if we've
>   * suppressed them? */
> -- 
> 1.8.3.1


  reply	other threads:[~2023-02-02 17:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31 23:22 [PATCH v2 0/7] features provisioning fixes and mlx5_vdpa support Si-Wei Liu
2023-01-31 23:22 ` [PATCH v2 1/7] vdpa: fix improper error message when adding vdpa dev Si-Wei Liu
2023-02-02  4:45   ` Parav Pandit
2023-02-02 13:13   ` Eli Cohen
2023-01-31 23:22 ` [PATCH v2 2/7] vdpa: conditionally read STATUS in config space Si-Wei Liu
2023-02-02  4:58   ` Parav Pandit
2023-01-31 23:22 ` [PATCH v2 3/7] vdpa: validate provisioned device features against specified attribute Si-Wei Liu
2023-02-02  5:05   ` Parav Pandit
2023-02-02 21:58     ` Si-Wei Liu
2023-02-02 22:01       ` Parav Pandit
2023-01-31 23:22 ` [PATCH v2 4/7] virtio: VIRTIO_DEVICE_F_MASK for all per-device features Si-Wei Liu
2023-02-02 17:29   ` Michael S. Tsirkin [this message]
2023-02-02 22:00     ` Si-Wei Liu
2023-01-31 23:22 ` [PATCH v2 5/7] vdpa: validate device feature provisioning against supported class Si-Wei Liu
2023-02-03  8:09   ` Michael S. Tsirkin
2023-02-03 19:32     ` Si-Wei Liu
2023-01-31 23:22 ` [PATCH v2 6/7] vdpa/mlx5: conditionally show MTU and STATUS in config space Si-Wei Liu
2023-02-02 13:31   ` Eli Cohen
2023-02-02 22:18     ` Si-Wei Liu
2023-02-03  8:14   ` Michael S. Tsirkin
2023-02-03 19:37     ` Si-Wei Liu
2023-01-31 23:22 ` [PATCH v2 7/7] vdpa/mlx5: support device features provisioning Si-Wei Liu

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=20230202122851-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=elic@nvidia.com \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=parav@nvidia.com \
    --cc=si-wei.liu@oracle.com \
    --cc=virtualization@lists.linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome