search for: remove_device

Displaying 20 results from an estimated 85 matches for "remove_device".

Did you mean: remove_devices
2020 Apr 14
0
[PATCH v2 07/33] iommu: Add probe_device() and remove_device() call-backs
From: Joerg Roedel <jroedel at suse.de> Add call-backs to 'struct iommu_ops' as an alternative to the add_device() and remove_device() call-backs, which will be removed when all drivers are converted. The new call-backs will not setupt IOMMU groups and domains anymore, so also add a probe_finalize() call-back where the IOMMU driver can do per-device setup work which require the device to be set up with a group and a domain. Si...
2020 Apr 14
0
[PATCH v2 32/33] iommu: Remove add_device()/remove_device() code-paths
From: Joerg Roedel <jroedel at suse.de> All drivers are converted to use the probe/release_device() call-backs, so the add_device/remove_device() pointers are unused and the code using them can be removed. Signed-off-by: Joerg Roedel <jroedel at suse.de> --- drivers/iommu/iommu.c | 149 ++++++++---------------------------------- include/linux/iommu.h | 4 -- 2 files changed, 29 insertions(+), 124 deletions(-) diff --git a/driver...
2020 Apr 15
0
[PATCH v2 07/33] iommu: Add probe_device() and remove_device() call-backs
On Wed, Apr 15, 2020 at 02:36:20PM +0800, Lu Baolu wrote: > On 2020/4/14 21:15, Joerg Roedel wrote: > > From: Joerg Roedel<jroedel at suse.de> > > > > Add call-backs to 'struct iommu_ops' as an alternative to the > > add_device() and remove_device() call-backs, which will be removed when > > all drivers are converted. > > > > The new call-backs will not setupt IOMMU groups and domains anymore, > > so also add a probe_finalize() call-back where the IOMMU driver can do > > per-device setup work which require the...
2020 Apr 14
0
[RFC PATCH 33/34] iommu: Remove add_device()/remove_device() code-paths
Hi Marek, On Fri, Apr 10, 2020 at 12:39:38PM +0200, Marek Szyprowski wrote: > > + if (!group->default_domain) > > + continue; > > It doesn't look straight from the above diff, but this continue leaks > group->lock taken. You are right, thanks for the review! I fixed it in v2. Regards, Joerg
2020 Apr 14
35
[PATCH v2 00/33] iommu: Move iommu_group setup to IOMMU core code
...parate function iommu/amd: Implement iommu_ops->def_domain_type call-back iommu/vt-d: Wire up iommu_ops->def_domain_type iommu/amd: Remove dma_mask check from check_device() iommu/amd: Return -ENODEV in add_device when device is not handled by IOMMU iommu: Add probe_device() and remove_device() call-backs iommu: Move default domain allocation to iommu_probe_device() iommu: Keep a list of allocated groups in __iommu_probe_device() iommu: Move new probe_device path to separate function iommu: Split off default domain allocation from group assignment iommu: Move iommu_group_creat...
2020 Apr 14
35
[PATCH v2 00/33] iommu: Move iommu_group setup to IOMMU core code
...parate function iommu/amd: Implement iommu_ops->def_domain_type call-back iommu/vt-d: Wire up iommu_ops->def_domain_type iommu/amd: Remove dma_mask check from check_device() iommu/amd: Return -ENODEV in add_device when device is not handled by IOMMU iommu: Add probe_device() and remove_device() call-backs iommu: Move default domain allocation to iommu_probe_device() iommu: Keep a list of allocated groups in __iommu_probe_device() iommu: Move new probe_device path to separate function iommu: Split off default domain allocation from group assignment iommu: Move iommu_group_creat...
2020 Apr 29
35
[PATCH v3 00/34] iommu: Move iommu_group setup to IOMMU core code
...vert to probe/release_device() call-backs iommu/omap: Remove orphan_dev tracking iommu/omap: Convert to probe/release_device() call-backs iommu/exynos: Use first SYSMMU in controllers list for IOMMU core iommu/exynos: Convert to probe/release_device() call-backs iommu: Remove add_device()/remove_device() code-paths iommu: Move more initialization to __iommu_probe_device() iommu: Unexport iommu_group_get_for_dev() Sai Praneeth Prakhya (1): iommu: Add def_domain_type() callback in iommu_ops drivers/iommu/amd_iommu.c | 97 ++++---- drivers/iommu/amd_iommu_types.h | 1 - drivers/iom...
2020 Apr 07
41
[RFC PATCH 00/34] iommu: Move iommu_group setup to IOMMU core code
...ain type and then allocates it for the group. It turned out that this required to remove the calls of iommu_group_get_for_dev() from the IOMMU drivers. While at it, the calls to iommu_device_link()/unlink() where also moved out of the drivers, which required a different interface than add_device()/remove_device(). The result is the new probe_device()/release_device() interface, where the driver just does its own setup and then returns the iommu_device which belongs to the device being probed. There is certainly more room for cleanups, but I think this is a good start to simplify the code flow during IOMM...
2020 Apr 07
41
[RFC PATCH 00/34] iommu: Move iommu_group setup to IOMMU core code
...ain type and then allocates it for the group. It turned out that this required to remove the calls of iommu_group_get_for_dev() from the IOMMU drivers. While at it, the calls to iommu_device_link()/unlink() where also moved out of the drivers, which required a different interface than add_device()/remove_device(). The result is the new probe_device()/release_device() interface, where the driver just does its own setup and then returns the iommu_device which belongs to the device being probed. There is certainly more room for cleanups, but I think this is a good start to simplify the code flow during IOMM...
2020 Apr 14
0
[PATCH v2 19/33] iommu/s390: Convert to probe/release_device() call-backs
...*group = iommu_group_get_for_dev(dev); struct zpci_dev *zdev = to_pci_dev(dev)->sysdata; - if (IS_ERR(group)) - return PTR_ERR(group); - - iommu_group_put(group); - iommu_device_link(&zdev->iommu_dev, dev); - - return 0; + return &zdev->iommu_dev; } -static void s390_iommu_remove_device(struct device *dev) +static void s390_iommu_release_device(struct device *dev) { struct zpci_dev *zdev = to_pci_dev(dev)->sysdata; struct iommu_domain *domain; @@ -191,7 +184,7 @@ static void s390_iommu_remove_device(struct device *dev) * to vfio-pci and completing the VFIO_SET_IOMMU ioc...
2020 Apr 14
0
[PATCH v2 08/33] iommu: Move default domain allocation to iommu_probe_device()
From: Joerg Roedel <jroedel at suse.de> Well, not really. The call to iommu_alloc_default_domain() in iommu_group_get_for_dev() has to stay around as long as there are IOMMU drivers using the add/remove_device() call-backs instead of probe/release_device(). Those drivers expect that iommu_group_get_for_dev() returns the device attached to a group and the group set up with a default domain (and the device attached to the groups current domain). But when all drivers are converted this compatability mess...
2019 Dec 18
7
[PATCH v3 0/5] iommu: Implement generic_iommu_put_resv_regions()
From: Thierry Reding <treding at nvidia.com> Most IOMMU drivers only need to free the memory allocated for each reserved region. Instead of open-coding the loop to do this in each driver, extract the code into a common function that can be used by all these drivers. Changes in v3: - add Reviewed-by from Jean-Philippe Brucker on virtio patch - add Acked-by from Will Deacon on ARM SMMU patch
2020 Apr 14
0
[PATCH v2 17/33] iommu/arm-smmu: Convert to probe/release_device() call-backs
...link; - } - - iommu_group_put(group); - return 0; - -err_unlink: - iommu_device_unlink(&smmu->iommu, dev); -err_disable_pasid: - arm_smmu_disable_pasid(master); err_free_master: kfree(master); dev_iommu_priv_set(dev, NULL); - return ret; + return ERR_PTR(ret); } -static void arm_smmu_remove_device(struct device *dev) +static void arm_smmu_release_device(struct device *dev) { struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); struct arm_smmu_master *master; @@ -3010,8 +2994,6 @@ static void arm_smmu_remove_device(struct device *dev) master = dev_iommu_priv_get(dev); smmu = mast...
2020 Apr 08
1
[RFC PATCH 17/34] iommu/arm-smmu: Store device instead of group in arm_smmu_s2cr
...uld happen: >> >> create device A >> iommu_probe_device(A) >> iommu_device_group(A) -> alloc group X >> create device B >> iommu_probe_device(B) >> iommu_device_group(A) -> lookup returns group X >> ... >> iommu_remove_device(A) >> delete device A >> create device C >> iommu_probe_device(C) >> iommu_device_group(C) -> use-after-free of A >> >> Preserving the logical behaviour here would probably look *something* like >> the mangled diff below, but I haven't...
2013 Jul 25
1
[PATCH 4/5] Intel MIC Card Driver Changes for Virtio Devices.
...; VIRTIO_CONFIG_S_DRIVER_OK) + wait_for_completion(&mvdev->reset_done); + kfree(mvdev); + iowrite8(1, &dc->guest_ack); + dev_info(mdrv->dev, "%s %d guest_ack %d\n", + __func__, __LINE__, ioread8(&dc->guest_ack)); + ret = 0; + } + + return ret; +} + +#define REMOVE_DEVICES true + +static void scan_devices(struct mic_driver *mdrv, bool remove) +{ + s8 type; + unsigned int i; + struct mic_device_desc __iomem *d; + struct mic_device_ctrl __iomem *dc; + struct device *dev; + int ret; + + for (i = mic_aligned_size(struct mic_bootparam); + i < MIC_DP_SIZE; i += mic_to...
2013 Jul 25
1
[PATCH 4/5] Intel MIC Card Driver Changes for Virtio Devices.
...; VIRTIO_CONFIG_S_DRIVER_OK) + wait_for_completion(&mvdev->reset_done); + kfree(mvdev); + iowrite8(1, &dc->guest_ack); + dev_info(mdrv->dev, "%s %d guest_ack %d\n", + __func__, __LINE__, ioread8(&dc->guest_ack)); + ret = 0; + } + + return ret; +} + +#define REMOVE_DEVICES true + +static void scan_devices(struct mic_driver *mdrv, bool remove) +{ + s8 type; + unsigned int i; + struct mic_device_desc __iomem *d; + struct mic_device_ctrl __iomem *dc; + struct device *dev; + int ret; + + for (i = mic_aligned_size(struct mic_bootparam); + i < MIC_DP_SIZE; i += mic_to...
2012 Jun 24
17
PCI Passthrough, Radeon 7950 and Windows 7 64-bit
Hello, I've been consistently attempting to make the setup mentioned in the subject work on the following hardware: Xeon E3 1275 (v1, Sandy Bridge) Asus P8B WS (Firmware: 0904 and 2009) 16 GB RAM Sapphire Radeon HD 7950 OC (Firmware: 015.013.000.010.000705) Linux 3.4.1 dom0, x86-64, pvops. Xen 4.1.2 (+ security patch) and 4.1.3-rc1. Old qemu-dm setup. (not new mainline qemu) Windows 7 64-bit
2019 Dec 09
8
[PATCH v2 0/5] iommu: Implement iommu_put_resv_regions_simple()
From: Thierry Reding <treding at nvidia.com> Most IOMMU drivers only need to free the memory allocated for each reserved region. Instead of open-coding the loop to do this in each driver, extract the code into a common function that can be used by all these drivers. Changes in v2: - change subject prefix to "iommu: virtio: " for virtio-iommu.c driver Thierry Thierry Reding (5):
2019 Dec 09
0
[PATCH v2 5/5] iommu: virtio: Use iommu_put_resv_regions_simple()
...(struct device *dev) err_unlink_dev: iommu_device_unlink(&viommu->iommu, dev); err_free_dev: - viommu_put_resv_regions(dev, &vdev->resv_regions); + iommu_put_resv_regions_simple(dev, &vdev->resv_regions); kfree(vdev); return ret; @@ -932,7 +924,7 @@ static void viommu_remove_device(struct device *dev) iommu_group_remove_device(dev); iommu_device_unlink(&vdev->viommu->iommu, dev); - viommu_put_resv_regions(dev, &vdev->resv_regions); + iommu_put_resv_regions_simple(dev, &vdev->resv_regions); kfree(vdev); } @@ -961,7 +953,7 @@ static struct iom...
2019 Dec 19
0
[PATCH v3 4/5] iommu: intel: Use generic_iommu_put_resv_regions()
...gt; > - > > int intel_iommu_enable_pasid(struct intel_iommu *iommu, struct device *dev) > > { > > struct device_domain_info *info; > > @@ -5987,7 +5978,7 @@ const struct iommu_ops intel_iommu_ops = { > > .add_device = intel_iommu_add_device, > > .remove_device = intel_iommu_remove_device, > > .get_resv_regions = intel_iommu_get_resv_regions, > > - .put_resv_regions = intel_iommu_put_resv_regions, > > + .put_resv_regions = generic_iommu_put_resv_regions, > > .apply_resv_region = intel_iommu_apply_resv_region, > > .d...