aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/vmw_vmci_defs.h
diff options
context:
space:
mode:
authorJorgen Hansen <jhansen@vmware.com>2022-02-07 02:27:19 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-08 12:15:58 +0100
commite283a0e8b7ea83915e988ed059384af166b444c0 (patch)
treec96da105d75cbaafbecd1cbeb803ad766c9ce4bb /include/linux/vmw_vmci_defs.h
parentVMCI: dma dg: whitespace formatting change for vmci register defines (diff)
downloadlinux-dev-e283a0e8b7ea83915e988ed059384af166b444c0.tar.xz
linux-dev-e283a0e8b7ea83915e988ed059384af166b444c0.zip
VMCI: dma dg: add MMIO access to registers
Detect the support for MMIO access through examination of the length of the region requested in BAR1. If it is 256KB, the VMCI device supports MMIO access to registers. If MMIO access is supported, map the area of the region used for MMIO access (64KB size at offset 128KB). Add wrapper functions for accessing 32 bit register accesses through either MMIO or IO ports based on device configuration. Sending and receiving datagrams through iowrite8_rep/ioread8_rep is left unchanged for now, and will be addressed in a later change. Reviewed-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Jorgen Hansen <jhansen@vmware.com> Link: https://lore.kernel.org/r/20220207102725.2742-3-jhansen@vmware.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/vmw_vmci_defs.h')
-rw-r--r--include/linux/vmw_vmci_defs.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/vmw_vmci_defs.h b/include/linux/vmw_vmci_defs.h
index 9911ecfc18ba..8fc00e2685cf 100644
--- a/include/linux/vmw_vmci_defs.h
+++ b/include/linux/vmw_vmci_defs.h
@@ -83,6 +83,18 @@ enum {
#define VMCI_MAX_PINNED_QP_MEMORY ((size_t)(32 * 1024))
/*
+ * The version of the VMCI device that supports MMIO access to registers
+ * requests 256KB for BAR1 whereas the version of VMCI that supports
+ * MSI/MSI-X only requests 8KB. The layout of the larger 256KB region is:
+ * - the first 128KB are used for MSI/MSI-X.
+ * - the following 64KB are used for MMIO register access.
+ * - the remaining 64KB are unused.
+ */
+#define VMCI_WITH_MMIO_ACCESS_BAR_SIZE ((size_t)(256 * 1024))
+#define VMCI_MMIO_ACCESS_OFFSET ((size_t)(128 * 1024))
+#define VMCI_MMIO_ACCESS_SIZE ((size_t)(64 * 1024))
+
+/*
* We have a fixed set of resource IDs available in the VMX.
* This allows us to have a very simple implementation since we statically
* know how many will create datagram handles. If a new caller arrives and