From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 6 of 7] IOMMU: add crash_shutdown iommu_op Date: Wed, 15 Jun 2011 14:06:31 +0100 Message-ID: <4DF8AE57.2030800@citrix.com> References: <3ad737eb0a8ded1b8306.1307984573@andrewcoop.uk.xensource.com> <987664A83D2D224EAE907B061CE93D5301E728131A@orsmsx505.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <987664A83D2D224EAE907B061CE93D5301E728131A@orsmsx505.amr.corp.intel.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: "Kay, Allen M" Cc: Jan, "xen-devel@lists.xensource.com" , Keir Fraser , Beulich List-Id: xen-devel@lists.xenproject.org On 14/06/11 23:15, Kay, Allen M wrote: > +static void vtd_crash_shutdown(void) > +{ > + struct acpi_drhd_unit *drhd; > + struct iommu *iommu; > + > + if ( !iommu_enabled ) > + return; > + > + iommu_flush_all(); > + > + for_each_drhd_unit ( drhd ) > + { > + iommu = drhd->iommu; > + iommu_disable_translation(iommu); > + } > + > + iommu_disable_x2apic_IR(); > +} > + > > Iommu_disable_x2apic_IR() check for iommu_supports_eim() before entering. What happens when x2apic is not enabled but interrupt remapping is enabled? > > Maybe you should just create disable_intremap() and disable_qi() functions and call from vtd_crash_shutdown() and iommu_disable_x2apic_IR(). > > Allen Well spotted - I missed that. My suggestion would be to remove the check for eim and deal with it in the relevant disable_intremap and disable_qi functions. My feeling is that a call to "iommu_disable_IR" should be able to deal whether or not you have eim. If there are no objections, I will go ahead and try this and integrate it into the patch 5 of the series which is already dealing with eim, and needs some refactoring following my chat with Ian Campbell this morning. -- Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer T: +44 (0)1223 225 900, http://www.citrix.com