All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] DMA userspace access
@ 2016-02-04 15:28 Michael Smith
  2016-02-05 12:53 ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Smith @ 2016-02-04 15:28 UTC (permalink / raw)
  To: Xenomai@xenomai.org

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.

Thanks.
Michael


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Xenomai] DMA userspace access
  2016-02-04 15:28 [Xenomai] DMA userspace access Michael Smith
@ 2016-02-05 12:53 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2016-02-05 12:53 UTC (permalink / raw)
  To: Michael Smith, Xenomai@xenomai.org

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-05 12:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-04 15:28 [Xenomai] DMA userspace access Michael Smith
2016-02-05 12:53 ` Jan Kiszka

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.