On Wed, 2008-10-22 at 09:39 +0200, Michel Dänzer wrote:
> On Tue, 2008-10-21 at 12:07 -0700, Eric Anholt wrote:
> > This fixes vblank support for a 32-bit X Server on a 64-bit kernel.
> 
> Thanks for tackling this, mea culpa for not testing it with 32 on 64 in
> the first place.
> 
> 
> > +   if (!access_ok(VERIFY_WRITE, request, sizeof(*request)) ||
> > +       __put_user(update32.handle, &request->handle) ||
> > +       __put_user(update32.type, &request->type) ||
> > +       __put_user(update32.num, &request->num) ||
> > +       copy_in_user(&request->data, &update32.data, sizeof(request->data)))
> > +           return -EFAULT;
> 
> AFAICT from the existing DRM 32 bit compatibility handlers, this could
> use __put_user() for the data member as well as possibly a single
> (__)copy_in_user() for all the members with identical layout in both
> cases.

I thought __put_user was a 32-bit function, and not the magic that it
actually is.  I'll use __put_user there.

I don't want to do a pair of copy_in_users, as I'd rather see the
information on how the strucutre is actually laid out in one place
rather than two.

Ideally we change drm_ioc32 handling to have the individual handlers
operate on memory in kernel space and call the native functions directly
instead of dispatching to the native ioctl handler.  Gets rid of
userspace allocations, __put_users, and all of that mess, and would
leave us with just a series of handlers that only move members between
formats.  And then it's up to my compiler to notice that I'm doing a
long series of 32-bit copies and do something sensible. (though if
you've got any ioc32 in a performance path, you should add a new
interface that doesn't need ioc32 handling anyway)

-- 
Eric Anholt
[EMAIL PROTECTED]                         [EMAIL PROTECTED]


Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to