[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Kernel Oops when reading kernel_page_tables debugfs file



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.