Re: [PATCH v3] iommu/s390: Add support for iommu_device handling

2017-08-15 Thread Sebastian Ott
On Tue, 15 Aug 2017, Joerg Roedel wrote: > On Tue, Aug 15, 2017 at 06:02:20PM +0200, Sebastian Ott wrote: > > On Mon, 14 Aug 2017, Joerg Roedel wrote: > > > I attach the patch I wrote to fix this, can you please test it together > > > with the initial patch in this thread? > > > > I did and can

Re: [PATCH v3] iommu/s390: Add support for iommu_device handling

2017-08-15 Thread Joerg Roedel
On Tue, Aug 15, 2017 at 06:02:20PM +0200, Sebastian Ott wrote: > On Mon, 14 Aug 2017, Joerg Roedel wrote: > > I attach the patch I wrote to fix this, can you please test it together > > with the initial patch in this thread? > > I did and can confirm that everything worked as expected! Great,

Re: [PATCH v3] iommu/s390: Add support for iommu_device handling

2017-08-15 Thread Sebastian Ott
On Mon, 14 Aug 2017, Joerg Roedel wrote: > I attach the patch I wrote to fix this, can you please test it together > with the initial patch in this thread? I did and can confirm that everything worked as expected! Thanks, Sebastian ___ iommu mailing

Re: [PATCH v3] iommu/s390: Add support for iommu_device handling

2017-08-14 Thread Joerg Roedel
Hi Sebastian, On Fri, Aug 11, 2017 at 07:02:36PM +0200, Sebastian Ott wrote: > ..but I found the bug, actually 2 bugs: > > * That patch embedded a struct iommu_device within struct zpci_dev but > the iommu_device has a release function (via its class) - so when > the release function gets called

Re: [PATCH v3] iommu/s390: Add support for iommu_device handling

2017-08-11 Thread Sebastian Ott
On Fri, 11 Aug 2017, Sebastian Ott wrote: > * That patch embedded a struct iommu_device within struct zpci_dev but > the iommu_device has a release function (via its class) - so when > the release function gets called it frees memory that was never allocated. > The fix is to not embedd struct

Re: [PATCH v3] iommu/s390: Add support for iommu_device handling

2017-08-11 Thread Sebastian Ott
On Fri, 11 Aug 2017, Sebastian Ott wrote: > * iommu_release_device must not release the struct device but the > structure it is embedded in: struct iommu_device (I'll send a patch > for that) --->8 >From 2839c92e038af47b8cb569f84d571878c54d1815 Mon Sep 17 00:00:00 2001 From: Sebastian Ott

Re: [PATCH v3] iommu/s390: Add support for iommu_device handling

2017-08-11 Thread Sebastian Ott
Hello Joerg, On Fri, 11 Aug 2017, Joerg Roedel wrote: > Hey Sebastian, > > On Thu, Aug 10, 2017 at 09:07:06PM +0200, Sebastian Ott wrote: > > With this patch pci hot-unplug fails with a use after free or refcounting > > issue - I'm currently trying to understand what's going on... > > Let me

Re: [PATCH v3] iommu/s390: Add support for iommu_device handling

2017-08-11 Thread Joerg Roedel
Hey Sebastian, On Thu, Aug 10, 2017 at 09:07:06PM +0200, Sebastian Ott wrote: > With this patch pci hot-unplug fails with a use after free or refcounting > issue - I'm currently trying to understand what's going on... Let me know if I can help with debugging the issue, do you have a backtrace

Re: [PATCH v3] iommu/s390: Add support for iommu_device handling

2017-08-10 Thread Joerg Roedel
Hi Sebastian, On Thu, Aug 10, 2017 at 09:07:06PM +0200, Sebastian Ott wrote: > On Wed, 9 Aug 2017, Joerg Roedel wrote: > > From: Joerg Roedel > > > > Add support for the iommu_device_register interface to make > > the s390 hardware iommus visible to the iommu core and in > >

Re: [PATCH v3] iommu/s390: Add support for iommu_device handling

2017-08-10 Thread Sebastian Ott
On Wed, 9 Aug 2017, Joerg Roedel wrote: > From: Joerg Roedel > > Add support for the iommu_device_register interface to make > the s390 hardware iommus visible to the iommu core and in > sysfs. > With this patch pci hot-unplug fails with a use after free or refcounting issue -

[PATCH v3] iommu/s390: Add support for iommu_device handling

2017-08-09 Thread Joerg Roedel
From: Joerg Roedel Add support for the iommu_device_register interface to make the s390 hardware iommus visible to the iommu core and in sysfs. Signed-off-by: Joerg Roedel --- arch/s390/include/asm/pci.h | 7 +++ arch/s390/pci/pci.c | 9