linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] powerpc/pci: unmap interrupts when a PHB is removed
@ 2020-06-17 16:29 Cédric Le Goater
  2020-06-17 16:29 ` [PATCH v2 1/2] powerpc/pci: unmap legacy INTx " Cédric Le Goater
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Cédric Le Goater @ 2020-06-17 16:29 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Oliver O'Halloran, Cédric Le Goater

Hello,

When a passthrough IO adapter is removed from a pseries machine using
hash MMU and the XIVE interrupt mode, the POWER hypervisor expects the
guest OS to clear all page table entries related to the adapter. If
some are still present, the RTAS call which isolates the PCI slot
returns error 9001 "valid outstanding translations" and the removal of
the IO adapter fails. This is because when the PHBs are scanned, Linux
maps automatically some interrupts in the Linux interrupt number space
but these are never removed.

To solve this problem, we introduce a PPC platform specific
pcibios_remove_bus() routine which clears all interrupt mappings when
the bus is removed. This also clears the associated page table entries
of the ESB pages when using XIVE.

For this purpose, we record the logical interrupt numbers of the
mapped interrupt under the PHB structure and let pcibios_remove_bus()
do the clean up.

Tested on :

  - PowerNV with PCI, OpenCAPI, CAPI and GPU adapters. I don't know
    how to inject a failure on a PHB but that would be a good test.
  - KVM P8+P9 guests with passthrough PCI adapters, but PHBs can not
    be removed under QEMU/KVM.   
  - PowerVM with passthrough PCI adapters (main target)
  
Thanks,

C.

Changes since v1:

 - extended the removal to interrupts other than the legacy INTx.

Cédric Le Goater (2):
  powerpc/pci: unmap legacy INTx interrupts when a PHB is removed
  powerpc/pci: unmap all interrupts when a PHB is removed

 arch/powerpc/include/asm/pci-bridge.h |   6 ++
 arch/powerpc/kernel/pci-common.c      | 114 ++++++++++++++++++++++++++
 2 files changed, 120 insertions(+)

-- 
2.25.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-08-07 10:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-17 16:29 [PATCH v2 0/2] powerpc/pci: unmap interrupts when a PHB is removed Cédric Le Goater
2020-06-17 16:29 ` [PATCH v2 1/2] powerpc/pci: unmap legacy INTx " Cédric Le Goater
2020-06-17 16:29 ` [PATCH v2 2/2] powerpc/pci: unmap all " Cédric Le Goater
2020-08-07  6:01   ` Alexey Kardashevskiy
2020-08-07 10:02     ` Cédric Le Goater
2020-06-18 13:47 ` [PATCH v2 0/2] powerpc/pci: unmap " Cédric Le Goater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).