Re: [PATCH RFC] Fixes to Linus' 'remove set_fs patch'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Linus,

On 7/07/21 6:47 am, Linus Torvalds wrote:
On Mon, Jul 5, 2021 at 4:20 PM Michael Schmitz <schmitzmic@xxxxxxxxx> wrote:
Linus' patch didn't compile out of the box. I'm a little
worried that I had to patch mm/maccess.c,
Yeah, that's not the right way to do it.

See the other thread where Christoph rightly points out that the
problem is that m68k needs __{get,put}_kernel_nofault() and then just
enable CONFIG_HAVE_GET_KERNEL_NOFAULT.
Yep, saw that late yesterday and started implementing those.

__{get,put}_kernel_nofault() is basically the similar to
__get_user/__put_user, except for

  (a) it uses kernel addresses (so in m68k parlance, "move" rather than "moves")
Thanks for reminding me ... after backing out the mm/maccess.c changes, new __get/put_kernel_asm() macros and basically copying the __get/put_kernel_nofault() framework from mips, I still have a working kernel. I'd like to test those changes on actual hardware though (and will need help from someone with a 040 or 060 machine for that).

  (b) it uses the "goto err_label" approach instead of being an
expression that returns an error value

That (b) is what allows the use of "asm goto" to implement the
exception case much more efficiently (but you can avoid having to
convert to that model by just doing something like

         if (unlikely(__gu_err)) goto err_label;

inside the macro instead - even architectures that use the "asm goto"
do that for old compilers that don't support "asm goto" with output
values.

It shouldn't be too hard to implement on m68k - you'd likely want to
make the helper macros in <asm/uaccess.h> take that "MOVES" thing as a
new argument, so that you can generate code for the "move" vs "moves"
cases using the same helper macros, just with different arguments.

True - let's get some test coverage first though.

Cheers,

    Michael



             Linus



[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux