From: Si-Wei Liu <si-wei.liu@oracle.com>
To: mst@redhat.com, jasowang@redhat.com, parav@nvidia.com, elic@nvidia.com
Cc: linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org
Subject: [PATCH 4/6] virtio: VIRTIO_DEVICE_F_MASK for all per-device features
Date: Mon, 30 Jan 2023 12:30:41 -0800 [thread overview]
Message-ID: <1675110643-28143-5-git-send-email-si-wei.liu@oracle.com> (raw)
In-Reply-To: <1675110643-28143-1-git-send-email-si-wei.liu@oracle.com>
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(+)
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
next prev parent reply other threads:[~2023-01-30 21:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 20:30 [PATCH 0/6] features provisioning fixes and mlx5_vdpa support Si-Wei Liu
2023-01-30 20:30 ` [PATCH 1/6] vdpa: fix improper error message when adding vdpa dev Si-Wei Liu
[not found] ` <07f5a4cb-2a55-c774-6b23-d3fa6605cb43@nvidia.com>
2023-01-31 22:51 ` Si-Wei Liu
2023-01-30 20:30 ` [PATCH 2/6] vdpa: conditionally read STATUS in config space Si-Wei Liu
2023-01-30 20:30 ` [PATCH 3/6] vdpa: validate provisioned device features against specified attribute Si-Wei Liu
2023-01-30 20:30 ` Si-Wei Liu [this message]
2023-01-30 20:30 ` [PATCH 5/6] vdpa: validate device feature provisioning against supported class Si-Wei Liu
2023-01-30 20:30 ` [PATCH 6/6] vdpa/mlx5: support device features provisioning Si-Wei Liu
[not found] ` <0b1f2898-e49d-9cb5-2913-382c9a04170f@nvidia.com>
2023-01-31 22:58 ` Si-Wei Liu
2023-01-31 23:22 [PATCH 0/6] features provisioning fixes and mlx5_vdpa support Si-Wei Liu
2023-01-31 23:22 ` [PATCH 4/6] virtio: VIRTIO_DEVICE_F_MASK for all per-device features 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=1675110643-28143-5-git-send-email-si-wei.liu@oracle.com \
--to=si-wei.liu@oracle.com \
--cc=elic@nvidia.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=parav@nvidia.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).