mbox series

[G,0/1] zPCI DMA tables and bitmap leak on hard unplug (PCI Event 0x0304) (LP: 1896216)

Message ID 20200918185538.681177-1-frank.heimes@canonical.com
Headers show
Series zPCI DMA tables and bitmap leak on hard unplug (PCI Event 0x0304) (LP: 1896216) | expand

Message

Frank Heimes Sept. 18, 2020, 6:55 p.m. UTC
Buglink: https://bugs.launchpad.net/bugs/1896216

Commit "s390/pci: adapt events for zbus" removed the zpci_disable_device() call for a zPCI event with PEC 0x0304 (hot unplug) becausethe device is already deconfigured by the platform.
This however skips the Linux side of the disable in particular it leads to leaking the DMA tables and bitmaps because zpci_dma_exit_device() is never called on the device.
This has been fixed in the following commit, that re-introduces the zpci_disable_device() call as it was before the zbus introduction, for good measure I also added a comment to zpci_disable_device() to call out the fact that it may be called with the device disabled already.

Niklas Schnelle (1):
  From: Niklas Schnelle <schnelle@linux.ibm.com>

 arch/s390/pci/pci.c       | 4 ++++
 arch/s390/pci/pci_event.c | 2 ++
 2 files changed, 6 insertions(+)

Comments

Colin Ian King Sept. 21, 2020, 11:05 a.m. UTC | #1
On 18/09/2020 19:55, frank.heimes@canonical.com wrote:
> Buglink: https://bugs.launchpad.net/bugs/1896216
> 
> Commit "s390/pci: adapt events for zbus" removed the zpci_disable_device() call for a zPCI event with PEC 0x0304 (hot unplug) becausethe device is already deconfigured by the platform.
> This however skips the Linux side of the disable in particular it leads to leaking the DMA tables and bitmaps because zpci_dma_exit_device() is never called on the device.
> This has been fixed in the following commit, that re-introduces the zpci_disable_device() call as it was before the zbus introduction, for good measure I also added a comment to zpci_disable_device() to call out the fact that it may be called with the device disabled already.
> 
> Niklas Schnelle (1):
>   From: Niklas Schnelle <schnelle@linux.ibm.com>
> 
>  arch/s390/pci/pci.c       | 4 ++++
>  arch/s390/pci/pci_event.c | 2 ++
>  2 files changed, 6 insertions(+)
> 

Clean cherry pick from linux-next, detailed test plan. Looks good to me.

Acked-by: Colin Ian King <colin.king@canonical.com>
Paolo Pisati Sept. 22, 2020, 10:06 a.m. UTC | #2
On Fri, Sep 18, 2020 at 08:55:37PM +0200, frank.heimes@canonical.com wrote:
> Buglink: https://bugs.launchpad.net/bugs/1896216

BTW, it's already queued for stable v5.8.11:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/tree/queue-5.8/s390-pci-fix-leak-of-dma-tables-on-hard-unplug.patch