[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 7/7] virtio/vhost.c: vhost-pci needs remote g
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v3 7/7] virtio/vhost.c: vhost-pci needs remote gpa |
Date: |
Tue, 5 Dec 2017 16:05:12 +0000 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Tue, Dec 05, 2017 at 11:33:16AM +0800, Wei Wang wrote:
> The vhost-pci driver uses the remote guest physical address to send/receive
> packets from the remote guest, so when sending the ving info to the vhost-pci
> device, send the guest physical adress directly.
>
> Signed-off-by: Wei Wang <address@hidden>
> ---
> hw/virtio/vhost.c | 56
> +++++++++++++++++++++++++++++++++++--------------------
> 1 file changed, 36 insertions(+), 20 deletions(-)
Can you do it inside vhost_memory_map()/vhost_memory_unmap() instead of
modifying callers?
Looks like vhost_dev_has_iommu() already takes this approach:
static void *vhost_memory_map(struct vhost_dev *dev, hwaddr addr,
hwaddr *plen, int is_write)
{
if (!vhost_dev_has_iommu(dev)) {
return cpu_physical_memory_map(addr, plen, is_write);
} else {
return (void *)(uintptr_t)addr;
}
}
static void vhost_memory_unmap(struct vhost_dev *dev, void *buffer,
hwaddr len, int is_write,
hwaddr access_len)
{
if (!vhost_dev_has_iommu(dev)) {
cpu_physical_memory_unmap(buffer, len, is_write, access_len);
}
}
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH v3 4/7] vhost-pci-slave: add vhost-pci slave implementation, (continued)
- [Qemu-devel] [PATCH v3 6/7] vhost-pci-slave: handle VHOST_USER_SET_VHOST_PCI, Wei Wang, 2017/12/04
- [Qemu-devel] [PATCH v3 7/7] virtio/vhost.c: vhost-pci needs remote gpa, Wei Wang, 2017/12/04
- Re: [Qemu-devel] [PATCH v3 7/7] virtio/vhost.c: vhost-pci needs remote gpa,
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PATCH v3 0/7] Vhost-pci for inter-VM communication, no-reply, 2017/12/04
- Re: [Qemu-devel] [virtio-dev] [PATCH v3 0/7] Vhost-pci for inter-VM communication, Jason Wang, 2017/12/05
Re: [Qemu-devel] [virtio-dev] [PATCH v3 0/7] Vhost-pci for inter-VM communication, Stefan Hajnoczi, 2017/12/05
Re: [Qemu-devel] [PATCH v3 0/7] Vhost-pci for inter-VM communication, Michael S. Tsirkin, 2017/12/05
Re: [Qemu-devel] [virtio-dev] [PATCH v3 0/7] Vhost-pci for inter-VM communication, Stefan Hajnoczi, 2017/12/05