All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: "Dugger, Donald D" <donald.d.dugger@intel.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: "Ronciak, John" <john.ronciak@intel.com>,
	"Szwed, Maciej" <maciej.szwed@intel.com>
Subject: Re: Problem with MMAP on Xen kernel
Date: Fri, 16 Jan 2015 18:44:54 +0000	[thread overview]
Message-ID: <54B95C26.8020805@citrix.com> (raw)
In-Reply-To: <6AF484C0160C61439DE06F17668F3BCB5348719C@ORSMSX114.amr.corp.intel.com>

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’t work for xen kernels (but it doesn’t
> 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

  reply	other threads:[~2015-01-16 18:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-16 18:24 Problem with MMAP on Xen kernel Dugger, Donald D
2015-01-16 18:44 ` David Vrabel [this message]
2015-01-20 13:49   ` Szwed, Maciej
2015-01-21 14:38   ` Szwed, Maciej
2015-01-21 14:44     ` David Vrabel
2015-01-21 14:54       ` David Vrabel

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=54B95C26.8020805@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=donald.d.dugger@intel.com \
    --cc=john.ronciak@intel.com \
    --cc=maciej.szwed@intel.com \
    --cc=xen-devel@lists.xen.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.