From: Tong Tiangen <tongtiangen@huawei.com>
To: Arnd Bergmann <arnd@arndb.de>
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: Sat, 27 Aug 2022 18:43:06 +0800 [thread overview]
Message-ID: <c0e286b4-3005-71fb-3bb2-476944099d4e@huawei.com> (raw)
In-Reply-To: <CAK8P3a0ixaYimjCh77QBJpbHbVsw+9C7RiW2LEnwQ8HnwG_jHg@mail.gmail.com>
在 2022/8/26 17:30, Arnd Bergmann 写道:
> On Mon, Aug 15, 2022 at 5:20 AM Tong Tiangen <tongtiangen@huawei.com> 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>
>
> I would prefer this not being done, it just makes riscv diverge from the
> code on other architectures. While the new name does make more sense,
> it ends up making it harder to refactor this across architectures in the end.
>
> There are two important cleanups that I would like to see done in
> asm/uaccess.h across architectures:
>
> - generalize the __get_user()/__put_user()/__get_kernel_nofault()/
> __put_kernel_nofault() wrappers to the point that architectures do not
> need to worry about the variable type stuff but instead just provide
> trivial fixed-length helpers of some sort
>
> - change the calling conventions in a way that allows the use of the
> asm-goto-with-output method for better object code on modern
> compilers.
>
> The x86 version already has most of this, with their
> __get_user_size() macro supporting both the asm-goto label
> and the error code assignment, so the generalized code should
> probably be based on that approach.
I am very interested in the implementation of X86. I need to investigate
and consider a cross architecture implementation.
However, I understand that the modification of the current patch has
little to do with the two points mentioned above. We can optimize the
code step by step.
Thanks,
Tong.
>
> Arnd
>
> .
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Tong Tiangen <tongtiangen@huawei.com>
To: Arnd Bergmann <arnd@arndb.de>
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: Sat, 27 Aug 2022 18:43:06 +0800 [thread overview]
Message-ID: <c0e286b4-3005-71fb-3bb2-476944099d4e@huawei.com> (raw)
In-Reply-To: <CAK8P3a0ixaYimjCh77QBJpbHbVsw+9C7RiW2LEnwQ8HnwG_jHg@mail.gmail.com>
在 2022/8/26 17:30, Arnd Bergmann 写道:
> On Mon, Aug 15, 2022 at 5:20 AM Tong Tiangen <tongtiangen@huawei.com> 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>
>
> I would prefer this not being done, it just makes riscv diverge from the
> code on other architectures. While the new name does make more sense,
> it ends up making it harder to refactor this across architectures in the end.
>
> There are two important cleanups that I would like to see done in
> asm/uaccess.h across architectures:
>
> - generalize the __get_user()/__put_user()/__get_kernel_nofault()/
> __put_kernel_nofault() wrappers to the point that architectures do not
> need to worry about the variable type stuff but instead just provide
> trivial fixed-length helpers of some sort
>
> - change the calling conventions in a way that allows the use of the
> asm-goto-with-output method for better object code on modern
> compilers.
>
> The x86 version already has most of this, with their
> __get_user_size() macro supporting both the asm-goto label
> and the error code assignment, so the generalized code should
> probably be based on that approach.
I am very interested in the implementation of X86. I need to investigate
and consider a cross architecture implementation.
However, I understand that the modification of the current patch has
little to do with the two points mentioned above. We can optimize the
code step by step.
Thanks,
Tong.
>
> Arnd
>
> .
next prev parent reply other threads:[~2022-08-27 10:43 UTC|newest]
Thread overview: 40+ 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 ` 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-15 3:20 ` Tong Tiangen
2022-08-25 10:56 ` Andrew Jones
2022-08-25 10:56 ` Andrew Jones
2022-08-26 6:33 ` Tong Tiangen
2022-08-26 6:33 ` Tong Tiangen
2022-08-26 7:43 ` Andrew Jones
2022-08-26 7:43 ` Andrew Jones
2022-08-27 10:39 ` Tong Tiangen
2022-08-27 10:39 ` Tong Tiangen
2022-08-26 9:30 ` Arnd Bergmann
2022-08-26 9:30 ` Arnd Bergmann
2022-08-27 10:43 ` Tong Tiangen [this message]
2022-08-27 10:43 ` Tong Tiangen
2022-08-27 12:49 ` Arnd Bergmann
2022-08-27 12:49 ` Arnd Bergmann
2022-08-29 1:26 ` Tong Tiangen
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-15 3:20 ` Tong Tiangen
2022-08-25 11:06 ` Andrew Jones
2022-08-25 11:06 ` Andrew Jones
2022-08-26 6:44 ` Tong Tiangen
2022-08-26 6:44 ` Tong Tiangen
2022-08-26 8:16 ` Andrew Jones
2022-08-26 8:16 ` Andrew Jones
2022-08-27 10:39 ` Tong Tiangen
2022-08-27 10:39 ` Tong Tiangen
2022-09-21 20:25 ` Palmer Dabbelt
2022-09-21 20:25 ` Palmer Dabbelt
2022-10-21 12:23 ` Tong Tiangen
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 6:31 ` Tong Tiangen
2022-08-24 16:49 ` Conor.Dooley
2022-08-24 16:49 ` Conor.Dooley
2022-08-25 3:04 ` Tong Tiangen
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=c0e286b4-3005-71fb-3bb2-476944099d4e@huawei.com \
--to=tongtiangen@huawei.com \
--cc=Conor.Dooley@microchip.com \
--cc=aou@eecs.berkeley.edu \
--cc=arnd@arndb.de \
--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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.