From patchwork Mon Jul 23 20:16:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 10541057 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8CEBB14BC for ; Mon, 23 Jul 2018 21:20:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EEB02858B for ; Mon, 23 Jul 2018 21:20:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D02E285B7; Mon, 23 Jul 2018 21:20:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EBBCD2858B for ; Mon, 23 Jul 2018 21:20:30 +0000 (UTC) Received: from localhost ([::1]:36726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhiFq-0007OB-5T for patchwork-qemu-devel@patchwork.kernel.org; Mon, 23 Jul 2018 17:20:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhKn-00040Q-Vi for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:21:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhhKm-0005RE-VQ for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:21:33 -0400 Received: from mail-oi0-x232.google.com ([2607:f8b0:4003:c06::232]:45719) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhhKm-0005QD-Pu; Mon, 23 Jul 2018 16:21:32 -0400 Received: by mail-oi0-x232.google.com with SMTP id q11-v6so3456144oic.12; Mon, 23 Jul 2018 13:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=EaTxCD4dCy7sNTik1/TmsBRvMf4jyt0iRialxKCbExs=; b=eYtA3MTolElYKHZ4BtGGqMm6WSEY4LxcE85q9TVdCvBOBAXHnehumEUtQFbMNRVsr/ ntPBo1/ve3A+T4yMVE2UjuMcUhGk65fwSBciK8//uophG9nT4TvTfvxhgXa5eh5mU5pr l3KQyOAjoT/ZxAOzDdBDAIB6BuqiyckhqIav4k/E4zJW+6VNzkZJxIdqU0qtQcXYUD+E 9ajsBTy+RSFaNtQ7wcMnSDdGiXaRQgVzRhDOYnD3IhWluJxd91sMftogGkSI3U6rCh1t iNY15fwHIkIVuMev6LqBWCdrcfyXxZRDCa7qGkEwWBq5+7F/Y62Jj9Cik6CKkV6WNqo4 xFYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=EaTxCD4dCy7sNTik1/TmsBRvMf4jyt0iRialxKCbExs=; b=uDBhJxJFvBuAwA1oXDiQUsMCeSTAYdlFm4/l+jBe6U7nWYySLRbHlF8hql7G6yS/Q6 vEGAYW+mRscQWrn92uM0k6dC2+1PmCZlT8YRKD3C7BmE6UkN69d3IMQdQdRqELaXLfxM pFB8++oo40b36C3XWmuBbXZ+YeetpSXe0xzQeFAUG1W5oa08FZoYbvQyLqDw/8Tc6IdC qDd/Kt5YcTu2x+9hCIAqmb4st29Nj3JpHc/eC5rrVF/Gg56Ij+eO8yR8EG32bk5danG/ ISLRZ47bI14rmSXcTmj7XakWFSMhX0+dpeM75LnlTevCLa/L4sWNREHPSuiyrJPIwx+o QQ8g== X-Gm-Message-State: AOUpUlFDe3ALwuzqVgmuVujn3rozojawudZh+R0oA51gE0yBKxV6ghvD j7/IMfN/c/cXPdG74LoIRROUz2VK0JYLVg== X-Google-Smtp-Source: AAOMgpcq2OPfOY7pyxTEIIrGj9K40IWKOqVV9rs95BIl0WlbpwozTsErl6y2p2vT/baHnYt81+cmew== X-Received: by 2002:aca:3357:: with SMTP id z84-v6mr321956oiz.49.1532377291653; Mon, 23 Jul 2018 13:21:31 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id m62-v6sm26390868oik.30.2018.07.23.13.21.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:21:30 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:16:16 -0500 Message-Id: <20180723201748.25573-8-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> References: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::232 Subject: [Qemu-devel] [PATCH 07/99] target/arm: Implement v8M VLLDM and VLSTM 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: , Cc: Peter Maydell , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Maydell For v8M the instructions VLLDM and VLSTM support lazy saving and restoring of the secure floating-point registers. Even if the floating point extension is not implemented, these instructions must act as NOPs in Secure state, so they can be used as part of the secure-to-nonsecure call sequence. Fixes: https://bugs.launchpad.net/qemu/+bug/1768295 Cc: qemu-stable@nongnu.org Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20180503105730.5958-1-peter.maydell@linaro.org (cherry picked from commit b1e5336a9899016c53d59eba53ebf6abcc21995c) Signed-off-by: Michael Roth --- target/arm/translate.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index db1ce6510a..64b9bf33af 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10783,8 +10783,23 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) /* Coprocessor. */ if (arm_dc_feature(s, ARM_FEATURE_M)) { /* We don't currently implement M profile FP support, - * so this entire space should give a NOCP fault. + * so this entire space should give a NOCP fault, with + * the exception of the v8M VLLDM and VLSTM insns, which + * must be NOPs in Secure state and UNDEF in Nonsecure state. */ + if (arm_dc_feature(s, ARM_FEATURE_V8) && + (insn & 0xffa00f00) == 0xec200a00) { + /* 0b1110_1100_0x1x_xxxx_xxxx_1010_xxxx_xxxx + * - VLLDM, VLSTM + * We choose to UNDEF if the RAZ bits are non-zero. + */ + if (!s->v8m_secure || (insn & 0x0040f0ff)) { + goto illegal_op; + } + /* Just NOP since FP support is not implemented */ + break; + } + /* All other insns: NOCP */ gen_exception_insn(s, 4, EXCP_NOCP, syn_uncategorized(), default_exception_el(s)); break;