linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
To: Alex Feinman <alex@alexfeinman.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Contiguous DMA buffer view for a custom device (Intel/x86)
Date: Mon, 20 Aug 2018 21:58:04 +0100	[thread overview]
Message-ID: <20180820215804.67c78e3d@alans-desktop> (raw)
In-Reply-To: <CAGXJtFFjVTqYraM0OFipYnNbdLt_BojP5U8WhJETLgw4XWehGQ@mail.gmail.com>

> 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)

Yes. The EDK2 firmware toolkit has all the bits you need in it I think.

https://firmware.intel.com/sites/default/files/Intel_WhitePaper_Using_IOMMU_for_DMA_Protection_in_UEFI.pdf

isn't quite on the topic you want but it does explain it fairly well in
passing.

https://software.intel.com/en-us/blogs/2009/03/02/intels-virtualization-for-directed-io-aka-iommu-part-1

is a bit out of date but may help too.

> 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?

If performance is absolutely critical simply stealing a chunk of memory
in the firmware and describing it your device some other way is ugly, but
for a custom solution I guess anything goes 8)

Alan

  reply	other threads:[~2018-08-20 20:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20 20:39 Contiguous DMA buffer view for a custom device (Intel/x86) Alex Feinman
2018-08-20 20:58 ` Alan Cox [this message]
2018-08-21 23:50   ` Alex Feinman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180820215804.67c78e3d@alans-desktop \
    --to=gnomes@lxorguk.ukuu.org.uk \
    --cc=alex@alexfeinman.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).