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: 142644 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp6508996ljj; Mon, 23 Jul 2018 14:21:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeYBzrHRg2v/Q0Z8KDAc6MyoPfi6BPnxihcCUtL37FjhvVVugndKVFS9m52QnK7ZWzIJfFN X-Received: by 2002:a0c:b24c:: with SMTP id k12-v6mr12833274qve.152.1532380909711; Mon, 23 Jul 2018 14:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532380909; cv=none; d=google.com; s=arc-20160816; b=fVQmPlnM/3doHAxrumSb76slLsA36rUfbHrstcLR1nruSQgYa2pUSov0BBbPHnnxhY nof03z+6XtUYkk+R+DgrDWIcja8aWYM2YJJjdCLEnF1SuNAak3NNMWmOpGXw02l0TrC4 HYYUiL2VRv+8jsTe9mLNag/M/vpESow9Q+gd7J9JickE4wANQC1JwSsYbXD41IgC5Ndk 5o/3pIsYv9wsukN+2NStKXMSGuuE6F+9REkSeTX+sAg4yXzmtzY1ODSW7VLzd+NUyM+G FJP4nuVTrVcRgRkHHNKK9NvenUqYQ996LId1ffut56a3+A7Fu2IG1wiwmMECbnYjnNtd VP5w== 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=EaTxCD4dCy7sNTik1/TmsBRvMf4jyt0iRialxKCbExs=; b=AzJzv6BxW5iPweAWNiItT3CtROLwW3jzLiI5118MYd+emn3aDU5Cfpc1Wiulk5Mnav MY5tu04T2CEqldYVqq+kIoNW0wQNdtevokbxiM/NKKO+HgDjvv/xhzuGYGrKp2HPxD9j e4X5HIofEkng/8Xp744qJOTJJraVBiTVphi0aP4RaT8NBC6tQ9bqRziD22/4cfrUfQK2 Y9qxYn3TK/DN2/Zv45MR7v7kgwTsfKjOy+9P8mGZWyoY1KLp3HL3K3zCzDOGfMCaBSfw 4o1ciXzw32kY7irBXv5NBhNpTRNfxVzPNyRQZPOYlFRvg0HR0ubKMGJdxHNOwNTZlKpn WlMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=eYtA3MTo; 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 g38-v6si1621428qve.248.2018.07.23.14.21.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 23 Jul 2018 14:21:49 -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=eYtA3MTo; 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]:36726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhiH7-0007OB-1q for patch@linaro.org; Mon, 23 Jul 2018 17:21:49 -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-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+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.17.1 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;