WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Contiguous DMAble memory in Dom0 user space linux proces

To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: Re: [Xen-devel] Contiguous DMAble memory in Dom0 user space linux process
From: "Kashmira. K." <chimnee@xxxxxxxxx>
Date: Wed, 20 Jan 2010 13:10:24 -0800 (PST)
Cc: winterfi@xxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 20 Jan 2010 13:12:10 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1264021824; bh=evM3DbtL1EgvPZdJsHU+tmchd0Ah60BtSD5e6KP9gWM=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=LN3Ipae8fVfMjj5INDFajAMta6er66SR/E5g7wEvuyTaUJyt+daCYwIzrkBGd2CQ4SfsfxlfDAy8cBFqAfAC2vLMpVDKqshtcot9GoYrLU2hfBErHVrnR7AZW437JXNtDcRdVdCnMnF7Fi2SzjVI+7Swaf2tJBhemzEuMHKRhCE=
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=5q7P3f+w5PwRwIn1wwe3xM7w5+hLwvLkQ15WcH6yEYILehjjMyYKFpgl4qSsRSv6j0t+eMmsYtmqvVXFZb9V135e/ppAVFAWS2Hr2H67lXZWBlAu5SS6wtrqfjFXMRjExtzScWSoCsMvWaYB0k0+kgT44nyttUZLFLlh+mYHtrQ=;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100115165917.GC11986@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20100113213153.GA10553@xxxxxxxxxxxxxxxxxxx> <494534.34716.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20100115165917.GC11986@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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?

Thanks
Kashmira
----- Original Message ----

From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
To: Kashmira. K. <chimnee@xxxxxxxxx>
Cc: winterfi@xxxxxxxxx; xen-devel@xxxxxxxxxxxxxxxxxxx
Sent: Fri, January 15, 2010 8:59:17 AM
Subject: Re: [Xen-devel] Contiguous DMAble memory in Dom0 user space linux 
process

> Actually I'm not trying to communicate with a driver. The user space 
> application is kind of a driver that lives outside of the kernel and 
> communicates with the device directly. 

OK, but isn't the hardware visible via the PCI bus? Does it have any
PCI BARs defined?

> On a linux system (non xen) the bigphysarea patch was used to get large 
> contiguous DMA memory in  user space. 
> I am trying to do the equivalant on Xen capable linux in Dom0 so the same 
> application will work. Kind of port it from 'linux' to 'Xen capable linux'.

Oh boy. I think you have two options:

1) Play with stubdomains. They are based on Mini-OS and
   allow you to create applications + MiniOS (that runs under Xen).
   An example of this is the QEMU stubdomain.

   You can modify your MiniOS to get you virtual addresses that are
   mapped directly to contingous memory areas.

2). Look at fbmem.c and write a device driver that allows the userspace
   application to mmap the driver (similar to fb_mem), which in turn sets
   up a vmalloc-ed area that is physically contigous (by using the
   xen_create_contiguous_region function to exchange PFNs).


      

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel