WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH] Enable K8 GART as an IOMMU

To: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] Enable K8 GART as an IOMMU
From: "Langsdorf, Mark" <mark.langsdorf@xxxxxxx>
Date: Tue, 13 Feb 2007 17:19:15 -0600
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 13 Feb 2007 15:18:48 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45D1891A.76E4.0078.0@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1449F58C868D8D4E9C72945771150BDFD965D2@xxxxxxxxxxxxxxxxx> <45D1891A.76E4.0078.0@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcdPS5T881GBLwPSSluIANxcAsoqFgAeU4Sw
Thread-topic: [Xen-devel] [PATCH] Enable K8 GART as an IOMMU
> >--- a/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c Fri Feb 
> 09 10:48:41 2007 +0000
> >+++ b/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c Fri Feb 
> 09 16:32:04 2007 -0600
> >@@ -252,7 +252,7 @@ static void contiguous_bitmap_clear(
> > }
> > 
> > /* Protected by balloon_lock. */
> >-#define MAX_CONTIG_ORDER 9 /* 2MB */
> >+#define MAX_CONTIG_ORDER 16 /* 256MB */
> > static unsigned long discontig_frames[1<<MAX_CONTIG_ORDER];
> > static multicall_entry_t cr_mcl[1<<MAX_CONTIG_ORDER];
> 
> This seems dangerous to me.

We need at least 64MB of contiguous memory for the aperture.


> a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/dma-ma
> pping.h       Fri Feb 09 10:48:41 2007 +0000
> >+++ 
> b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/dma-ma
> pping.h       Fri Feb 09 16:32:04 2007 -0600
> >@@ -62,7 +62,12 @@ static inline int valid_dma_direction(in
> >             (dma_direction == DMA_FROM_DEVICE));
> > }
> > 
> >-#if 0
> >+#ifdef CONFIG_XEN
> >+#define global_need_iommu() 1
> >+#else
> >+#define global_need_iommu() 
> (HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL)>MAX_DMA32_PFN)
> >+#endif
> >+
> > static inline int dma_mapping_error(dma_addr_t dma_addr)
> > {
> >     if (dma_ops->mapping_error)
> 
> HYPERVISOR_memory_op() if CONFIG_XEN is undefined?

Will fix.

> >--- a/linux-2.6-xen-sparse/lib/Makefile      Fri Feb 09 
> 10:48:41 2007 +0000
> >+++ b/linux-2.6-xen-sparse/lib/Makefile      Fri Feb 09 
> 16:32:04 2007 -0600
> >@@ -51,8 +51,7 @@ obj-$(CONFIG_SMP) += percpu_counter.o
> > obj-$(CONFIG_SMP) += percpu_counter.o
> > obj-$(CONFIG_AUDIT_GENERIC) += audit.o
> > 
> >-obj-$(CONFIG_SWIOTLB) += swiotlb.o
> >-swiotlb-$(CONFIG_XEN) := ../arch/i386/kernel/swiotlb.o
> >+obj-$(CONFIG_SWIOTLB) += swiotlb-xen.o
> > 
> > hostprogs-y := gen_crc32table
> > clean-files := crc32table.h
> 
> This seems very unlikely to have been tested in a native 
> build. You should use cherry-pick-xen in the file.

Okay.

> I generally welcome moving arch/i386/kernel/swiotlb.c to 
> lib/swiotlb-xen.c, but would appreciate if you then also
> removed the original file (and perhaps this should be done
> as a separate patch, so that it'd be clear that the move
> itself doesn't change the file in any way (and if you need 
> changes to it for the IOMMU patch, have only those changes
> in the patch here).

I'll seperate the reorg a bit and make it clearer.  Thanks for
looking at this.

-Mark Langsdorf
AMD, Inc.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel