From patchwork Tue Jun 19 01:42:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 139073 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4678430lji; Mon, 18 Jun 2018 20:08:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJW3EVPLgea3RE/DgyAn8mXzzRYrhYCV4uHp0s6trd/rXQwULRMLUXuDq+vBHpKZKss38zj X-Received: by 2002:a37:f713:: with SMTP id q19-v6mr12414084qkj.278.1529377692397; Mon, 18 Jun 2018 20:08:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529377692; cv=none; d=google.com; s=arc-20160816; b=QPsxCYDs7jj4C6vnC6fIOwFkrRLtfFd7yvSeZ9j4yG/XRqFqu1JnqdNoSZKrvKFcVK U3jNmYDgE7DpQ85lkG8h+xOvgoA/5/qvTg4zwqbz7Tj1+a3V+OtdC+JE5+wd6xGUGoKy VXgejdruRt7vH3nYCjYS5q7ujha1TqjVuIQ2AWKVvHDjAFncVbXI3xW6spczH63tovAS kt72AMgS8Syy0ErfTjDxphAkGjMPpLA5DYeBZZ29hT8Da5aqwo8ZmIwlEI2oBza6FU8F IvV1CcNOtygaXymv0KEOzEXdaza7JkljLgqIFu31I2e9MMohob3bqXKif3ZfneARy0Wu RAQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=8IvJppQ7K4e0ec4Tu1tPfeuKWzXeZ7Q12FRDR3t1nJw=; b=X1Nzxnat3JC068Jh1R5Z2G8JyCMtZpc3W9nSKpbHxY05jieHNTVkzj/a/cBM9kNedM iUQ+yU7D3U6I10ZX3j60OhLQ4JgSBHP7gKeWXERAbNOVQP0DN0D/PYKY0L/TQGTWsI7P ZrjyaoxfNCAWLbbXwuUT8lwAxFSxCXDd8UJnCA4OUjqxAxMosVlA8/qhnoT2wnlexPeW xPyJ2+8m7pdb1VvoyqIfaRmv50pv6CRR5bCuguhTqyad3gs0eZ77zlfzYZpY8aNoY5F1 V9bXaQyE6XWyMjIKjHMIJ07Ytif54ya4CizpmPqGe3pfHRZFf29RekWLXC/6gdgJBi3b sHjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=L4QRiqXB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a2-v6si9642078qka.10.2018.06.18.20.08.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Jun 2018 20:08:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=L4QRiqXB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from localhost ([::1]:38906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fV707-00005u-P6 for patch@linaro.org; Mon, 18 Jun 2018 23:08:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fV5j6-0002fP-R2 for qemu-devel@nongnu.org; Mon, 18 Jun 2018 21:46:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fV5j5-0000Pa-Oi for qemu-devel@nongnu.org; Mon, 18 Jun 2018 21:46:32 -0400 Received: from mail-oi0-x22f.google.com ([2607:f8b0:4003:c06::22f]:37063) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fV5j5-0000PL-JQ; Mon, 18 Jun 2018 21:46:31 -0400 Received: by mail-oi0-x22f.google.com with SMTP id l22-v6so16718271oib.4; Mon, 18 Jun 2018 18:46:31 -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=8IvJppQ7K4e0ec4Tu1tPfeuKWzXeZ7Q12FRDR3t1nJw=; b=L4QRiqXB+FpaCw0IcmN5CSFcAO4EF4kC13XkfJxi6TRH/okj6AMZcc4R127dKTWJmR vPV8xkSaWeUedSfxMVoi457VBBy4DK/6A40sZb9E6G1GYeoeXVIzVg0hpcC0Ek4E/StF q2Rg1b6cndV3AcNTftGozLYPRWxKwBqD4d5GfQtcuzUB/o4Zqa6FrMQMOso56R9s2lf5 gZ0C0GxaGtZtt5EsEFoFsdefKjyBAJ+J8WLZxSeChzdbKXxzP1p3qbwI4byC/Ub3KK6D q7krkfjLGio7kMXV5nwMpOFDPNp1G1EDUtx2fZC9KhjJChQM9DS2Y71pIekiDVQarvWf LVDQ== 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=8IvJppQ7K4e0ec4Tu1tPfeuKWzXeZ7Q12FRDR3t1nJw=; b=QV/VPtnaIpZLz/MB6KVYEE1knsVNxStpP4kJ7ueCVI63BZyP/cJjahvRhu/uxjI1YS g8bmnXcq12qHstkC4GkqXGzMRdB3eep+MmYGw1D1vHsUzde6GZk3WNwlC+o4Zfle3l6D 0fXaHe7TJtlwgiHVKtNZwhACWeq8myqsgtl/vAxrR44zsa0udrEXMkE1Unhwun95alHR WcLgh+cb+/UjHfAAFC501xYCICuwo7YFR43jqdBl3mXeCjlnvSIs7gO9aSF47E9zy5Je CeGUjkUrajHW44QodZKc+9rD0gDHtF4Qd4BMMAZ1mU3BkHo/oD66oFtz2PFawhcozzDi v+ew== X-Gm-Message-State: APt69E0auGY83e65oEuNaxSgftZOW+4dDtlziWbKTpEGWOZxqhRwHo2e RrmZNApn9xS9u7lSSYOVZSsj8U67sLU= X-Received: by 2002:aca:501:: with SMTP id 1-v6mr8584115oif.217.1529372790390; Mon, 18 Jun 2018 18:46:30 -0700 (PDT) Received: from localhost ([2600:1700:70:e488:b0ee:9bda:ee6f:91be]) by smtp.gmail.com with ESMTPSA id z44-v6sm9636236otc.46.2018.06.18.18.46.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Jun 2018 18:46:29 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 18 Jun 2018 20:42:31 -0500 Message-Id: <20180619014319.28272-66-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180619014319.28272-1-mdroth@linux.vnet.ibm.com> References: <20180619014319.28272-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::22f Subject: [Qemu-devel] [PATCH 065/113] 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.11.0 diff --git a/target/arm/translate.c b/target/arm/translate.c index f120932f44..a8e8168a06 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10511,8 +10511,23 @@ static int 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;