lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081225123004.GA13640@8bytes.org>
Date:	Thu, 25 Dec 2008 13:30:04 +0100
From:	Joerg Roedel <joro@...tes.org>
To:	"Hans J. Koch" <hjk@...utronix.de>
Cc:	Edward Estabrook <edward.estabrook.lkml@...il.com>,
	linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
	gregkh@...e.de, edward.estabrook@...il.com,
	edward_estabrook@...lent.com
Subject: Re: [PATCH 1/1] Userspace I/O (UIO): Add support for userspace DMA (corrected)

On Thu, Dec 11, 2008 at 01:33:41AM +0100, Hans J. Koch wrote:
> On Wed, Dec 03, 2008 at 05:51:30PM -0800, Edward Estabrook wrote:
> > From: Edward Estabrook <Edward_Estabrook@...lent.com>
> > 
> > Here is a patch that adds the ability to dynamically allocate and use
> > coherent DMA
> > from userspace by extending the Userspace IO driver.  This patch applies against
> > 2.6.28-rc6.
> 
> Hi Edward,
> sorry I didn't answer sooner. It was not lack of interest in your work, I
> just had to think about it (and had quite a lot of other work, too).
> I consider your idea of having DMA coherent memory allocatable from userspace
> a valid demand. However, the interface should be implemented differently.
> 
> As a general requirement, all information you need to pass to userspace has
> to go through sysfs. This is a UIO design decision and should not be changed
> lightly. Please don't fill information into the allocated memory.
> 
> We shouldn't mix dynamically allocated DMA regions with the already existing
> static memory mappings. There should be an extra directory, maybe called
> /sys/class/uio/uioN/dyn_dma_mem/ containing information about this kind of
> DMA memory. This directory would not exist by default, it's only created if
> some user actually allocates such memory.
> 
> In the UIO core, these mappings should be handled with a dynamic list, not
> a static array. The number of possible mappings has to be limited to a
> sensible maximum, maybe 50 or 100. The code handling the existing static
> mappings could mostly stay as-is.

I like that idea of a seperate directory in sysfs. How about allocating
DMA memory by creating files in this directory. The memory itself can be
accessed via mmap() and the dma address can be gathered using read().
When a file is closed the dma memory is unmapped.
This would work great as long as /sys/class/uio/uioN/ belongs only to
one physical device.

Joerg

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ