* [PATCH 1/4] virtio_pci: Define id field
2019-07-25 17:50 [PATCH 0/4] virtio: Add definitions for shared memory regions Dr. David Alan Gilbert (git)
@ 2019-07-25 17:50 ` Dr. David Alan Gilbert (git)
2019-07-25 17:50 ` [PATCH 2/4] virtio_pci: Define virtio_pci_cap64 Dr. David Alan Gilbert (git)
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2019-07-25 17:50 UTC (permalink / raw)
To: virtualization, mst, jasowang; +Cc: sebastien.boeuf, vgoyal, stefanha
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
The new virtio-shared memory region system allows multiple regions
to be defined for a device; each of these is the same type of
capability.
To allow multiple capabilities of the same type, create
an 'id' field to differentiate them.
Defined in virtio spec commit 39dfc8afc0b93 ("pci: Define id field")
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
include/uapi/linux/virtio_pci.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index 90007a1abcab..9defe4a124c5 100644
--- a/include/uapi/linux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -121,7 +121,8 @@ struct virtio_pci_cap {
__u8 cap_len; /* Generic PCI field: capability length */
__u8 cfg_type; /* Identifies the structure. */
__u8 bar; /* Where to find it. */
- __u8 padding[3]; /* Pad to full dword. */
+ __u8 id; /* Multiple capabilities of the same type */
+ __u8 padding[2]; /* Pad to full dword. */
__le32 offset; /* Offset within bar. */
__le32 length; /* Length of the structure, in bytes. */
};
--
2.21.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] virtio_pci: Define virtio_pci_cap64
2019-07-25 17:50 [PATCH 0/4] virtio: Add definitions for shared memory regions Dr. David Alan Gilbert (git)
2019-07-25 17:50 ` [PATCH 1/4] virtio_pci: Define id field Dr. David Alan Gilbert (git)
@ 2019-07-25 17:50 ` Dr. David Alan Gilbert (git)
2019-07-25 17:50 ` [PATCH 3/4] virtio_pci: Defined shared memory capability Dr. David Alan Gilbert (git)
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2019-07-25 17:50 UTC (permalink / raw)
To: virtualization, mst, jasowang; +Cc: sebastien.boeuf, vgoyal, stefanha
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Define 'virtio_pci_cap64' to allow capabilities to describe
memory regions larger than, or with an offset larger than 4GiB.
This will be used by the shared memory region capability.
Defined in virtio spec commit 8100dcfcd622 ("pci: Define virtio_pci_cap64")
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
include/uapi/linux/virtio_pci.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index 9defe4a124c5..11e508719dfd 100644
--- a/include/uapi/linux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -127,6 +127,12 @@ struct virtio_pci_cap {
__le32 length; /* Length of the structure, in bytes. */
};
+struct virtio_pci_cap64 {
+ struct virtio_pci_cap cap;
+ __le32 offset_hi; /* Most sig 32 bits of offset */
+ __le32 length_hi; /* Most sig 32 bits of length */
+};
+
struct virtio_pci_notify_cap {
struct virtio_pci_cap cap;
__le32 notify_off_multiplier; /* Multiplier for queue_notify_off. */
--
2.21.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] virtio_pci: Defined shared memory capability
2019-07-25 17:50 [PATCH 0/4] virtio: Add definitions for shared memory regions Dr. David Alan Gilbert (git)
2019-07-25 17:50 ` [PATCH 1/4] virtio_pci: Define id field Dr. David Alan Gilbert (git)
2019-07-25 17:50 ` [PATCH 2/4] virtio_pci: Define virtio_pci_cap64 Dr. David Alan Gilbert (git)
@ 2019-07-25 17:50 ` Dr. David Alan Gilbert (git)
2019-07-25 17:50 ` [PATCH 4/4] virito_mmio: Define shared memory region registers Dr. David Alan Gilbert (git)
2019-08-07 13:20 ` [PATCH 0/4] virtio: Add definitions for shared memory regions Stefan Hajnoczi
4 siblings, 0 replies; 6+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2019-07-25 17:50 UTC (permalink / raw)
To: virtualization, mst, jasowang; +Cc: sebastien.boeuf, vgoyal, stefanha
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Define the PCI capability used for enumerating shared memory regions.
Each capability contains a 'struct virtio_pci_cap64'
Multiple capabilities of this type may exist for a device and may
be distinguished using the 'cap.id' field.
Defined in virtio spec commit 855ad7af2bd64 ("shared memory: Define PCI capability")
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
include/uapi/linux/virtio_pci.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index 11e508719dfd..401a5d6851f1 100644
--- a/include/uapi/linux/virtio_pci.h
+++ b/include/uapi/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 {
--
2.21.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] virito_mmio: Define shared memory region registers
2019-07-25 17:50 [PATCH 0/4] virtio: Add definitions for shared memory regions Dr. David Alan Gilbert (git)
` (2 preceding siblings ...)
2019-07-25 17:50 ` [PATCH 3/4] virtio_pci: Defined shared memory capability Dr. David Alan Gilbert (git)
@ 2019-07-25 17:50 ` Dr. David Alan Gilbert (git)
2019-08-07 13:20 ` [PATCH 0/4] virtio: Add definitions for shared memory regions Stefan Hajnoczi
4 siblings, 0 replies; 6+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2019-07-25 17:50 UTC (permalink / raw)
To: virtualization, mst, jasowang; +Cc: sebastien.boeuf, vgoyal, stefanha
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Define an MMIO interface to discover and map shared
memory regions.
Defined in virtio spec commit 2dd2d468f69b ("shared memory: Define mmio registers")
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
include/uapi/linux/virtio_mmio.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/uapi/linux/virtio_mmio.h b/include/uapi/linux/virtio_mmio.h
index c4b09689ab64..0650f91bea6c 100644
--- a/include/uapi/linux/virtio_mmio.h
+++ b/include/uapi/linux/virtio_mmio.h
@@ -122,6 +122,17 @@
#define VIRTIO_MMIO_QUEUE_USED_LOW 0x0a0
#define VIRTIO_MMIO_QUEUE_USED_HIGH 0x0a4
+/* Shared memory region id */
+#define VIRTIO_MMIO_SHM_SEL 0x0ac
+
+/* Shared memory region length, 64 bits in two halves */
+#define VIRTIO_MMIO_SHM_LEN_LOW 0x0b0
+#define VIRTIO_MMIO_SHM_LEN_HIGH 0x0b4
+
+/* Shared memory region base address, 64 bits in two halves */
+#define VIRTIO_MMIO_SHM_BASE_LOW 0x0b8
+#define VIRTIO_MMIO_SHM_BASE_HIGH 0x0bc
+
/* Configuration atomicity value */
#define VIRTIO_MMIO_CONFIG_GENERATION 0x0fc
--
2.21.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] virtio: Add definitions for shared memory regions
2019-07-25 17:50 [PATCH 0/4] virtio: Add definitions for shared memory regions Dr. David Alan Gilbert (git)
` (3 preceding siblings ...)
2019-07-25 17:50 ` [PATCH 4/4] virito_mmio: Define shared memory region registers Dr. David Alan Gilbert (git)
@ 2019-08-07 13:20 ` Stefan Hajnoczi
4 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2019-08-07 13:20 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git); +Cc: mst, sebastien.boeuf, vgoyal, virtualization
On Thu, Jul 25, 2019 at 06:50:40PM +0100, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Add the virtio shared memory region definitions that
> have just got merged into the spec.
>
> Dr. David Alan Gilbert (4):
> virtio_pci: Define id field
> virtio_pci: Define virtio_pci_cap64
> virtio_pci: Defined shared memory capability
> virito_mmio: Define shared memory region registers
>
> include/uapi/linux/virtio_mmio.h | 11 +++++++++++
> include/uapi/linux/virtio_pci.h | 11 ++++++++++-
> 2 files changed, 21 insertions(+), 1 deletion(-)
>
> --
> 2.21.0
>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
^ permalink raw reply [flat|nested] 6+ messages in thread