diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2012-09-04 11:19:35 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-10 00:36:17 -0400 |
commit | 11f63d3fb9c4257b1f005db8d11deba9f992bdf6 (patch) | |
tree | a9ab9deefe703cd00c020cba522b4700a64f775b /arch/powerpc/platforms/powernv | |
parent | 4715fed600109e0bd3d6cfa2b925a643173a08b4 (diff) |
powerpc/iommu: Add ppc_md.tce_get() callback for use by VFIO
The upcoming VFIO support requires a way to know which
entry in the TCE map is not empty in order to do cleanup
at QEMU exit/crash. This patch adds such functionality
to POWERNV platform code.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/powernv')
-rw-r--r-- | arch/powerpc/platforms/powernv/pci.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 1e908aef4201..c01688a1a741 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c | |||
@@ -446,6 +446,11 @@ static void pnv_tce_free(struct iommu_table *tbl, long index, long npages) | |||
446 | pnv_tce_invalidate(tbl, tces, tcep - 1); | 446 | pnv_tce_invalidate(tbl, tces, tcep - 1); |
447 | } | 447 | } |
448 | 448 | ||
449 | static unsigned long pnv_tce_get(struct iommu_table *tbl, long index) | ||
450 | { | ||
451 | return ((u64 *)tbl->it_base)[index - tbl->it_offset]; | ||
452 | } | ||
453 | |||
449 | void pnv_pci_setup_iommu_table(struct iommu_table *tbl, | 454 | void pnv_pci_setup_iommu_table(struct iommu_table *tbl, |
450 | void *tce_mem, u64 tce_size, | 455 | void *tce_mem, u64 tce_size, |
451 | u64 dma_offset) | 456 | u64 dma_offset) |
@@ -596,6 +601,7 @@ void __init pnv_pci_init(void) | |||
596 | ppc_md.pci_dma_dev_setup = pnv_pci_dma_dev_setup; | 601 | ppc_md.pci_dma_dev_setup = pnv_pci_dma_dev_setup; |
597 | ppc_md.tce_build = pnv_tce_build; | 602 | ppc_md.tce_build = pnv_tce_build; |
598 | ppc_md.tce_free = pnv_tce_free; | 603 | ppc_md.tce_free = pnv_tce_free; |
604 | ppc_md.tce_get = pnv_tce_get; | ||
599 | ppc_md.pci_probe_mode = pnv_pci_probe_mode; | 605 | ppc_md.pci_probe_mode = pnv_pci_probe_mode; |
600 | set_pci_dma_ops(&dma_iommu_ops); | 606 | set_pci_dma_ops(&dma_iommu_ops); |
601 | 607 | ||