From: "Hans J. Koch" <hjk@hansjkoch.de>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jean-Francois Dagenais <jeff.dagenais@gmail.com>,
"Hans J. Koch" <hjk@hansjkoch.de>, Greg KH <gregkh@suse.de>,
tglx@linutronix.de, linux-pci@vger.kernel.org,
open list <linux-kernel@vger.kernel.org>
Subject: Re: extra large DMA buffer for PCI-E device under UIO
Date: Tue, 22 Nov 2011 18:54:02 +0100 [thread overview]
Message-ID: <20111122175402.GC15508@local> (raw)
In-Reply-To: <20111122173722.GA29068@redhat.com>
On Tue, Nov 22, 2011 at 07:37:23PM +0200, Michael S. Tsirkin wrote:
[...]
> > Or am I better off with a UIO solution?
>
> You should probably write a proper kernel driver, not a UIO one.
> your kernel driver would have to prevent the device fom DMA into memory
> outside the allocated range, even if userspace is malicious.
> That's why UIO is generally not recommended for PCI devices that do DMA.
When UIO was designed, the main goal was the ability to handle interrupts
from userspace. There was no requirement for DMA. In fact, in five years I
didn't get one real world device on my desk that needed it. That doesn't
mean there are no such devices. Adding DMA support to the UIO core was
discussed several times but noone ever did it. Ideas are still welcome...
If parts of the driver should be in userspace, you should really try
to extend the UIO core instead of re-implementing UIO functionality in
a "proper kernel driver".
Thanks,
Hans
next prev parent reply other threads:[~2011-11-22 17:54 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-18 21:16 extra large DMA buffer for PCI-E device under UIO Jean-Francois Dagenais
2011-11-18 22:08 ` Greg KH
2011-11-21 15:31 ` Jean-Francois Dagenais
2011-11-21 17:36 ` Greg KH
2011-11-21 18:17 ` Hans J. Koch
[not found] ` <4A52B447-8E21-43F6-A38E-711E36F89A34@gmail.com>
2011-11-21 19:29 ` Hans J. Koch
2011-11-22 15:24 ` Jean-Francois Dagenais
2011-11-22 15:35 ` Michael S. Tsirkin
2011-11-22 16:54 ` Jean-Francois Dagenais
2011-11-22 17:27 ` Matthew Wilcox
2011-11-22 17:40 ` Michael S. Tsirkin
2011-11-22 17:37 ` Michael S. Tsirkin
2011-11-22 17:54 ` Hans J. Koch [this message]
2011-11-22 18:40 ` Michael S. Tsirkin
2011-11-22 18:52 ` Hans J. Koch
2011-11-22 19:50 ` Jean-Francois Dagenais
2011-11-23 8:20 ` Michael S. Tsirkin
2011-11-22 16:05 ` Hans J. Koch
2011-11-22 19:57 ` Jean-Francois Dagenais
2013-01-23 2:00 ` Jean-François Dagenais
2011-11-18 22:27 ` Hans J. Koch
2011-11-21 15:10 ` Jean-Francois Dagenais
2011-11-21 15:47 ` Rolf Eike Beer
2011-11-21 16:01 ` Jean-Francois Dagenais
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=20111122175402.GC15508@local \
--to=hjk@hansjkoch.de \
--cc=gregkh@suse.de \
--cc=jeff.dagenais@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mst@redhat.com \
--cc=tglx@linutronix.de \
/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