From patchwork Fri Jun 24 09:53:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 640131 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 3rbZ5j6GWzz9sBX for ; Fri, 24 Jun 2016 20:17: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=dzPSZGTM; dkim-atps=neutral Received: from localhost ([::1]:42366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGOBD-0003uE-No for incoming@patchwork.ozlabs.org; Fri, 24 Jun 2016 06:17:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNo6-0000yJ-40 for qemu-devel@nongnu.org; Fri, 24 Jun 2016 05:53:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGNo5-0003TA-52 for qemu-devel@nongnu.org; Fri, 24 Jun 2016 05:53:50 -0400 Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]:32957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNo4-0003T2-TO for qemu-devel@nongnu.org; Fri, 24 Jun 2016 05:53:49 -0400 Received: by mail-lf0-x229.google.com with SMTP id f6so112307971lfg.0 for ; Fri, 24 Jun 2016 02:53:48 -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=dzPSZGTMRmUoiDmTGqlt4CY7Kuyunwg3FdG6MVo5nir+xHbaPbJzBBdQX/vXmEf8bA p3UujjspPaSgD/tbVHA1C9XpARhYRl7g9R05bcSV3KoWyDZ1Zngrzcoeu3h3Om6kuR9h eYhcMVUuKf4jsBCm6DTREIhTY6aCjvzjgBkWI= 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=eqVCdv7dvOWgSKgzaXIYXyQhljn7+skb7nsFVOu9HyI7CEIfuZwl/4BPjGwi0RWfrg zim+Spsr/ys+mA+RkbZaPjkOjUG6fQpf/QFFxfVZZBtSn9Hmsyy7fKKKp1gGLHZ03LhR YEcdHX1NIZ4SKzw3Z+Bi1Od9U3+M2R/Vbq2I4+8VBGh8nfz6EFmOhYVHyBQt6gufpwIu TNxF1R/kMKlcA0X4VkqG0qjFj7TzxBdAj4QdTJoYLZVxvjKqRhevm+W/7dCGx6gAn1ZE 9IteCOdOuk4B13DYyvRZgrvoxGUf16ctyOZM5EQNtckPN2LS9z9lULD+uueGI++2nKXU jBVA== X-Gm-Message-State: ALyK8tLHe1eZzo+JlJiXEDFrcGlouNXx3u+HYAsY4PemYMV3oE1oFQspHGrI0rqhT6SynGZ8 X-Received: by 10.25.127.8 with SMTP id a8mr1095575lfd.12.1466762028133; Fri, 24 Jun 2016 02:53:48 -0700 (PDT) Received: from beaming.home (85-76-80-69-nat.elisa-mobile.fi. [85.76.80.69]) by smtp.gmail.com with ESMTPSA id o137sm798203lfe.2.2016.06.24.02.53.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Jun 2016 02:53:47 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 24 Jun 2016 12:53:14 +0300 Message-Id: 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::229 Subject: [Qemu-devel] [PULL 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