qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH qemu v5 11/12] spapr_pci: Disable all DMA windows on


From: Alexey Kardashevskiy
Subject: [Qemu-devel] [PATCH qemu v5 11/12] spapr_pci: Disable all DMA windows on reset
Date: Tue, 31 Mar 2015 16:28:46 +1100

This disables all DMA windows on a PHB reset. It does not make any
difference now as there is just one DMA window but it will later with DDW
patches.

Signed-off-by: Alexey Kardashevskiy <address@hidden>
---
 hw/ppc/spapr_pci.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index b8c2488..a85289e 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -724,13 +724,24 @@ static const MemoryRegionOps spapr_msi_ops = {
 /*
  * DMA windows
  */
+static int spapr_phb_disable_dma_windows(Object *child, void *opaque)
+{
+    sPAPRTCETable *tcet = (sPAPRTCETable *)
+        object_dynamic_cast(child, TYPE_SPAPR_TCE_TABLE);
+
+    if (tcet) {
+        spapr_tce_table_disable(tcet);
+    }
+
+    return 0;
+}
+
 int spapr_phb_dma_reset(sPAPRPHBState *sphb)
 {
     const uint32_t liobn = SPAPR_PCI_LIOBN(sphb->index, 0);
-    sPAPRTCETable *tcet = spapr_tce_find_by_liobn(liobn);
     sPAPRPHBClass *spc = SPAPR_PCI_HOST_BRIDGE_GET_CLASS(sphb);
 
-    spapr_tce_table_disable(tcet);
+    object_child_foreach(OBJECT(sphb), spapr_phb_disable_dma_windows, NULL);
     spc->dma_init_window(sphb, liobn, SPAPR_TCE_PAGE_SHIFT, 0);
 
     return 0;
-- 
2.0.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]