[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v3 PATCH 19/45] multi-process: Add LSI device prox
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [RFC v3 PATCH 19/45] multi-process: Add LSI device proxy object |
Date: |
Thu, 5 Sep 2019 12:22:34 +0200 |
User-agent: |
NeoMutt/20180716 |
Hi,
> +static uint64_t proxy_lsi_io_read(void *opaque, hwaddr addr, unsigned size)
> +{
> + ProxyLSIState *s = opaque;
> +
> + return proxy_default_bar_read(PCI_PROXY_DEV(s), &s->io_io, addr, size,
> + false);
> +}
> +
> +static void proxy_lsi_io_write(void *opaque, hwaddr addr, uint64_t val,
> + unsigned size)
> +{
> + ProxyLSIState *s = opaque;
> +
> + proxy_default_bar_write(PCI_PROXY_DEV(s), &s->io_io, addr, val, size,
> + false);
> +}
> +
> +static const MemoryRegionOps proxy_lsi_io_ops = {
> + .read = proxy_lsi_io_read,
> + .write = proxy_lsi_io_write,
> + .endianness = DEVICE_NATIVE_ENDIAN,
> + .impl = {
> + .min_access_size = 1,
> + .max_access_size = 1,
> + },
> +};
Hmm, as more devices get proxy support there will be alot of simliar
boilerplate.
I think it would be useful to have a
struct pci_device_description {
u16 vendor_id,
u16 device_id,
[ ... ]
struct {
[ ... ]
} bar[6];
};
> + proxy_class->realize = proxy_lsi_realize;
> + proxy_class->command = g_strdup("qemu-scsi-dev");
Hook that up here (proxy_class->description = &lsi_description),
then have the pci proxy realize function setup everything. All pci
bar access is just forwarded to the proxy, that should be doable
without duplicating the code for each proxied pci device ...
At least parts of the pci_device_description can probably also used for
non-proxy device setup (should work for pci config space, probably
would not work for memory regions as they are very device specific).
cheers,
Gerd
- [Qemu-devel] [RFC v3 PATCH 11/45] multi-process: setup memory manager for remote device, (continued)
- [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, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 19/45] multi-process: Add LSI device proxy object, Jagannathan Raman, 2019/09/03
- Re: [Qemu-devel] [RFC v3 PATCH 19/45] multi-process: Add LSI device proxy object,
Gerd Hoffmann <=
- [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
- [Qemu-devel] [RFC v3 PATCH 23/45] multi-process: add qdev_proxy_add to create proxy devices, Jagannathan Raman, 2019/09/03
- [Qemu-devel] [RFC v3 PATCH 29/45] multi-process: refractor vl.c code to re-use in remote, Jagannathan Raman, 2019/09/03