public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Daniel Thompson <daniel.thompson@linaro.org>,
	Russell King <linux@arm.linux.org.uk>,
	Nicolas Pitre <nicolas.pitre@linaro.org>,
	linaro-kernel@lists.linaro.org, patches@linaro.org,
	linux-kernel@vger.kernel.org, Rob Clark <robdclark@gmail.com>,
	Arnd Bergmann <arnd.bergmann@linaro.org>
Subject: Re: [PATCH v3] ARM: add get_user() support for 8 byte types
Date: Thu, 12 Jun 2014 19:04:52 +0200	[thread overview]
Message-ID: <4740478.2oOtz84PUv@wuerfel> (raw)
In-Reply-To: <1402587755-29245-1-git-send-email-daniel.thompson@linaro.org>

On Thursday 12 June 2014 16:42:35 Daniel Thompson wrote:
>  #define __get_user_check(x,p)                                                  \
>         ({                                                              \
>                 unsigned long __limit = current_thread_info()->addr_limit - 1; \
>                 register const typeof(*(p)) __user *__p asm("r0") = (p);\
> -               register unsigned long __r2 asm("r2");                  \
> +               register typeof(x) __r2 asm("r2");                      \
>                 register unsigned long __l asm("r1") = __limit;         \
>                 register int __e asm("r0");                             \
>                 switch (sizeof(*(__p))) {                               \
> @@ -142,6 +152,12 @@ extern int __get_user_4(void *);
>                 case 4:                                                 \
>                         __get_user_x(__r2, __p, __e, __l, 4);           \
>                         break;                                          \
> +               case 8:                                                 \
> +                       if (sizeof((x)) < 8)                            \
> +                               __get_user_xb(__r2, __p, __e, __l, 4);  \
> +                       else                                            \
> +                               __get_user_x(__r2, __p, __e, __l, 8);   \
> +                       break;                                          \
>                 default: __e = __get_user_bad(); break;                 \
>                 }                                                       \
>                 x = (typeof(*(p))) __r2;                                \
> 

I don't think there is a way to do this without copying the
__builtin_choose_expr() hack from x86.

	Arnd

  parent reply	other threads:[~2014-06-12 17:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12 15:42 [PATCH v3] ARM: add get_user() support for 8 byte types Daniel Thompson
2014-06-12 15:58 ` Russell King - ARM Linux
2014-06-17 10:17   ` Daniel Thompson
2014-06-17 11:09     ` Russell King - ARM Linux
2014-06-17 13:28       ` Daniel Thompson
2014-06-17 13:36         ` Russell King - ARM Linux
2014-06-17 13:54           ` Daniel Thompson
2014-06-12 17:04 ` Arnd Bergmann [this message]
2014-06-20 10:01 ` [PATCH v4] " Daniel Thompson
2014-07-10 19:47   ` [PATCH 3.16.0-rc3-rmk v5] " Daniel Thompson
2014-08-21  5:36     ` Victor Kamensky

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=4740478.2oOtz84PUv@wuerfel \
    --to=arnd@arndb.de \
    --cc=arnd.bergmann@linaro.org \
    --cc=daniel.thompson@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nicolas.pitre@linaro.org \
    --cc=patches@linaro.org \
    --cc=robdclark@gmail.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