public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Michael Schmitz <schmitzmic@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-m68k <linux-m68k@lists.linux-m68k.org>
Subject: Re: [PATCH RFC] Fixes to Linus' 'remove set_fs patch'
Date: Wed, 7 Jul 2021 08:47:20 +1200	[thread overview]
Message-ID: <56f17d9d-ba15-be0e-1ee0-a2ddcff8a612@gmail.com> (raw)
In-Reply-To: <CAHk-=wjokOnXnth3jw1d9yOnOFMaYNhOftTC+qm2XVh9Pe+7=Q@mail.gmail.com>

Hi Linus,

On 7/07/21 6:47 am, Linus Torvalds wrote:
> On Mon, Jul 5, 2021 at 4:20 PM Michael Schmitz <schmitzmic@gmail.com> 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

      reply	other threads:[~2021-07-06 20:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 23:20 [PATCH RFC] Fixes to Linus' 'remove set_fs patch' Michael Schmitz
2021-07-06 18:47 ` Linus Torvalds
2021-07-06 20:47   ` Michael Schmitz [this message]

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=56f17d9d-ba15-be0e-1ee0-a2ddcff8a612@gmail.com \
    --to=schmitzmic@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=torvalds@linux-foundation.org \
    /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