From nobody Tue Dec 16 11:04:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1631991104; cv=none; d=zohomail.com; s=zohoarc; b=gPxX3t272jCA0duyiU4m2GELggrpObGAW6CdEu21bANHm2fxlod4agtIc6xvM0kSNn59TfdM5gmp0eFNEN+iff4g8rSMj6A6v7FdeKvPJJEY9Kp2/BMotH+VeNonNR7rB2kRjS6ZvzbKb2swShLGv3h/PdVrZgBvNeHfwIIQpCA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631991104; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=00YKLAZKgTNNfjhBetZk/EbYoBmFV300gqUFQ/RO0uM=; b=Y7rCkTDI+M4jORbSQYhOmHxh2UV59FgxXShklWR+/YTeRFSiGCZJnarliFqyrWwgnFgKKeAxsVXmA7VbohQTJ6VE44NoPGHQlZ86By0SNTVOJLfNwgcmjIWeJUKwmI9/DsM2TG7cgmv/H0b8620vU/L3bhlIHkYiw1G4Lj2Wh+Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1631991104822957.6956051177078; Sat, 18 Sep 2021 11:51:44 -0700 (PDT) Received: from localhost ([::1]:48468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRfR9-00058e-NX for importer@patchew.org; Sat, 18 Sep 2021 14:51:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRfLE-0004yZ-H3 for qemu-devel@nongnu.org; Sat, 18 Sep 2021 14:45:37 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:36412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRfLA-0006hM-To for qemu-devel@nongnu.org; Sat, 18 Sep 2021 14:45:35 -0400 Received: by mail-pg1-x52f.google.com with SMTP id t1so13124247pgv.3 for ; Sat, 18 Sep 2021 11:45:32 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y26sm9555858pfe.69.2021.09.18.11.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Sep 2021 11:45:30 -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=00YKLAZKgTNNfjhBetZk/EbYoBmFV300gqUFQ/RO0uM=; b=xigLHquHLCUG78JHrVvVwD9zo791ZGsW4L99y+/cSFetdnuCZ/iCCD96u0XYhr18zX 7OcJD+M+IEo8o1WVdOzE/JXBcjkSaN4Vwrn3ovixq6IVjc9WhLCdAGI1bD4dnciWRfL9 sLrGv87NlDN48Cb4xtPFOv5Y8xThhoeW0Eg0tiXNI13UBWO54xwe30yZ7lgQbbnwQSt0 5E2RAwmT+t3TlwAJ2bkopVSVcTfQK7lZaToqfU0P7qL9L+foUMUQWH6C6G2fHMdKTDks hYu5OhnEm0RFZyMtv4pKef6+8go1SeMQ+og6VLuDGtqyfVQDCsZGwkHcAVYvCxv48Tlf ffYQ== 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=00YKLAZKgTNNfjhBetZk/EbYoBmFV300gqUFQ/RO0uM=; b=Ex/RhvuVoCc3NVsLUfMXKSBz0r/knw47XZQnasjcmuNfUKl/Cg+QKb9+1z3JqOocJq O0L+88Cy43e68I+10KLF1gUZ5itElY6SMce003MGmmPI1jpIcpjcYMbQDgDUDujzoezs tsp9YVaYe7s6/ohFhH5gwgvJ6tM9UKZiS36Xfp32+u0dftcmHA5wHrOl4jXRPr7dGco5 ecmspIVTiRcsFdvom/Np73qoius9paGrs0Buw+xtbqfAwFmUGw0Rl04QNGxmzd9UVa6a 59ZBAtwjOwmQNxwfAWtof61rpyrlRXDkr5hKomtOvGhfgQPTJdTbIMZ1zLXyD3E1U/JB lJYQ== X-Gm-Message-State: AOAM532SV8nULHMFFjj5WyXWK79DTvdX928qc1XxssNoMcXEXZWHmKW2 kx+erHPXsvYwgAWEmh2S7j1UgOOV+HB4mA== X-Google-Smtp-Source: ABdhPJz6Vn0GbqgEVydRiE+kSOnsZj/mI4aFuJpZ2hpOS/Q84psStRkIF0WaDynHsuBC7VSc1WVetw== X-Received: by 2002:a65:6187:: with SMTP id c7mr15986844pgv.317.1631990731111; Sat, 18 Sep 2021 11:45:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 02/41] accel/tcg: Move clear_helper_retaddr to cpu loop Date: Sat, 18 Sep 2021 11:44:48 -0700 Message-Id: <20210918184527.408540-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210918184527.408540-1-richard.henderson@linaro.org> References: <20210918184527.408540-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.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: laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1631991106004100001 Content-Type: text/plain; charset="utf-8" Currently there are only two places that require we reset this value before exiting to the main loop, but that will change. Signed-off-by: Richard Henderson Reviewed-by: Warner Losh --- accel/tcg/cpu-exec.c | 3 ++- accel/tcg/user-exec.c | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 5fd1ed3422..410588d08a 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -451,6 +451,7 @@ void cpu_exec_step_atomic(CPUState *cpu) * memory. */ #ifndef CONFIG_SOFTMMU + clear_helper_retaddr(); tcg_debug_assert(!have_mmap_lock()); #endif if (qemu_mutex_iothread_locked()) { @@ -460,7 +461,6 @@ void cpu_exec_step_atomic(CPUState *cpu) qemu_plugin_disable_mem_helpers(cpu); } =20 - /* * As we start the exclusive region before codegen we must still * be in the region if we longjump out of either the codegen or @@ -905,6 +905,7 @@ int cpu_exec(CPUState *cpu) #endif =20 #ifndef CONFIG_SOFTMMU + clear_helper_retaddr(); tcg_debug_assert(!have_mmap_lock()); #endif if (qemu_mutex_iothread_locked()) { diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index cef025d001..e94f1fed00 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -175,7 +175,6 @@ static inline int handle_cpu_signal(uintptr_t pc, sigin= fo_t *info, * currently executing TB was modified and must be exited * immediately. Clear helper_retaddr for next execution. */ - clear_helper_retaddr(); cpu_exit_tb_from_sighandler(cpu, old_set); /* NORETURN */ =20 @@ -193,7 +192,6 @@ static inline int handle_cpu_signal(uintptr_t pc, sigin= fo_t *info, * an exception. Undo signal and retaddr state prior to longjmp. */ sigprocmask(SIG_SETMASK, old_set, NULL); - clear_helper_retaddr(); =20 cc =3D CPU_GET_CLASS(cpu); cc->tcg_ops->tlb_fill(cpu, address, 0, access_type, --=20 2.25.1