From: Andrew Jones <ajones@ventanamicro.com>
To: Tong Tiangen <tongtiangen@huawei.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Palmer Dabbelt <palmer@rivosinc.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Conor.Dooley@microchip.com, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org, wangkefeng.wang@huawei.com,
Guohanjun <guohanjun@huawei.com>
Subject: Re: [PATCH -next v2 1/2] riscv: uaccess: rename __get/put_user_nocheck to __get/put_mem_nocheck
Date: Thu, 25 Aug 2022 12:56:00 +0200 [thread overview]
Message-ID: <20220825105600.ezueddmwehob42rf@kamzik> (raw)
In-Reply-To: <20220815032025.2685516-2-tongtiangen@huawei.com>
On Mon, Aug 15, 2022 at 03:20:24AM +0000, Tong Tiangen wrote:
> Current, The helpers __get/put_user_nocheck() is used by get/put_user() and
> __get/put_kernel_nofault(), which is not always uaccess, so the name with
> *user* is not appropriate.
>
> Also rename xxx_user_xxx to xxx_mem_xx on the call path of
> __get/put_user_nocheck()
>
> Only refactor code without any functional changes.
>
> Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
> ---
> arch/riscv/include/asm/uaccess.h | 48 ++++++++++++++++----------------
> 1 file changed, 24 insertions(+), 24 deletions(-)
>
> diff --git a/arch/riscv/include/asm/uaccess.h b/arch/riscv/include/asm/uaccess.h
> index 855450bed9f5..1370da055b44 100644
> --- a/arch/riscv/include/asm/uaccess.h
> +++ b/arch/riscv/include/asm/uaccess.h
> @@ -50,7 +50,7 @@
> * call.
> */
>
> -#define __get_user_asm(insn, x, ptr, err) \
> +#define __get_mem_asm(insn, x, ptr, err) \
> do { \
> __typeof__(x) __x; \
> __asm__ __volatile__ ( \
> @@ -64,12 +64,12 @@ do { \
> } while (0)
>
> #ifdef CONFIG_64BIT
> -#define __get_user_8(x, ptr, err) \
> - __get_user_asm("ld", x, ptr, err)
> +#define __get_mem_8(x, ptr, err) \
> + __get_mem_asm("ld", x, ptr, err)
> #else /* !CONFIG_64BIT */
> -#define __get_user_8(x, ptr, err) \
> +#define __get_mem_8(x, ptr, err) \
> do { \
> - u32 __user *__ptr = (u32 __user *)(ptr); \
> + u32 *__ptr = (u32 *)(ptr); \
Doesn't casting away __user reduce sparse's utility?
> u32 __lo, __hi; \
> __asm__ __volatile__ ( \
> "1:\n" \
> @@ -88,20 +88,20 @@ do { \
> } while (0)
> #endif /* CONFIG_64BIT */
>
> -#define __get_user_nocheck(x, __gu_ptr, __gu_err) \
> +#define __get_mem_nocheck(x, __gu_ptr, __gu_err) \
The patch replaces all get/put_user instances with get/put_mem,
but what about 'gu' and 'pu' instances (which are presumably short
for get/put_user)?
Thanks,
drew
next prev parent reply other threads:[~2022-08-25 10:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 3:20 [PATCH -next v2 0/2]riscv: some refactorings realted to uaccess and extable Tong Tiangen
2022-08-15 3:20 ` [PATCH -next v2 1/2] riscv: uaccess: rename __get/put_user_nocheck to __get/put_mem_nocheck Tong Tiangen
2022-08-25 10:56 ` Andrew Jones [this message]
2022-08-26 6:33 ` Tong Tiangen
2022-08-26 7:43 ` Andrew Jones
2022-08-27 10:39 ` Tong Tiangen
2022-08-26 9:30 ` Arnd Bergmann
2022-08-27 10:43 ` Tong Tiangen
2022-08-27 12:49 ` Arnd Bergmann
2022-08-29 1:26 ` Tong Tiangen
2022-08-15 3:20 ` [PATCH -next v2 2/2] riscv: extable: add new extable type EX_TYPE_KACCESS_ERR_ZERO support Tong Tiangen
2022-08-25 11:06 ` Andrew Jones
2022-08-26 6:44 ` Tong Tiangen
2022-08-26 8:16 ` Andrew Jones
2022-08-27 10:39 ` Tong Tiangen
2022-09-21 20:25 ` Palmer Dabbelt
2022-10-21 12:23 ` Tong Tiangen
2022-08-24 6:31 ` [PATCH -next v2 0/2]riscv: some refactorings realted to uaccess and extable Tong Tiangen
2022-08-24 16:49 ` Conor.Dooley
2022-08-25 3:04 ` Tong Tiangen
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=20220825105600.ezueddmwehob42rf@kamzik \
--to=ajones@ventanamicro.com \
--cc=Conor.Dooley@microchip.com \
--cc=aou@eecs.berkeley.edu \
--cc=guohanjun@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=palmer@rivosinc.com \
--cc=paul.walmsley@sifive.com \
--cc=tongtiangen@huawei.com \
--cc=wangkefeng.wang@huawei.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
all inboxes | Powered by JetHome®