Skip to content

Commit eb63150

Browse files
legoatergregkh
authored andcommitted
powerpc/xive: Clear the page tables for the ESB IO mapping
[ Upstream commit a101950 ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 282acc1 commit eb63150

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎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/prom.h>
2425
#include <asm/io.h>
@@ -1013,12 +1014,16 @@ EXPORT_SYMBOL_GPL(is_xive_irq);
10131014
void xive_cleanup_irq_data(struct xive_irq_data *xd)
10141015
{
10151016
if (xd->eoi_mmio) {
1017+
unmap_kernel_range((unsigned long)xd->eoi_mmio,
1018+
1u << xd->esb_shift);
10161019
iounmap(xd->eoi_mmio);
10171020
if (xd->eoi_mmio == xd->trig_mmio)
10181021
xd->trig_mmio = NULL;
10191022
xd->eoi_mmio = NULL;
10201023
}
10211024
if (xd->trig_mmio) {
1025+
unmap_kernel_range((unsigned long)xd->trig_mmio,
1026+
1u << xd->esb_shift);
10221027
iounmap(xd->trig_mmio);
10231028
xd->trig_mmio = NULL;
10241029
}

0 commit comments

Comments
 (0)