From patchwork Sun Apr 28 21:49:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 792914 Delivered-To: patch@linaro.org Received: by 2002:adf:cc13:0:b0:346:15ad:a2a with SMTP id x19csp1417634wrh; Sun, 28 Apr 2024 14:51:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUbwJX/8g68ICuMoKqdIMbVYrOIIZCR1CrEoxMlf+XtyeHTXUEgXiyyvvPX6pPC9hRYyreeM2wu+PsKOO3vSRTY X-Google-Smtp-Source: AGHT+IH8CuMuh5ui8/IfmMbFV5G1pxhxVbXTU3dy6VRsI+6ztbQGoUQXQpkO9BakjqapfzZ9q8Om X-Received: by 2002:a25:ce4d:0:b0:dcd:5187:a033 with SMTP id x74-20020a25ce4d000000b00dcd5187a033mr9054597ybe.2.1714341096681; Sun, 28 Apr 2024 14:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714341096; cv=none; d=google.com; s=arc-20160816; b=njcJo2mlvW4vg1IMN1c6aijq9nK27VRkWV85rmsDzVCihEDSVPMjnuTYM+1axkvg+F 10EuWW/CYXl4xdixPAPVmzWWvr+yRrFpq3Q5WRQiUh/yuSWH6QvWerbDFNqC5v25bSW9 UODYQXyiyi0X2Mwrjzkh/LrvxZ08g7nDSjeM+mRNYYED9KkAGTKxaZ7zbb4hhfMwLbaA pXvFLXA8ZajHvMawbATNSZhtOamQZRi6nF9WBh/NBtLFhU75msDqT05hfXQF9YbAZ+zv Ri24EcJBDg+fDEZa5WwRS0yE2NJQwo9TvsMLhyK/Jmrq/GfGwpdkahrqSIgEPeoAu5nN y9Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=0n+ImpRw4HIvF2HMD0Mqry3BChMB8K31XsSyFCMilH8=; fh=ZXDWg7hKG7Hj19AbRuutTLw+Zvn/B9RsGUUw/YagpFI=; b=oO8XD6snyR/nUE3CF2Giv9Jo6RUCo9nL71QOVhK/2oeyCoDzzhYuncnsqtCtWh7kIu RGf2HGOcQ9xPdFy5bbOBsuIK2g5LZX2ZX4tlui+YFXinBjc2wcDnQYP/GkmXn91AjqaE NN/r3tyvPni33pV/1xOmQIyEbEJWnNZF4MFZuNHifpbJdU7DCFyBZh94fRLUueV30BeV 7oqRWvjcxmjTvbNjq6mPye3nfAWGE3iheYmVQXQoFxP2XeMBLhA2V9KpmC/YzC7E89vh T54QWYYf/dMLNOSh5X9HUx3vW0Cp9PLogXABpQHSDg+EjetDdtT6hqq7lMLSa4oQvIra /euQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="l/j7oLb6"; 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 f31-20020a05622a1a1f00b0043ac04e697asi2939677qtb.727.2024.04.28.14.51.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Apr 2024 14:51:36 -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=pass header.i=@linaro.org header.s=google header.b="l/j7oLb6"; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1CPl-0003Ax-F0; Sun, 28 Apr 2024 17:50:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1CPi-00035V-J7 for qemu-devel@nongnu.org; Sun, 28 Apr 2024 17:50:27 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1CPW-0001JO-0n for qemu-devel@nongnu.org; Sun, 28 Apr 2024 17:50:26 -0400 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-56e1f3462caso4807725a12.3 for ; Sun, 28 Apr 2024 14:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714341010; x=1714945810; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0n+ImpRw4HIvF2HMD0Mqry3BChMB8K31XsSyFCMilH8=; b=l/j7oLb6VBJricJ7aSp9NlbvLArVslOrxKocx4ulcOEWruW71vDibugY66SmscOnRZ MbUsUdLFlUYtrqwNawduWqrlMtUGoNCOYH2bKG2joHbFusL7+uc7csAMNRggKyPC8MFT nHEG1FkCh5o32eY5y8AIjQXRsnuODeJlapA5vjUTBGUDuDymsTsjuaNqs6JC27fgrfQU GGyIj4xiuVYr2x3G+J4fapqeeGld6hz184GggNDlxF+QWijDCTpiLrImTMsbsJhncfVg WmPid0b7YrhF/MwuqlY3bFsGhB10jqTLQEbUbhPgArFUNEc6SasbVKrXtVlgumAynrqq M4hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714341010; x=1714945810; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0n+ImpRw4HIvF2HMD0Mqry3BChMB8K31XsSyFCMilH8=; b=XskhTnGKPRmFXC5ZB84erNMvclDbITItgMuRGZyGLjBUuLc2yI7K5RAOMCvOwspnNB uDBvMk6GC8g5TGwJDry0///r+ron/PvO1qSP+oo/kQz8U+gk8b/cmCV8xE5k8NNKCGDL e3BCcNyQ1o04UIrBtmtSou2UO9tuSm3lWshTKGYvjMQ0xrvjOuRUZDdJrPqRdXuXFl6T K2I67SoyvHootJmG3X7bfba3uBjer9ViSVGBNXnqN4CkKcNVEi00H4hSxbMREaN+RK2Z 09lUjs2aD0bGwI/a8yKsNNFlQN83SOe+/zfAi8SrZ+R58ucPR3upn0nIMODuvZqywHFS r/WA== X-Gm-Message-State: AOJu0YyD5Uv6Sr13rtc6QjbydNIdzN2LQ+pNZcSy0wlJPrmLK0MmozPh beKS3/mlgtdJSWcIg12NVQMjVGcBJafelqnjKwqXsshuzixV7m7TMrJjEyZGvJoNRd0PiLIcGdD T X-Received: by 2002:a50:d752:0:b0:572:727f:d0db with SMTP id i18-20020a50d752000000b00572727fd0dbmr2475784edj.15.1714341010733; Sun, 28 Apr 2024 14:50:10 -0700 (PDT) Received: from m1x-phil.lan ([176.176.142.130]) by smtp.gmail.com with ESMTPSA id i32-20020a0564020f2000b005723bcad44bsm4472844eda.41.2024.04.28.14.50.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 28 Apr 2024 14:50:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 09/12] accel/tcg: Restrict cpu_loop_exit_requested() to TCG Date: Sun, 28 Apr 2024 23:49:12 +0200 Message-ID: <20240428214915.10339-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240428214915.10339-1-philmd@linaro.org> References: <20240428214915.10339-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=philmd@linaro.org; helo=mail-ed1-x535.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, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org cpu_loop_exit_requested() is specific to TCG, move it to "exec/translate-all.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/exec/exec-all.h | 17 ----------------- include/exec/translate-all.h | 20 ++++++++++++++++++++ target/arm/tcg/helper-a64.c | 1 + target/s390x/tcg/mem_helper.c | 1 + 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 4c5e470581..2be7ef1809 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -29,23 +29,6 @@ #include "exec/translation-block.h" #include "qemu/clang-tsa.h" -/** - * cpu_loop_exit_requested: - * @cpu: The CPU state to be tested - * - * Indicate if somebody asked for a return of the CPU to the main loop - * (e.g., via cpu_exit() or cpu_interrupt()). - * - * This is helpful for architectures that support interruptible - * instructions. After writing back all state to registers/memory, this - * call can be used to check if it makes sense to return to the main loop - * or to continue executing the interruptible instruction. - */ -static inline bool cpu_loop_exit_requested(CPUState *cpu) -{ - return (int32_t)qatomic_read(&cpu->neg.icount_decr.u32) < 0; -} - #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) /* cputlb.c */ /** diff --git a/include/exec/translate-all.h b/include/exec/translate-all.h index 85c9460c7c..dd26f70378 100644 --- a/include/exec/translate-all.h +++ b/include/exec/translate-all.h @@ -19,8 +19,28 @@ #ifndef TRANSLATE_ALL_H #define TRANSLATE_ALL_H +#include "qemu/atomic.h" #include "exec/exec-all.h" +#include "hw/core/cpu.h" +#ifdef CONFIG_TCG +/** + * cpu_loop_exit_requested: + * @cpu: The CPU state to be tested + * + * Indicate if somebody asked for a return of the CPU to the main loop + * (e.g., via cpu_exit() or cpu_interrupt()). + * + * This is helpful for architectures that support interruptible + * instructions. After writing back all state to registers/memory, this + * call can be used to check if it makes sense to return to the main loop + * or to continue executing the interruptible instruction. + */ +static inline bool cpu_loop_exit_requested(CPUState *cpu) +{ + return (int32_t)qatomic_read(&cpu->neg.icount_decr.u32) < 0; +} +#endif /* translate-all.c */ void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr); diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index 0ea8668ab4..f78430da0d 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -29,6 +29,7 @@ #include "internals.h" #include "qemu/crc32c.h" #include "exec/exec-all.h" +#include "exec/translate-all.h" #include "exec/cpu_ldst.h" #include "qemu/int128.h" #include "qemu/atomic128.h" diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index 6a308c5553..17fab5e8be 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -25,6 +25,7 @@ #include "tcg_s390x.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" +#include "exec/translate-all.h" #include "exec/page-protection.h" #include "exec/cpu_ldst.h" #include "hw/core/tcg-cpu-ops.h"