public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [REPOST PATCH RFC SWIOTLB 0.5] Separate address translation routines from core SWIOTLB book-keeping
@ 2010-02-18 16:26 Konrad Rzeszutek Wilk
  2010-02-18 16:26 ` [PATCH 01/10] swiotlb: fix: Update 'setup_io_tlb_npages' to accept both arguments in either order Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 14+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-02-18 16:26 UTC (permalink / raw)
  To: linux-kernel, fujita.tomonori, chrisw, iommu, dwmw2,
	alex.williamson
  Cc: jeremy, Ian.Campbell

[Sorry for the repost - I sent the earlier one to the wrong LKML email]

Fujita-san et al.

Attached is a set of ten RFC patches that separate the address translation
(virt_to_phys, virt_to_bus, etc) from the SWIOTLB library. They also enhance
the SWIOTLB library a bit.

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).

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.
(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 that can be loaded when running under non-bare-metal platform.

The set of ten patches is also accessible on:

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

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/swiotlb-2.6.git xen-swiotlb-0.5

---

 Documentation/x86/x86_64/boot-options.txt |    6 +-
 include/linux/swiotlb.h                   |   44 ++++++-
 lib/swiotlb.c                             |  187 ++++++++++++++++++-----------
 3 files changed, 156 insertions(+), 81 deletions(-)

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-02-25 23:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-18 16:26 [REPOST PATCH RFC SWIOTLB 0.5] Separate address translation routines from core SWIOTLB book-keeping Konrad Rzeszutek Wilk
2010-02-18 16:26 ` [PATCH 01/10] swiotlb: fix: Update 'setup_io_tlb_npages' to accept both arguments in either order Konrad Rzeszutek Wilk
2010-02-18 16:26   ` [PATCH 02/10] swiotlb: Make 'setup_io_tlb_npages' accept new 'swiotlb=' syntax Konrad Rzeszutek Wilk
2010-02-18 16:26     ` [PATCH 03/10] swiotlb: Normalize the swiotlb_init_* function's naming syntax Konrad Rzeszutek Wilk
2010-02-18 16:27       ` [PATCH 04/10] swiotlb: Make printk's use same prefix and include dev_err when possible Konrad Rzeszutek Wilk
2010-02-18 16:27         ` [PATCH 05/10] swiotlb: Make internal bookkeeping functions have 'do_' prefix Konrad Rzeszutek Wilk
2010-02-18 16:27           ` [PATCH 06/10] swiotlb: do_map_single: abstract out swiotlb_virt_to_bus calls out Konrad Rzeszutek Wilk
2010-02-18 16:27             ` [PATCH 07/10] swiotlb: Fix checkpatch warnings Konrad Rzeszutek Wilk
2010-02-18 16:27               ` [PATCH 08/10] swiotlb: Re-order the function declerations Konrad Rzeszutek Wilk
2010-02-18 16:27                 ` [PATCH 09/10] swiotlb: Make swiotlb bookkeeping functions visible in the header file Konrad Rzeszutek Wilk
2010-02-18 16:27                   ` [PATCH 10/10] swiotlb: EXPORT_SYMBOL_GPL functions + variables that are defined " Konrad Rzeszutek Wilk
2010-02-25  6:53     ` [PATCH 02/10] swiotlb: Make 'setup_io_tlb_npages' accept new 'swiotlb=' syntax FUJITA Tomonori
2010-02-25 12:49       ` Konrad Rzeszutek Wilk
2010-02-25 23:52         ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox