From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: Problem with MMAP on Xen kernel Date: Fri, 16 Jan 2015 18:44:54 +0000 Message-ID: <54B95C26.8020805@citrix.com> References: <6AF484C0160C61439DE06F17668F3BCB5348719C@ORSMSX114.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <6AF484C0160C61439DE06F17668F3BCB5348719C@ORSMSX114.amr.corp.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Dugger, Donald D" , "xen-devel@lists.xen.org" Cc: "Ronciak, John" , "Szwed, Maciej" List-Id: xen-devel@lists.xenproject.org On 16/01/15 18:24, Dugger, Donald D wrote: > One of our engineers, Maciek, is working on a driver and stumbled upon > what looks like a bug in the Xen kernel. The report I got was: > = > = > = > We recently started to provide mmap functionality in our driver for > Linux. Function for this: > = > = > = > /int/ > = > /NalMmap(/ > = > / struct file* File,/ > = > / struct vm_area_struct* Vma/ > = > / )/ > = > /{/ > = > / if(remap_pfn_range(Vma,/ > = > / Vma->vm_start,/ > = > / Vma->vm_pgoff,/ > = > / Vma->vm_end - Vma->vm_start,/ > = > / Vma->vm_page_prot))/ > = > / {/ > = > / return -EAGAIN;/ > = > / }/ > = > / / > = > / return 0;/ > = > /}/ > = > = > = > We discovered that this doesn=92t work for xen kernels (but it doesn=92t > return any error, just does not map). I found that it is suggested to > use io_remap_pfn_range instead of remap_pfn_range. After switching > function everything still works on standard kernel, but on xen this time > it returns error. Not a lot to go on here. What kernel version? What PFNs are you trying to map (RAM? MMIO?) What error do you get? Can you provide a minimal driver that shows the problem? David