From: Yishai Hadas <yishaih@nvidia.com> To: <alex.williamson@redhat.com>, <mst@redhat.com>, <jasowang@redhat.com>, <jgg@nvidia.com> Cc: <kvm@vger.kernel.org>, <virtualization@lists.linux-foundation.org>, <parav@nvidia.com>, <feliu@nvidia.com>, <jiri@nvidia.com>, <kevin.tian@intel.com>, <joao.m.martins@oracle.com>, <si-wei.liu@oracle.com>, <leonro@nvidia.com>, <yishaih@nvidia.com>, <maorg@nvidia.com> Subject: [PATCH V1 vfio 5/9] virtio-pci: Introduce admin commands Date: Tue, 17 Oct 2023 16:42:13 +0300 [thread overview] Message-ID: <20231017134217.82497-6-yishaih@nvidia.com> (raw) In-Reply-To: <20231017134217.82497-1-yishaih@nvidia.com> From: Feng Liu <feliu@nvidia.com> Introduces admin commands, as follow: The "list query" command can be used by the driver to query the set of admin commands supported by the virtio device. The "list use" command is used to inform the virtio device which admin commands the driver will use. The "legacy common cfg rd/wr" commands are used to read from/write into the legacy common configuration structure. The "legacy dev cfg rd/wr" commands are used to read from/write into the legacy device configuration structure. The "notify info" command is used to query the notification region information. Signed-off-by: Feng Liu <feliu@nvidia.com> Reviewed-by: Parav Pandit <parav@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Yishai Hadas <yishaih@nvidia.com> --- include/uapi/linux/virtio_pci.h | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h index 68eacc9676dc..6e42c211fc08 100644 --- a/include/uapi/linux/virtio_pci.h +++ b/include/uapi/linux/virtio_pci.h @@ -210,6 +210,23 @@ struct virtio_pci_cfg_cap { /* Admin command status. */ #define VIRTIO_ADMIN_STATUS_OK 0 +/* Admin command opcode. */ +#define VIRTIO_ADMIN_CMD_LIST_QUERY 0x0 +#define VIRTIO_ADMIN_CMD_LIST_USE 0x1 + +/* Admin command group type. */ +#define VIRTIO_ADMIN_GROUP_TYPE_SRIOV 0x1 + +/* Transitional device admin command. */ +#define VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE 0x2 +#define VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ 0x3 +#define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE 0x4 +#define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ 0x5 +#define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO 0x6 + +/* Increment MAX_OPCODE to next value when new opcode is added */ +#define VIRTIO_ADMIN_MAX_CMD_OPCODE 0x6 + struct __packed virtio_admin_cmd_hdr { __le16 opcode; /* @@ -229,4 +246,31 @@ struct __packed virtio_admin_cmd_status { __u8 reserved2[4]; }; +struct __packed virtio_admin_cmd_legacy_wr_data { + __u8 offset; /* Starting offset of the register(s) to write. */ + __u8 reserved[7]; + __u8 registers[]; +}; + +struct __packed virtio_admin_cmd_legacy_rd_data { + __u8 offset; /* Starting offset of the register(s) to read. */ +}; + +#define VIRTIO_ADMIN_CMD_NOTIFY_INFO_FLAGS_END 0 +#define VIRTIO_ADMIN_CMD_NOTIFY_INFO_FLAGS_OWNER_DEV 0x1 +#define VIRTIO_ADMIN_CMD_NOTIFY_INFO_FLAGS_OWNER_MEM 0x2 + +#define VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO 4 + +struct __packed virtio_admin_cmd_notify_info_data { + __u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */ + __u8 bar; /* BAR of the member or the owner device */ + __u8 padding[6]; + __le64 offset; /* Offset within bar. */ +}; + +struct virtio_admin_cmd_notify_info_result { + struct virtio_admin_cmd_notify_info_data entries[VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO]; +}; + #endif -- 2.27.0
WARNING: multiple messages have this Message-ID (diff)
From: Yishai Hadas via Virtualization <virtualization@lists.linux-foundation.org> To: <alex.williamson@redhat.com>, <mst@redhat.com>, <jasowang@redhat.com>, <jgg@nvidia.com> Cc: kvm@vger.kernel.org, maorg@nvidia.com, virtualization@lists.linux-foundation.org, jiri@nvidia.com, leonro@nvidia.com Subject: [PATCH V1 vfio 5/9] virtio-pci: Introduce admin commands Date: Tue, 17 Oct 2023 16:42:13 +0300 [thread overview] Message-ID: <20231017134217.82497-6-yishaih@nvidia.com> (raw) In-Reply-To: <20231017134217.82497-1-yishaih@nvidia.com> From: Feng Liu <feliu@nvidia.com> Introduces admin commands, as follow: The "list query" command can be used by the driver to query the set of admin commands supported by the virtio device. The "list use" command is used to inform the virtio device which admin commands the driver will use. The "legacy common cfg rd/wr" commands are used to read from/write into the legacy common configuration structure. The "legacy dev cfg rd/wr" commands are used to read from/write into the legacy device configuration structure. The "notify info" command is used to query the notification region information. Signed-off-by: Feng Liu <feliu@nvidia.com> Reviewed-by: Parav Pandit <parav@nvidia.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Yishai Hadas <yishaih@nvidia.com> --- include/uapi/linux/virtio_pci.h | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h index 68eacc9676dc..6e42c211fc08 100644 --- a/include/uapi/linux/virtio_pci.h +++ b/include/uapi/linux/virtio_pci.h @@ -210,6 +210,23 @@ struct virtio_pci_cfg_cap { /* Admin command status. */ #define VIRTIO_ADMIN_STATUS_OK 0 +/* Admin command opcode. */ +#define VIRTIO_ADMIN_CMD_LIST_QUERY 0x0 +#define VIRTIO_ADMIN_CMD_LIST_USE 0x1 + +/* Admin command group type. */ +#define VIRTIO_ADMIN_GROUP_TYPE_SRIOV 0x1 + +/* Transitional device admin command. */ +#define VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_WRITE 0x2 +#define VIRTIO_ADMIN_CMD_LEGACY_COMMON_CFG_READ 0x3 +#define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_WRITE 0x4 +#define VIRTIO_ADMIN_CMD_LEGACY_DEV_CFG_READ 0x5 +#define VIRTIO_ADMIN_CMD_LEGACY_NOTIFY_INFO 0x6 + +/* Increment MAX_OPCODE to next value when new opcode is added */ +#define VIRTIO_ADMIN_MAX_CMD_OPCODE 0x6 + struct __packed virtio_admin_cmd_hdr { __le16 opcode; /* @@ -229,4 +246,31 @@ struct __packed virtio_admin_cmd_status { __u8 reserved2[4]; }; +struct __packed virtio_admin_cmd_legacy_wr_data { + __u8 offset; /* Starting offset of the register(s) to write. */ + __u8 reserved[7]; + __u8 registers[]; +}; + +struct __packed virtio_admin_cmd_legacy_rd_data { + __u8 offset; /* Starting offset of the register(s) to read. */ +}; + +#define VIRTIO_ADMIN_CMD_NOTIFY_INFO_FLAGS_END 0 +#define VIRTIO_ADMIN_CMD_NOTIFY_INFO_FLAGS_OWNER_DEV 0x1 +#define VIRTIO_ADMIN_CMD_NOTIFY_INFO_FLAGS_OWNER_MEM 0x2 + +#define VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO 4 + +struct __packed virtio_admin_cmd_notify_info_data { + __u8 flags; /* 0 = end of list, 1 = owner device, 2 = member device */ + __u8 bar; /* BAR of the member or the owner device */ + __u8 padding[6]; + __le64 offset; /* Offset within bar. */ +}; + +struct virtio_admin_cmd_notify_info_result { + struct virtio_admin_cmd_notify_info_data entries[VIRTIO_ADMIN_CMD_MAX_NOTIFY_INFO]; +}; + #endif -- 2.27.0 _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2023-10-17 13:43 UTC|newest] Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-17 13:42 [PATCH V1 vfio 0/9] Introduce a vfio driver over virtio devices Yishai Hadas 2023-10-17 13:42 ` Yishai Hadas via Virtualization 2023-10-17 13:42 ` [PATCH V1 vfio 1/9] virtio-pci: Fix common config map for modern device Yishai Hadas 2023-10-17 13:42 ` Yishai Hadas via Virtualization 2023-10-17 13:42 ` [PATCH V1 vfio 2/9] virtio: Define feature bit for administration virtqueue Yishai Hadas 2023-10-17 13:42 ` Yishai Hadas via Virtualization 2023-10-17 13:42 ` [PATCH V1 vfio 3/9] virtio-pci: Introduce admin virtqueue Yishai Hadas 2023-10-17 13:42 ` Yishai Hadas via Virtualization 2023-10-17 13:42 ` [PATCH V1 vfio 4/9] virtio-pci: Introduce admin command sending function Yishai Hadas 2023-10-17 13:42 ` Yishai Hadas via Virtualization 2023-10-17 13:42 ` Yishai Hadas [this message] 2023-10-17 13:42 ` [PATCH V1 vfio 5/9] virtio-pci: Introduce admin commands Yishai Hadas via Virtualization 2023-10-17 13:42 ` [PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO " Yishai Hadas 2023-10-17 13:42 ` Yishai Hadas via Virtualization 2023-10-17 20:33 ` kernel test robot 2023-10-17 20:33 ` kernel test robot 2023-10-22 1:14 ` kernel test robot 2023-10-22 1:14 ` kernel test robot 2023-10-24 21:01 ` Michael S. Tsirkin 2023-10-24 21:01 ` Michael S. Tsirkin 2023-10-25 9:18 ` Yishai Hadas via Virtualization 2023-10-25 10:17 ` Michael S. Tsirkin 2023-10-25 10:17 ` Michael S. Tsirkin 2023-10-25 13:00 ` Yishai Hadas 2023-10-25 13:00 ` Yishai Hadas via Virtualization 2023-10-25 13:04 ` Michael S. Tsirkin 2023-10-25 13:04 ` Michael S. Tsirkin 2023-10-25 13:44 ` Michael S. Tsirkin 2023-10-25 13:44 ` Michael S. Tsirkin 2023-10-25 14:03 ` Yishai Hadas 2023-10-25 14:03 ` Yishai Hadas via Virtualization 2023-10-25 16:31 ` Michael S. Tsirkin 2023-10-25 16:31 ` Michael S. Tsirkin 2023-10-25 9:36 ` Yishai Hadas 2023-10-25 9:36 ` Yishai Hadas via Virtualization 2023-10-17 13:42 ` [PATCH V1 vfio 7/9] vfio/pci: Expose vfio_pci_core_setup_barmap() Yishai Hadas 2023-10-17 13:42 ` Yishai Hadas via Virtualization 2023-10-17 13:42 ` [PATCH V1 vfio 8/9] vfio/pci: Expose vfio_pci_iowrite/read##size() Yishai Hadas 2023-10-17 13:42 ` Yishai Hadas via Virtualization 2023-10-17 13:42 ` [PATCH V1 vfio 9/9] vfio/virtio: Introduce a vfio driver over virtio devices Yishai Hadas 2023-10-17 13:42 ` Yishai Hadas via Virtualization 2023-10-17 20:24 ` Alex Williamson 2023-10-17 20:24 ` Alex Williamson 2023-10-18 9:01 ` Yishai Hadas 2023-10-18 9:01 ` Yishai Hadas via Virtualization 2023-10-18 12:51 ` Alex Williamson 2023-10-18 12:51 ` Alex Williamson 2023-10-18 13:06 ` Parav Pandit 2023-10-18 13:06 ` Parav Pandit via Virtualization 2023-10-18 16:33 ` Jason Gunthorpe 2023-10-18 18:29 ` Alex Williamson 2023-10-18 18:29 ` Alex Williamson 2023-10-18 19:28 ` Jason Gunthorpe 2023-10-24 19:57 ` Alex Williamson 2023-10-24 19:57 ` Alex Williamson 2023-10-25 14:35 ` Yishai Hadas 2023-10-25 14:35 ` Yishai Hadas via Virtualization 2023-10-25 16:28 ` Michael S. Tsirkin 2023-10-25 16:28 ` Michael S. Tsirkin 2023-10-25 19:13 ` Alex Williamson 2023-10-25 19:13 ` Alex Williamson 2023-10-26 12:08 ` Yishai Hadas 2023-10-26 12:08 ` Yishai Hadas via Virtualization 2023-10-26 12:12 ` Michael S. Tsirkin 2023-10-26 12:12 ` Michael S. Tsirkin 2023-10-26 12:40 ` Parav Pandit 2023-10-26 12:40 ` Parav Pandit via Virtualization 2023-10-26 13:15 ` Michael S. Tsirkin 2023-10-26 13:15 ` Michael S. Tsirkin 2023-10-26 13:28 ` Parav Pandit 2023-10-26 13:28 ` Parav Pandit via Virtualization 2023-10-26 15:06 ` Michael S. Tsirkin 2023-10-26 15:06 ` Michael S. Tsirkin 2023-10-26 15:09 ` Parav Pandit 2023-10-26 15:09 ` Parav Pandit via Virtualization 2023-10-26 15:46 ` Michael S. Tsirkin 2023-10-26 15:46 ` Michael S. Tsirkin 2023-10-26 15:56 ` Parav Pandit 2023-10-26 15:56 ` Parav Pandit via Virtualization 2023-10-26 17:55 ` Alex Williamson 2023-10-26 17:55 ` Alex Williamson 2023-10-26 19:49 ` Michael S. Tsirkin 2023-10-26 19:49 ` Michael S. Tsirkin 2023-10-29 16:13 ` Yishai Hadas via Virtualization 2023-10-29 16:13 ` Yishai Hadas 2023-10-22 8:20 ` [PATCH V1 vfio 0/9] " Yishai Hadas 2023-10-22 8:20 ` Yishai Hadas via Virtualization 2023-10-22 9:12 ` Michael S. Tsirkin 2023-10-22 9:12 ` Michael S. Tsirkin 2023-10-23 15:33 ` Alex Williamson 2023-10-23 15:33 ` Alex Williamson 2023-10-23 15:42 ` Jason Gunthorpe 2023-10-23 16:09 ` Alex Williamson 2023-10-23 16:09 ` Alex Williamson 2023-10-23 16:20 ` Jason Gunthorpe 2023-10-23 16:45 ` Alex Williamson 2023-10-23 16:45 ` Alex Williamson 2023-10-23 17:27 ` Jason Gunthorpe 2023-10-25 8:34 ` Tian, Kevin 2023-10-25 8:34 ` Tian, Kevin
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=20231017134217.82497-6-yishaih@nvidia.com \ --to=yishaih@nvidia.com \ --cc=alex.williamson@redhat.com \ --cc=feliu@nvidia.com \ --cc=jasowang@redhat.com \ --cc=jgg@nvidia.com \ --cc=jiri@nvidia.com \ --cc=joao.m.martins@oracle.com \ --cc=kevin.tian@intel.com \ --cc=kvm@vger.kernel.org \ --cc=leonro@nvidia.com \ --cc=maorg@nvidia.com \ --cc=mst@redhat.com \ --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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.