On Thu, Aug 27, 2020 at 11:12:25AM -0700, elena.ufimts...@oracle.com wrote: > +static void process_bar_read(QIOChannel *ioc, MPQemuMsg *msg, Error **errp) > +{ > + BarAccessMsg *bar_access = &msg->data.bar_access; > + MPQemuMsg ret = { 0 }; > + MPQemuRequest req = { 0 }; > + AddressSpace *as; > + MemTxResult res; > + uint64_t val = 0; > + Error *local_err = NULL; > + > + as = bar_access->memory ? &address_space_memory : &address_space_io;
Doesn't need to be changed yet but eventually this should directly access BAR MemoryRegions instead of using global address_space_memory/address_space_io. Then bar_access->addr can be relative to the start of the BAR. Isolating the device from global address spaces makes it possible to support multiple devices running in the same device emulation process. > diff --git a/hw/pci/proxy.c b/hw/pci/proxy.c > index 23aab44d8e..d332c63bf3 100644 > --- a/hw/pci/proxy.c > +++ b/hw/pci/proxy.c > @@ -61,7 +61,7 @@ static int config_op_send(PCIProxyDev *pdev, uint32_t addr, > uint32_t *val, > int l, unsigned int op) > { > MPQemuMsg msg = { 0 }; > - long ret = -EINVAL; > + uint64_t ret = -EINVAL; > Error *local_err = NULL; > > msg.cmd = op; > @@ -72,7 +72,7 @@ static int config_op_send(PCIProxyDev *pdev, uint32_t addr, > uint32_t *val, > > ret = mpqemu_msg_send_and_await_reply(&msg, pdev, &local_err); > if (local_err) { > - error_report("Failed to exchange PCI_CONFIG message with remote"); > + error_report_err(local_err); > } > if (op == PCI_CONFIG_READ) { > *val = (uint32_t)ret; Unrelated fixes. Please squash them into the PCI_CONFIG_READ patch. Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
signature.asc
Description: PGP signature