From: Huang Rui <ray.huang@amd.com>
To: "Gerd Hoffmann" <kraxel@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Anthony PERARD" <anthony.perard@citrix.com>,
"Antonio Caggiano" <antonio.caggiano@collabora.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
"Robert Beckett" <bob.beckett@collabora.com>,
"Dmitry Osipenko" <dmitry.osipenko@collabora.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
qemu-devel@nongnu.org
Cc: xen-devel@lists.xenproject.org,
"Gurchetan Singh" <gurchetansingh@chromium.org>,
ernunes@redhat.com, "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Akihiko Odaki" <akihiko.odaki@daynix.com>,
"Alyssa Ross" <hi@alyssa.is>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Xenia Ragiadakou" <xenia.ragiadakou@amd.com>,
"Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>,
"Honglei Huang" <honglei1.huang@amd.com>,
"Julia Zhang" <julia.zhang@amd.com>,
"Chen Jiqian" <Jiqian.Chen@amd.com>,
"Huang Rui" <ray.huang@amd.com>
Subject: [QEMU PATCH v4 01/13] virtio: Add shared memory capability
Date: Thu, 31 Aug 2023 17:32:40 +0800 [thread overview]
Message-ID: <20230831093252.2461282-2-ray.huang@amd.com> (raw)
In-Reply-To: <20230831093252.2461282-1-ray.huang@amd.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Define a new capability type 'VIRTIO_PCI_CAP_SHARED_MEMORY_CFG' to allow
defining shared memory regions with sizes and offsets of 2^32 and more.
Multiple instances of the capability are allowed and distinguished
by a device-specific 'id'.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Alyssa Ross <hi@alyssa.is>
Tested-by: Huang Rui <ray.huang@amd.com>
Tested-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
---
This patch is already under review as part of the "rutabaga_gfx + gfxstream"
series (already in v13) and has been included here because of dependency.
hw/virtio/virtio-pci.c | 18 ++++++++++++++++++
include/hw/virtio/virtio-pci.h | 4 ++++
2 files changed, 22 insertions(+)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index edbc0daa18..da8c9ea12d 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1435,6 +1435,24 @@ static int virtio_pci_add_mem_cap(VirtIOPCIProxy *proxy,
return offset;
}
+int virtio_pci_add_shm_cap(VirtIOPCIProxy *proxy,
+ uint8_t bar, uint64_t offset, uint64_t length,
+ uint8_t id)
+{
+ struct virtio_pci_cap64 cap = {
+ .cap.cap_len = sizeof cap,
+ .cap.cfg_type = VIRTIO_PCI_CAP_SHARED_MEMORY_CFG,
+ };
+
+ cap.cap.bar = bar;
+ cap.cap.length = cpu_to_le32(length);
+ cap.length_hi = cpu_to_le32(length >> 32);
+ cap.cap.offset = cpu_to_le32(offset);
+ cap.offset_hi = cpu_to_le32(offset >> 32);
+ cap.cap.id = id;
+ return virtio_pci_add_mem_cap(proxy, &cap.cap);
+}
+
static uint64_t virtio_pci_common_read(void *opaque, hwaddr addr,
unsigned size)
{
diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h
index ab2051b64b..5a3f182f99 100644
--- a/include/hw/virtio/virtio-pci.h
+++ b/include/hw/virtio/virtio-pci.h
@@ -264,4 +264,8 @@ unsigned virtio_pci_optimal_num_queues(unsigned fixed_queues);
void virtio_pci_set_guest_notifier_fd_handler(VirtIODevice *vdev, VirtQueue *vq,
int n, bool assign,
bool with_irqfd);
+
+int virtio_pci_add_shm_cap(VirtIOPCIProxy *proxy, uint8_t bar, uint64_t offset,
+ uint64_t length, uint8_t id);
+
#endif
--
2.34.1
next prev parent reply other threads:[~2023-08-31 9:34 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-31 9:32 [QEMU PATCH v4 00/13] Support blob memory and venus on qemu Huang Rui
2023-08-31 9:32 ` Huang Rui [this message]
2023-08-31 9:32 ` [QEMU PATCH v4 02/13] virtio-gpu: CONTEXT_INIT feature Huang Rui
2023-08-31 9:32 ` [QEMU PATCH v4 03/13] virtio-gpu: hostmem Huang Rui
2023-08-31 9:32 ` [QEMU PATCH v4 04/13] virtio-gpu: blob prep Huang Rui
2023-08-31 9:32 ` [QEMU PATCH v4 05/13] virtio-gpu: Support context init feature with virglrenderer Huang Rui
2023-08-31 9:41 ` Philippe Mathieu-Daudé
2023-08-31 9:32 ` [QEMU PATCH v4 06/13] virtio-gpu: Configure context init for virglrenderer Huang Rui
2023-08-31 9:39 ` Philippe Mathieu-Daudé
2023-09-04 6:45 ` Huang Rui via
2023-08-31 9:32 ` [QEMU PATCH v4 07/13] softmmu/memory: enable automatic deallocation of memory regions Huang Rui
2023-08-31 10:10 ` Akihiko Odaki
2023-09-05 9:07 ` Huang Rui
2023-09-05 9:17 ` Akihiko Odaki
2023-09-05 13:29 ` Huang Rui
2023-08-31 9:32 ` [QEMU PATCH v4 08/13] virtio-gpu: Don't require udmabuf when blobs and virgl are enabled Huang Rui
2023-08-31 9:32 ` [QEMU PATCH v4 09/13] virtio-gpu: Handle resource blob commands Huang Rui
2023-08-31 10:24 ` Akihiko Odaki
2023-09-05 9:08 ` Huang Rui
2023-09-05 9:20 ` Akihiko Odaki
2023-09-06 3:09 ` Huang Rui
2023-09-06 3:39 ` Akihiko Odaki
2023-09-06 7:56 ` Huang Rui
2023-09-06 14:16 ` Akihiko Odaki
2023-08-31 9:32 ` [QEMU PATCH v4 10/13] virtio-gpu: Resource UUID Huang Rui
2023-08-31 10:36 ` Akihiko Odaki
2023-09-09 9:09 ` Huang Rui
2023-09-10 4:21 ` Akihiko Odaki
2023-09-13 7:55 ` Albert Esteve
2023-09-13 10:34 ` Akihiko Odaki
2023-09-13 11:34 ` Albert Esteve
2023-09-13 12:22 ` Akihiko Odaki
2023-09-13 12:58 ` Albert Esteve
2023-09-13 13:43 ` Akihiko Odaki
2023-09-13 14:18 ` Albert Esteve
2023-09-13 14:27 ` Albert Esteve
2023-09-14 7:17 ` Akihiko Odaki
2023-09-14 8:29 ` Albert Esteve
2023-09-14 16:55 ` Akihiko Odaki
2023-09-15 9:56 ` Albert Esteve
2023-08-31 9:32 ` [QEMU PATCH v4 11/13] virtio-gpu: Support Venus capset Huang Rui
2023-08-31 10:43 ` Akihiko Odaki
2023-09-09 9:29 ` Huang Rui
2023-09-10 4:32 ` Akihiko Odaki
2023-08-31 9:32 ` [QEMU PATCH v4 12/13] virtio-gpu: Initialize Venus Huang Rui
2023-08-31 10:40 ` Antonio Caggiano
2023-08-31 15:51 ` Dmitry Osipenko
2023-09-09 10:53 ` Huang Rui via
2023-09-12 13:44 ` Dmitry Osipenko
2023-09-09 10:52 ` Huang Rui
2023-08-31 9:32 ` [QEMU PATCH v4 13/13] virtio-gpu: Enable virglrenderer render server flag for venus Huang Rui
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=20230831093252.2461282-2-ray.huang@amd.com \
--to=ray.huang@amd.com \
--cc=Jiqian.Chen@amd.com \
--cc=akihiko.odaki@daynix.com \
--cc=alex.bennee@linaro.org \
--cc=alexander.deucher@amd.com \
--cc=anthony.perard@citrix.com \
--cc=antonio.caggiano@collabora.com \
--cc=bob.beckett@collabora.com \
--cc=christian.koenig@amd.com \
--cc=dgilbert@redhat.com \
--cc=dmitry.osipenko@collabora.com \
--cc=ernunes@redhat.com \
--cc=gurchetansingh@chromium.org \
--cc=hi@alyssa.is \
--cc=honglei1.huang@amd.com \
--cc=julia.zhang@amd.com \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=philmd@linaro.org \
--cc=pierre-eric.pelloux-prayer@amd.com \
--cc=qemu-devel@nongnu.org \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=xenia.ragiadakou@amd.com \
/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).