From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9Ub7-0001nZ-Bm for qemu-devel@nongnu.org; Mon, 08 Oct 2018 08:25:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9Ub6-0001Ra-KI for qemu-devel@nongnu.org; Mon, 08 Oct 2018 08:25:17 -0400 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:38287) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g9Ub2-0001Oi-U1 for qemu-devel@nongnu.org; Mon, 08 Oct 2018 08:25:14 -0400 Received: by mail-oi1-x244.google.com with SMTP id u197-v6so15593853oif.5 for ; Mon, 08 Oct 2018 05:25:12 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1538579266-8389-7-git-send-email-edgar.iglesias@gmail.com> References: <1538579266-8389-1-git-send-email-edgar.iglesias@gmail.com> <1538579266-8389-7-git-send-email-edgar.iglesias@gmail.com> From: Peter Maydell Date: Mon, 8 Oct 2018 13:24:51 +0100 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] [PATCH v1 06/12] net: cadence_gem: Add support for selecting the DMA MemoryRegion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: QEMU Developers , qemu-arm , Richard Henderson , KONRAD Frederic , Alistair Francis , Francisco Iglesias , figlesia@xilinx.com, Stefano Stabellini , Sai Pavan Boddu , Edgar Iglesias On 3 October 2018 at 16:07, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Add support for selecting the Memory Region that the GEM > will do DMA to. > > Signed-off-by: Edgar E. Iglesias > --- > @@ -1500,6 +1506,13 @@ static void gem_realize(DeviceState *dev, Error **errp) > CadenceGEMState *s = CADENCE_GEM(dev); > int i; > > + if (s->dma_mr) { > + s->dma_as = g_malloc0(sizeof(AddressSpace)); > + address_space_init(s->dma_as, s->dma_mr, NULL); Why not just have the CadenceGEMState embed the AddressSpace AddressSpace dma_as; rather than doing a separate memory allocation here? > + } else { > + s->dma_as = &address_space_memory; > + } thanks -- PMM