From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: Kernel Oops when reading kernel_page_tables debugfs file Date: Tue, 30 Nov 2010 10:04:21 -0500 Message-ID: <20101130150421.GA3817@dumpdata.com> References: <20101129152025.GA19646@dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Vivien Bernet-Rollande Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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 > wrote: > > On Wed, Nov 24, 2010 at 05:07:49PM +0100, Vivien Bernet-Rollande wrot= e: > >> Hi list. > >> I'm =A0currently 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? > > >=20 > 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 |=3D VM_IO | VM_RESERVED | VM_PFNMAP; >=20 > 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 =3D 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. >=20 > 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.