From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycoku-0004NU-OE for qemu-devel@nongnu.org; Tue, 31 Mar 2015 01:30:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ycokm-0007oW-V2 for qemu-devel@nongnu.org; Tue, 31 Mar 2015 01:30:28 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:55583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycokl-0007lo-VC for qemu-devel@nongnu.org; Tue, 31 Mar 2015 01:30:20 -0400 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 Mar 2015 15:30:16 +1000 From: Alexey Kardashevskiy Date: Tue, 31 Mar 2015 16:28:46 +1100 Message-Id: <1427779727-13353-12-git-send-email-aik@ozlabs.ru> In-Reply-To: <1427779727-13353-1-git-send-email-aik@ozlabs.ru> References: <1427779727-13353-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH qemu v5 11/12] spapr_pci: Disable all DMA windows on reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , Alex Williamson , qemu-ppc@nongnu.org, Alexander Graf , David Gibson 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 --- 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