Re: /dev/kmem BUG on mmap

2012-07-30 Thread Hugh Dickins
On Mon, 30 Jul 2012, Johannes Weiner wrote: > On Mon, Jul 30, 2012 at 12:28:35AM +0200, Sasha Levin wrote: > > Hi all, > > > > I was poking around /dev/kmem related code, and noticed the following in > > mmap_kmem(): > > > > /* Turn a kernel-virtual address into a physical page frame */

Re: /dev/kmem BUG on mmap

2012-07-30 Thread Johannes Weiner
On Mon, Jul 30, 2012 at 12:28:35AM +0200, Sasha Levin wrote: > Hi all, > > I was poking around /dev/kmem related code, and noticed the following in > mmap_kmem(): > > /* Turn a kernel-virtual address into a physical page frame */ > pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >>

Re: /dev/kmem BUG on mmap

2012-07-30 Thread Johannes Weiner
On Mon, Jul 30, 2012 at 12:28:35AM +0200, Sasha Levin wrote: Hi all, I was poking around /dev/kmem related code, and noticed the following in mmap_kmem(): /* Turn a kernel-virtual address into a physical page frame */ pfn = __pa((u64)vma-vm_pgoff PAGE_SHIFT) PAGE_SHIFT;

Re: /dev/kmem BUG on mmap

2012-07-30 Thread Hugh Dickins
On Mon, 30 Jul 2012, Johannes Weiner wrote: On Mon, Jul 30, 2012 at 12:28:35AM +0200, Sasha Levin wrote: Hi all, I was poking around /dev/kmem related code, and noticed the following in mmap_kmem(): /* Turn a kernel-virtual address into a physical page frame */

/dev/kmem BUG on mmap

2012-07-29 Thread Sasha Levin
Hi all, I was poking around /dev/kmem related code, and noticed the following in mmap_kmem(): /* Turn a kernel-virtual address into a physical page frame */ pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT; Which looked odd since vm_pgoff is the offset into the

/dev/kmem BUG on mmap

2012-07-29 Thread Sasha Levin
Hi all, I was poking around /dev/kmem related code, and noticed the following in mmap_kmem(): /* Turn a kernel-virtual address into a physical page frame */ pfn = __pa((u64)vma-vm_pgoff PAGE_SHIFT) PAGE_SHIFT; Which looked odd since vm_pgoff is the offset into the mapping, so