From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: Contiguous DMAble memory in Dom0 user space linux process Date: Wed, 20 Jan 2010 16:42:10 -0500 Message-ID: <20100120214210.GA13823@phenom.dumpdata.com> References: <20100113213153.GA10553@phenom.dumpdata.com> <494534.34716.qm@web50606.mail.re2.yahoo.com> <20100115165917.GC11986@phenom.dumpdata.com> <709670.16467.qm@web50604.mail.re2.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <709670.16467.qm@web50604.mail.re2.yahoo.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Kashmira. K." Cc: winterfi@cisco.com, xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Wed, Jan 20, 2010 at 01:10:24PM -0800, Kashmira. K. wrote: > Hi Konard, > > Thanks you for your reply. > > On the (non xen) linux system, the hardware was visible to the userspace app. The PCI bars were mapped. So I do need to get the same functionality on xen capable linux. > > I'm still a newbie to the xen internals, but I was wondering if I could write a simple linux kernel driver for a xen capable linux to do the following > - Map the PCI address (BAR). > - Get contiguous memory. > - Provide user space ioctl call to get the mapped PCI BAR > - Provide user space ioctl to get pointer to the contiguous memory. > > Will that work? Sure. I would recommend you look at the 3w-xxxx.c driver for a simple ioctl subsystem and how to get contiguous memory mapped in. For mmap functionality hpet.c is pretty simple. Foremost, make sure you get a PDF copy of "Understanding the Linux Kernel" as that will answer a lot of your questions.