[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Make AMD GART work as a mini IOMMU [4/4]

  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: "Langsdorf, Mark" <mark.langsdorf@xxxxxxx>
  • Date: Mon, 5 Mar 2007 15:05:57 -0600
  • Delivery-date: Mon, 05 Mar 2007 13:07:09 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcdfahHjq5cGBLfzQjas3HVpWdcKvA==
  • Thread-topic: [PATCH] Make AMD GART work as a mini IOMMU [4/4]

Every AMD processor has an AGP aperture and 
Graphics Address Transalation Table (GART) built
into its Northbridge.  The aperture is a
physically contiguous range of memory addresses
under 0xFFFFFFFF that devices can write to; the
GART is a table that translates GART addresses 
into defined virtual addresses.  A DMA device 
can transfer data through the aperture using
32-bit accesses and have the processor automatically
transfer the data to system memory above 4GB without
needing to use software bounce buffering.  On
systems using 32-bit DMA devices, it can speed 
up I/O performance by 15-20% or more.

This patch set enables the AGP aperture and GART
in Xen dom0.  In order to do that easily and 
without interfering with the swiotlb code, it
enables dma_ops for dom0 guests and modifies 
the x86_64 pci-swiotlb-xen.c code to work with

The first patch creates the 
arch/x86_64/kernel/pci-dma-xen.c file based on the 
standard pci-dma.c.

The second patch modifies 
arch/x86_64/kernel/pci-swiotlb-xen.c to work with 
dma_ops, and modifies arch/x86_64/kernel/pci-dma-xen.c
slightly to be Xen-safe by copying over some functions
from arch/i386/kernel/pci-dma-xen.c.

The third patch creates the 
arch/x86_64/kernel/pci-gart-xen.c and
arch/x86_64/kernel/aperture-xen.c files based on the
standard pci-gart.c and aperture.c files.

The fourth patch modifies pci-gart-xen.c and 
aperture-xen.c to work with Xen.  It adds a
hypervisor call to clear the aperture address
range from the hypervisor's memory tables,
which is necessary to avoid a cache coherency
issue, and ups the range of contiguous memory
that Xen provides, which is necessary since
the aperture must be at least 32 MB.

Attachment: make-gart-work.patch
Description: make-gart-work.patch

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.