qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: laurent@vivier.eu, imp@bsdimp.com
Subject: [PATCH v6 02/16] linux-user/host/ppc64: Use r11 for signal_pending address
Date: Tue, 23 Nov 2021 18:37:45 +0100	[thread overview]
Message-ID: <20211123173759.1383510-3-richard.henderson@linaro.org> (raw)
In-Reply-To: <20211123173759.1383510-1-richard.henderson@linaro.org>

We don't need a register that can live across the syscall;
we only need a register that can live until the syscall.
Use call-clobbered r11 instead of call-saved r14.
Eliminate the save and restore of r14 from the stack frame.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/host/ppc64/safe-syscall.inc.S | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/linux-user/host/ppc64/safe-syscall.inc.S b/linux-user/host/ppc64/safe-syscall.inc.S
index 4b57440585..5f19cd193c 100644
--- a/linux-user/host/ppc64/safe-syscall.inc.S
+++ b/linux-user/host/ppc64/safe-syscall.inc.S
@@ -49,9 +49,7 @@ safe_syscall_base:
          *               and returns the result in r3
          * Shuffle everything around appropriately.
          */
-        std     14, 16(1) /* Preserve r14 in SP+16 */
-        .cfi_offset 14, 16
-        mr      14, 3   /* signal_pending */
+        mr      11, 3   /* signal_pending */
         mr      0, 4    /* syscall number */
         mr      3, 5    /* syscall arguments */
         mr      4, 6
@@ -69,13 +67,12 @@ safe_syscall_base:
          */
 safe_syscall_start:
         /* if signal_pending is non-zero, don't do the call */
-        lwz     12, 0(14)
+        lwz     12, 0(11)
         cmpwi   0, 12, 0
         bne-    0f
         sc
 safe_syscall_end:
         /* code path when we did execute the syscall */
-        ld 14, 16(1) /* restore r14 to its original value */
         bnslr+
 
         /* syscall failed; return negative errno */
@@ -84,7 +81,6 @@ safe_syscall_end:
 
         /* code path when we didn't execute the syscall */
 0:      addi    3, 0, -TARGET_ERESTARTSYS
-        ld 14, 16(1) /* restore r14 to its original value */
         blr
         .cfi_endproc
 
-- 
2.25.1



  parent reply	other threads:[~2021-11-23 17:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 17:37 [PATCH for-7.0 v6 00/16] linux-user: simplify safe signal handling Richard Henderson
2021-11-23 17:37 ` [PATCH v6 01/16] linux-user: Untabify all safe-syscall.inc.S Richard Henderson
2021-11-25 10:17   ` Warner Losh
2021-11-23 17:37 ` Richard Henderson [this message]
2021-11-29 11:01   ` [PATCH v6 02/16] linux-user/host/ppc64: Use r11 for signal_pending address Peter Maydell
2021-11-29 14:30     ` Richard Henderson
2021-11-23 17:37 ` [PATCH v6 03/16] linux-user: Move syscall error detection into safe_syscall_base Richard Henderson
2021-11-25 10:25   ` Warner Losh
2021-11-23 17:37 ` [PATCH v6 04/16] linux-user/host/mips: Add safe-syscall.inc.S Richard Henderson
2021-11-25 10:22   ` Warner Losh
2021-11-29 16:40   ` Peter Maydell
2021-11-29 16:51     ` Richard Henderson
2021-11-23 17:37 ` [PATCH v6 05/16] linux-user/host/sparc64: " Richard Henderson
2021-11-23 17:37 ` [PATCH v6 06/16] linux-user: Remove HAVE_SAFE_SYSCALL and hostdep.h Richard Henderson
2021-11-23 17:37 ` [PATCH v6 07/16] linux-user: Rename TARGET_ERESTARTSYS to QEMU_ERESTARTSYS Richard Henderson
2021-11-23 17:37 ` [PATCH v6 08/16] bsd-user: " Richard Henderson
2021-11-23 17:37 ` [PATCH v6 09/16] linux-user: Rename TARGET_QEMU_ESIGRETURN to QEMU_ESIGRETURN Richard Henderson
2021-11-23 17:37 ` [PATCH v6 10/16] linux-user: Create special-errno.h Richard Henderson
2021-11-23 17:37 ` [PATCH v6 11/16] bsd-user: " Richard Henderson
2021-11-23 17:37 ` [PATCH v6 12/16] common-user: Move safe-syscall.* from linux-user Richard Henderson
2021-11-23 17:37 ` [PATCH v6 13/16] common-user: Adjust system call return on FreeBSD Richard Henderson
2021-11-23 17:37 ` [PATCH v6 14/16] linux-user: Move thunk.c from top-level Richard Henderson
2021-11-23 17:37 ` [PATCH v6 15/16] meson: Move linux_user_ss to linux-user/ Richard Henderson
2021-11-23 17:37 ` [PATCH v6 16/16] meson: Move bsd_user_ss to bsd-user/ Richard Henderson

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=20211123173759.1383510-3-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=imp@bsdimp.com \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).