From patchwork Fri Jul 8 04:56:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9220005 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A79A9607D9 for ; Fri, 8 Jul 2016 05:00:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97CD72841A for ; Fri, 8 Jul 2016 05:00:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A2FC2841C; Fri, 8 Jul 2016 05:00:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EBCA02841A for ; Fri, 8 Jul 2016 05:00:11 +0000 (UTC) Received: from localhost ([::1]:43589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLNta-0002wb-VR for patchwork-qemu-devel@patchwork.kernel.org; Fri, 08 Jul 2016 01:00:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLNqX-00018b-7T for qemu-devel@nongnu.org; Fri, 08 Jul 2016 00:57:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLNqS-0001iV-4G for qemu-devel@nongnu.org; Fri, 08 Jul 2016 00:57:00 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:33241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLNqR-0001iR-W1 for qemu-devel@nongnu.org; Fri, 08 Jul 2016 00:56:56 -0400 Received: by mail-qt0-x243.google.com with SMTP id f89so2736944qtd.0 for ; Thu, 07 Jul 2016 21:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=uO3Qa1PwcHOcmjkDrWxyBKG1qp6Ei/FJdZpxCzgKU/U=; b=R67LY9T60LBNI7WWlwUhj/m7T+X5hOA42uZoU7ReKTg4kVlJs17Cvf98yic68lnEkG a+908VjrI12kZHbdrNq6p1ifrHgv1Q/7HysFtujKo9tVrlPeUjhpaO+y1K3ZitRe2gsj 2UsK1FwWzQbV/X+ChvGym8x3/h5MqRdWFGSFR1n4obAzSWl5VC1GEbKvOObFSCuBbKXk UgCw+IjYpMBW9VAHX7h9FjpX3YF5vV8pGYQ7zCIH8P87r5Es9h9nQ4JelreIlKUmWnVm ROfABWFxl+ej1kPlsMwGo3TvlsUq5AYMANGFi9plkZUvGTZM2oCAPeU/YiPTl4ka7U+7 +L8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=uO3Qa1PwcHOcmjkDrWxyBKG1qp6Ei/FJdZpxCzgKU/U=; b=QAOr4NFfq3LzyovAVv0M6gEqGlhP5zRv33mbe/gpAZgZ4HBcONYBfgYOs9YZn/vrcq RBPCfLlmI7/QIi3SxpsHPP9dvi9iT6ndxOdJksUyqjHGWG8gKuQX/ShKLdHn2yZT8Zax NgvjJThI3Hap3CNLDnJYDXLUpZ6htkYVn8My3RTL04ICL/aaaEBRmsfy/o+QxuNmazqE sp45MdwrQGgwsqDosNh8HbxYsnXhdljFNtbMR6mfW7k6OhABKmtFrS5ooTmajAfdrPn7 OsmDGGqdkxbtttLHsdIRwedr0Bf6Bam95gzfVlR8DG5sWO77PMAW4wNrAwX1Rbr2xWnq BnRg== X-Gm-Message-State: ALyK8tIk5XcUiKoFq9roUAZ7UaXpYGnRzzLM+s0tVg0A10OTYXDtZOxzM/3EeEKb6u6l+g== X-Received: by 10.200.52.193 with SMTP id x1mr1161104qtb.65.1467953815509; Thu, 07 Jul 2016 21:56:55 -0700 (PDT) Received: from bigtime.com (71-37-54-227.tukw.qwest.net. [71.37.54.227]) by smtp.gmail.com with ESMTPSA id n198sm2975771qkn.15.2016.07.07.21.56.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jul 2016 21:56:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Jul 2016 21:56:15 -0700 Message-Id: <1467953776-26102-2-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467953776-26102-1-git-send-email-rth@twiddle.net> References: <1467953776-26102-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 1/2] linux-user: Fix i386 safe-syscall.S X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, riku.voipio@iki.fi, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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