From: Laurent Vivier <laurent@vivier.eu>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Giuseppe Musacchio <thatlemon@gmail.com>,
Richard Henderson <richard.henderson@linaro.org>,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Subject: Re: [PATCH v2 2/4] linux-user/sparc: Remove unneeded checks of 'err' from sparc64_get_context()
Date: Thu, 17 Dec 2020 12:32:34 +0100 [thread overview]
Message-ID: <b6cc0836-3245-3907-9bb0-83591d658320@vivier.eu> (raw)
In-Reply-To: <20201106152738.26026-3-peter.maydell@linaro.org>
Le 06/11/2020 à 16:27, Peter Maydell a écrit :
> Unlike the kernel macros, our __get_user() and __put_user() do not
> return a failure code. Kernel code typically has a style of
> err |= __get_user(...); err |= __get_user(...);
> and then checking err at the end. In sparc64_get_context() our
> version of the code dropped the accumulating into err but left the
> "if (err) goto do_sigsegv" checks, which will never be taken. Delete
> unnecessary if()s.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> linux-user/sparc/signal.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c
> index e661a769cb1..43dcd137f51 100644
> --- a/linux-user/sparc/signal.c
> +++ b/linux-user/sparc/signal.c
> @@ -555,8 +555,6 @@ void sparc64_get_context(CPUSPARCState *env)
> for (i = 0; i < TARGET_NSIG_WORDS; i++, dst++, src++) {
> __put_user(*src, dst);
> }
> - if (err)
> - goto do_sigsegv;
> }
>
> /* XXX: tstate must be saved properly */
> @@ -598,8 +596,6 @@ void sparc64_get_context(CPUSPARCState *env)
> * hidden behind an "if (fenab)" where fenab is always 0).
> */
>
> - if (err)
> - goto do_sigsegv;
> unlock_user_struct(ucp, ucp_addr, 1);
> return;
> do_sigsegv:
>
Applied to my linux-user-for-6.0 branch.
Thanks,
Laurent
next prev parent reply other threads:[~2020-12-17 11:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-06 15:27 [PATCH v2 0/4] linux/sparc: more get/set_context fixes Peter Maydell
2020-11-06 15:27 ` [PATCH v2 1/4] linux-user/sparc: Correct sparc64_get/set_context() FPU handling Peter Maydell
2020-11-06 17:09 ` Richard Henderson
2020-11-06 17:10 ` Peter Maydell
2020-12-17 11:30 ` Laurent Vivier
2020-11-06 15:27 ` [PATCH v2 2/4] linux-user/sparc: Remove unneeded checks of 'err' from sparc64_get_context() Peter Maydell
2020-11-06 17:10 ` Richard Henderson
2020-12-17 11:32 ` Laurent Vivier [this message]
2020-11-06 15:27 ` [PATCH v2 3/4] linux-user/sparc: Don't restore %g7 in sparc64_set_context() Peter Maydell
2020-11-06 17:11 ` Richard Henderson
2020-12-17 11:33 ` Laurent Vivier
2020-11-06 15:27 ` [PATCH v2 4/4] linux-user/sparc: Handle tstate in sparc64_get/set_context() Peter Maydell
2020-11-06 17:22 ` Richard Henderson
2020-12-17 11:33 ` Laurent Vivier
2020-11-06 15:30 ` [PATCH v2 0/4] linux/sparc: more get/set_context fixes Peter Maydell
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=b6cc0836-3245-3907-9bb0-83591d658320@vivier.eu \
--to=laurent@vivier.eu \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thatlemon@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;
as well as URLs for NNTP newsgroup(s).