[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: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu() |
Date: |
Mon, 5 Mar 2018 16:27:43 +0800 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Thu, Mar 01, 2018 at 06:33:31PM +0800, Liu, Yi L wrote:
[...]
> -void pci_setup_iommu(PCIBus *bus, PCIIOMMUFunc fn, void *opaque)
> +void pci_device_notify_iommu(PCIDevice *dev, PCIDevNotifyType type)
> {
> - bus->iommu_fn = fn;
> + PCIBus *bus = PCI_BUS(pci_get_bus(dev));
> + PCIBus *iommu_bus = bus;
> +
> + while (iommu_bus && !iommu_bus->iommu_fn && iommu_bus->parent_dev) {
> + iommu_bus = PCI_BUS(pci_get_bus(iommu_bus->parent_dev));
> + }
> + if (iommu_bus && iommu_bus->notify_fn) {
> + iommu_bus->notify_fn(bus,
> + iommu_bus->iommu_opaque,
> + dev->devfn,
> + type);
We didn't really check the return code for notify function. What if
it failed? If we care, we'd better handle the failure; or we can just
define the notify_fn() to return void (now it's int).
> + }
> + return;
I saw many places in the series that you added explicit return for
"void" return-typed functions. IMHO all of them can be dropped.
> +}
Thanks,
--
Peter Xu
- Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), (continued)
- 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
- Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(),
Peter Xu <=
- Re: [Qemu-devel] [PATCH v3 08/12] hw/pci: introduce pci_device_notify_iommu(), Liu, Yi L, 2018/03/05
[Qemu-devel] [PATCH v3 12/12] intel_iommu: bind device to PASID tagged AddressSpace, Liu, Yi L, 2018/03/01
Re: [Qemu-devel] [PATCH v3 12/12] intel_iommu: bind device to PASID tagged AddressSpace, Peter Xu, 2018/03/06
Re: [Qemu-devel] [PATCH v3 12/12] intel_iommu: bind device to PASID tagged AddressSpace, Liu, Yi L, 2018/03/08
Re: [Qemu-devel] [PATCH v3 12/12] intel_iommu: bind device to PASID tagged AddressSpace, Peter Xu, 2018/03/09
Re: [Qemu-devel] [PATCH v3 12/12] intel_iommu: bind device to PASID tagged AddressSpace, Tian, Kevin, 2018/03/09
Re: [Qemu-devel] [PATCH v3 12/12] intel_iommu: bind device to PASID tagged AddressSpace, Liu, Yi L, 2018/03/09
[Qemu-devel] [PATCH v3 10/12] intel_iommu: bind guest pasid table to host, Liu, Yi L, 2018/03/01