From patchwork Mon Sep 13 22:05:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 509842 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp954358jao; Mon, 13 Sep 2021 15:07:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQxi6uFlbAQ9VIkSeMz0K3eQjFv5v0vfSWuiSPaddgtwyWf9YD7A9u2Dl4lXRKAZ+HC4hf X-Received: by 2002:a05:6e02:ef4:: with SMTP id j20mr10039152ilk.294.1631570849490; Mon, 13 Sep 2021 15:07:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631570849; cv=none; d=google.com; s=arc-20160816; b=bWOT8Z6XeI5j8XESI0xl6YncUlTeOjBBPKHvAKGwk6VZb3hpONXBSlAGNC8M7NVye2 eqv19WTUeeGZhWx9yUhpsuEQvNqGlA/3WJ7tvAyICDyvh2jYeFVyin+/Bu5Pz8zUtfOU aOMtJC2OCR72p/XhQ3p+acx5G75IzOairjNJ7PHk4mBfony3GM6R0Rk/evGr76y26Yij vG34LDC5iksLl0ZoVg+PLnb/j8yX46fxNJzwxaXGcwqHbBCtIXdGZ4umk5EgxtSdpV/5 RvZD1EDwJ7MBnoCxHV1gDmzBR2oSrUEKCBmoGxC9wA+EQyQM3jUK1+52T/nMaWIAlO6C zPQQ== 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=UEwGCVckIB8KvhnLN1rP6M7bfEXyZ0UAya2D2H0VVIs=; b=jxaqZ174V5Wycgn7DBJfnPKHUoki83JRWqm3tmHwG1x4d0w4sWGg3IghVjGosb7N8T fi8NAdPkwlGcibS/r7lRWjjx9+FsA/gXXJAdMdKD9BYMr/iaefhdDwWztL2hcH4sFwHU P+d4UCWULQrCKUxUrPf18Ipe7wdnEse0gayvXFUSmRRlA2/W624AVuxLPtqMfD40g14L vohm133rHdE7z3nCueP8Kp49N109nx/3t0+3H/0whwOGyZ9U66TYfyWdAkJJdkDKPLqG rSy6qjDORwHRhE90aTId3ucIRaNoN0pvHZHxdmfVm4P6YO3VYf6aDJF30L3ekKQV5YOk h5rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=J8LDeKa3; 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 o6si8283258ilh.124.2021.09.13.15.07.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Sep 2021 15:07:29 -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=J8LDeKa3; 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]:48898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPu6p-0001w2-W8 for patch@linaro.org; Mon, 13 Sep 2021 18:07:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPu5S-0001t2-Td for qemu-devel@nongnu.org; Mon, 13 Sep 2021 18:06:04 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:35355) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPu5Q-0007OR-64 for qemu-devel@nongnu.org; Mon, 13 Sep 2021 18:06:02 -0400 Received: by mail-pj1-x1035.google.com with SMTP id f3-20020a17090a638300b00199097ddf1aso589787pjj.0 for ; Mon, 13 Sep 2021 15:05:59 -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=UEwGCVckIB8KvhnLN1rP6M7bfEXyZ0UAya2D2H0VVIs=; b=J8LDeKa3EDA8SSu5356+HpTlXWKwj50nhwERzzWrwr5A9AdfbKlmDsRJCULm3tFc10 pW/USukh5GQ/dlcCRz6XzWZuTtKOy5NjWjzhJFEfFO2mG9JI5ZEcHVky0C5bOtoHaz5l OMEGtDhqK62CDpahobQ+ZihQnT4ROWfqMc5xewBds3KAWKp4ijM/QwMtk7co/KxIai6G VcMPpJXhQhOBrRYrLAZ3CUtg5X5O3GQvNTyq5+oCuZquIyL+sd8vMdrI1eHyOZy1RvBz QmBrKNVrdsHwbI1yTXhQKFh24RmbElHupSDHrRAc47BWTKqhu3yxJzcTI61IhMbqcETa mURQ== 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=UEwGCVckIB8KvhnLN1rP6M7bfEXyZ0UAya2D2H0VVIs=; b=5cZfyNSdf4cfbbW5zURmIbVD6snkiehNi6CsFUtQiRjhXLufrt3rsNwq8BBEsXXavr WUMmymfowYRvEn3Ss3xTzChH6xaQbZRE3b7/HrEGjsGWbIUz7x+7zT2r7R1mbfFOO1GB o1KBu264htJ7XhGiSVwudquZrg67M0bHKUdOpJnPU140kAsvu2C5Bt/EWgRKaQUsbtzn 2LDocK8U1XjYAj51pEPAw4tpQ/gX4CR2fQYQaVp3lKWsQlf+KkKCEJawKcWuRJlXl+JK r2V0cy2GO6XkPL83k8YFkFH14dx3EU7Y61iD4Sv/Me6/CMBH/jgopMYOazdQEpUcI/ZB ovSA== X-Gm-Message-State: AOAM533U3WiuQ9rFdaPHksoPHDjKUl2V0IDIAienylCuoZaB3cMks/Sv XUTRX1Bk7RRbDQFXymyIh8o9Or8DTc5G4g== X-Received: by 2002:a17:90a:5511:: with SMTP id b17mr1797527pji.222.1631570758512; Mon, 13 Sep 2021 15:05:58 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id 17sm7721404pfx.167.2021.09.13.15.05.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 15:05:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [RFC PATCH 5/7] accel/tcg: Fold cpu_exit_tb_from_sighandler into caller Date: Mon, 13 Sep 2021 15:05:50 -0700 Message-Id: <20210913220552.604064-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210913220552.604064-1-richard.henderson@linaro.org> References: <20210913220552.604064-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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: peter.maydell@linaro.org, laurent@vivier.eu, imp@bsdimp.com 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 | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) -- 2.25.1 diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 83351db719..ad6b4f6abf 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_signal_pc: * @pc: raw pc from the host signal ucontext_t. @@ -157,9 +146,9 @@ 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(); }