|| ||Konrad Rzeszutek Wilk <firstname.lastname@example.org> |
|| ||email@example.com, firstname.lastname@example.org, email@example.com |
|| ||[PATCH] swiotlb v0.8: seperation of physical/virtual address translation |
|| ||Tue, 11 May 2010 11:39:07 -0400|
|| ||firstname.lastname@example.org, email@example.com, Ian.Campbell@eu.citrix.com, firstname.lastname@example.org, email@example.com|
|| ||Article, Thread
Fujita-san et al.
Thank you for your continued careful review of these patches! I've attached your
set of patches to this e-mail, I hope that is ok?
Since the last posting [v7] I've done:
- Minimized the list of exported functions even further.
- Integrated your set of patches and changed "swiotlb_tlb" to "swiotlb_tbl"
- Minimized the list exported functions/variable with a prefix of: "swiotbl_tbl".
- Made the usage of 'int dir' to be 'enum dma_data_direction'.
- Made the exported functions/variables have the 'swiotlb_bk' prefix to be
- dropped the checkpatches/other reworks
.. and the writeup for this set set of patches:
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 on the environment it is running in:
bare-metal or virtualized (Xen for now). Another is the Wii DMA implementation
so that the Wii USB controller can work.
On bare-metal SWIOTLB is used when there are no hardware IOMMU. In virtualized
environment it used when PCI pass-through is enabled for the guest. The problems
with PCI pass-through is that the guest's idea of PFN's is not the real thing.
To fix that, there is translation layer for PFN->machine frame number and vice-versa.
To bubble that up to the SWIOTLB layer there are two possible solutions.
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 would be big code overlap with the real SWIOTLB.
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 that can be loaded when running under non-bare-metal platform.
The set of patches is also accessible on:
include/linux/swiotlb.h | 27 ++++++++-
lib/swiotlb.c | 140 ++++++++++++++++++++++++++++-------------------
2 files changed, 108 insertions(+), 59 deletions(-)