From patchwork Fri Oct 1 17:11:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515064 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp1005454jaf; Fri, 1 Oct 2021 10:23:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS/MVGcSSqoycpo24Fdo80kifX92W3bKouY/zhuErwlnuZLsyvMs7SFUcgQPFD/0Zfw65J X-Received: by 2002:a05:6102:21ce:: with SMTP id r14mr5468593vsg.40.1633109018462; Fri, 01 Oct 2021 10:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633109018; cv=none; d=google.com; s=arc-20160816; b=PC1ipZNeksrBJCN4PeVRDJ7FJ4sB23OlS0yDQsuFL3SpHNhk9F12W0JQEkw8TqhRmx ugIcmJyAserdKZF7kx/FLS14NObPu6TtLWKUDjVwbhk07Jz2JCGgK6q6TMfTIafPpg7z jLFpOoY5c3sbWsqa7h/Lygxm+dgqO3yR7s9suF1bfe6glMWokFdG1c9fKcsayvrjLtBG +7n6tBs93e/x0vUIcGOrTOJFSYdPXOzXxLL1L3lgAXnrW6JB6Xcd/dPWcYmlTno9bx9S gxb6S7YK4JRYquMjnYCHfBBXjDCVeg9X39fou8v5o9R9MS+udg6Uhg4lqYfeZlQZn3DN URrA== 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=lQDDeP4KrE59xBXWzR54VwCb3z15HLMlRMki+IJBEEo=; b=nu6MY1++T84ucdI1LHUZdVUPGEowrGKRhtJr4bjPEJuS9iIsO93pkMsJ3Z/o5DfoPR HUbGJ56C9pSBI9RiwUsZW6P68xb2bsCLAdpUR6Y8yixIyvN2ymIDDJyjzSmtGH0hKK0Q rAQj8MYEQeLcxij04gYZVNu3MoZt0Vh/mXrGjIHynyRZsCXJpbFO2bUJaX6z0qTIKo/8 rlHTFC0LhhdyhJN8ArqG10sTDgDg58sUH5iZUBmLt1BaP+CiCQOjY0Hg8cBRuRlaTuDm IEeBt/h/Pw6/dIqMtFwuJVzETuwAtoI6YnwLGJmxLi4v100G1Pty76isPgbFijcSMLCg O3Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VXoI1wrn; 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=fail (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 i25si734158vsm.122.2021.10.01.10.23.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 10:23:38 -0700 (PDT) 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=fail header.i=@linaro.org header.s=google header.b=VXoI1wrn; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWMG1-0005HJ-SD for patch@linaro.org; Fri, 01 Oct 2021 13:23:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWM4k-0004a6-QY for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:12:02 -0400 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]:46641) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWM4j-0004wv-DH for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:11:58 -0400 Received: by mail-qv1-xf36.google.com with SMTP id gs10so5959590qvb.13 for ; Fri, 01 Oct 2021 10:11:57 -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=lQDDeP4KrE59xBXWzR54VwCb3z15HLMlRMki+IJBEEo=; b=VXoI1wrngFfI/1y3jprxxdASxBCUI+A3c6wnpzEoNctfl2zsM5nYZmmSygKzZSvYv1 N8kcVkftZgXJxzmx9JYoiIDW0bipKiaT/eUQQi0cysu6Zr0Yk7OTm3pYskiSPzerrt48 3rKbQoViDZc6g8h9wfMQRuNH7CgBRdwjZTk+Ua0/EvirI54/xZJ1cTQ4Djs6/Yvk462r sMyFMxATIPI0TVRaduFJhNhI5Dn0GQtcvMafW9wsXwCdlW1bsrYtc9sDfqjTybi+2wuH LYxbYzYvyZpYGIZ+RLPHvzBsjVNrUbl15FXa0La39bqnOFAD8iXrDT5S1Vw4K0vgCor3 Z4cA== 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=lQDDeP4KrE59xBXWzR54VwCb3z15HLMlRMki+IJBEEo=; b=qIMMjj48Nb+Q372VKOyfSL12PJzuoir+8cVJzimE1kw9bMn3p4x63LY3HQkMwnhJPg R6WWSM4ioyjoAnqqu7qco+N7YqOI+reIdSBYvuivYcQECwyr9UVuHrmvlNnCBRh8LBCG QkA+B+aNpdD1esKaKyhz5cF9DB9XE+2BH1bFho69PsbmsyUP/A47C469eqt8rjOvL8bH AmweNkdgn+6X5M/qEbGGrvltnrg5iY/7lr5ZGgGIxrlf8RQL7TM5e6t57opeAEix8RFJ xIm+0Fcp8e9Qp5d+oudDqZeiSAgT6vXQjK0NVrxojvdhPnT3PTL2/1gbT7L9Neay8PdB cyAQ== X-Gm-Message-State: AOAM532w39DaaRrFLw0vvFTI3Adfd05PHwMbDu1aF0Xn5v5ImyPKFkzD Lv/4DnrJjyHQCW8ED+po3kY99dC7QFlp5w== X-Received: by 2002:a05:6214:1269:: with SMTP id r9mr10196117qvv.35.1633108316552; Fri, 01 Oct 2021 10:11:56 -0700 (PDT) Received: from localhost.localdomain (c-67-174-166-185.hsd1.ga.comcast.net. [67.174.166.185]) by smtp.gmail.com with ESMTPSA id y15sm3557250qko.78.2021.10.01.10.11.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 10:11:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 04/41] accel/tcg: Fold cpu_exit_tb_from_sighandler into caller Date: Fri, 1 Oct 2021 13:11:14 -0400 Message-Id: <20211001171151.1739472-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211001171151.1739472-1-richard.henderson@linaro.org> References: <20211001171151.1739472-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f36; envelope-from=richard.henderson@linaro.org; helo=mail-qv1-xf36.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Remove the comment about siglongjmp. We do use sigsetjmp in the main cpu loop, but we do not save the signal mask as most exits from the cpu loop do not require them. Signed-off-by: Richard Henderson --- accel/tcg/user-exec.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) -- 2.25.1 diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 6f4fc01b60..de4565f13e 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -46,17 +46,6 @@ __thread uintptr_t helper_retaddr; //#define DEBUG_SIGNAL -/* exit the current TB from a signal handler. The host registers are - restored in a state compatible with the CPU emulator - */ -static void QEMU_NORETURN cpu_exit_tb_from_sighandler(CPUState *cpu, - sigset_t *old_set) -{ - /* XXX: use siglongjmp ? */ - sigprocmask(SIG_SETMASK, old_set, NULL); - cpu_loop_exit_noexc(cpu); -} - /* * Adjust the pc to pass to cpu_restore_state; return the memop type. */ @@ -155,7 +144,8 @@ bool handle_sigsegv_accerr_write(CPUState *cpu, sigset_t *old_set, * currently executing TB was modified and must be exited * immediately. Clear helper_retaddr for next execution. */ - cpu_exit_tb_from_sighandler(cpu, old_set); + sigprocmask(SIG_SETMASK, old_set, NULL); + cpu_loop_exit_noexc(cpu); /* NORETURN */ default: g_assert_not_reached();