From patchwork Sun Jun 11 08:58:40 2023 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: 691355 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp1572393wru; Sun, 11 Jun 2023 02:05:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/PU+Od4oqpYx0ls2Swh873FLWWewLXJ9Yip2XZXK7MBzl1kDCZFPFV1jJ/ftErlwuhe54 X-Received: by 2002:ac8:5a09:0:b0:3f6:b151:7db1 with SMTP id n9-20020ac85a09000000b003f6b1517db1mr7308974qta.62.1686474306347; Sun, 11 Jun 2023 02:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686474306; cv=none; d=google.com; s=arc-20160816; b=FWkOCpg9rO98y8/r5Y0vHg/F6xH0IZKeAqghAn+MNu2vdnwQKeI/r4yVZwNJCjhzKR rUFbJNtKxi1zp4xdoyInkt9XDHCENN1omnmxg9eUMpk6tH5BTmidTkWVlnQ8eSJD/bZR Xc7xrWMxDS7eFikvoQGiKJ2YLhceQx1NKuzDNtxEqe3MLaHnA6W4Vblvivt9FvVsqw3k ZuxwRhqLGmv+hPnik/adz5ZaLv9EuuURPTG36V4k7FPZ2EHZGZ8+WnIsMXXNuBKyqlQh sjUaZNxozdFmJhCgTaELnxqEJ4RsyB15d3lpVLGNqnmjLQHTls0FTC5Z+Zo3M/OMqSHt 6JCw== 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=TyRRQl63EjUwf6nuHb///9HEwrhn3HTdxj4GOGWSaio=; b=nyEfSTe0EMeMfbQZC8yjbimDfwSXjgEBEg4Ou4TG7nfsNcATfxhQlakILbyf70H1I3 lkRSlFjnT7qK28VjGCttSU9zvMyRV/pS573p/3TE8nO8+Vdp61QQDb8ibemAcxUim2Uy L9KIic5KSzEuUkCeFUGMD98mbGV8Yu1UqxVC+X52+IUfee/BWas7AKHvk/IvfwgXdKc/ INmpJybrGzcwA2qGXy0+S8JWDrw1lzPOxjLeXgYlYzbTT5UCRagXwBBpWns7hCBB3KC1 rNFvXPtP0ySPndz+u47KUzTU7xXoAU65H+dh7BrpaBP6yrGhBs1RaSj0r7OEP3hrwVPR DZDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wFALolBS; 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 f38-20020a05622a1a2600b003e3874d7b4esi4343446qtb.407.2023.06.11.02.05.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Jun 2023 02:05:06 -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=wFALolBS; 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 1q8Gxm-0005wY-Nz; Sun, 11 Jun 2023 05:02:18 -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 1q8Gvt-0002mQ-1j for qemu-devel@nongnu.org; Sun, 11 Jun 2023 05:00:21 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q8Gvp-00042B-CN for qemu-devel@nongnu.org; Sun, 11 Jun 2023 05:00:19 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f6d7abe934so23013095e9.2 for ; Sun, 11 Jun 2023 02:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686474015; x=1689066015; 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=TyRRQl63EjUwf6nuHb///9HEwrhn3HTdxj4GOGWSaio=; b=wFALolBSDATXLAJZVy/5VIIHEKz6MtJ4Oo6FQJUB+5nDrq+KEN5DiyDI6EJlSwLAaT fj8VUBclM/4BP3MoSOiwGOMrHMFvfVVnE+nidosA3fVEsCPggsO40vArzPMWXHmxaihF RbZbz27aKCCfK/vrDMIW/FO9QzXpFLK+bLBH4rC6P+2CUz9FQpwPwfT93abSrDWclrBV roFycHxq5Ji56xFVMC2OetkezCi0Wfr06M/Od5T4ZbaCJgb0OqSMvb+dmET6EOiuKEeZ f6NKLV3bm473qj4aiyp3Q4WKzA1rB7z6URXN811+jCUW6GpJ3tWboJqR00+IQX8M/kgI qAmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686474015; x=1689066015; 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=TyRRQl63EjUwf6nuHb///9HEwrhn3HTdxj4GOGWSaio=; b=Kh1hFcc8oe4ckrQsOfhrpj0fPjOo3+bw5xeARypsc7p4d0cB3AzhwMDaEhZXmoDJEz s32JnzPp2109pzHXTWU0RcQ2Szo5LwbXOcWmcDcOrgYAkbCXtfLo0HlTrtIRN5Nn0jIY pXi5qKlkNCZh5thxthads0Ama30xvjDSqrG3e9Ui5Y7NBrvjnqcm9CJoevqM7nDLEiD2 zWf61/+1WefULpi5TtSdcziuUHwXHEwzABezVzB35PU9nE+iV+4/K+e2N5EI/FpEA80z QGPQzkJwD2cwAwxxkFLVQPbCZCA8onEObY5RAGLixLV/rtGZSyUgxvk/V6bzJ5KSE4Wo 2//g== X-Gm-Message-State: AC+VfDwQZRGzfIbFXp21Va6j5SaJV8WQ28nMKmAeKbsbbgcbY11DE8QA XBfXvFeepfTR5DFMuIuczD/jy6NyAq25JGroYys= X-Received: by 2002:a7b:c7d4:0:b0:3f6:389:73b1 with SMTP id z20-20020a7bc7d4000000b003f6038973b1mr3909544wmk.6.1686474014917; Sun, 11 Jun 2023 02:00:14 -0700 (PDT) Received: from localhost.localdomain (91-163-26-170.subs.proxad.net. [91.163.26.170]) by smtp.gmail.com with ESMTPSA id u5-20020a5d5145000000b0030fa57d8064sm5842041wrt.52.2023.06.11.02.00.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 11 Jun 2023 02:00:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Ph?= =?utf-8?q?ilippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 20/26] target/arm/tcg: Move v8m_stackcheck() from op_helper.c to m_helper.c Date: Sun, 11 Jun 2023 10:58:40 +0200 Message-Id: <20230611085846.21415-21-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230611085846.21415-1-philmd@linaro.org> References: <20230611085846.21415-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 No need to have the v8m_stackcheck() helper in the generic op_helper.c, move it with the rest of the M-profile helpers. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/arm/tcg/m_helper.c | 16 ++++++++++++++++ target/arm/tcg/op_helper.c | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/target/arm/tcg/m_helper.c b/target/arm/tcg/m_helper.c index 0891acc29c..0780bb3dea 100644 --- a/target/arm/tcg/m_helper.c +++ b/target/arm/tcg/m_helper.c @@ -2893,3 +2893,19 @@ uint32_t *arm_v7m_get_sp_ptr(CPUARMState *env, bool secure, bool threadmode, } } } + +void HELPER(v8m_stackcheck)(CPUARMState *env, uint32_t newvalue) +{ + /* + * Perform the v8M stack limit check for SP updates from translated code, + * raising an exception if the limit is breached. + */ + if (newvalue < v7m_sp_limit(env)) { + /* + * Stack limit exceptions are a rare case, so rather than syncing + * PC/condbits before the call, we use raise_exception_ra() so + * that cpu_restore_state() will sort them out. + */ + raise_exception_ra(env, EXCP_STKOF, 0, 1, GETPC()); + } +} diff --git a/target/arm/tcg/op_helper.c b/target/arm/tcg/op_helper.c index 70a9c37b74..04a90e3e3a 100644 --- a/target/arm/tcg/op_helper.c +++ b/target/arm/tcg/op_helper.c @@ -82,22 +82,6 @@ void raise_exception_ra(CPUARMState *env, uint32_t excp, uint32_t syndrome, raise_exception(env, excp, syndrome, target_el); } -void HELPER(v8m_stackcheck)(CPUARMState *env, uint32_t newvalue) -{ - /* - * Perform the v8M stack limit check for SP updates from translated code, - * raising an exception if the limit is breached. - */ - if (newvalue < v7m_sp_limit(env)) { - /* - * Stack limit exceptions are a rare case, so rather than syncing - * PC/condbits before the call, we use raise_exception_ra() so - * that cpu_restore_state() will sort them out. - */ - raise_exception_ra(env, EXCP_STKOF, 0, 1, GETPC()); - } -} - uint32_t HELPER(add_setq)(CPUARMState *env, uint32_t a, uint32_t b) { uint32_t res = a + b;