[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_io
From: |
Liu, Yi L |
Subject: |
Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu() |
Date: |
Mon, 5 Mar 2018 16:42:07 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, Mar 02, 2018 at 04:12:01PM +0100, Paolo Bonzini wrote:
> On 01/03/2018 11:33, Liu, Yi L wrote:
> > This patch adds pci_device_notify_iommu() for notify virtual IOMMU
> > emulator when assigned device is added. And adds a new notify_func
> > in PCIBus. vIOMMU emulator provides the instance of this notify_func.
> >
> > Reason:
> > When virtual IOMMU is exposed to guest, vIOMMU emulator needs to
> > programm host IOMMU to setup DMA mapping for assigned devices. This
> > is a per-device operation, to be efficient, vIOMMU emulator needs
> > to record the assigned devices.
> >
> > Example: devices assigned thru vfio, vfio_realize would call
> > pci_device_notify_iommu() to notify vIOMMU emulator to record necessary
> > info for assigned device.
>
> I think the notification should not be left to the individual device.
> Instead, the add notification should be done in pci_setup_sva_ops, and
> the delete notification should be done in pci_qdev_unrealize, before
> calling pc->exit, and only if dev->sva_ops is not NULL.
Agreed. I think it works together with your comments against
"[PATCH v3 05/12] hw/pci: introduce PCISVAOps to PCIDevice". Would apply
it in next version.
> In general I think it's better to change your names from "assigned_dev"
> to "sva_dev", because the point of the list is to only iterate over
> devices that might be interested in using SVA.
For "assigned_dev", my purpose is to distinguish "assigned devices" from
emulated devices. Only the SVA usage on "assigned devices" is cared here.
But it is true only SVA capable device is interested. So I may need to
rename it as "assigned_sva_dev". How about your opinion?
Thanks,
Yi Liu
[Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), Liu, Yi L, 2018/03/01
- Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), Paolo Bonzini, 2018/03/02
- Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(),
Liu, Yi L <=
- Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), Paolo Bonzini, 2018/03/06
- Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), Liu, Yi L, 2018/03/06
- Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), Paolo Bonzini, 2018/03/06
- Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), Liu, Yi L, 2018/03/06
Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), Paolo Bonzini, 2018/03/02
Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), Liu, Yi L, 2018/03/05
Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), Peter Xu, 2018/03/05
Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), Paolo Bonzini, 2018/03/06
Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), Peter Xu, 2018/03/06
Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), Liu, Yi L, 2018/03/06