From patchwork Tue Jun 28 19:12:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 641737 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rfGWF3gXHz9sdb for ; Wed, 29 Jun 2016 05:45:45 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=aKWSPi5z; dkim-atps=neutral Received: from localhost ([::1]:39200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHyx5-0004h2-Gf for incoming@patchwork.ozlabs.org; Tue, 28 Jun 2016 15:45:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHyRw-0002Jt-6N for qemu-devel@nongnu.org; Tue, 28 Jun 2016 15:13:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHyRr-0006yP-8V for qemu-devel@nongnu.org; Tue, 28 Jun 2016 15:13:31 -0400 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]:33308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHyRr-0006yF-1L for qemu-devel@nongnu.org; Tue, 28 Jun 2016 15:13:27 -0400 Received: by mail-lf0-x22a.google.com with SMTP id f6so18205131lfg.0 for ; Tue, 28 Jun 2016 12:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BOOqWB6AyJUGev2/KeUNNa4VXeL3/umcOquS5WXUExE=; b=aKWSPi5z2hIdSg0tf2wrjtti87ScyX4d74OMDrYe3owY0kCX0LN9viIrQeuRgdJeqP QfiJtw/oT7f8Lgv+8UUmRwFr5HTYcfOPImHuVFdVdFiFFGIiMiQrLTcUZTF1WcVDjS/Q SXOlPY9fK51iPcB5Hfsuokjb0iCg82VEC3MqE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BOOqWB6AyJUGev2/KeUNNa4VXeL3/umcOquS5WXUExE=; b=A+9ybvAGAtQFQRvU9VCQha2aWH+jHHgGczIDebeQqSVEYa1urUS9Jg30MwRPznTbTI 2bOn9z5Jrn/HzeHERn4d5ksEtNYGgYN3WsRqncL+KMqFQA8CJtRDNkgaDmfrsAVI4cx+ BEnpu1pahLhulw16LsjVwIRAc9ufxEh+cQJJmiW+SqYY3XXQepgP4XAMCWl/NYp8l2XA XRB6P6Hdsm/97bHmG1WL0zJZ3OnP6UsRWV0DcFfEhaY4BNd42MCBXU42IOWD+4wIaCs6 U+jsJi6E93dJhJksg4phKObm158WZaQYHALF+zTQWhEZliIPh2+xfAYrPrIeaRa9FKhN mBZw== X-Gm-Message-State: ALyK8tIF/3+uxmP2v7YIKHWbD3EwaOtrDVELbSfb0VBNtzUepduNz9T97NpzxW/o2O7Dg0sp X-Received: by 10.25.141.75 with SMTP id p72mr1514498lfd.86.1467141206220; Tue, 28 Jun 2016 12:13:26 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id h10sm4262823ljh.38.2016.06.28.12.13.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Jun 2016 12:13:25 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 28 Jun 2016 22:12:53 +0300 Message-Id: <4eed9990a0d50d9c2bc7042fb3b68579985867ae.1467138806.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22a Subject: [Qemu-devel] [PULL v2 19/24] linux-user: fix x86_64 safe_syscall 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: Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Do what the comment says, test for signal_pending non-zero, rather than the current code which tests for bit 0 non-zero. Signed-off-by: Richard Henderson Signed-off-by: Riku Voipio Reviewed-by: Peter Maydell --- linux-user/host/x86_64/safe-syscall.inc.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/host/x86_64/safe-syscall.inc.S b/linux-user/host/x86_64/safe-syscall.inc.S index e09368d..f36992d 100644 --- a/linux-user/host/x86_64/safe-syscall.inc.S +++ b/linux-user/host/x86_64/safe-syscall.inc.S @@ -67,8 +67,8 @@ safe_syscall_base: */ safe_syscall_start: /* if signal_pending is non-zero, don't do the call */ - testl $1, (%rbp) - jnz return_ERESTARTSYS + cmpl $0, (%rbp) + jnz 1f syscall safe_syscall_end: /* code path for having successfully executed the syscall */ @@ -78,7 +78,7 @@ safe_syscall_end: .cfi_restore rbp ret -return_ERESTARTSYS: +1: /* code path when we didn't execute the syscall */ .cfi_restore_state mov $-TARGET_ERESTARTSYS, %rax