qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 1/7] virtio: Add shared memory capability


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC PATCH 1/7] virtio: Add shared memory capability
Date: Mon, 10 Dec 2018 15:03:27 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1

On 12/10/18 11:31 AM, Dr. David Alan Gilbert (git) wrote:
From: "Dr. David Alan Gilbert" <address@hidden>

Define a new capability type 'VIRTIO_PCI_CAP_SHARED_MEMORY_CFG'
and the data structure 'virtio_pci_shm_cap' to go with it.
They 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 <address@hidden>
---
  hw/virtio/virtio-pci.c                      | 20 ++++++++++++++++++++
  include/standard-headers/linux/virtio_pci.h |  9 +++++++++
  2 files changed, 29 insertions(+)


+++ b/include/standard-headers/linux/virtio_pci.h
@@ -113,6 +113,8 @@
  #define VIRTIO_PCI_CAP_DEVICE_CFG     4
  /* PCI configuration access */
  #define VIRTIO_PCI_CAP_PCI_CFG                5
+/* Additional shared memory capability */
+#define VIRTIO_PCI_CAP_SHARED_MEMORY_CFG 8
/* This is the PCI capability header: */
  struct virtio_pci_cap {
@@ -163,6 +165,13 @@ struct virtio_pci_cfg_cap {
        uint8_t pci_cfg_data[4]; /* Data for BAR access. */
  };
+struct virtio_pci_shm_cap {
+       struct virtio_pci_cap cap;
+       uint32_t offset_hi;             /* Most sig 32 bits of offset */
+       uint32_t length_hi;             /* Most sig 32 bits of length */
+        uint8_t  id;                    /* To distinguish shm chunks */

TAB damage.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]