virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Si-Wei Liu <si-wei.liu@oracle.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: linux-kernel@vger.kernel.org, elic@nvidia.com,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v2 4/7] virtio: VIRTIO_DEVICE_F_MASK for all per-device features
Date: Thu, 2 Feb 2023 14:00:59 -0800	[thread overview]
Message-ID: <57fe17e4-b60a-49aa-4661-bf88b0753953@oracle.com> (raw)
In-Reply-To: <20230202122851-mutt-send-email-mst@kernel.org>



On 2/2/2023 9:29 AM, Michael S. Tsirkin wrote:
> 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.
Good point. Then keep this macro private to vdpa.c for now?

-Siwei
>
>> 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

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2023-02-02 22:01 UTC|newest]

Thread overview: 20+ 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 via Virtualization
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 via Virtualization
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 via Virtualization
2023-02-02 21:58     ` Si-Wei Liu
2023-02-02 22:01       ` Parav Pandit via Virtualization
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
2023-02-02 22:00     ` Si-Wei Liu [this message]
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
     [not found]   ` <bad92641-e10e-cb06-179d-2f4bc11c721d@nvidia.com>
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=57fe17e4-b60a-49aa-4661-bf88b0753953@oracle.com \
    --to=si-wei.liu@oracle.com \
    --cc=elic@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.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;
as well as URLs for NNTP newsgroup(s).