qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org, peter.maydell@linaro.org, riku.voipio@iki.fi
Subject: [Qemu-devel] [PATCH 1/2] linux-user: Fix i386 safe-syscall.S
Date: Thu,  7 Jul 2016 21:56:15 -0700	[thread overview]
Message-ID: <1467953776-26102-2-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1467953776-26102-1-git-send-email-rth@twiddle.net>

Clang insists that "cmp" is ambiguous with a memory destination,
requiring an explicit size suffix.

There was a true error in the use of .cfi_def_cfa_offset in the
epilogue, but changing to use the proper .cfi_adjust_cfa_offset
runs afoul of a clang bug wrt .cfi_restore_state.  Better to
fold the two epilogues so that we don't trigger the bug.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 linux-user/host/i386/safe-syscall.inc.S | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/linux-user/host/i386/safe-syscall.inc.S b/linux-user/host/i386/safe-syscall.inc.S
index 766d0de..9e58fc6 100644
--- a/linux-user/host/i386/safe-syscall.inc.S
+++ b/linux-user/host/i386/safe-syscall.inc.S
@@ -69,7 +69,7 @@ safe_syscall_base:
 safe_syscall_start:
 	/* if signal_pending is non-zero, don't do the call */
 	mov	4+16(%esp), %eax	/* signal_pending */
-	cmp	$0, (%eax)
+	cmpl	$0, (%eax)
 	jnz	1f
 	mov	8+16(%esp), %eax	/* syscall number */
 	int	$0x80
@@ -77,16 +77,16 @@ safe_syscall_end:
 	/* code path for having successfully executed the syscall */
 	pop	%ebx
 	.cfi_remember_state
-	.cfi_def_cfa_offset -4
+	.cfi_adjust_cfa_offset -4
 	.cfi_restore ebx
 	pop	%edi
-	.cfi_def_cfa_offset -4
+	.cfi_adjust_cfa_offset -4
 	.cfi_restore edi
 	pop	%esi
-	.cfi_def_cfa_offset -4
+	.cfi_adjust_cfa_offset -4
 	.cfi_restore esi
 	pop	%ebp
-	.cfi_def_cfa_offset -4
+	.cfi_adjust_cfa_offset -4
 	.cfi_restore ebp
 	ret
 
@@ -94,19 +94,7 @@ safe_syscall_end:
 	/* code path when we didn't execute the syscall */
 	.cfi_restore_state
 	mov	$-TARGET_ERESTARTSYS, %eax
-	pop	%ebx
-	.cfi_def_cfa_offset -4
-	.cfi_restore ebx
-	pop	%edi
-	.cfi_def_cfa_offset -4
-	.cfi_restore edi
-	pop	%esi
-	.cfi_def_cfa_offset -4
-	.cfi_restore esi
-	pop	%ebp
-	.cfi_def_cfa_offset -4
-	.cfi_restore ebp
-	ret
+	jmp	safe_syscall_end
 	.cfi_endproc
 
 	.size	safe_syscall_base, .-safe_syscall_base
-- 
2.7.4

  reply	other threads:[~2016-07-08  4:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08  4:56 [Qemu-devel] [PATCH 0/2] build fix for clang 3.4 Richard Henderson
2016-07-08  4:56 ` Richard Henderson [this message]
2016-07-08  4:56 ` [Qemu-devel] [PATCH 2/2] build: Use $(AS) for optionrom explicitly Richard Henderson
2016-07-09  6:54   ` Alex Bennée

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=1467953776-26102-2-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=alex.bennee@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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).