linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc-powernv: added tce_get callback for powernv platform
@ 2012-09-05  1:19 Alexey Kardashevskiy
  2012-09-10  2:35 ` David Gibson
  0 siblings, 1 reply; 28+ messages in thread
From: Alexey Kardashevskiy @ 2012-09-05  1:19 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Alexey Kardashevskiy, linuxppc-dev, Paul Mackerras, david

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>
---
 arch/powerpc/platforms/powernv/pci.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index be3cfc5..05205cf 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -447,6 +447,11 @@ static void pnv_tce_free(struct iommu_table *tbl, long index, long npages)
 		pnv_tce_invalidate(tbl, tces, tcep - 1);
 }
 
+static unsigned long pnv_tce_get(struct iommu_table *tbl, long index)
+{
+	return ((u64 *)tbl->it_base)[index - tbl->it_offset];
+}
+
 void pnv_pci_setup_iommu_table(struct iommu_table *tbl,
 			       void *tce_mem, u64 tce_size,
 			       u64 dma_offset)
@@ -597,6 +602,7 @@ void __init pnv_pci_init(void)
 	ppc_md.pci_dma_dev_setup = pnv_pci_dma_dev_setup;
 	ppc_md.tce_build = pnv_tce_build;
 	ppc_md.tce_free = pnv_tce_free;
+	ppc_md.tce_get = pnv_tce_get;
 	ppc_md.pci_probe_mode = pnv_pci_probe_mode;
 	set_pci_dma_ops(&dma_iommu_ops);
 
-- 
1.7.10.4

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

end of thread, other threads:[~2012-10-11 18:09 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20120821113534.GS29724@truffula.fritz.box>
2012-09-04  7:33 ` [PATCH] vfio: enabled and supported on power (v7) Alexey Kardashevskiy
2012-09-04  7:35   ` [PATCH] powerpc-powernv: added tce_get callback for powernv platform Alexey Kardashevskiy
2012-09-04 19:41     ` Benjamin Herrenschmidt
2012-09-04 22:35       ` David Gibson
2012-09-05  0:19       ` Alexey Kardashevskiy
2012-09-05  0:32         ` Benjamin Herrenschmidt
2012-09-04  7:36   ` [PATCH] powerpc-kvm: fixing page alignment for TCE Alexey Kardashevskiy
2012-09-20  9:01     ` Alexander Graf
2012-09-04  7:36   ` [PATCH] powerpc-powernv: align BARs to PAGE_SIZE on powernv platform Alexey Kardashevskiy
2012-09-04 19:45     ` Benjamin Herrenschmidt
2012-09-05  0:55       ` Alexey Kardashevskiy
2012-09-05  1:16         ` Benjamin Herrenschmidt
2012-09-05  4:57           ` Alex Williamson
2012-09-05  5:17             ` Benjamin Herrenschmidt
2012-09-05  5:27               ` Alexey Kardashevskiy
2012-09-10 17:06                 ` Alex Williamson
2012-09-10 16:02   ` [PATCH] vfio: enabled and supported on power (v7) Alex Williamson
2012-09-11  8:28     ` Alexey Kardashevskiy
2012-09-13 22:34       ` Alex Williamson
2012-09-13 22:41         ` Scott Wood
2012-09-13 22:55           ` Alex Williamson
2012-09-14  0:51         ` Alexey Kardashevskiy
2012-09-14  4:35           ` Alex Williamson
2012-10-11  8:19             ` Alexey Kardashevskiy
2012-10-11 18:09               ` Alex Williamson
2012-09-05  1:19 [PATCH] powerpc-powernv: added tce_get callback for powernv platform Alexey Kardashevskiy
2012-09-10  2:35 ` David Gibson
2012-09-10  5:19   ` Benjamin Herrenschmidt

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