From patchwork Tue Dec 21 02:50:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 526589 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp4676099imb; Mon, 20 Dec 2021 18:56:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwafSg08gjivITMgWK4E/sqSIAlfksBp3CtF2+6VFHeHilgMHiF4CS8EbGT8+cFqOQpusJo X-Received: by 2002:a25:fc5:: with SMTP id 188mr1668336ybp.608.1640055364969; Mon, 20 Dec 2021 18:56:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640055364; cv=none; d=google.com; s=arc-20160816; b=1HxLT9Rw/MgiLaX1Z20lrOi5mz213JplT2Lls36OJJucQZBygeys4YspnSbQq2bLMJ AhbTVz6ghqItaxinaPzKqVPy7JViXvcQe4TRQBLWjZRzhZfnJ9eoeytpvgD5V0RFQ1No GGd/hW+BONoL5xtGeaij5qIhcIP58vy8fkm05pTIrKUyIBRSAXacuBWF4Utl8Jx3bl1E fZnbw8Jolehm6NmPghrpDMLjGo2hT0yQlfvA3XhxX454unXiLpB0KxNw8AfhgDnBM6bg J5hSD+9d7/1HmXkKbg10hYW25eCmdLp6BM9S0xSwBBs+f9JvNewu6YPeA48zoSbbQ+HB 4nDQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=isjT3VM0fssSgBZyBVG7BinpIcaowlRssp8BNfIngDU=; b=q/rYKWtcqPbHr3Z3kbLydnpnUJlTMbI/OdhvFC7dbPfbZIWoozYnwiWVIGFRTRh3Rd d5eYQBQob70AGYjutEKRVVDD3ZKzGPy7yn/WIsEZuS2EJOIeYeKNkCjo/FfEbN2XxkOS B1ZmiSBuIP6itdgv+g/SViUmsodLQZZZMfUExXgONj1Sa8nnwRa+mpsb6OR0kWvYE8NH 8TazfsD7TfZnXTiApKrM4UP24s+Vz0QDEK0EdYyjwvUHAxQTeW7ancKZ20NMQ59I8yYq Xvuv0mrUxvB1JLq8unv59zi1u356k6DzgxeHaU3rRNdnn9aCiZl42RAbDebVhH5w0iSZ NIjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qEMK4bV0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r13si21744327ybk.372.2021.12.20.18.56.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Dec 2021 18:56:04 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qEMK4bV0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzVJs-0002vH-FI for patch@linaro.org; Mon, 20 Dec 2021 21:56:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzVEN-0003m6-KV for qemu-devel@nongnu.org; Mon, 20 Dec 2021 21:50:23 -0500 Received: from [2607:f8b0:4864:20::529] (port=37648 helo=mail-pg1-x529.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzVEL-0000DQ-UV for qemu-devel@nongnu.org; Mon, 20 Dec 2021 21:50:23 -0500 Received: by mail-pg1-x529.google.com with SMTP id a23so11037162pgm.4 for ; Mon, 20 Dec 2021 18:50:21 -0800 (PST) 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=isjT3VM0fssSgBZyBVG7BinpIcaowlRssp8BNfIngDU=; b=qEMK4bV0Ey3Oi/KzFEFwGRoC/Mg1tbvFb81ieKvcru8GgS8qARGWfLjChBna+mnzdk QhvK1qYQQt0Uwt/M1BJHXAoMTOzlHNAyIds+4WbQ6C0tC6QOPqFA6ihEVBJ3CXm0fj93 FJ6Fv37Rq9nsIfYXvN6cWrJWcH9A1Q9kEDzULB0yRP5BQornIe0FvL/xNxBnWpPskgFv hRWtw1BFm+1sXF+5orQum6eb44NH1OBbPNEFtk0NexNinpkF/YHxFFGEofkp91YoQQoN uHTbaLOS7efryPOofcHkl1q2dos/KGdrAR1qMarSPR8lF06iBy5YOo29kg6DeaQM6b8+ vv4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=isjT3VM0fssSgBZyBVG7BinpIcaowlRssp8BNfIngDU=; b=2j7yqlgK3BL4IzSOIDeWa6fqD7vEqM4ZU4/NlbWtHf5nf6Y7WWWA8ZzxG4WtKa5uIB a9itzcxYW03FiRwMS2EvSlcFkBjLpuyvx80raLfg1IjzHnKtzTAstUBH3UR06SqQRsbc xAU9yeZWvwCSSdByZAws+W7DzFVZjzzKqWDj182eZ01atsIgLiqm/l5ZWkeMrP+quUD0 Rb0rFv1Wp8OnMDQoBpycIdOYBmJXpv3PjHpv/yK7zWyR6QMf+z6mPbqsDA7N6rG4w8WA 6qGw+rvamVbscxAEpfnetvn5X75rCSNn70fxSvYrQMGc2INq44Ynu3RMJZbeoLI3ajQH Zgtw== X-Gm-Message-State: AOAM530TqTebOkH5L0jp+U/svwRDse+aeM3joOqdlIMwO9QzMPcOehik kgHsadzC3grD9YqJceLuSlFw998SoggmJw== X-Received: by 2002:a63:8448:: with SMTP id k69mr1044271pgd.268.1640055020610; Mon, 20 Dec 2021 18:50:20 -0800 (PST) Received: from localhost.localdomain ([156.19.246.20]) by smtp.gmail.com with ESMTPSA id bg23sm694025pjb.24.2021.12.20.18.50.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 18:50:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 7/7] linux-user/nios2: Use set_sigmask in do_rt_sigreturn Date: Mon, 20 Dec 2021 18:50:12 -0800 Message-Id: <20211221025012.1057923-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211221025012.1057923-1-richard.henderson@linaro.org> References: <20211221025012.1057923-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::529 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Using do_sigprocmask directly was incorrect, as it will leave the signal blocked by the outer layers of linux-user. Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson --- linux-user/nios2/signal.c | 2 +- linux-user/signal.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/linux-user/nios2/signal.c b/linux-user/nios2/signal.c index 80e3d42fc9..517cd39270 100644 --- a/linux-user/nios2/signal.c +++ b/linux-user/nios2/signal.c @@ -205,7 +205,7 @@ long do_rt_sigreturn(CPUNios2State *env) } target_to_host_sigset(&set, &frame->uc.tuc_sigmask); - do_sigprocmask(SIG_SETMASK, &set, NULL); + set_sigmask(&set); if (rt_restore_ucontext(env, &frame->uc, &rval)) { goto badframe; diff --git a/linux-user/signal.c b/linux-user/signal.c index 6d5e5b698c..8cb33a351c 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -258,7 +258,6 @@ int do_sigprocmask(int how, const sigset_t *set, sigset_t *oldset) return 0; } -#if !defined(TARGET_NIOS2) /* Just set the guest's signal mask to the specified value; the * caller is assumed to have called block_signals() already. */ @@ -268,7 +267,6 @@ void set_sigmask(const sigset_t *set) ts->signal_mask = *set; } -#endif /* sigaltstack management */