From nobody Wed Apr 16 04:30:44 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15390090834341012.0769260798864; Mon, 8 Oct 2018 07:31:23 -0700 (PDT) Received: from localhost ([::1]:46526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9WZ8-0008OJ-Bi for importer@patchew.org; Mon, 08 Oct 2018 10:31:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9W5x-0001Wx-Mr for qemu-devel@nongnu.org; Mon, 08 Oct 2018 10:01:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9W5v-0007PD-Tv for qemu-devel@nongnu.org; Mon, 08 Oct 2018 10:01:13 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:51694) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g9W5p-0006yM-8U for qemu-devel@nongnu.org; Mon, 08 Oct 2018 10:01:09 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1g9W5R-0003lW-Gk for qemu-devel@nongnu.org; Mon, 08 Oct 2018 15:00:41 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 8 Oct 2018 15:00:02 +0100 Message-Id: <20181008140004.12612-32-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008140004.12612-1-peter.maydell@linaro.org> References: <20181008140004.12612-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 31/33] target/arm: Add v8M stack checks for VLDM/VSTM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Add the v8M stack checks for the VLDM/VSTM (aka VPUSH/VPOP) instructions. This code is currently unreachable because we haven't yet implemented M profile floating point support, but since the change is simple, we add it now because otherwise we're likely to forget to do it later. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20181002163556.10279-13-peter.maydell@linaro.org --- target/arm/translate.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target/arm/translate.c b/target/arm/translate.c index ef64d2559de..1b4bacb522b 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -4229,6 +4229,18 @@ static int disas_vfp_insn(DisasContext *s, uint32_t = insn) if (insn & (1 << 24)) /* pre-decrement */ tcg_gen_addi_i32(addr, addr, -((insn & 0xff) << 2)); =20 + if (s->v8m_stackcheck && rn =3D=3D 13 && w) { + /* + * Here 'addr' is the lowest address we will store to, + * and is either the old SP (if post-increment) or + * the new SP (if pre-decrement). For post-increment + * where the old value is below the limit and the new + * value is above, it is UNKNOWN whether the limit che= ck + * triggers; we choose to trigger. + */ + gen_helper_v8m_stackcheck(cpu_env, addr); + } + if (dp) offset =3D 8; else --=20 2.19.0