[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v3 PATCH 17/45] multi-process: modify BARs read/write
From: |
Jagannathan Raman |
Subject: |
[Qemu-devel] [RFC v3 PATCH 17/45] multi-process: modify BARs read/write to support dev_id |
Date: |
Tue, 3 Sep 2019 16:37:43 -0400 |
From: Elena Ufimtseva <address@hidden>
Signed-off-by: Elena Ufimtseva <address@hidden>
Signed-off-by: Jagannathan Raman <address@hidden>
Signed-off-by: John G Johnson <address@hidden>
Reviewed-by: Liam Merwick <address@hidden>
---
New patch in v3
hw/proxy/qemu-proxy.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/hw/proxy/qemu-proxy.c b/hw/proxy/qemu-proxy.c
index 44668bf..1021045 100644
--- a/hw/proxy/qemu-proxy.c
+++ b/hw/proxy/qemu-proxy.c
@@ -288,13 +288,16 @@ static void pci_proxy_dev_realize(PCIDevice *device,
Error **errp)
dev->init_proxy = init_proxy;
}
-static void send_bar_access_msg(ProxyLinkState *proxy_link, MemoryRegion *mr,
+static void send_bar_access_msg(PCIProxyDev *dev, MemoryRegion *mr,
bool write, hwaddr addr, uint64_t *val,
unsigned size, bool memory)
{
+ ProxyLinkState *proxy_link;
ProcMsg msg;
int wait;
+ proxy_link = dev->proxy_link;
+
memset(&msg, 0, sizeof(ProcMsg));
msg.bytestream = 0;
@@ -314,18 +317,31 @@ static void send_bar_access_msg(ProxyLinkState
*proxy_link, MemoryRegion *mr,
msg.fds[0] = wait;
}
+ if (dev->dev_id) {
+ msg.size_id = strlen(dev->dev_id) + 1;
+ msg.id = calloc(1, msg.size_id);
+ memcpy(msg.id, dev->dev_id, msg.size_id);
+ } else {
+ msg.size_id = 0;
+ }
+
proxy_proc_send(proxy_link, &msg, proxy_link->com);
if (!write) {
*val = wait_for_remote(wait);
PUT_REMOTE_WAIT(wait);
}
+
+ if (msg.id) {
+ free(msg.id);
+ }
+
}
void proxy_default_bar_write(PCIProxyDev *dev, MemoryRegion *mr, hwaddr addr,
uint64_t val, unsigned size, bool memory)
{
- send_bar_access_msg(dev->proxy_link, mr, true, addr, &val, size, memory);
+ send_bar_access_msg(dev, mr, true, addr, &val, size, memory);
}
uint64_t proxy_default_bar_read(PCIProxyDev *dev, MemoryRegion *mr, hwaddr
addr,
@@ -333,7 +349,7 @@ uint64_t proxy_default_bar_read(PCIProxyDev *dev,
MemoryRegion *mr, hwaddr addr,
{
uint64_t val;
- send_bar_access_msg(dev->proxy_link, mr, false, addr, &val, size, memory);
+ send_bar_access_msg(dev, mr, false, addr, &val, size, memory);
return val;
}
--
1.8.3.1
- Re: [Qemu-devel] [RFC v3 PATCH 07/45] multi-process: define proxy-link object, (continued)
- [Qemu-devel] [RFC v3 PATCH 06/45] multi-process: build system for remote device process, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 11/45] multi-process: setup memory manager for remote device, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 12/45] multi-process: remote process initialization, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 13/45] multi-process: introduce proxy object, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 14/45] mutli-process: build remote command line args, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 15/45] multi-process: add support of device id to communication channel, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 16/45] multi-process: PCI BAR read/write handling for proxy & remote endpoints, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 09/45] multi-process: setup PCI host bridge for remote device, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 18/45] multi-process: support dev id in config read/write, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 17/45] multi-process: modify BARs read/write to support dev_id,
Jagannathan Raman <=
- [Qemu-devel] [RFC v3 PATCH 19/45] multi-process: Add LSI device proxy object, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 22/45] multi-process: configure remote side devices, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 20/45] multi-process: Synchronize remote memory, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 21/45] multi-process: create IOHUB object to handle irq, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 25/45] multi-process: remote: use fd for socket from parent process, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 24/45] multi-process: remote: add setup_devices and setup_drive msg processing, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 27/45] multi-process: add processing of remote drive and device command line, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 26/45] multi-process: remote: add create_done condition, Jagannathan Raman, 2019/09/03