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)