From patchwork Wed May 31 13:08:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 100752 Delivered-To: patch@linaro.org Received: by 10.182.202.35 with SMTP id kf3csp294187obc; Wed, 31 May 2017 06:11:42 -0700 (PDT) X-Received: by 10.55.111.198 with SMTP id k189mr27662596qkc.160.1496236302004; Wed, 31 May 2017 06:11:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496236301; cv=none; d=google.com; s=arc-20160816; b=gTUUBdO+K6Y2oPcTa0QKA187HIBFtDWwbeBvz8HdyPVgSNx6rPmfH18AiVBlRp0d6u DlWqApX357gEesBR450+hmlsawY1KKzT4qaNonhvMqztaQ3hKg9q/uNWPtspmMJ1SNwi xg13BJTldNaO2B3j+rp+KAynQCr4R2I/RbcXyLjmN6wPhl8xB4XFzW0TNpHfCt8VjvQi mn69YnCslSv8OedFyXo9+LJOFPFl0PeMt1S+SSjVzT3KfR9H0/y2S9iW96/pLW/CRcZ2 4RteT0smV09BIAKM7XIvdMqyGEN8dwQAm7PbtEtmVZc1jG9E/HrM12iNsqIl461DnPcy acDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=VG4eZNogBzxWH3wtW9iYiZOiLLqqSsAUGrFh7oRbYWY=; b=Bi6tqhHFp89EjFnDB6YC4GcnztbNbiJkb/lbGjQSjje+9vOhzlPq27UH6ATY8s/NGO k5z4jTeOm7qAzqNSvpD8SJOiVs6Qa/2GzGfchDWFAjjCUKFt5qdrEAt/j6CbdxNuKdel aqOS8HaDnFF0sOqJsj3Mu/zjT9hQFBGiTMAw+UxT/FHmSIM16l7gw7iMYCRYJG0Y15md 1vj7Tj/wNhMeEzicBpXuYbATtyc/2Us9Qks2LH7rzKLFVXMo+G9o+0iD5dfm9MXnILtQ UKBY/seE22PTHTlY7oMonwhpDUy4CKLK4ZzX3R9JoLPTjkylHdWRkymndO20Hl1N9PSU e7og== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g4si15947225qkc.101.2017.05.31.06.11.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 31 May 2017 06:11:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG3PX-0001KZ-E1 for patch@linaro.org; Wed, 31 May 2017 09:11:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG3Mk-0007Zy-S0 for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dG3Mj-0003ex-PS for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:46 -0400 Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:34477) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dG3Mj-0003ee-IZ for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:45 -0400 Received: by mail-lf0-x230.google.com with SMTP id 99so8621455lfu.1 for ; Wed, 31 May 2017 06:08:45 -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 :mime-version:content-transfer-encoding; bh=VG4eZNogBzxWH3wtW9iYiZOiLLqqSsAUGrFh7oRbYWY=; b=HIZSg1YGdt5FguNo102SDpzJezuVdKbUFbLxaAjvLZBn9MGFhTxb4WWtZY5axM7wDb 97CUL21/knpKT8+MNnmgjN4bercHzSURIOvuN8clllherOiraeTututW8mtGp2etDxF4 rAUvXJMInV6RznuhGeKdy9DBltqNnE/rrntHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VG4eZNogBzxWH3wtW9iYiZOiLLqqSsAUGrFh7oRbYWY=; b=muWtUTjI6gaxdefIbou9nm1cJn3JwGkfoAgmut0mg5296vF1NovDIO1OJ0UARel0e4 Iz/DMhW9lakkubxoH44k1O/EVmxNe9Nd+/EZ+y/IPI7RhMew6RS8ffVoOF0KvpHrr2Kz hU9Eqy6tKY6ZkWNC6aWnpN55+vG2Dea8Ovvjzkm4wIeylbXsZLIevRwJZLFMaSSf7XvE /npczWJCWrlvBwAgwe/00jqcdfYInoW7FWGSELCv457szfZVjp1EDJGFq0Dhen/1hnJc x/SP7V6OZbD31FEkdkUCE5bXgxfI4JPeLH1HmAUbrJZO9JT3ZvMezIYQZhOqMEAs+lTY pYmA== X-Gm-Message-State: AODbwcBu+bwRTk++1zNOhx0bkayNTMoozcRYXN0Hz84MZrhJuoh1iG2X G22C08G7ILl9sbetpDUz8A== X-Received: by 10.25.79.3 with SMTP id d3mr7431103lfb.179.1496236124130; Wed, 31 May 2017 06:08:44 -0700 (PDT) Received: from localhost.localdomain (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id o101sm3741766lfg.3.2017.05.31.06.08.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2017 06:08:43 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 31 May 2017 16:08:21 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::230 Subject: [Qemu-devel] [PULL 09/15] linux-user: fix ssetmask() system call 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, =?utf-8?b?TWlsb8WhIFN0b2phbm92acSH?= , stefanha@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Miloš Stojanović Fix the ssetmask() system call by removing the invocation of sigorset(). The ssetmask() system call should replace the old signal mask with the new and return the old mask. It shouldn't combine the old and the new mask with sigorset(). Fetching the old mask for sigorset() is also no longer needed. The problem was detected after running LTP test group syscalls for the MIPS EL 32 R2 architecture where the test ssetmask01 failed with exit code 1. The test passes now that the ssetmask() system call is fixed. Signed-off-by: Miloš Stojanović Signed-off-by: Riku Voipio --- linux-user/syscall.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) -- 2.11.0 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 909dde6de6..93bc6f679e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8621,17 +8621,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #ifdef TARGET_NR_ssetmask /* not on alpha */ case TARGET_NR_ssetmask: { - sigset_t set, oset, cur_set; + sigset_t set, oset; abi_ulong target_set = arg1; - /* We only have one word of the new mask so we must read - * the rest of it with do_sigprocmask() and OR in this word. - * We are guaranteed that a do_sigprocmask() that only queries - * the signal mask will not fail. - */ - ret = do_sigprocmask(0, NULL, &cur_set); - assert(!ret); target_to_host_old_sigset(&set, &target_set); - sigorset(&set, &set, &cur_set); ret = do_sigprocmask(SIG_SETMASK, &set, &oset); if (!ret) { host_to_target_old_sigset(&target_set, &oset);