Re: [PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-06-27 Thread Yoshinori Sato
On Thu, 11 Jun 2020 16:58:11 +0900, John Paul Adrian Glaubitz wrote: > > Trying to build the kernel with CONFIG_INFINIBAND_USER_ACCESS enabled fails > > ERROR: "__get_user_unknown" [drivers/infiniband/core/ib_uverbs.ko] > undefined! > > with on SH since the kernel misses a 64-bit

[PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-06-11 Thread John Paul Adrian Glaubitz
Trying to build the kernel with CONFIG_INFINIBAND_USER_ACCESS enabled fails ERROR: "__get_user_unknown" [drivers/infiniband/core/ib_uverbs.ko] undefined! with on SH since the kernel misses a 64-bit implementation of get_user(). Implement the missing 64-bit get_user() as __get_user_u64(),

Re: [PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-06-02 Thread Michael Karcher
Rich Felker schrieb: >> There is a functional argument agains using get_user_32 twice, which I >> overlooked in my private reply to Adrian. If any of the loads fail, we >> do not only want err to be set to -EFAULT (which will happen), but we >> also want a 64-bit zero as result. If one 32-bit read

Re: [PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-06-01 Thread Rich Felker
On Mon, Jun 01, 2020 at 10:26:09PM +0200, Michael Karcher wrote: > Rich Felker schrieb: > >> >> Can I propose a different solution? For archs where there isn't > >> >> actually any 64-bit load or store instruction, does it make sense to > >> >> be writing asm just to do two 32-bit loads/stores,

Re: [PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-06-01 Thread Michael Karcher
Rich Felker schrieb: >> >> Can I propose a different solution? For archs where there isn't >> >> actually any 64-bit load or store instruction, does it make sense to >> >> be writing asm just to do two 32-bit loads/stores, especially when >> >> this code is not in a hot path? >> > Yes, that's an

Re: [PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-06-01 Thread Rich Felker
On Mon, Jun 01, 2020 at 11:13:26AM +0200, John Paul Adrian Glaubitz wrote: > Hello! > > On 6/1/20 11:02 AM, Geert Uytterhoeven wrote: > >> Can I propose a different solution? For archs where there isn't > >> actually any 64-bit load or store instruction, does it make sense to > >> be writing asm

Re: [PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-06-01 Thread John Paul Adrian Glaubitz
Hello! On 6/1/20 11:02 AM, Geert Uytterhoeven wrote: >> Can I propose a different solution? For archs where there isn't >> actually any 64-bit load or store instruction, does it make sense to >> be writing asm just to do two 32-bit loads/stores, especially when >> this code is not in a hot path?

Re: [PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-06-01 Thread Geert Uytterhoeven
Hi Rich, On Mon, Jun 1, 2020 at 5:03 AM Rich Felker wrote: > On Sun, May 31, 2020 at 12:43:11PM +0200, Geert Uytterhoeven wrote: > > On Sun, May 31, 2020 at 11:59 AM John Paul Adrian Glaubitz > > wrote: > > > On 5/31/20 11:54 AM, John Paul Adrian Glaubitz wrote: > > > > On 5/31/20 11:52 AM,

Re: [PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-05-31 Thread Rich Felker
On Sun, May 31, 2020 at 12:43:11PM +0200, Geert Uytterhoeven wrote: > Hi Adrian, > > On Sun, May 31, 2020 at 11:59 AM John Paul Adrian Glaubitz > wrote: > > On 5/31/20 11:54 AM, John Paul Adrian Glaubitz wrote: > > > On 5/31/20 11:52 AM, Geert Uytterhoeven wrote: > > >> As this is the 64-bit

Re: [PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-05-31 Thread John Paul Adrian Glaubitz
Hi Geert! Thanks a lot for the explanation! On 5/31/20 12:43 PM, Geert Uytterhoeven wrote: >> Hmm, this change is not the case for __put_user_asm() vs. __put_user_u64(). >> But I have to admit, I don't know what the part below "3:\n\t" is for. > > It's part of the exception handling, in case

Re: [PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-05-31 Thread Geert Uytterhoeven
Hi Adrian, On Sun, May 31, 2020 at 11:59 AM John Paul Adrian Glaubitz wrote: > On 5/31/20 11:54 AM, John Paul Adrian Glaubitz wrote: > > On 5/31/20 11:52 AM, Geert Uytterhoeven wrote: > >> As this is the 64-bit variant, I think this single move should be > >> replaced by a double move: > >> > >>

Re: [PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-05-31 Thread John Paul Adrian Glaubitz
On 5/31/20 11:54 AM, John Paul Adrian Glaubitz wrote: > Hi Geert! > > On 5/31/20 11:52 AM, Geert Uytterhoeven wrote: >> As this is the 64-bit variant, I think this single move should be >> replaced by a double move: >> >>"mov #0,%R1\n\t" \ >>"mov #0,%S1\n\t" \ >> >> Same for the

Re: [PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-05-31 Thread John Paul Adrian Glaubitz
Hi Geert! On 5/31/20 11:52 AM, Geert Uytterhoeven wrote: > As this is the 64-bit variant, I think this single move should be > replaced by a double move: > >"mov #0,%R1\n\t" \ >"mov #0,%S1\n\t" \ > > Same for the big endian version below. > > Disclaimer: uncompiled, untested,

Re: [PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-05-31 Thread Geert Uytterhoeven
Hi Adrian, On Fri, May 29, 2020 at 7:46 PM John Paul Adrian Glaubitz wrote: > Trying to build the kernel with CONFIG_INFINIBAND_USER_ACCESS enabled fails > > ERROR: "__get_user_unknown" [drivers/infiniband/core/ib_uverbs.ko] > undefined! > > with on SH since the kernel misses a 64-bit

[PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-05-29 Thread John Paul Adrian Glaubitz
Trying to build the kernel with CONFIG_INFINIBAND_USER_ACCESS enabled fails ERROR: "__get_user_unknown" [drivers/infiniband/core/ib_uverbs.ko] undefined! with on SH since the kernel misses a 64-bit implementation of get_user(). Implement the missing 64-bit get_user() as __get_user_u64(),

[PATCH] sh: Implement __get_user_u64() required for 64-bit get_user()

2020-05-29 Thread John Paul Adrian Glaubitz
Trying to build the kernel with CONFIG_INFINIBAND_USER_ACCESS enabled fails ERROR: "__get_user_unknown" [drivers/infiniband/core/ib_uverbs.ko] undefined! with on SH since the kernel misses a 64-bit implementation of get_user(). Implement the missing 64-bit get_user() as __get_user_u64(),