aboutsummaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorJagannathan Raman <jag.raman@oracle.com>2021-01-29 11:46:17 -0500
committerStefan Hajnoczi <stefanha@redhat.com>2021-02-10 09:23:28 +0000
commit7ee3f82384f07e84f1d2e26a0ab1e5efa7e7f822 (patch)
treeea9a7b872ac3d6ee0fbb8d2fe7496e0aed0318a8 /include/hw
parent11ab872588335918ddc83c73957077bb85a38a6d (diff)
downloadqemu-arm-7ee3f82384f07e84f1d2e26a0ab1e5efa7e7f822.tar.gz
multi-process: PCI BAR read/write handling for proxy & remote endpoints
Proxy device object implements handler for PCI BAR writes and reads. The handler uses BAR_WRITE/BAR_READ message to communicate to the remote process with the BAR address and value to be written/read. The remote process implements handler for BAR_WRITE/BAR_READ message. Signed-off-by: Jagannathan Raman <jag.raman@oracle.com> Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com> Signed-off-by: John G Johnson <john.g.johnson@oracle.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: a8b76714a9688be5552c4c92d089bc9e8a4707ff.1611938319.git.jag.raman@oracle.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/remote/mpqemu-link.h10
-rw-r--r--include/hw/remote/proxy.h9
2 files changed, 19 insertions, 0 deletions
diff --git a/include/hw/remote/mpqemu-link.h b/include/hw/remote/mpqemu-link.h
index 7bc0bddb5a..6303e62b17 100644
--- a/include/hw/remote/mpqemu-link.h
+++ b/include/hw/remote/mpqemu-link.h
@@ -37,6 +37,8 @@ typedef enum {
MPQEMU_CMD_RET,
MPQEMU_CMD_PCI_CFGWRITE,
MPQEMU_CMD_PCI_CFGREAD,
+ MPQEMU_CMD_BAR_WRITE,
+ MPQEMU_CMD_BAR_READ,
MPQEMU_CMD_MAX,
} MPQemuCmd;
@@ -52,6 +54,13 @@ typedef struct {
int len;
} PciConfDataMsg;
+typedef struct {
+ hwaddr addr;
+ uint64_t val;
+ unsigned size;
+ bool memory;
+} BarAccessMsg;
+
/**
* MPQemuMsg:
* @cmd: The remote command
@@ -71,6 +80,7 @@ typedef struct {
uint64_t u64;
PciConfDataMsg pci_conf_data;
SyncSysmemMsg sync_sysmem;
+ BarAccessMsg bar_access;
} data;
int fds[REMOTE_MAX_FDS];
diff --git a/include/hw/remote/proxy.h b/include/hw/remote/proxy.h
index faa9c4d580..ea7fa4fb3c 100644
--- a/include/hw/remote/proxy.h
+++ b/include/hw/remote/proxy.h
@@ -15,6 +15,14 @@
#define TYPE_PCI_PROXY_DEV "x-pci-proxy-dev"
OBJECT_DECLARE_SIMPLE_TYPE(PCIProxyDev, PCI_PROXY_DEV)
+typedef struct ProxyMemoryRegion {
+ PCIProxyDev *dev;
+ MemoryRegion mr;
+ bool memory;
+ bool present;
+ uint8_t type;
+} ProxyMemoryRegion;
+
struct PCIProxyDev {
PCIDevice parent_dev;
char *fd;
@@ -28,6 +36,7 @@ struct PCIProxyDev {
QemuMutex io_mutex;
QIOChannel *ioc;
Error *migration_blocker;
+ ProxyMemoryRegion region[PCI_NUM_REGIONS];
};
#endif /* PROXY_H */