All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC SWIOTLB-0.2]
@ 2010-01-14 23:00 Konrad Rzeszutek Wilk
  2010-01-14 23:00 ` [PATCH 01/15] [swiotlb] fix: Update 'setup_io_tlb_npages' to accept both arguments in either order Konrad Rzeszutek Wilk
  2010-01-15  2:25 ` [RFC SWIOTLB-0.2] Chris Wright
  0 siblings, 2 replies; 56+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-01-14 23:00 UTC (permalink / raw)
  To: fujita.tomonori, alex.williamson, joerg.roedel, dwmw2, chrisw,
	iommu
  Cc: Ian.Campbell, jeremy, xen-devel

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

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

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

Thread overview: 56+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-14 23:00 [RFC SWIOTLB-0.2] Konrad Rzeszutek Wilk
2010-01-14 23:00 ` [PATCH 01/15] [swiotlb] fix: Update 'setup_io_tlb_npages' to accept both arguments in either order Konrad Rzeszutek Wilk
2010-01-14 23:00   ` [PATCH 02/15] [swiotlb] Add swiotlb_engine structure for tracking multiple software IO TLBs Konrad Rzeszutek Wilk
2010-01-14 23:00     ` [PATCH 03/15] [swiotlb] Add swiotlb_register_engine function Konrad Rzeszutek Wilk
2010-01-14 23:00       ` [PATCH 04/15] [swiotlb] Search and replace s/io_tlb/iommu_sw->/ Konrad Rzeszutek Wilk
2010-01-14 23:00         ` [PATCH 05/15] [swiotlb] Respect the io_tlb_nslabs argument value Konrad Rzeszutek Wilk
2010-01-14 23:00           ` [PATCH 06/15] [swiotlb] In 'swiotlb_init' take advantage of the default swiotlb_engine support Konrad Rzeszutek Wilk
2010-01-14 23:00             ` [PATCH 07/15] [swiotlb] In 'swiotlb_free' check iommu_sw pointer Konrad Rzeszutek Wilk
2010-01-14 23:00               ` [PATCH 08/15] [swiotlb] Add 'is_swiotlb_buffer' to the swiotlb_ops function decleration Konrad Rzeszutek Wilk
2010-01-14 23:00                 ` [PATCH 09/15] [swiotlb] Add 'dma_capable' to the swiotlb_ops structure Konrad Rzeszutek Wilk
2010-01-14 23:00                   ` [PATCH 10/15] [swiotlb] Replace the [phys, bus]->virt and virt->[bus, phys] functions with iommu_sw calls Konrad Rzeszutek Wilk
2010-01-14 23:01                     ` [PATCH 11/15] [swiotlb] Replace late_alloc with iommu_sw->priv usage Konrad Rzeszutek Wilk
2010-01-14 23:01                       ` [PATCH 12/15] [swiotlb] Remove un-used static declerations obsoleted by iommu_sw Konrad Rzeszutek Wilk
2010-01-14 23:01                         ` [PATCH 13/15] [swiotlb] Make io_tlb_nslabs visible outside lib/swiotlb.c and rename it Konrad Rzeszutek Wilk
2010-01-14 23:01                           ` [PATCH 14/15] [swiotlb] Move initialization (swiotlb_init) and its friends in swiotlb-default.c Konrad Rzeszutek Wilk
2010-01-14 23:01                             ` [PATCH 15/15] [swiotlb] Take advantage of iommu_sw->name and add %s to printk's Konrad Rzeszutek Wilk
2010-01-15  2:14                             ` [PATCH 14/15] [swiotlb] Move initialization (swiotlb_init) and its friends in swiotlb-default.c Chris Wright
2010-01-19 17:45                               ` Konrad Rzeszutek Wilk
2010-01-19 18:55                                 ` Chris Wright
2010-01-15  2:02               ` [PATCH 07/15] [swiotlb] In 'swiotlb_free' check iommu_sw pointer Chris Wright
2010-01-19 17:45                 ` Konrad Rzeszutek Wilk
2010-01-19 18:23                   ` Chris Wright
2010-01-15  1:57             ` [PATCH 06/15] [swiotlb] In 'swiotlb_init' take advantage of the default swiotlb_engine support Chris Wright
2010-01-19 17:45               ` Konrad Rzeszutek Wilk
2010-01-15  1:47           ` [PATCH 05/15] [swiotlb] Respect the io_tlb_nslabs argument value Chris Wright
2010-01-15  1:43         ` [PATCH 04/15] [swiotlb] Search and replace s/io_tlb/iommu_sw->/ Chris Wright
2010-01-19 17:45           ` Konrad Rzeszutek Wilk
2010-01-15  1:41       ` [PATCH 03/15] [swiotlb] Add swiotlb_register_engine function Chris Wright
2010-01-19 17:25         ` Konrad Rzeszutek Wilk
2010-01-15  1:33     ` [PATCH 02/15] [swiotlb] Add swiotlb_engine structure for tracking multiple software IO TLBs Chris Wright
2010-01-19 17:46       ` Konrad Rzeszutek Wilk
2010-01-19 18:43         ` Chris Wright
2010-01-22  1:51     ` FUJITA Tomonori
2010-01-26 16:20       ` Konrad Rzeszutek Wilk
2010-02-03  2:04         ` FUJITA Tomonori
2010-02-03 17:08           ` [RFC SWIOTLB-0.4] Konrad Rzeszutek Wilk
2010-02-03 17:08             ` [PATCH 01/11] [swiotlb] fix: Update 'setup_io_tlb_npages' to accept both arguments in either order Konrad Rzeszutek Wilk
2010-02-03 17:08               ` [PATCH 02/11] [swiotlb] Make 'setup_io_tlb_npages' accept new 'swiotlb=' syntax Konrad Rzeszutek Wilk
2010-02-03 17:08                 ` [PATCH 03/11] [swiotlb] Normalize the swiotlb_init_* function's naming syntax Konrad Rzeszutek Wilk
2010-02-03 17:08                   ` [PATCH 04/11] [swiotlb] Make printk's use same prefix and include dev_err when possible Konrad Rzeszutek Wilk
2010-02-03 17:08                     ` [PATCH 05/11] [swiotlb] Make internal bookkeeping functions have 'do_' prefix Konrad Rzeszutek Wilk
2010-02-03 17:08                       ` [PATCH 06/11] [swiotlb] do_map_single: abstract out swiotlb_virt_to_bus calls out Konrad Rzeszutek Wilk
2010-02-03 17:08                         ` [PATCH 07/11] [swiotlb] Fix checkpatch warnings Konrad Rzeszutek Wilk
2010-02-03 17:08                           ` [PATCH 08/11] [swiotlb] Re-order the function declerations Konrad Rzeszutek Wilk
2010-02-03 17:08                             ` [PATCH 09/11] [swiotlb] Make swiotlb bookkeeping functions visible in the header file Konrad Rzeszutek Wilk
2010-02-03 17:08                               ` [PATCH 10/11] [swiotlb] Rename swiotlb.c to swiotlb-core.c Konrad Rzeszutek Wilk
2010-02-03 17:08                                 ` [PATCH 11/11] [swiotlb] move dma_ops functions to swiotlb.c Konrad Rzeszutek Wilk
2010-02-04  0:17             ` [RFC SWIOTLB-0.4] FUJITA Tomonori
2010-02-04  3:07               ` Konrad Rzeszutek Wilk
2010-02-16 23:37                 ` Konrad Rzeszutek Wilk
2010-01-15  1:22   ` [PATCH 01/15] [swiotlb] fix: Update 'setup_io_tlb_npages' to accept both arguments in either order Chris Wright
2010-01-19 17:47     ` Konrad Rzeszutek Wilk
2010-01-19 19:00       ` Chris Wright
2010-01-19 19:39         ` Konrad Rzeszutek Wilk
2010-01-15  2:25 ` [RFC SWIOTLB-0.2] Chris Wright
2010-01-19 18:20   ` Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.