From patchwork Mon Aug 26 15:15:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172171 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp4487464ily; Mon, 26 Aug 2019 08:16:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqweN9y390aL9xXA1ib0JxEBp8UFec8He/99ebxIxA7rS3WUU/2ueHRE/E09kHB5ejYqmeg3 X-Received: by 2002:a17:906:19cc:: with SMTP id h12mr17237095ejd.304.1566832587751; Mon, 26 Aug 2019 08:16:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566832587; cv=none; d=google.com; s=arc-20160816; b=Zl/sl5JCHP/TaiJf61HHOSuK51QFymWwSCyoZDOhfuqQKJEyzoY2ODg2Md4QiAYpPl ozv9qLRfhYmxj0dCbaJym7OKr8Y8W/5Y08DOzFX7690IQjWEbeJKe4U2GryBkqEH3M8H IWAvvQXohDFASmWkIS6+fWDx1rWbLGLDGypVAU2jCNgEAdGb19vSR3DC1ac3NrffIA5u JKCphJDxcpk+XMfV+ndrtxNVp58LSMSmL8jzY3XjCnzQ5pUWVP9JRNnmSuUWfBXbIKto sn0QtKCIg+CNnOkm6OMURHiLO4n722nPvz0E8FE94N60uZf78tNaBVUaDb53YlMCoPHo LtFg== 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; bh=8MFzsPufqFdgCy1pEwhM+wHrg2dggUQBauGMpOYZwlA=; b=vMhG594NNXpe8UuLA/Hq3KrTYC9hZB/iu+0O/eu4NKH2JMoyVvH+ldq6s/tq/epJ0v DQd0JXfrEzp2x/G9h3NVl0Mx7ZsBg8jvSHMvW6ynC27AoCcFUtr6jeDmLEjffCqqmQtj u+N5MlnkW7GFPxq9U07oCKtwHT6Brz+bCJyY1C+FjX5PBSXOeM9dwDwwIucq6NE1ufDN OgMFP80+J77tTYYAHBTGh4W0e5l1udabAifCi9EvLHyfBdWgLRsNybaBYym0pnxklpzL 4PpmMlyTAp1Yxe9x0a89S8KLI0/twRW9/KtS7Z7v/Rnt/GbiSPPIbI9s0O9bbKBF4w0p hw/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EVleF2ZK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v55si6534281edm.283.2019.08.26.08.16.27 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Aug 2019 08:16:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EVleF2ZK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2GjK-0000x2-44 for patch@linaro.org; Mon, 26 Aug 2019 11:16:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54834) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2Gic-0000up-LK for qemu-devel@nongnu.org; Mon, 26 Aug 2019 11:15:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2Gib-0008Fx-71 for qemu-devel@nongnu.org; Mon, 26 Aug 2019 11:15:42 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:43325) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i2Gib-0008FD-0v for qemu-devel@nongnu.org; Mon, 26 Aug 2019 11:15:41 -0400 Received: by mail-pl1-x642.google.com with SMTP id 4so10173959pld.10 for ; Mon, 26 Aug 2019 08:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8MFzsPufqFdgCy1pEwhM+wHrg2dggUQBauGMpOYZwlA=; b=EVleF2ZKTAs0/vaUtn0ljzHuO1VQ99XAWUj/rPtQk8byuoz0tenW3wHxhntoC75HZE 1pCUlT9JfYoGCcoCBO48HEDP4Ha2vqxxlRsA7NmlyiQPVGfflGNaLryjz1qFPzD0aiMs TBWaY8khPQDVFdr1tX75z3uNKvbvhpsTGY+19MOCN3VrtEgksTjeqJM77NoDYFk/ZGzR f9aSQqml6Va5rhj+E38M+YQAQdC16cSNAqg3c+oI4f5l/ltzqyYJEqj9dGg/0pRj2A3O q6Wr/xEoy3GjpZ6r/BHT6E1tI3pA6okPBBhDUVP5vk3dwg7zEX9T7kMztz+LAVtimWJ+ HWLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8MFzsPufqFdgCy1pEwhM+wHrg2dggUQBauGMpOYZwlA=; b=sfSBAknlvg9mIuzeYzBZeQWbXbvxUItBFzuQPqET0Q5asZscrx6uLbpMJ6znKCcx0J s+dssR7lrhObsCL4g1QH59SW9S8g8o5/6fEHkffUN1rnHb/6jfHpJ4S+bRyZxWMOCtp4 ePXI7YvLZscxJHANVP127b9hPJHbfWQTz4E+tKGINxWLH/ZcXqpzD+9IGMPaRw3v5UeR 58aRpzFxjUOm4Y34B97F5UrUCJySdjFHliGQ0qgzv2354o1klPlgLBCtbshG27bmSO9i JiqlMPqQmKkN3qdntkjBcGeYBy4tmDz+R1gVqaPBWh4ADscta0eY3dvkdbeieJZapjzw 4lrA== X-Gm-Message-State: APjAAAUFumSjJOPTLfvxjMtwqcTmQw80eCk2gQa+s6dKWStlELrAtWMS I4D/RXBG0rzed98crRzv9VpnSh4xEIw= X-Received: by 2002:a17:902:b48c:: with SMTP id y12mr19286238plr.202.1566832539738; Mon, 26 Aug 2019 08:15:39 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id q4sm13563612pff.183.2019.08.26.08.15.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 08:15:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 26 Aug 2019 08:15:35 -0700 Message-Id: <20190826151536.6771-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190826151536.6771-1-richard.henderson@linaro.org> References: <20190826151536.6771-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 Subject: [Qemu-devel] [PATCH 1/2] Revert "target/arm: Use unallocated_encoding for aarch32" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.desnogues@gmail.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This reverts commit 3cb36637157088892e9e33ddb1034bffd1251d3b. Despite the fact that the text for the call to gen_exception_insn is identical for aarch64 and aarch32, the implementation inside gen_exception_insn is totally different. This fixes exceptions raised from aarch64. Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson --- target/arm/translate-a64.h | 2 ++ target/arm/translate.h | 2 -- target/arm/translate-a64.c | 7 +++++++ target/arm/translate-vfp.inc.c | 3 ++- target/arm/translate.c | 22 ++++++++++------------ 5 files changed, 21 insertions(+), 15 deletions(-) -- 2.17.1 Reviewed-by: Laurent Desnogues diff --git a/target/arm/translate-a64.h b/target/arm/translate-a64.h index 12ad8ac6ed..9cd2b3d238 100644 --- a/target/arm/translate-a64.h +++ b/target/arm/translate-a64.h @@ -18,6 +18,8 @@ #ifndef TARGET_ARM_TRANSLATE_A64_H #define TARGET_ARM_TRANSLATE_A64_H +void unallocated_encoding(DisasContext *s); + #define unsupported_encoding(s, insn) \ do { \ qemu_log_mask(LOG_UNIMP, \ diff --git a/target/arm/translate.h b/target/arm/translate.h index 92ef790be9..64304c957e 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -99,8 +99,6 @@ typedef struct DisasCompare { bool value_global; } DisasCompare; -void unallocated_encoding(DisasContext *s); - /* Share the TCG temporaries common between 32 and 64 bit modes. */ extern TCGv_i32 cpu_NF, cpu_ZF, cpu_CF, cpu_VF; extern TCGv_i64 cpu_exclusive_addr; diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 6fd0b779d3..9183f89ba3 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -338,6 +338,13 @@ static inline void gen_goto_tb(DisasContext *s, int n, uint64_t dest) } } +void unallocated_encoding(DisasContext *s) +{ + /* Unallocated and reserved encodings are uncategorized */ + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), + default_exception_el(s)); +} + static void init_tmp_a64_array(DisasContext *s) { #ifdef CONFIG_DEBUG_TCG diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 3e8ea80493..5065d4524c 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -108,7 +108,8 @@ static bool full_vfp_access_check(DisasContext *s, bool ignore_vfp_enabled) if (!s->vfp_enabled && !ignore_vfp_enabled) { assert(!arm_dc_feature(s, ARM_FEATURE_M)); - unallocated_encoding(s); + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), + default_exception_el(s)); return false; } diff --git a/target/arm/translate.c b/target/arm/translate.c index cbe19b7a62..2aac9aae68 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -1231,13 +1231,6 @@ static void gen_exception_bkpt_insn(DisasContext *s, uint32_t syn) s->base.is_jmp = DISAS_NORETURN; } -void unallocated_encoding(DisasContext *s) -{ - /* Unallocated and reserved encodings are uncategorized */ - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); -} - /* Force a TB lookup after an instruction that changes the CPU state. */ static inline void gen_lookup_tb(DisasContext *s) { @@ -1268,7 +1261,8 @@ static inline void gen_hlt(DisasContext *s, int imm) return; } - unallocated_encoding(s); + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), + default_exception_el(s)); } static inline void gen_add_data_offset(DisasContext *s, unsigned int insn, @@ -7580,7 +7574,8 @@ static void gen_srs(DisasContext *s, } if (undef) { - unallocated_encoding(s); + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), + default_exception_el(s)); return; } @@ -9201,7 +9196,8 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) break; default: illegal_op: - unallocated_encoding(s); + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), + default_exception_el(s)); break; } } @@ -10886,7 +10882,8 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) } return; illegal_op: - unallocated_encoding(s); + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), + default_exception_el(s)); } static void disas_thumb_insn(DisasContext *s, uint32_t insn) @@ -11709,7 +11706,8 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) return; illegal_op: undef: - unallocated_encoding(s); + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), + default_exception_el(s)); } static bool insn_crosses_page(CPUARMState *env, DisasContext *s)