public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Xen-SWIOTBL v0.8.3 used for Xen PCI pass through for PV guests.
@ 2010-06-22 19:42 Konrad Rzeszutek Wilk
  2010-06-22 19:42 ` [PATCH 01/19] xen: use _PAGE_IOMAP in ioremap to do machine mappings Konrad Rzeszutek Wilk
                   ` (19 more replies)
  0 siblings, 20 replies; 22+ messages in thread
From: Konrad Rzeszutek Wilk @ 2010-06-22 19:42 UTC (permalink / raw)
  To: linux-kernel, fujita.tomonori, iommu, albert_herranz, x86

These nineteen patches lay the groundwork for Xen Paravirtualized (PV)
domains to access PCI pass-through devices. These patches utilize the
SWIOTLB library modifications (http://lkml.org/lkml/2010/6/4/272).

The end user of this is the Xen PCI frontend and Xen PCI [1] which
require a DMA API "backend" that understands Xen's MMU. This allows the
PV domains to use PCI devices.

This patch-set is split in two groups. The first alter the Xen components,
while the second introduces the SWIOTLB-Xen.

The Xen components patches consist of:

 [PATCH 01/19] xen: use _PAGE_IOMAP in ioremap to do machine mappings
 [PATCH 02/19] xen: Allow unprivileged Xen domains to create iomap pages
 [PATCH 03/19] xen: Rename the balloon lock
 [PATCH 04/19] xen: Add xen_create_contiguous_region

which alter the Xen MMU, which by default utilizes a layer of indirection
wherein the PFN is translated to the Machine Frame Number (MFN) and vice-versa.
This is required to "fool" the guest in thinking its memory starts at PFN 0 and
goes up to the available amount.  While in the background, PFN 0 might as well be
MFN 1048576 (4GB).

For PCI/DMA API calls (ioremap, pci_map_page, etc) having a PFN != MFN is
not too good, so two new mechanisms are introduced:
  a). For PTEs which manipulate the PCI/DMA pages the PFN == MFN. This is done
      via utilizing the _PAGE_IOMAP flag to distinguish the PTE as an IO type.
  b). Allow a mechanism to "swizzle" the MFN's under a PFN to be under a certain
      bus width (say 32). This allows us to provide a mechanism for the
      SWIOTLB Xen to allocate memory for its pool that will be guaranteed to be
      under the 4GB mark.

The SWIOTLB-Xen adds a library that is only used if the machine is detected
to be running under Xen. It utilizes the SWIOTLB library bookkeeping functions
(swiotlb_tbl_*) and only deals with the virtual to [physical, bus] (and vice-versa)
address translations.

The diffstat:

 arch/x86/include/asm/xen/page.h        |    8 +-
 arch/x86/include/asm/xen/swiotlb-xen.h |   14 +
 arch/x86/kernel/pci-dma.c              |    7 +-
 arch/x86/xen/Kconfig                   |    4 +
 arch/x86/xen/Makefile                  |    1 +
 arch/x86/xen/enlighten.c               |    4 +
 arch/x86/xen/mmu.c                     |  291 ++++++++++++++++++-
 arch/x86/xen/pci-swiotlb-xen.c         |   58 ++++
 drivers/xen/balloon.c                  |   15 +-
 include/linux/swiotlb-xen.h            |   65 ++++
 include/xen/interface/memory.h         |   50 +++
 include/xen/xen-ops.h                  |    6 +
 lib/Makefile                           |    1 +
 lib/swiotlb-xen.c                      |  515 ++++++++++++++++++++++++++++++++
 14 files changed, 1018 insertions(+), 21 deletions(-)


[1]: The Xen PCI and Xen PCI fronted patches, which have not yet been
posted are available at git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git
under the branch devel/xen-pcifront-0.2. A merge of all required branches
is under 'devel/merge.2.6.35-rc3'. Or 'devel/merge.2.6.34'. I will post them quite soon.

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

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

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-22 19:42 [PATCH] Xen-SWIOTBL v0.8.3 used for Xen PCI pass through for PV guests Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 01/19] xen: use _PAGE_IOMAP in ioremap to do machine mappings Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 02/19] xen: Allow unprivileged Xen domains to create iomap pages Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 03/19] xen: Rename the balloon lock Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 04/19] xen: Add xen_create_contiguous_region Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 05/19] swiotlb-xen: Early skeleton code and explanation Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 06/19] swiotlb-xen: Copied swiotlb.c in, added xen_ prefix Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 07/19] swiotlb-xen: Make 'xen_swiotlb_alloc_coherent' work Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 08/19] swiotlb-xen: Don't allocate DMA-memory beyond 4GB in 32-bit mode Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 09/19] swiotlb-xen: Make 'xen_swiotlb_free_coherent' work Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 10/19] swiotlb-xen: Make 'xen_swiotlb_[map|unmap]_page' work Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 11/19] swiotlb-xen: Make 'xen_swiotlb_sync_single' work Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 12/19] swiotlb-xen: Make 'xen_swiotlb_map_sg_attrs' work Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 13/19] swiotlb-xen: Remove io_tlb_overflow usage Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 14/19] swiotlb-xen: Add 'xen_swiotlb_init' function Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 15/19] swiotlb-xen: Put 'swiotlb-xen.c' function declarations in the header Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 16/19] swiotlb-xen: Removing the 'struct device' in the address translation routines Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 17/19] swiotlb-xen: Coalesce usage of xen_swiotlb_map Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 18/19] pci-swiotlb-xen: Add glue code to setup dma_ops utilizing xen_swiotlb_* functions Konrad Rzeszutek Wilk
2010-06-22 19:42 ` [PATCH 19/19] x86: Detect whether we should use Xen SWIOTLB Konrad Rzeszutek Wilk
2010-06-22 21:23 ` [PATCH] Xen-SWIOTBL v0.8.3 used for Xen PCI pass through for PV guests Alex Williamson
2010-06-23 16:32   ` Konrad Rzeszutek Wilk

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