LinuxPPC-Dev Archive on
 help / color / Atom feed
From: "Cédric Le Goater" <>
To: Michael Ellerman <>
Cc:, "Cédric Le Goater" <>,
Subject: [PATCH 1/3] powerpc/xive: Clear the page tables for the ESB IO mapping
Date: Wed, 29 Apr 2020 09:51:20 +0200
Message-ID: <> (raw)
In-Reply-To: <>

Commit 1ca3dec2b2df ("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

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: 1ca3dec2b2df ("powerpc/xive: Prevent page fault issues in the machine crash handler")
Cc: # v5.5+
Signed-off-by: Cédric Le Goater <>
 arch/powerpc/sysdev/xive/common.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
index 9603b2830d03..3dbc94cb4380 100644
--- a/arch/powerpc/sysdev/xive/common.c
+++ b/arch/powerpc/sysdev/xive/common.c
@@ -19,6 +19,7 @@
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/msi.h>
+#include <linux/vmalloc.h>
 #include <asm/debugfs.h>
 #include <asm/prom.h>
@@ -1020,12 +1021,16 @@ EXPORT_SYMBOL_GPL(is_xive_irq);
 void xive_cleanup_irq_data(struct xive_irq_data *xd)
 	if (xd->eoi_mmio) {
+		unmap_kernel_range((unsigned long)xd->eoi_mmio,
+				   1u << xd->esb_shift);
 		if (xd->eoi_mmio == xd->trig_mmio)
 			xd->trig_mmio = NULL;
 		xd->eoi_mmio = NULL;
 	if (xd->trig_mmio) {
+		unmap_kernel_range((unsigned long)xd->trig_mmio,
+				   1u << xd->esb_shift);
 		xd->trig_mmio = NULL;

  reply index

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29  7:51 [PATCH 0/3] powerpc/xive: PCI hotplug fixes under PowerVM Cédric Le Goater
2020-04-29  7:51 ` Cédric Le Goater [this message]
2020-04-29  7:51 ` [PATCH 2/3] powerpc/pci: unmap legacy INTx interrupts of passthrough IO adapters Cédric Le Goater
2020-05-21  7:13   ` Cédric Le Goater
2020-05-27  0:57   ` Oliver O'Halloran
2020-05-27  7:31     ` Cédric Le Goater
2020-06-10 18:10     ` Cédric Le Goater
2020-05-27 11:05   ` Cédric Le Goater
2020-05-28 13:25     ` Michael Ellerman
2020-04-29  7:51 ` [PATCH 3/3] powerpc/xive: Do not expose a debugfs file when XIVE is disabled Cédric Le Goater
2020-06-09  5:28 ` [PATCH 0/3] powerpc/xive: PCI hotplug fixes under PowerVM Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LinuxPPC-Dev Archive on

Archives are clonable:
	git clone --mirror linuxppc-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linuxppc-dev linuxppc-dev/ \
	public-inbox-index linuxppc-dev

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone