linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] vfio-pci: add support for Freescale IOMMU (PAMU)
@ 2013-09-19  7:29 Bharat Bhushan
  2013-09-19  7:29 ` [PATCH 1/7] powerpc: Add interface to get msi region information Bharat Bhushan
                   ` (6 more replies)
  0 siblings, 7 replies; 41+ messages in thread
From: Bharat Bhushan @ 2013-09-19  7:29 UTC (permalink / raw)
  To: alex.williamson, joro, benh, galak, linux-kernel, linuxppc-dev,
	linux-pci, agraf, scottwood, iommu
  Cc: Bharat Bhushan

From: Bharat Bhushan <bharat.bhushan@freescale.com>

This patchset adds support for vfio-pci with Freescale
IOMMU (PAMU- Peripheral Access Management Unit)

The Freescale PAMU is an aperture-based IOMMU with the following
characteristics.  Each device has an entry in a table in memory
describing the iova->phys mapping. The mapping has:
  -an overall aperture that is power of 2 sized, and has a start iova that
   is naturally aligned
  -has 1 or more windows within the aperture
  -number of windows must be power of 2, max is 256
  -size of each window is determined by aperture size / # of windows
  -iova of each window is determined by aperture start iova / # of windows
  -the mapped region in each window can be different than
   the window size...mapping must power of 2
  -physical address of the mapping must be naturally aligned
   with the mapping size

Because of some of above said limitations we need to set limited aperture 
window which will have space for MSI address mapping. So we create space
for MSI windows just after the IOVA (guest memory).
First 4 patches in this patchset are for setting up MSI window and MSI address
at device accordingly.

Fifth patch resolves compilation error.
Sixth patch moves some common functions in a separate file so that they can be
used by FSL_PAMU implementation (next patch uses this). These will be used later for
iommu-none implementation. I believe we can do more of this but will take step by step.

Finally the seventh patch actually adds the support for FSL-PAMU :)

Bharat Bhushan (7):
  powerpc: Add interface to get msi region information
  iommu: add api to get iommu_domain of a device
  fsl iommu: add get_dev_iommu_domain
  powerpc: translate msi addr to iova if iommu is in use
  iommu: supress loff_t compilation error on powerpc
  vfio: moving some functions in common file
  vfio pci: Add vfio iommu implementation for FSL_PAMU

 arch/powerpc/include/asm/machdep.h |    8 +
 arch/powerpc/include/asm/pci.h     |    2 +
 arch/powerpc/kernel/msi.c          |   18 +
 arch/powerpc/sysdev/fsl_msi.c      |   95 ++++-
 arch/powerpc/sysdev/fsl_msi.h      |   11 +-
 drivers/iommu/fsl_pamu_domain.c    |   30 ++
 drivers/iommu/iommu.c              |   10 +
 drivers/pci/msi.c                  |   26 +
 drivers/vfio/Kconfig               |    6 +
 drivers/vfio/Makefile              |    5 +-
 drivers/vfio/pci/vfio_pci_rdwr.c   |    3 +-
 drivers/vfio/vfio_iommu_common.c   |  235 +++++++++
 drivers/vfio/vfio_iommu_common.h   |   30 ++
 drivers/vfio/vfio_iommu_fsl_pamu.c |  952 ++++++++++++++++++++++++++++++++++++
 drivers/vfio/vfio_iommu_type1.c    |  206 +--------
 include/linux/iommu.h              |    7 +
 include/linux/msi.h                |    8 +
 include/linux/pci.h                |   13 +
 include/uapi/linux/vfio.h          |  100 ++++
 19 files changed, 1550 insertions(+), 215 deletions(-)
 create mode 100644 drivers/vfio/vfio_iommu_common.c
 create mode 100644 drivers/vfio/vfio_iommu_common.h
 create mode 100644 drivers/vfio/vfio_iommu_fsl_pamu.c



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

end of thread, other threads:[~2013-10-14 14:20 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-19  7:29 [PATCH 0/7] vfio-pci: add support for Freescale IOMMU (PAMU) Bharat Bhushan
2013-09-19  7:29 ` [PATCH 1/7] powerpc: Add interface to get msi region information Bharat Bhushan
2013-09-24 23:58   ` Bjorn Helgaas
2013-10-04  5:19     ` Bhushan Bharat-R65777
2013-10-08 16:47       ` Bjorn Helgaas
2013-10-08 17:02         ` joro
2013-10-08 17:09           ` Bhushan Bharat-R65777
2013-10-10 21:13             ` Sethi Varun-B16395
2013-10-08 17:09         ` Scott Wood
2013-10-08 22:57   ` Scott Wood
2013-10-08 23:25     ` Bjorn Helgaas
2013-10-08 23:35       ` Scott Wood
2013-10-09  4:47     ` Bhushan Bharat-R65777
2013-09-19  7:29 ` [PATCH 2/7] iommu: add api to get iommu_domain of a device Bharat Bhushan
2013-09-25 16:45   ` Alex Williamson
2013-10-04  9:54     ` Bhushan Bharat-R65777
2013-10-04 15:45       ` Alex Williamson
2013-10-04 16:47         ` Bhushan Bharat-R65777
2013-10-04 17:12           ` Alex Williamson
2013-10-04 17:23             ` Bhushan Bharat-R65777
2013-10-04 18:12               ` Alex Williamson
2013-10-07  5:46                 ` Bhushan Bharat-R65777
2013-10-08  3:13                   ` Alex Williamson
2013-10-08  3:42                     ` Bhushan Bharat-R65777
2013-10-10 20:09                     ` Sethi Varun-B16395
2013-10-10 20:41                       ` Alex Williamson
2013-10-14 12:58                         ` Sethi Varun-B16395
2013-10-14 14:20                           ` Alex Williamson
2013-10-04 10:42     ` Bhushan Bharat-R65777
2013-09-19  7:29 ` [PATCH 3/7] fsl iommu: add get_dev_iommu_domain Bharat Bhushan
2013-09-19  7:29 ` [PATCH 4/7] powerpc: translate msi addr to iova if iommu is in use Bharat Bhushan
2013-09-19  7:29 ` [PATCH 5/7] iommu: supress loff_t compilation error on powerpc Bharat Bhushan
2013-09-25 16:40   ` Alex Williamson
2013-09-26  3:53     ` Bhushan Bharat-R65777
2013-09-26 22:20       ` Scott Wood
2013-09-19  7:29 ` [PATCH 6/7] vfio: moving some functions in common file Bharat Bhushan
2013-09-25 17:02   ` Alex Williamson
2013-09-26  3:57     ` Bhushan Bharat-R65777
2013-09-19  7:29 ` [PATCH 7/7] vfio pci: Add vfio iommu implementation for FSL_PAMU Bharat Bhushan
2013-09-25 19:06   ` Alex Williamson
2013-09-26  5:27     ` Bhushan Bharat-R65777

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).