From: Tim Deegan Subject: Re: Re: IOMMU faults Date: Fri, 24 Jun 2011 14:32:14 +0100 Message-ID: <20110624133214.GC17634@whitby.uk.xensource.com> References: <20110616092509.GH17634@whitby.uk.xensource.com> <20110616094757.GG12480@spongy.cam.xci-test.com> <20110616100743.GI17634@whitby.uk.xensource.com> <20110616102817.GK12480@spongy.cam.xci-test.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Return-path: Content-Disposition: inline In-Reply-To: <20110616102817.GK12480@spongy.cam.xci-test.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jean Guyader Cc: Wei Wang , xen-devel@lists.xensource.com, Allen Kay List-Id: xen-devel@lists.xenproject.org Hi, At 11:28 +0100 on 16 Jun (1308223697), Jean Guyader wrote: > > Of course, even with this patch, my original question still stands: > > should Xen do something more assertive in the IOMMU fault handler? > > What we really want to achive here is to stop DMA on this device. > One way of doing it is to perform a proper PCI reset (FLR, secondary > bus reset, ...) when that happens. I think that's more or less a consensus then, that we should try to stop the device from the IOMMU fault handler. Looking at your patch in a bit more detail, I see two things that worry me. The first is that the new pci_reset_device() function does nothing at all if the device isn't one of the particular graphics cards it know about! The second is this comment: > + /* Leave CMD MEMORY set otherwise the platform can crashe during FLR */ > + pci_conf_write16(bus, d, f, PCI_COMMAND, 2); which implies that my current approach of just disabling the card might have pretty bad conequences. Can you expand on that? Would it be better just to mask out PCI_COMMAND_MASTER? And if I do that do I need to try and issue a reset as well (i.e. are there cards that are known to ignore this bit?) Cheers, Tim. -- Tim Deegan Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)