From patchwork Mon Jun 19 15:55:04 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: 694086 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp2442877wru; Mon, 19 Jun 2023 09:00:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7RVdf7BY6HQf3d8bMwnG2lklzaY8QvwmFMGTUZJnneL3RK6tcqx3v69VcBqxs1CXYX3XEg X-Received: by 2002:ac8:5cc8:0:b0:3fb:42cb:aa9 with SMTP id s8-20020ac85cc8000000b003fb42cb0aa9mr12981604qta.45.1687190437510; Mon, 19 Jun 2023 09:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687190437; cv=none; d=google.com; s=arc-20160816; b=OiFRMURM+OUJSfjq+KKjeX/M1RE3701roQUzZLA9sE3MpLEI34ZucIOfiBQuJIJkR/ 3jsv3fgUf/O3Al8v2OegBREOty1x+sIFJyvcW7RZUjDx9Me9/jRmYjWj9TNeTwM3G75B CLDADsO7lzUFVmln59g1fLn9Ca9H2kNPwjj7kPTV3UmE4ipr9TP7kFepSZlybnn/V/FK 9n4pQ50OxjUMP9f9toNvBX2+Bh7YUwhl902sTGKgJfQy9gMFcr0I6qbLjMT7P2sVRSOP vkCpUys+NlL+tn0vg0IhwEILLNpmPc7KznE6NyV5jbNHreLoqaKXPQOwIU7g/VZzXli2 OLBw== 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=T9+gGtDS9ywwEh28nkl3saVm0tIlPTr21VKGfFlQMT8cijiVY7HAjH08cD0iB58H8O IsxWAyyw2nv9yPGn8XNP9DvQWA7LOR1dtYjfIo7TV2YnyOwv0iHO51mmZRvxKSk3/zps GOC5ayzYEw9nV2u1rlEaY0orWlCbrqBJEmW5N7ATgnDrw9mWC2U6A8y6Eu46jWjdDJ9N HfV1XyrI4NVPCsuAsvnVivkoerlXS5vXo3WACwgY52C29eZycb+4Cr5thCbIggnQS/ET LnLFkM063OXQWoZk32oUVfFb4gmkG+Buq017uVCUpzrMCpHh/PsRrOuMZ5V/KyrmLQmD GuNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f6S2zwWW; 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 12-20020ac84e8c000000b003f53624729bsi31520qtp.57.2023.06.19.09.00.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Jun 2023 09:00:37 -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=f6S2zwWW; 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 1qBHGT-0002Gp-10; Mon, 19 Jun 2023 11:58:01 -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 1qBHFq-0000cR-A6 for qemu-devel@nongnu.org; Mon, 19 Jun 2023 11:57:26 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBHFj-0005Fj-AL for qemu-devel@nongnu.org; Mon, 19 Jun 2023 11:57:17 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-988aefaa44eso178196066b.2 for ; Mon, 19 Jun 2023 08:57:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687190233; x=1689782233; 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=f6S2zwWWAF3t1VnoQDeiBA9YlPUEUuXhyaiTrXI/3rO3gJJ4guVLEpekLkCJCemuk9 dwjRdbCy98pxzlUPgodmMxn79cy788qEA2PugNp/zT4kwepzxvaN1bxOxrrZDBHVtAVP ngcEk66/HIU5pZEf0z3paxbRoq8a81rJo3MQCF5CQBgLDEu/Bi7TUpAYshA+2RKEQeo2 3af925cGoSm4/VUu+oSJjteibsAk6ZhANI94WobQIflnV8tMyt83XnnVi4pbiIDG+ny0 WgI1xgCJPsFMMqfvRovxYtyn2d1KfogGANSX2i0aqWf4lHIpyl3CGBqPpRO2PaM1QkfU hEHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687190233; x=1689782233; 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=axjFJ8HY38EkFK+NMcTd6Jtvf/rQ50n8H2pn22mM9MeFLZc2Yo0g/3jgt8czVLWqqQ QhwNiJ++f3t8brKpZ71Hc2RcFGfcAS7q9PejZobpLQANfoIIDUMIw0Aji43V6FoJJZKa ymNGDq8V6/8Pdf+3zAA3T36CQmalh7Lnxdz9vifnFHC0lMWLpr3zSKyQrlo+ZhUBUaJQ jE4qX8ROr8uBwk3OfUQgJa7cxhriPh+VhMs3VpZx4Acrnej9cvs6EZDayobFXlkvEuar Evk4SjZbUPNpKMlr2cT6X9ynDPFPqBc1+zOwUbkmoa6YBjuZl+7cwFAHlYwjYo4it0mC b7Ag== X-Gm-Message-State: AC+VfDz/ccSFd/lpWj8WVnpzpXMvKU50ziYvpHqVVzBg7I8y9sm26SYK 8+mPQtZTuK4SgW64B+jM76mdNfefrxMusQ0Be7Ea3A== X-Received: by 2002:a17:906:730c:b0:988:9b29:5653 with SMTP id di12-20020a170906730c00b009889b295653mr3281223ejc.77.1687190233704; Mon, 19 Jun 2023 08:57:13 -0700 (PDT) Received: from m1x-phil.lan (sar95-h02-176-184-10-225.dsl.sta.abo.bbox.fr. [176.184.10.225]) by smtp.gmail.com with ESMTPSA id u15-20020a170906068f00b009886aaeb722sm2632724ejb.137.2023.06.19.08.57.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 19 Jun 2023 08:57:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , qemu-arm@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v3 28/34] target/arm/tcg: Move v8m_stackcheck() from op_helper.c to m_helper.c Date: Mon, 19 Jun 2023 17:55:04 +0200 Message-Id: <20230619155510.80991-16-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230619155510.80991-1-philmd@linaro.org> References: <20230619154302.80350-1-philmd@linaro.org> <20230619155510.80991-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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;