From: Sam Ravnborg <sam@ravnborg.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: sparclinux@vger.kernel.org
Subject: Re: [PATCH] sparc32: fix a braino in fault handling in csum_and_copy_..._user()
Date: Fri, 27 Oct 2023 20:47:53 +0200 [thread overview]
Message-ID: <20231027184753.GA1048069@ravnborg.org> (raw)
In-Reply-To: <20231026021613.GI800259@ZenIV>
Hi Al,
On Thu, Oct 26, 2023 at 03:16:13AM +0100, Al Viro wrote:
> Fault handler used to make non-trivial calls, so it needed
> to set a stack frame up. Used to be
> save ... - grab a stack frame, old %o... become %i...
> ....
> ret - go back to address originally in %o7, currently %i7
> restore - switch to previous stack frame, in delay slot
> Non-trivial calls had been gone since ab5e8b331244 and that code should
> have become
> retl - go back to address in %o7
> clr %o0 - have return value set to 0
> What it had become instead was
> ret - go back to address in %i7 - return address of *caller*
> clr %o0 - have return value set to 0
> which is not good, to put it mildly - we forcibly return 0 from
> csum_and_copy_{from,to}_iter() (which is what the call of that
> thing had been inlined into) and do that without dropping the
> stack frame of said csum_and_copy_..._iter(). Confuses the
> hell out of the caller of csum_and_copy_..._iter(), obviously...
I wonder how you managed to find this? Do you actually use sparc32 these
days?
You could also kill the EX2 define while touchign the file,
it is no longer used after ab5e8b331244.
>
> Fixes: ab5e8b331244 "sparc32: propagate the calling conventions change down to __csum_partial_copy_sparc_generic()"
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
> ---
> arch/sparc/lib/checksum_32.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/sparc/lib/checksum_32.S b/arch/sparc/lib/checksum_32.S
> index 84ad709cbecb..66eda40fce36 100644
> --- a/arch/sparc/lib/checksum_32.S
> +++ b/arch/sparc/lib/checksum_32.S
> @@ -453,5 +453,5 @@ ccslow: cmp %g1, 0
> * we only bother with faults on loads... */
>
> cc_fault:
> - ret
> + retl
> clr %o0
> --
> 2.39.2
next prev parent reply other threads:[~2023-10-27 19:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-26 2:16 [PATCH] sparc32: fix a braino in fault handling in csum_and_copy_..._user() Al Viro
2023-10-27 18:47 ` Sam Ravnborg [this message]
2023-10-27 19:02 ` Al Viro
2023-10-27 20:14 ` Sam Ravnborg
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=20231027184753.GA1048069@ravnborg.org \
--to=sam@ravnborg.org \
--cc=sparclinux@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.