Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp997873ybt; Fri, 19 Jun 2020 21:04:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXLJNUB3zcTh4TslNoTaVc5pmMOnkM3V6LsKNqBWo8ba+vttnTu5MRfDOpG7NGja6t1W7j X-Received: by 2002:aa7:d28d:: with SMTP id w13mr6510157edq.336.1592625858969; Fri, 19 Jun 2020 21:04:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592625858; cv=none; d=google.com; s=arc-20160816; b=PUdbA0KbdYWxbzoIrU+OIffDm8GwPi4BPhzg8ydIkYSyCv7MbuOvQIhXVd4qSD44qd Y1H5gWTGzibD3V9f7Y3xGtOkP9BP3YCJge91jqaG7+lNzsBN5OUeT7Ayo7u4Zwp5yN9K TWJiMl51ImAQSCqyGMu/C9qEQ0lTg+SedxnLJkJU0QIYuNNQHU+kokKnia0rrGMxQofu dIAKHtrups4fSePCouDoezLfXIowABB3yU92lA6rPEATcyTk4kpmPUasWprhni1bMbKM H52JH4TG1EZEmln33Zg4eI3NCiKDdUDLKoRdoznIBAQRKu4pduA4nbQhQt72xcfr5y7v fZcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=X8HKmye/RdGRqw9bQtLNtZquLA/A/3kk3bysM882d34=; b=W3Eio4rvhgQP8yKg23FSD7YKRSosgjtcX/N+etq0j1EOicGS84XgQCrpM+gUkah0L3 I+pxNCctPJoS2bT8UY21V/xfIoEbjbfBAzQu+yzWP+LwwZTUcBzP/uHTn1IZ8a4mRQ/3 hzn0+KUt83TPwW64aH3HlJEgyfoqCfzo71CumQbFAVLa3KJVAUDDBgVONq6PJ3bPRGKK qAKhVXrPTrVzF1f7KfaluvadSrCBXDied+tlFOq70RPWcx5kNGKBjoUpuETiTpp2zFXJ xmrQs3HNy+9mYJV2P4Z9GJENlVKN5Q7vyGR2adk8HAxiegcsO78/59OVZcL7wEi27k48 Ypnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rCCwZjIS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d4si5160469ejw.326.2020.06.19.21.03.57; Fri, 19 Jun 2020 21:04:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rCCwZjIS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395466AbgFSQkv (ORCPT + 99 others); Fri, 19 Jun 2020 12:40:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:36902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388694AbgFSOpW (ORCPT ); Fri, 19 Jun 2020 10:45:22 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC7E621582; Fri, 19 Jun 2020 14:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592577920; bh=/Wg8oUx8NKYXft/ZBX+n83+W+uXdbNFLAgFid1Z/GQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rCCwZjISmpmXqejI1ptNQjbog1dJSyltZS/hB5NnqbzYfZiVtPdZr4c4LVJZDWASd VJ7CYCIXivoIqVePac9PpZVQZLlnYDpPUkYkYtFIwIsb5IRSaNrQlaoBRH3w5u3V3k S2Le1WLSknxMRs8jHkyTs1Q0fDu7yqq0+I0ysAFo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Michael Ellerman , Sasha Levin Subject: [PATCH 4.14 014/190] powerpc/xive: Clear the page tables for the ESB IO mapping Date: Fri, 19 Jun 2020 16:30:59 +0200 Message-Id: <20200619141634.175927404@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141633.446429600@linuxfoundation.org> References: <20200619141633.446429600@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Cédric Le Goater [ Upstream commit a101950fcb78b0ba20cd487be6627dea58d55c2b ] 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 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: 1ca3dec2b2df ("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 Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200429075122.1216388-2-clg@kaod.org Signed-off-by: Sasha Levin --- 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 b7ae5a027714..f8181c8af32d 100644 --- a/arch/powerpc/sysdev/xive/common.c +++ b/arch/powerpc/sysdev/xive/common.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -932,12 +933,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); iounmap(xd->eoi_mmio); 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); iounmap(xd->trig_mmio); xd->trig_mmio = NULL; } -- 2.25.1