From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: David Miller <davem@davemloft.net>
Cc: airlied@linux.ie, dri-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: Only use DRM_IOCTL_UPDATE_DRAW compat wrapper for compat X86.
Date: Thu, 19 Feb 2009 08:59:50 +1100 [thread overview]
Message-ID: <1234994390.14060.463.camel@pasglop> (raw)
In-Reply-To: <20090218.013521.97380943.davem@davemloft.net>
On Wed, 2009-02-18 at 01:35 -0800, David Miller wrote:
> Ben, I'm pretty sure you're hitting this too on powerpc. Every time a
> 32-bit process tries to upload cliprects it's going to fail with
> -EFAULT or similar.
Heh, quite possibly
Could that be related to the kernel spewing a bunch of
[drm:drm_update_drawable_info] *ERROR* Failed to copy cliprects from userspace
?
I've seen that yesterday on the Bimini, was planning to dig today until
I got stuck home with a cold...
> Nothing in userspace checks the return value for errors, etc. :-/
Surprise !
> The only reason I caught this is because I have a debugging check on
> sparc64 that makes sure that faults on kernel accesses to 32-bit
> userspace never have any of the high 32-bits set.
That's a nice trick, I might do something similar on power..
Cheers,
Ben.
> --------------------
>
> drm: Only use DRM_IOCTL_UPDATE_DRAW compat wrapper for compat X86.
>
> Only X86 32-bit uses a different alignment for "unsigned long long"
> than it's 64-bit counterpart.
>
> Therefore this compat translation is only correct, and only needed,
> when either CONFIG_X86 or CONFIG_IA64.
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
> drivers/gpu/drm/drm_ioc32.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
> index 920b72f..282d9fd 100644
> --- a/drivers/gpu/drm/drm_ioc32.c
> +++ b/drivers/gpu/drm/drm_ioc32.c
> @@ -954,6 +954,7 @@ static int compat_drm_sg_free(struct file *file, unsigned int cmd,
> DRM_IOCTL_SG_FREE, (unsigned long)request);
> }
>
> +#if defined(CONFIG_X86) || defined(CONFIG_IA64)
> typedef struct drm_update_draw32 {
> drm_drawable_t handle;
> unsigned int type;
> @@ -984,6 +985,7 @@ static int compat_drm_update_draw(struct file *file, unsigned int cmd,
> DRM_IOCTL_UPDATE_DRAW, (unsigned long)request);
> return err;
> }
> +#endif
>
> struct drm_wait_vblank_request32 {
> enum drm_vblank_seq_type type;
> @@ -1066,7 +1068,9 @@ drm_ioctl_compat_t *drm_compat_ioctls[] = {
> #endif
> [DRM_IOCTL_NR(DRM_IOCTL_SG_ALLOC32)] = compat_drm_sg_alloc,
> [DRM_IOCTL_NR(DRM_IOCTL_SG_FREE32)] = compat_drm_sg_free,
> +#if defined(CONFIG_X86) || defined(CONFIG_IA64)
> [DRM_IOCTL_NR(DRM_IOCTL_UPDATE_DRAW32)] = compat_drm_update_draw,
> +#endif
> [DRM_IOCTL_NR(DRM_IOCTL_WAIT_VBLANK32)] = compat_drm_wait_vblank,
> };
>
next prev parent reply other threads:[~2009-02-18 22:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-18 9:35 [PATCH] drm: Only use DRM_IOCTL_UPDATE_DRAW compat wrapper for compat X86 David Miller
2009-02-18 21:59 ` Benjamin Herrenschmidt [this message]
2009-02-18 22:05 ` David Miller
2009-02-19 14:19 ` Arnd Bergmann
2009-02-20 8:52 ` David Miller
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=1234994390.14060.463.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=airlied@linux.ie \
--cc=davem@davemloft.net \
--cc=dri-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/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