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

From: John Paul Adrian Glaubitz
Date: Mon Jun 01 2020 - 05:13:33 EST


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?
>>
>> What about just having the 64-bit versions call the corresponding
>> 32-bit version twice? (Ideally this would even be arch-generic and
>> could replace the m68k asm.) It would return EFAULT if either of the
>> 32-bit calls did.
>
> Yes, that's an option, too.

That's the solution that Michael Karcher suggested to me as an alternative
when I talked to him off-list.

While I understand that it works, I don't like the inconsistency and I also
don't see why we should opt for a potentially slower solution when we can
used the fastest one.

I'm also not sure how the exception handling would properly work when you
have two invocations of __get_user_asm().

My current approach is consistent with the existing code, so I think it's
the natural choice. I just need someone with more experience in SH assembler
than me that the solution is correct.

I have already pinged Niibe-san in private, he'll hopefully get back to me
within the next days.

Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glaubitz@xxxxxxxxxx
`. `' Freie Universitaet Berlin - glaubitz@xxxxxxxxxxxxxxxxxxx
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913