public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Finn Thain <fthain@linux-m68k.org>
To: Michael Schmitz <schmitzmic@gmail.com>
Cc: linux-m68k@vger.kernel.org, geert@linux-m68k.org,
	gerg@linux-m68k.org,  linux-m68k@lists.linux-m68k.org
Subject: Re: [PATCH v3 1/2] m68k: Handle __generic_copy_to_user faults more carefully
Date: Sun, 28 Apr 2024 13:28:33 +1000 (AEST)	[thread overview]
Message-ID: <95677826-e3cb-9c1d-7d03-253a88aff3eb@linux-m68k.org> (raw)
In-Reply-To: <f88ad8f7-4fd9-45b2-a52c-cee3217083bf@gmail.com>

On Sun, 28 Apr 2024, Michael Schmitz wrote:

> In my tests, the fault seen there had been caused by the movesl in the 
> section above, hence the fixup at 20b.
> 

Well, that was my point. A fault at MOVE.W should get fixed up at 20b, not 
50b. So the patch is wrong, isn't it?

> >
> > Should we put a NOP here to avoid having the unknown next instruction 
> > (label 9) in the exception table? We can't actually fix up a fault 
> > there unless by chance it was the MOVES that caused it.
> 
> ... As to the unknown instructions following the final exception label: 
> These functions, though they contain inline assembly code are not 
> further inlined, and the instructions following the inline assembly are 
> simple boilerplate register restore stack saves that ought not to fault 
> (an invalid stack pointer would have faulted on function entry, if at 
> all).
> 

But that's just luck. IMHO, the asm is a foot-gun even if it has not gone 
off yet.

> On balance, I am confident the code is correct as-is. You (and in 
> particular, Geert) may argue though that the NOP approach follows the 
> principle of least surprises, and can be considered safe to apply 
> without further testing on 68060 and Coldfire.
> 

If you're saying that your patch addresses a different bug, fair enough.

All I'm saying is that, since you're adding the NOP anyway, you could make 
better use of it.

Anyway, like you, I am keen to hear from others regarding the API issue.

  reply	other threads:[~2024-04-28  3:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-27  8:48 [PATCH v3 0/2] m68k uaccess fault handling fixes Michael Schmitz
2024-04-27  8:48 ` [PATCH v3 1/2] m68k: Handle __generic_copy_to_user faults more carefully Michael Schmitz
2024-04-27  9:34   ` Finn Thain
2024-04-27 23:16     ` Michael Schmitz
2024-04-28  3:28       ` Finn Thain [this message]
2024-04-28  3:51         ` Michael Schmitz
2024-04-28  8:03           ` Finn Thain
2024-04-27  8:48 ` [PATCH v3 2/2] m68k: improve __constant_copy_to_user_asm() fault handling Michael Schmitz
2024-04-27  9:24   ` Finn Thain

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=95677826-e3cb-9c1d-7d03-253a88aff3eb@linux-m68k.org \
    --to=fthain@linux-m68k.org \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=schmitzmic@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox