Wei Wang2
2008-Jul-31 12:27 UTC
[Xen-devel] [PATCH 1/5] AMD IOMMU: bug fix and code cleanup
init.patch: Since device id covered by each iommu can never overlap, use a global device table instead of allocating private tables for each iommu. Migrate a few functions from pci_amd_iommu.c -Wei Signed-off-by: Wei Wang <wei.wang2@amd.com> -- AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Nakajima, Jun
2008-Jul-31 13:25 UTC
RE: [Xen-devel] [PATCH 1/5] AMD IOMMU: bug fix and code cleanup
On 7/31/2008 5:27:45 AM, Wei Wang2 wrote:> init.patch: Since device id covered by each iommu can never overlap, > use a global device table instead of allocating private tables for > each iommu. Migrate a few functions from pci_amd_iommu.c > > -Wei+void __init enable_iommu(struct amd_iommu *iommu) +{ + unsigned long flags; + spin_lock_irqsave(&iommu->lock, flags); - amd_iommu_msi_data_init (iommu, vector); + if ( iommu->enabled ) + return; I just scanned the code for a second, but you might want to add spin_unlock_irqrestore(&iommu->lock, flags) before returning?> > Signed-off-by: Wei Wang <wei.wang2@amd.com> > -- > AMD Saxony, Dresden, Germany > Operating System Research Center > > Legal Information: > AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): > Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht > Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC > (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. > Hans-R. Deppe, Thomas McCoy. Jun Nakajima | Intel Open Source Technology Center _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Wei Wang2
2008-Jul-31 13:37 UTC
RE: [Xen-devel] [PATCH 1/5] AMD IOMMU: bug fix and code cleanup
On Thu, 2008-07-31 at 06:25 -0700, Nakajima, Jun wrote:> On 7/31/2008 5:27:45 AM, Wei Wang2 wrote: > > init.patch: Since device id covered by each iommu can never overlap, > > use a global device table instead of allocating private tables for > > each iommu. Migrate a few functions from pci_amd_iommu.c > > > > -Wei > > +void __init enable_iommu(struct amd_iommu *iommu) > +{ > + unsigned long flags; > + > spin_lock_irqsave(&iommu->lock, flags); > > - amd_iommu_msi_data_init (iommu, vector); > + if ( iommu->enabled ) > + return; > > I just scanned the code for a second, but you might want to add > spin_unlock_irqrestore(&iommu->lock, flags) before returning?Yes, that is a bug, attached is a fix for that, Thanks a lot -Wei Signed-off-by: Wei Wang <wei.wang2@amd.com> -- AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy> > > > > Signed-off-by: Wei Wang <wei.wang2@amd.com> > > -- > > AMD Saxony, Dresden, Germany > > Operating System Research Center > > > > Legal Information: > > AMD Saxony Limited Liability Company & Co. KG Sitz (Geschäftsanschrift): > > Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht > > Dresden: HRA 4896 vertretungsberechtigter Komplementär: AMD Saxony LLC > > (Sitz Wilmington, Delaware, USA) Geschäftsführer der AMD Saxony LLC: Dr. > > Hans-R. Deppe, Thomas McCoy > . > Jun Nakajima | Intel Open Source Technology Center_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel