Skip to content

Commit a101950

Browse files
legoatermpe
authored andcommitted
powerpc/xive: Clear the page tables for the ESB IO mapping
Commit 1ca3dec ("powerpc/xive: Prevent page fault issues in the machine crash handler") fixed an issue in the FW assisted dump of machines using hash MMU and the XIVE interrupt mode under the POWER hypervisor. It forced the mapping of the ESB page of interrupts being mapped in the Linux IRQ number space to make sure the 'crash kexec' sequence worked during such an event. But it didn't handle the un-mapping. This mapping is now blocking the removal of a passthrough IO adapter under the POWER hypervisor because it expects the guest OS to have cleared 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". Remove these mapping in the IRQ data cleanup routine. Under KVM, this cleanup is not required because the ESB pages for the adapter interrupts are un-mapped from the guest by the hypervisor in the KVM XIVE native device. This is now redundant but it's harmless. Fixes: 1ca3dec ("powerpc/xive: Prevent page fault issues in the machine crash handler") Cc: stable@vger.kernel.org # v5.5+ Signed-off-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200429075122.1216388-2-clg@kaod.org
1 parent 16ef976 commit a101950

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/powerpc/sysdev/xive/common.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/slab.h>
2020
#include <linux/spinlock.h>
2121
#include <linux/msi.h>
22+
#include <linux/vmalloc.h>
2223

2324
#include <asm/debugfs.h>
2425
#include <asm/prom.h>
@@ -1020,12 +1021,16 @@ EXPORT_SYMBOL_GPL(is_xive_irq);
10201021
void xive_cleanup_irq_data(struct xive_irq_data *xd)
10211022
{
10221023
if (xd->eoi_mmio) {
1024+
unmap_kernel_range((unsigned long)xd->eoi_mmio,
1025+
1u << xd->esb_shift);
10231026
iounmap(xd->eoi_mmio);
10241027
if (xd->eoi_mmio == xd->trig_mmio)
10251028
xd->trig_mmio = NULL;
10261029
xd->eoi_mmio = NULL;
10271030
}
10281031
if (xd->trig_mmio) {
1032+
unmap_kernel_range((unsigned long)xd->trig_mmio,
1033+
1u << xd->esb_shift);
10291034
iounmap(xd->trig_mmio);
10301035
xd->trig_mmio = NULL;
10311036
}

0 commit comments

Comments
 (0)