qemu/include/hw/remote/proxy.h
Jagannathan Raman 7ee3f82384 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>
2021-02-10 09:23:28 +00:00

43 lines
943 B
C

/*
* Copyright © 2018, 2021 Oracle and/or its affiliates.
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*
*/
#ifndef PROXY_H
#define PROXY_H
#include "hw/pci/pci.h"
#include "io/channel.h"
#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;
/*
* Mutex used to protect the QIOChannel fd from
* the concurrent access by the VCPUs since proxy
* blocks while awaiting for the replies from the
* process remote.
*/
QemuMutex io_mutex;
QIOChannel *ioc;
Error *migration_blocker;
ProxyMemoryRegion region[PCI_NUM_REGIONS];
};
#endif /* PROXY_H */