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] Kernel Oops when reading kernel_page_tables debugfs file

To: Vivien Bernet-Rollande <vbernetr@xxxxxxxxx>
Subject: Re: [Xen-devel] Kernel Oops when reading kernel_page_tables debugfs file
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Tue, 30 Nov 2010 10:04:21 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 30 Nov 2010 07:05:35 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AANLkTikjs2yzMii6vo1fmv7joA+uyG==nBO7L725Nh3E@xxxxxxxxxxxxxx>
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: <AANLkTik_vGN8EkXFCpb1HuE-7m436Kxsbk5aT49LkMFc@xxxxxxxxxxxxxx> <20101129152025.GA19646@xxxxxxxxxxxx> <AANLkTikjs2yzMii6vo1fmv7joA+uyG==nBO7L725Nh3E@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
On Tue, Nov 30, 2010 at 10:34:07AM +0100, Vivien Bernet-Rollande wrote:
> On Mon, Nov 29, 2010 at 4:20 PM, Konrad Rzeszutek Wilk
> <konrad.wilk@xxxxxxxxxx> wrote:
> > On Wed, Nov 24, 2010 at 05:07:49PM +0100, Vivien Bernet-Rollande wrote:
> >> Hi list.
> >> I'm  currently trying to get a device driver to work on Xen dom0. The 
> >> driver
> >> maps PCI space to userland, and for some reason I have yet to figure, it
> >> doesn't work.
> >
> > Did you set VM_IO on your mapping?
> >
> 
> The driver doesn't set the VM_IO flag itself. However, it calls
> io_remap_pfn_range(), which is a macro wrapper around
> remap_pfn_range(). The later does :
> vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
> 
> So the VM_IO flag is set. I actually corrected the bug by adding the
> _PAGE_IOMAP flag in the vma->vm_pgprot.

Ah, there is a macro for that: vm_get_page_prot, as so:

vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);

And under Xen the vm_get_page_prot will set _PAGE_IOMAP if it detects VM_IO 
flag.
> 
> Shouldn't remap_pfn_range() set that flag if VM_IO is set ?

Nope. You need to use the above mentioned macro to do it.

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

<Prev in Thread] Current Thread [Next in Thread>