From patchwork Wed Jun 3 21:45:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 480252 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2ACDA1401EF for ; Thu, 4 Jun 2015 07:54:08 +1000 (AEST) Received: from localhost ([::1]:38489 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Gbu-0006Fn-A7 for incoming@patchwork.ozlabs.org; Wed, 03 Jun 2015 17:54:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0GTw-0006fz-Gm for qemu-devel@nongnu.org; Wed, 03 Jun 2015 17:45:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0GTo-0003Ka-C4 for qemu-devel@nongnu.org; Wed, 03 Jun 2015 17:45:52 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52577 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0GTo-0003Jv-6L; Wed, 03 Jun 2015 17:45:44 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 03BF1ADB8; Wed, 3 Jun 2015 21:45:42 +0000 (UTC) From: Alexander Graf To: qemu-ppc@nongnu.org Date: Wed, 3 Jun 2015 23:45:10 +0200 Message-Id: <1433367941-119488-10-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1433367941-119488-1-git-send-email-agraf@suse.de> References: <1433367941-119488-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 Cc: Alexey Kardashevskiy , peter.maydell@linaro.org, qemu-devel@nongnu.org, David Gibson Subject: [Qemu-devel] [PULL 09/40] spapr_pci: Define default DMA window size as a macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Alexey Kardashevskiy This gets rid of a magic constant describing the default DMA window size for an emulated PHB. Signed-off-by: Alexey Kardashevskiy Signed-off-by: David Gibson Signed-off-by: Alexander Graf --- hw/ppc/spapr_pci.c | 6 +++--- include/hw/pci-host/spapr.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index a69d908..312f0d9 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -893,11 +893,11 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp) static void spapr_phb_finish_realize(sPAPRPHBState *sphb, Error **errp) { sPAPRTCETable *tcet; + uint32_t nb_table; + nb_table = SPAPR_PCI_DMA32_SIZE >> SPAPR_TCE_PAGE_SHIFT; tcet = spapr_tce_new_table(DEVICE(sphb), sphb->dma_liobn, - 0, - SPAPR_TCE_PAGE_SHIFT, - 0x40000000 >> SPAPR_TCE_PAGE_SHIFT, false); + 0, SPAPR_TCE_PAGE_SHIFT, nb_table, false); if (!tcet) { error_setg(errp, "Unable to create TCE table for %s", sphb->dtbusname); diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 895d273..d7b521d 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -114,6 +114,8 @@ struct sPAPRPHBVFIOState { #define SPAPR_PCI_MSI_WINDOW 0x40000000000ULL +#define SPAPR_PCI_DMA32_SIZE 0x40000000 + static inline qemu_irq spapr_phb_lsi_qirq(struct sPAPRPHBState *phb, int pin) { return xics_get_qirq(spapr->icp, phb->lsi_table[pin].irq);