From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axquG-0007si-A3 for qemu-devel@nongnu.org; Wed, 04 May 2016 03:07:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axqty-0000bs-ID for qemu-devel@nongnu.org; Wed, 04 May 2016 03:07:30 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:46380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axqtx-0000XF-Va for qemu-devel@nongnu.org; Wed, 04 May 2016 03:07:18 -0400 Received: from localhost by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 May 2016 17:06:58 +1000 From: Alexey Kardashevskiy Date: Wed, 4 May 2016 16:52:27 +1000 Message-Id: <1462344751-28281-16-git-send-email-aik@ozlabs.ru> In-Reply-To: <1462344751-28281-1-git-send-email-aik@ozlabs.ru> References: <1462344751-28281-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH qemu v16 15/19] spapr_pci: Add and export DMA resetting helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Alexander Graf , David Gibson , Alex Williamson , Paolo Bonzini This will be later used by the "ibm,reset-pe-dma-window" RTAS handler which resets the DMA configuration to the defaults. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- hw/ppc/spapr_pci.c | 10 ++++++++-- include/hw/pci-host/spapr.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index aa9201b..5b9ccff 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1486,9 +1486,8 @@ static int spapr_phb_children_reset(Object *child, void *opaque) return 0; } -static void spapr_phb_reset(DeviceState *qdev) +void spapr_phb_dma_reset(sPAPRPHBState *sphb) { - sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(qdev); sPAPRTCETable *tcet = spapr_tce_find_by_liobn(sphb->dma_liobn); if (tcet && tcet->enabled) { @@ -1498,6 +1497,13 @@ static void spapr_phb_reset(DeviceState *qdev) /* Register default 32bit DMA window */ spapr_tce_table_enable(tcet, SPAPR_TCE_PAGE_SHIFT, sphb->dma_win_addr, sphb->dma_win_size >> SPAPR_TCE_PAGE_SHIFT); +} + +static void spapr_phb_reset(DeviceState *qdev) +{ + sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(qdev); + + spapr_phb_dma_reset(sphb); /* Reset the IOMMU state */ object_child_foreach(OBJECT(qdev), spapr_phb_children_reset, NULL); diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 03ee006..7848366 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -147,4 +147,6 @@ static inline void spapr_phb_vfio_reset(DeviceState *qdev) } #endif +void spapr_phb_dma_reset(sPAPRPHBState *sphb); + #endif /* __HW_SPAPR_PCI_H__ */ -- 2.5.0.rc3