Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4210864imm; Mon, 20 Aug 2018 11:43:12 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxJU/LxE1T4hgvPSiYSdeb3vNeOqYc6HnTxqFxGoaqVUnAdZWY/oRDRR47Y7epSMmJS28Vn X-Received: by 2002:a63:2b82:: with SMTP id r124-v6mr1076431pgr.159.1534790592302; Mon, 20 Aug 2018 11:43:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534790592; cv=none; d=google.com; s=arc-20160816; b=sveKTLqdx9w7/6fXC6aAB24rVYeh4fpt/oQrxLOgKJwZ2UCCJ1upmpwV96oQPsn3MN p2B7HAJ6K35y6NhF3ycOl+JANZS+n/V6BVcN6L6sVN6zAzQd1Xpheq9zLBUcw2H3QU5T q8qanLQDmG4F0+xzpaPPIuQ+q21ui/udeNOLAWugJePL6hgomUtPAn3jsp2ji8M+RD1s sG3jQlUqtEsYJzMhkMPN3lrnvqAA23ubZVnmA3xNBFTpXuYhKjqK519R5PTrhLvbWsH3 aNUuWg7Z765KF9cxdc82enB19g/MUc1L2UTE3hHKWiPpjjfEJpWEq2KxOwU4pK6mL3/p zCqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :mime-version:dkim-signature:arc-authentication-results; bh=Tyuo+FMJvyv4hlhTB1k3iGZPSUOzaSKhIjmGYY/7QYs=; b=xq+8KrisTwKIQO2qyO+6noRwFFlmMUFqnBI6YEuHd7F6EsvYYrDpD7I8oGdI6OmXiY okHI4KnON2xEfjt7DSUdOpeOqylrehzgNfThVngr6Akvrm7oQhGnimw7JAj2oXlldRIN p3yKzaU4KWB2pxWbmtVr6+5FVhaRtU9tkc963ysA7VjNBlwS6FEYpBgHjxGVpkgiislB OjtT24Xl8l7pk5zzHwT82kLtuzU0z6dcuk0qix8T2+d2y2MmTVOEbUuFGXPHA5iLi9p4 1HhQmWxcm0NTvjMtb7XrtKbX2GScrILw4I9H+gqcdX6gXoiFYjniepNV+vImYb23J7+Q hrIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alexfeinman-com.20150623.gappssmtp.com header.s=20150623 header.b=u5ry6XBW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a12-v6si8907424pgv.680.2018.08.20.11.42.56; Mon, 20 Aug 2018 11:43:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@alexfeinman-com.20150623.gappssmtp.com header.s=20150623 header.b=u5ry6XBW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726499AbeHTV6E (ORCPT + 99 others); Mon, 20 Aug 2018 17:58:04 -0400 Received: from mail-yw1-f50.google.com ([209.85.161.50]:33269 "EHLO mail-yw1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbeHTV6E (ORCPT ); Mon, 20 Aug 2018 17:58:04 -0400 Received: by mail-yw1-f50.google.com with SMTP id x67-v6so2120155ywg.0 for ; Mon, 20 Aug 2018 11:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alexfeinman-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=Tyuo+FMJvyv4hlhTB1k3iGZPSUOzaSKhIjmGYY/7QYs=; b=u5ry6XBWikHT+ULEG6da4NCRsowNJhRfRbTrIe8HhGVz6cG3M2AfAyIJs1L2uw6Z5M +OmBpqiAR7OcTPa1IeWMy3cLaTze88h5zM81r+zKPyIjNas693z3QOvCmxbWDSyz2hyn VbGehj9epQ0+8Bs7UmfDmP/JzrAglByI9K5WkifFo/LB16y2xV3t5MorqbwSui4D9zQN JvDtJNM/3e4z09Ba64mSPHUtbgkrtOS6za+5xYJS06sEI4tzQWftQ+prgsK3eUO5hpRy o8VIT8m2I6+d9PgjKK1+JvuH5uxcB8hPzlJbbVSTR5YgG+VKBTzKLy7PbtPCrVX01lYI bMDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Tyuo+FMJvyv4hlhTB1k3iGZPSUOzaSKhIjmGYY/7QYs=; b=Pea5p5qHz6ossKBUvbMSbh2kjFFCXDvn0+C3Iyl2XnojQmP3a13FD2rFKNvnjGt6gh EO8Y2ZF/7tiviMpknQeemFRtjxKUh3GxohWDVxp5BwFlSfD2pWma5mdWIE9vAjv6o+5q O65vBDBiM0YSnDtpU/PKMeV8pdR6Ct8ODZ6BRe6uSBi9CGhNQU1pSxxa+sQHaFnDj3uS PRjmJPN7SKd3aN9CeP5wQjCwHPfuXuUH19W4069ih1fx4J6PrD6JsvK6us/J3zBoCzex R0rxtDSaRychKJcBY7BfvCoS7y3Dv+HuxDmCWsZoIsqmdUpgPhSa4nXGXDcSWoWpyI0d iSAw== X-Gm-Message-State: AOUpUlHtpapjiyLYF785AG5Nde5lAgUQFTyIe/9wladzqBjGDpZbSRNN pIggrcJe/k954o03G3QXq4FeCYltPoVRCAPtA/DZWdfj X-Received: by 2002:a0d:e044:: with SMTP id j65-v6mr25938971ywe.202.1534790478531; Mon, 20 Aug 2018 11:41:18 -0700 (PDT) MIME-Version: 1.0 From: Alex Feinman Date: Mon, 20 Aug 2018 11:41:07 -0700 Message-ID: Subject: To: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Good morning. I have a custom PCI device that needs to fill memory buffers of up to 16MB in size. For various reasons I would like to avoid implementing scatter-gather support in the device and would much rather prefer a contiguous buffer view instead. The buffers are allocated using dma_alloc_coherent or dma_alloc_attrs (as I don't necessarily need coherent access) This is on a custom Skylake/Kaby Lake platform It is my understanding (possibly incorrect) that a) The contiguous memory space available to subsystems like videobuf2-dma-contig is limited and I won't be likely to be able tp allocate say 4 16MB contiguous buffers reliably b) IOMMU can solve this problem for me by providing a device-specific contiguous view of a fragmented physical memory allocation c) In order to enable IOMMU do the above, I need to allocate DRHDs and DMARs in BIOS initialization (I build my own BIOS) Please, let me know if I am on the right track? Of course I realize that implementing SGDMA would be the best option, but short of that and blocking out some physical memory on boot, what are my options? Are there any pointers of how exactly achieve this (implementation I could peruse, articles and whatnot)? Best regards Alex Feinman