public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nickolay V. Shmyrev" <nshmyrev@yandex.ru>
To: Matti Aarnio <matti.aarnio@zmailer.org>
Cc: Linux and Kernel Video <video4linux-list@redhat.com>,
	Junichi Uekawa <dancer@netfort.gr.jp>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	Michael Krufky <mkrufky@m1k.net>,
	linux-kernel@vger.kernel.org, debian-amd64@lists.debian.org
Subject: Re: [x86_64] 2.6.14-git13 mplayer fails with "v4l2: ioctl queue buffer failed: Bad address" (2 Nov 2005, 11 Nov 2005)
Date: Wed, 16 Nov 2005 15:50:54 +0300	[thread overview]
Message-ID: <1132145454.12638.8.camel@t94> (raw)
In-Reply-To: <20051113025417.GN5706@mea-ext.zmailer.org>

В Вск, 13/11/2005 в 04:54 +0200, Matti Aarnio пишет:
> On Sun, Nov 13, 2005 at 01:22:51AM +0300, Nickolay V. Shmyrev wrote:
> > Hello all.
> > 
> > We have even found the hack that fix that problem:
> 
> A hack, but working one..
> (for the small while that I tested it)
> 
> > Index: linux/drivers/media/video/video-buf.c
> > ===================================================================
> > RCS file: /cvs/video4linux/v4l-kernel/linux/drivers/media/video/video-buf.c,v
> > retrieving revision 1.21
> > diff -u -p -r1.21 video-buf.c
> > --- linux/drivers/media/video/video-buf.c       16 Oct 2005 12:13:58 -0000
> > +++ linux/drivers/media/video/video-buf.c       12 Nov 2005 22:19:13 -0000
> > @@ -1248,7 +1248,7 @@ int videobuf_mmap_mapper(struct videobuf
> >         map->end      = vma->vm_end;
> >         map->q        = q;
> >         vma->vm_ops   = &videobuf_vm_ops;
> > -       vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED;
> > +       vma->vm_flags |= VM_DONTEXPAND;
> >         vma->vm_flags &= ~VM_IO; /* using shared anonymous pages */
> >         vma->vm_private_data = map;
> >         dprintk(1,"mmap %p: q=%p %08lx-%08lx pgoff %08lx bufs %d-%d\n",
> > 
> > Somehow since 2.6.15-rc1 VM_RESERVED makes get_user_pages return EFAULT.
> > I don't know the exact reason of that behavior and the correct way to fix
> > that problem. Just kernel interfaces changed once again, the old
> > point everyone knows. So if someone can explain it, that would be helpful.
> 
> This EFAULT rejection is due to change in  get_user_pages()  function
> in mm/memory.c  file of  2.6.14-git2
> 
> 
> @@ -945,8 +947,8 @@ int get_user_pages(struct task_struct *t
>                         continue;
>                 }
>  
> -               if (!vma || (vma->vm_flags & VM_IO)
> -                               || !(flags & vma->vm_flags))
> +               if (!vma || (vma->vm_flags & (VM_IO | VM_RESERVED))
> +                               || !(vm_flags & vma->vm_flags))
>                         return i ? : -EFAULT;
>  
>                 if (is_vm_hugetlb_page(vma)) {
> 
> 
> I don't know how to use git tools to see, whose patch actually
> did this particular change.
> 
> 
> /Matti Aarnio


It's sad, but I still don't understand the way it should be fixed.
Removal of VM_RESERVED is certainly not a solution, since we don't going
to swap mmaped pages and VM_RESERVED is used in other drivers (for
example, some sound drivers)

So, we need to find the problem itself. After looking at the code I've
found that the x86_64 dependency of that problem lies in the check in
memory.c:get_user_pages

if (vma && in_gate_area (task, start))

x86_64 defines it's own arch-dependant function in_gate_area which fails
in our case. Can someone trace that code and find why do we fail and
fail only on x86_64. It would be nice if someone could point me to
get_user_pages documentation, why it's so differently behaves for 64 bit
arch.

Also it seems that I had traces of video-buf module with debug enabled
on 64 bit, but lost them. Can someone just enable debug option to video-
buf module and collect those traces.




  parent reply	other threads:[~2005-11-16 12:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-03  4:26 mencoder fails with Linux kernel from linus's git tree (2 Nov 2005) Junichi Uekawa
2005-11-10 21:40 ` [x86_64] 2.6.14-git13 mplayer fails with "v4l2: ioctl queue buffer failed: Bad address" (2 Nov 2005, 11 " Junichi Uekawa
2005-11-10 22:58   ` Mike Krufky
2005-11-11  0:05     ` Junichi Uekawa
2005-11-11  3:24       ` Michael Krufky
2005-11-11 12:06         ` Junichi Uekawa
2005-11-11 13:11           ` Michael Krufky
2005-11-11 13:29           ` Junichi Uekawa
2005-11-11 14:06             ` Hugh Dickins
2005-11-12 22:22               ` Nickolay V. Shmyrev
2005-11-13  2:54                 ` Matti Aarnio
2005-11-13  4:24                   ` Junichi Uekawa
2005-11-16 12:50                   ` Nickolay V. Shmyrev [this message]
2005-11-16 17:47                     ` Hugh Dickins
2005-12-01  0:09                       ` Junichi Uekawa
2005-11-17  0:07                 ` Junichi Uekawa
2005-11-11 14:21             ` Junichi Uekawa
2005-11-12 21:11               ` Ricardo Cerqueira
     [not found]   ` <87mzj4uoys.dancerj%dancer@netfort.gr.jp>
2005-12-19 23:10     ` [x86_64] linux 2.6.15-rc6 mplayer fails to record ALSA audio Junichi Uekawa
2006-01-14  7:33       ` Junichi Uekawa
2006-01-19 23:11         ` [x86_64] bttv: linux 2.6.16-rc1 mplayer fails to record ALSA audio and fails tune TV Junichi Uekawa
2006-02-02  9:13           ` Junichi Uekawa
2006-02-02 13:53             ` Manu Abraham
2006-02-02 23:04               ` Junichi Uekawa

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=1132145454.12638.8.camel@t94 \
    --to=nshmyrev@yandex.ru \
    --cc=dancer@netfort.gr.jp \
    --cc=debian-amd64@lists.debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matti.aarnio@zmailer.org \
    --cc=mkrufky@m1k.net \
    --cc=nickpiggin@yahoo.com.au \
    --cc=video4linux-list@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox