OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [virtio-dev] Re: [PATCH v3 7/7] virtio/vhost.c: vhost-pci needs remote gpa

On 12/06/2017 12:05 AM, Stefan Hajnoczi wrote:
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 <wei.w.wang@intel.com>
  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);

Thanks for the reminder. I think this patch may be not needed with adding the F_IOMMU_PLATFORM feature.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]