From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E646EC34026 for ; Mon, 17 Feb 2020 19:39:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C7DEC20578 for ; Mon, 17 Feb 2020 19:39:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729450AbgBQTjI (ORCPT ); Mon, 17 Feb 2020 14:39:08 -0500 Received: from 8bytes.org ([81.169.241.247]:54498 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729294AbgBQTjI (ORCPT ); Mon, 17 Feb 2020 14:39:08 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id B27293C3; Mon, 17 Feb 2020 20:39:06 +0100 (CET) From: Joerg Roedel To: Lu Baolu , David Woodhouse Cc: Joerg Roedel , jroedel@suse.de, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/5] iommu/vt-d: Fix kdump boot with VT-d enabled Date: Mon, 17 Feb 2020 20:38:53 +0100 Message-Id: <20200217193858.26990-1-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, booting into a crashdump kernel with Intel IOMMU enabled and configured into passthrough mode does not succeed with the current kernel. The reason is that the check for identity mappings happen before the check for deferred device attachments. That results in wrong results returned from iommu_need_mapping() and subsequently in a wrong domain-type used in __intel_map_single(). A stripped oops is in the commit-message of patch 3. The patch-set fixes the issue and does a few code cleanups along the way. I have not yet researched the stable and fixes tags, but when the patches are fine I will add the tags before applying the patches. Please review. Thanks, Joerg Joerg Roedel (5): iommu/vt-d: Add attach_deferred() helper iommu/vt-d: Move deferred device attachment into helper function iommu/vt-d: Do deferred attachment in iommu_need_mapping() iommu/vt-d: Remove deferred_attach_domain() iommu/vt-d: Simplify check in identity_mapping() drivers/iommu/intel-iommu.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B6FAC34026 for ; Mon, 17 Feb 2020 19:39:14 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E37C20656 for ; Mon, 17 Feb 2020 19:39:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E37C20656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=8bytes.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0469387100; Mon, 17 Feb 2020 19:39:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sGqxRv1ZxFK3; Mon, 17 Feb 2020 19:39:13 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 5909987082; Mon, 17 Feb 2020 19:39:13 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 30120C1D8A; Mon, 17 Feb 2020 19:39:13 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9FD27C013E for ; Mon, 17 Feb 2020 19:39:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 89C9C20430 for ; Mon, 17 Feb 2020 19:39:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZSHFeWIMzoCi for ; Mon, 17 Feb 2020 19:39:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from theia.8bytes.org (8bytes.org [81.169.241.247]) by silver.osuosl.org (Postfix) with ESMTPS id 0AEC520373 for ; Mon, 17 Feb 2020 19:39:10 +0000 (UTC) Received: by theia.8bytes.org (Postfix, from userid 1000) id B27293C3; Mon, 17 Feb 2020 20:39:06 +0100 (CET) From: Joerg Roedel To: Lu Baolu , David Woodhouse Subject: [PATCH 0/5] iommu/vt-d: Fix kdump boot with VT-d enabled Date: Mon, 17 Feb 2020 20:38:53 +0100 Message-Id: <20200217193858.26990-1-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 Cc: jroedel@suse.de, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" Hi, booting into a crashdump kernel with Intel IOMMU enabled and configured into passthrough mode does not succeed with the current kernel. The reason is that the check for identity mappings happen before the check for deferred device attachments. That results in wrong results returned from iommu_need_mapping() and subsequently in a wrong domain-type used in __intel_map_single(). A stripped oops is in the commit-message of patch 3. The patch-set fixes the issue and does a few code cleanups along the way. I have not yet researched the stable and fixes tags, but when the patches are fine I will add the tags before applying the patches. Please review. Thanks, Joerg Joerg Roedel (5): iommu/vt-d: Add attach_deferred() helper iommu/vt-d: Move deferred device attachment into helper function iommu/vt-d: Do deferred attachment in iommu_need_mapping() iommu/vt-d: Remove deferred_attach_domain() iommu/vt-d: Simplify check in identity_mapping() drivers/iommu/intel-iommu.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) -- 2.17.1 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu