From nobody Wed Nov 12 00:30:45 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1566832819; cv=none; d=zoho.com; s=zohoarc; b=QYMzXvGl3c/SFYsesEehPV4lIto6p5KLrZsxpJ1yY46k6vbC93m/8qP1GGv05BLJRQNLA2KspxVxNcB43VrByfEwOH6IOTSSHJYhBjQXjILH+W+tbSgMIQmsZlNqEXpTDN3WKVYloXbHmvcaDJoIkBlvMiqXpUC2FA4NU8ylaTg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566832819; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=6Wc/MxLOr6YwXjgMWjLSNrJcZWJyujD788Ome0kD52E=; b=a4mfTGJDdopCa89D4t1zxGVKoYS4W2f4YeoiIQLT/bAAEJX0jBxRWU4UgYajYkCnXKwLGxa4/QboY3L1iqbAwkpT6Slrip7+k5o+dHzrajPgeuAsh9sW3fmfljXngLxdDrD38N5rILe84z36DvKUZtxCrq2xlrG42OcftW2SKWk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566832818992726.3258628987649; Mon, 26 Aug 2019 08:20:18 -0700 (PDT) Received: from localhost ([::1]:54652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2Gn0-0003yv-4b for importer@patchew.org; Mon, 26 Aug 2019 11:20:15 -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) 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) 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-Google-Smtp-Source: APXvYqymnlkc5BW8Wz8R3XD4t1PV/DphGyD7RLUfEMeTMW8NwK/uyxI+08VFL9uja5Plx9VfES7VyA== X-Received: by 2002:a17:90a:cb88:: with SMTP id a8mr7557845pju.111.1566832541150; Mon, 26 Aug 2019 08:15:41 -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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Laurent Desnogues --- target/arm/translate-vfp.inc.c | 3 +-- target/arm/translate.c | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) 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) =20 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; } =20 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 =3D DISAS_NORETURN; } =20 +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; } =20 - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + unallocated_encoding(s); } =20 static inline void gen_add_data_offset(DisasContext *s, unsigned int insn, @@ -7574,8 +7580,7 @@ static void gen_srs(DisasContext *s, } =20 if (undef) { - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + unallocated_encoding(s); return; } =20 @@ -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, uint= 32_t insn) } return; illegal_op: - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + unallocated_encoding(s); } =20 static void disas_thumb_insn(DisasContext *s, uint32_t insn) @@ -11706,8 +11709,7 @@ static void disas_thumb_insn(DisasContext *s, uint3= 2_t insn) return; illegal_op: undef: - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + unallocated_encoding(s); } =20 static bool insn_crosses_page(CPUARMState *env, DisasContext *s) --=20 2.17.1