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

[Xen-devel] [RFC SWIOTLB-0.2]



Fujita-san et al.

Attached is a set of fifteen RFC patches that separate the address translation
(virt_to_phys, virt_to_bus, etc) from the SWIOTLB library.

The idea behind this set of patches is to make it possible to have separate
mechanisms for translating virtual to physical or virtual to DMA addresses
on platforms which need an SWIOTLB, and where physical != PCI bus address.

One  customers of this, is the pv-ops project, which can switch between
different modes of operation depending in which environment it is running. One
of the usage model is the PCI pass-through in a virtualized environment
where an IOMMU is required since the Linux kernel's idea of physical address
is not the real physical address (worst yet, the PFNs that look like they
are under 4GB, could be actually pointing above 4GB - presents an interesting
set of bugs). Pv-ops kernel provides a set address translation mechanisms
to translate physical (PFNs) to real-physical (Machine Frame Number) frame
numbers (and vice-versa).

For the IOMMU, one solution has been to wholesale copy the SWIOTLB, stick it in
arch/x86/xen/swiotlb.c and modify the virt_to_phys, phys_to_virt and others
to use the Xen address translation functions. Unfortunately, since the kernel 
can
run on bare-metal, there is big code overlap with the real SWIOTLB.
(git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git 
xen/dom0/swiotlb-new)

Another approach, which this set of patches explores, is to abstract the
address translation and address determination functions away from the
SWIOTLB book-keeping functions. This way the core SWIOTLB library functions
are present in one place, while the address related functions are in
a separate library for different run-time platforms. I would very much
appreciate input on this idea and the set of patches.


The set of fifteen patches is also accessible on:

git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb-2.6.git 
swiotlb-rfc-0.2

An example of how this can be utilized in both bare-metal and Xen environments
is this git tree:

git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git swiotlb-xen-0.2

Sincerely,

Konrad Rzeszutek Wilk

 include/linux/swiotlb.h |   97 ++++++++++++
 lib/Makefile            |    2 +-
 lib/swiotlb-default.c   |  263 ++++++++++++++++++++++++++++++++
 lib/swiotlb.c           |  389 ++++++++++++++---------------------------------
 4 files changed, 477 insertions(+), 274 deletions(-)


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


 


Rackspace

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