From: Jan Kiszka <jan.kiszka@siemens.com>
To: Michael Smith <2michael.smith@gmail.com>,
"Xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] DMA userspace access
Date: Fri, 5 Feb 2016 13:53:39 +0100 [thread overview]
Message-ID: <56B49B53.10601@siemens.com> (raw)
In-Reply-To: <CANWkrROZXVOO1nSV0yJtky9H5XefA6Jqs8fC5bxGn3Zo5miv7Q@mail.gmail.com>
On 2016-02-04 16:28, Michael Smith wrote:
> Hi guys.
> I am currently converting an existing Linux driver to RTDM.
> I came across a read() file operations function where the author uses
> the function
> get_user_pages() to get a pointer to userspace memory do to a direct
> DMA transfer operation to it.
> I don't see any equivalent functionality in the RTDM API, so I just
> wanted to check if
> I'm not missing something.
> There are various RTDM functions to map IO & kernel memory to
> userspace but not to
> aquire and lock userspace pages in order to do a transfer to it like
> with this function.
>
> It seems that the only solution in this case is to keep the code as it
> is and to call it
> in the secondary domain instead of the primary.
> Please let me know if there is an alternative way to do this from the
> primary domain.
I didn't try yet, but it may work: vfio provides clean forwarding of
DMA-performing PCI and also AMBA platform devices to userspace. E.g.,
DPDK uses this to implement NIC drivers in userspace. Prerequisite:
Linux-supported IOMMU (SMMU on ARM).
However, you will still need RTDM for handling/forwarding interrupts
unless you plan for polling. And there we are in conflict with vfio
taking over the device. Probably, we need some extension of vfio here.
That said, there would still be the option to introduce a more or less
hacky "get my userspace page's phys address" call to udd.
Jan
--
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux
prev parent reply other threads:[~2016-02-05 12:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-04 15:28 [Xenomai] DMA userspace access Michael Smith
2016-02-05 12:53 ` Jan Kiszka [this message]
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=56B49B53.10601@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=2michael.smith@gmail.com \
--cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.