Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754085AbcCCD3X (ORCPT ); Wed, 2 Mar 2016 22:29:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47842 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751891AbcCCD3W (ORCPT ); Wed, 2 Mar 2016 22:29:22 -0500 Subject: Re: [PATCH] iommu/vt-d: Assign old irt entries a common valid vector in kdump kernel To: Joerg Roedel References: <1456912948-5052-1-git-send-email-xlpang@redhat.com> <20160302145823.GV22747@8bytes.org> Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Baoquan He , kexec@lists.infradead.org From: Xunlei Pang Message-ID: <56D7AF8A.7080008@redhat.com> Date: Thu, 3 Mar 2016 11:29:14 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20160302145823.GV22747@8bytes.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 03 Mar 2016 03:29:21 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1960 Lines: 46 On 03/02/2016 at 10:58 PM, Joerg Roedel wrote: > On Wed, Mar 02, 2016 at 06:02:28PM +0800, Xunlei Pang wrote: >> Currently, the kernel copies the old irt entries during iommu >> initialization for kdump, so old vectors in the first kernel are >> used but having no related kernel irq handlers set explicitly, >> this can lead to some problems after lapics are enabled: >> - When some in-flight dma finished and triggered an interrupt, >> the kernel will throw a warning message in do_IRQ() like "No >> irq handler", because handle_irq() will return false with no >> irq_desc handlers. This may confuse users. >> - When the in-flight dma interrupt arrives, and if there happens >> to be an irq with the same vector allocated in kdump kernel, >> it will invoke the existing ISR registered in kdump kernel as >> if one valid interrupt in the kdump kernel happens. This might >> cause some wrong software logic, for example if the ISR always >> wakes up a process. > Hmm, the current situation with misdirected irq messages in the kdump > kernel is not different from a situation without any iommu at all, > right? Right, non-iommu in-flight DMA after crash also suffers from this. I think both of them should be fixed if possible. > And the goal of preserving the old mappings is to get as close as > possible to the situation without iommu. This seems to carry the VT-d > driver away from that. Without iommu, it's not so easy to fix due to the MSI registers located in different pci devices. But vt-d introduces a mechanism to redirect both MSI/MSI-X and I/O APIC to a common IR table, so we can handle that much easily with the help of the IR table. On kdump side, present-day servers with vt-d enabled are becoming increasingly common-place, if this does happen in real world(usually it will), that would be hard to dig it out, so I think it would be better if we can fix it. Also CC kexec list Regards, Xunlei > > > Joerg >