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) From patchwork Mon Aug 26 15:15:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172172 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp4490666ily; Mon, 26 Aug 2019 08:18:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAvyLTVF0wZAs69g48NkPaf6iRTWIcOcS2QlLZEutFNUKJygmht/iW6QC8lAXoHE8Vj6DC X-Received: by 2002:ad4:430f:: with SMTP id c15mr4143963qvs.25.1566832739749; Mon, 26 Aug 2019 08:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566832739; cv=none; d=google.com; s=arc-20160816; b=TUcMWK3g+GcVGH/hquOumyPElFBLLzAw89S6VsAi/1M6h6Cbv6qjE2Na6GUJAFYPRO PnyLpF0evITQC2Yr3VAGSaF61lBLeMcn6e3k58Poq4mdWMkY5MUevQxDs0OHR/NfWjtj t2ZvPH40M1bnzaLCnVTn7s+/Z8qCcZ2RTOENDNwhE9z7aksCar9fIo43YSchobqSZ6vS ugGzFqhybgbhz8sq0+OwgBmsDrECdZxG0ETDXTp/1mvEhJTYT5ozYRRZRxXq48uN1iHG zchJyRFzswvc9imxqvyEcdRn5L8SRoXBqwbexU0nsJ2t8wqhQTAg1yM1eI2ocqya+i4/ FNKA== 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=6Wc/MxLOr6YwXjgMWjLSNrJcZWJyujD788Ome0kD52E=; b=FF7SzBJP+/wpTY9qr53IoEJgyhozoNmdzY+Ui6/Eq2yO6Ckgv3bDCXbPphlcPbQJb3 0c10Z6nagB4tmINbCycSMqXQEn3qw1nw3dmi59EO8z8VIUJPX7xTxiwVgIIrC7yEvXJM B7UzHlLoOj/A5ubFMPnYh61utQFNaN1LaF3Y4T7QIgcuU838iVN9HtncKGIePPz0F15X WZhPVNUOLbKDsXhRVxd4lW+lyp6zBIQ8SlusWZiA93xnV/URFwKd7j7ox05aqZV0D6dp 1wrq18WLNJT0hah31iqrS7/rFMchxLYwajfClE1yxa36h4GGjTr0/2LOGvlfr/Cfy349 diwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hJ+v5dbc; 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 j5si7618187qtb.129.2019.08.26.08.18.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Aug 2019 08:18:59 -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=hJ+v5dbc; 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]:54638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2Glm-0003GU-VS for patch@linaro.org; Mon, 26 Aug 2019 11:18:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54855) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2Gie-0000wB-JH for qemu-devel@nongnu.org; Mon, 26 Aug 2019 11:15:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2Gic-0008HK-Pg for qemu-devel@nongnu.org; Mon, 26 Aug 2019 11:15:44 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:33644) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i2Gic-0008Gh-Jc for qemu-devel@nongnu.org; Mon, 26 Aug 2019 11:15:42 -0400 Received: by mail-pf1-x444.google.com with SMTP id g2so12008001pfq.0 for ; Mon, 26 Aug 2019 08:15:42 -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=6Wc/MxLOr6YwXjgMWjLSNrJcZWJyujD788Ome0kD52E=; b=hJ+v5dbcFtjBPjywGUMdwsq0JFDTsk8lcqlIpKiI9Jbs6wtIi2u5EhjMTiz9qj449R w7de7pp1qO+0fTRSIzkHNrQUsBE4tLEVy53YyxyvVONEtp4G5/WtsLOoXsAnci7+u4ze L/rBLvmM/XxONMWD7RS+qBIYV9XAOOSMltGR0GRQq979ZmXcEzr3rUwCDt3caOTQVKct LrV9vU6ClbQ8Ceoz5OBZLmY5+O6GgY2sUgR45+g4wuYBs+/w5PvpRell2HKs8pCd/WOm w81c240uIb81WpkjARvloMgiEixfhiF7V9r/R+5wPmUynggoAHRlbjX06N3FrRs+0ZP/ ruBw== 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=6Wc/MxLOr6YwXjgMWjLSNrJcZWJyujD788Ome0kD52E=; b=JwwmU34YHyJg4u9KEB7dO5ThK5L/+LxMPNWk4mv5w+ONZWthXwFXl2Z3M33+9mErVq j8cxoGDqvNu7s7rDh/g4p3b87bgscRxJTxoB+qoB9gzdp6N+NnXtOokVHvDizPpd+x1+ KZHCJUvWQYMF+zzSzZBYTTB8UW7Z5xUl7k8+nmxBD910s1fFPx1IhJtvXdsxnzalBwIP OXuep9ZTpzuHCfaxtj5Srk+8qJSUQ/MfQ/ACCDZBHHpJbn97fPsmc0qsJ/5qQqJfwLRw pIPOGFX73HDqRlKiXCsM/do10vlcdtyONQO9oQzgdoonLFvzJkiX+gZ0wYpLmlLKtqFf 6L/A== X-Gm-Message-State: APjAAAWJ8RSPqkGS9fz4OKz5DnrmfmyXs0svopOmov331keFq9J3YXaT OzhnQeD3rjFy96304wrMUeiO7rRDxOk= X-Received: by 2002:a17:90a:cb88:: with SMTP id a8mr7557845pju.111.1566832541150; Mon, 26 Aug 2019 08:15:41 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 08:15:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 26 Aug 2019 08:15:36 -0700 Message-Id: <20190826151536.6771-3-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::444 Subject: [Qemu-devel] [PATCH 2/2] target/arm: Factor out 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" Make this a static function private to translate.c. Thus we can use the same idiom between aarch64 and aarch32 without actually sharing function implementations. Signed-off-by: Richard Henderson --- target/arm/translate-vfp.inc.c | 3 +-- target/arm/translate.c | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) -- 2.17.1 Reviewed-by: Laurent Desnogues diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 5065d4524c..3e8ea80493 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -108,8 +108,7 @@ 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)); - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + unallocated_encoding(s); return false; } diff --git a/target/arm/translate.c b/target/arm/translate.c index 2aac9aae68..66311580c0 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -1231,6 +1231,13 @@ static void gen_exception_bkpt_insn(DisasContext *s, uint32_t syn) s->base.is_jmp = DISAS_NORETURN; } +static 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) { @@ -1261,8 +1268,7 @@ static inline void gen_hlt(DisasContext *s, int imm) return; } - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + unallocated_encoding(s); } static inline void gen_add_data_offset(DisasContext *s, unsigned int insn, @@ -7574,8 +7580,7 @@ static void gen_srs(DisasContext *s, } if (undef) { - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + unallocated_encoding(s); return; } @@ -9196,8 +9201,7 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) break; default: illegal_op: - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + unallocated_encoding(s); break; } } @@ -10882,8 +10886,7 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) } return; illegal_op: - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + unallocated_encoding(s); } static void disas_thumb_insn(DisasContext *s, uint32_t insn) @@ -11706,8 +11709,7 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) return; illegal_op: undef: - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + unallocated_encoding(s); } static bool insn_crosses_page(CPUARMState *env, DisasContext *s)