From patchwork Fri Feb 1 16:06:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1034957 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Hq7ovbjn"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43rjb21PMgz9s3l for ; Sat, 2 Feb 2019 03:43:10 +1100 (AEDT) Received: from localhost ([127.0.0.1]:57753 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbuG-0004EP-4S for incoming@patchwork.ozlabs.org; Fri, 01 Feb 2019 11:43:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpbMH-0008J2-M0 for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:08:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpbMC-0003lz-87 for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:08:01 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:46409) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gpbMB-0003To-Uu for qemu-devel@nongnu.org; Fri, 01 Feb 2019 11:07:56 -0500 Received: by mail-wr1-x42d.google.com with SMTP id l9so7609865wrt.13 for ; Fri, 01 Feb 2019 08:07:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=bk+d+QUXl/9IknQrBZaMCa4GLbMftlOnnn9k98C3MVo=; b=Hq7ovbjndB0E8IEXWucHGHJYHyarRuD4AOfu3Qp/QnDvkRTrrGeUxp3mjp0rbnN8Os DbfZjpodr6k2pM22d6Q47tWB8gEmoqzGVVkU1I4TH0J9Ic/AIRFycA0z4LIPO0Cm+sur qnuIAI9VINMQav8kVIUcYKsj3DDIqIiHhxLX4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bk+d+QUXl/9IknQrBZaMCa4GLbMftlOnnn9k98C3MVo=; b=C/qRZi6+AFFUhDvBUMSuahRSze1T6Fh3cxYrGBk6R0y38cYDgIva3/H23qrx53nmpm xy6cEs/n+uIeSLPUGxn8+SJe6Wa+DkqhDqhNwt5PTuyc58wmhm70WlLAV/z1aqqipI21 zAA6iYzW6StqhcSf5uACnB5teBf8kwkeGi6tLpsCyZG+b0f/No/09lWFCGhz1Erls3AX 8bJG7e0X/ZFZypl+6hOVAdDxU4d2EirDySbFyCI/ksMzVnfe1OcXQPbHo1dqzxOhG8MQ LFaVXUq4HaT/1s0awYEhQXVILp8Pg2SMt3nOWjf6kAyEQT5gXNnn/dNhC0S2SLGMInxG WmwA== X-Gm-Message-State: AHQUAuamlerkaNeZ3v8jkyK5HzG+zjijS9dB8vQHeqZ+TSWSQf8xrm8C 2aZepwKI/VtvZzvtqxW1nMhh/ipeL73U8A== X-Google-Smtp-Source: AHgI3IapK0ruV7XTv8yn2+ZY/w11qKdzlJxrmMJ8lu/kjtojW+QAJ2hcM4AiegfK6Vygcq13lTaC+Q== X-Received: by 2002:a5d:52cc:: with SMTP id r12mr2688195wrv.277.1549037252159; Fri, 01 Feb 2019 08:07:32 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id n6sm2847250wmk.9.2019.02.01.08.07.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 08:07:31 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 1 Feb 2019 16:06:34 +0000 Message-Id: <20190201160653.13829-29-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190201160653.13829-1-peter.maydell@linaro.org> References: <20190201160653.13829-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d Subject: [Qemu-devel] [PULL 28/47] target/arm/translate-a64: Don't underdecode SIMD ld/st single 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" In the AdvSIMD load/store single structure encodings, the non-post-indexed case should have zeroes in [20:16] (which is the Rm field for the post-indexed case). Bit 31 must also be zero (a check we got right in ldst_multiple but not here). Correctly UNDEF these unallocated encodings. Reported-by: Laurent Desnogues Signed-off-by: Peter Maydell Reviewed-by: Laurent Desnogues Message-id: 20190125182626.9221-5-peter.maydell@linaro.org --- target/arm/translate-a64.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index c1f0cad7691..2cade64ed25 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -3409,6 +3409,7 @@ static void disas_ldst_single_struct(DisasContext *s, uint32_t insn) { int rt = extract32(insn, 0, 5); int rn = extract32(insn, 5, 5); + int rm = extract32(insn, 16, 5); int size = extract32(insn, 10, 2); int S = extract32(insn, 12, 1); int opc = extract32(insn, 13, 3); @@ -3424,6 +3425,15 @@ static void disas_ldst_single_struct(DisasContext *s, uint32_t insn) int ebytes, xs; TCGv_i64 tcg_addr, tcg_rn, tcg_ebytes; + if (extract32(insn, 31, 1)) { + unallocated_encoding(s); + return; + } + if (!is_postidx && rm != 0) { + unallocated_encoding(s); + return; + } + switch (scale) { case 3: if (!is_load || S) { @@ -3501,7 +3511,6 @@ static void disas_ldst_single_struct(DisasContext *s, uint32_t insn) } if (is_postidx) { - int rm = extract32(insn, 16, 5); if (rm == 31) { tcg_gen_mov_i64(tcg_rn, tcg_addr); } else {