Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933119AbbFKNsR (ORCPT ); Thu, 11 Jun 2015 09:48:17 -0400 Received: from 8bytes.org ([81.169.241.247]:39755 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752660AbbFKNrw (ORCPT ); Thu, 11 Jun 2015 09:47:52 -0400 From: Joerg Roedel To: iommu@lists.linux-foundation.org Cc: David Woodhouse , zhen-hual@hp.com, bhe@redhat.com, linux-kernel@vger.kernel.org, Joerg Roedel Subject: [PATCH 4/4] iommu/vt-d: Make sure si_domain is allocated for kdump kernel Date: Thu, 11 Jun 2015 15:47:43 +0200 Message-Id: <1434030463-942-5-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434030463-942-1-git-send-email-joro@8bytes.org> References: <1434030463-942-1-git-send-email-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2119 Lines: 67 From: Joerg Roedel The si_domain needs to be allocated in the kdump kernel too. Otherwise the iommu=pt case breaks with a panic of the kdump kernel. Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index fcb9310..e5af94a 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -2781,10 +2781,6 @@ static int __init iommu_prepare_static_identity_mapping(int hw) int i; int ret = 0; - ret = si_domain_init(hw); - if (ret) - return -EFAULT; - for_each_pci_dev(pdev) { ret = dev_prepare_static_identity_mapping(&pdev->dev, hw); if (ret) @@ -2798,7 +2794,7 @@ static int __init iommu_prepare_static_identity_mapping(int hw) if (dev->bus != &acpi_bus_type) continue; - + adev= to_acpi_device(dev); mutex_lock(&adev->physical_node_lock); list_for_each_entry(pn, &adev->physical_node_list, node) { @@ -2979,9 +2975,20 @@ static int __init init_dmars(void) check_tylersburg_isoch(); /* - * In the second kernel: Skip setting-up new domains for - * si, rmrr, and the isa bus on the expectation that these - * translations were copied from the old kernel. + * Make sure the si_domain is allocated in the case we are in a + * kdump kernel. + */ + if (iommu_identity_mapping) { + ret = si_domain_init(hw_pass_through); + if (ret) + goto free_iommu; + } + + /* + * In the second kernel: Skip setting-up new domains for rmrr + * and the isa bus, they will be allocated and assigned on the + * first DMA-API call. This is to keep the old mappings alive + * until the device driver of the kdump kernel takes over. */ if (g_translation_pre_enabled) goto skip_new_domains_for_si_rmrr_isa; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/