From patchwork Fri Jul 26 17:49:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 169873 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp355206ilk; Fri, 26 Jul 2019 10:52:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnjLKwe+4BH6GI0F5oRpKWhLp48KqXi2iTrjCZYiaWQMcfTraWMR3g6JAq99N6Fh0ws116 X-Received: by 2002:a05:620a:1443:: with SMTP id i3mr65863511qkl.11.1564163569090; Fri, 26 Jul 2019 10:52:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564163569; cv=none; d=google.com; s=arc-20160816; b=t5bLwTG6eAqsmv6/iZXnHjMPn8zrnzDccGiZoXcPaH7AnOcNWS4HQSr+GPcqQ/FRpd wRnGl7+qC7PneyOAr45fZRjGAVdyOt7iUvVzvNLXT7EOSBNL2Zn0PI16HNOZuorIFYl0 1EgSOtsXaAMUpoI93kPhpFaaHoVcP8cdpKHpqxvjXV0ICStWW+tzM1jdK5Y30wVM2vlg gQXWK51ukN8oDcDI8K5eGb/rhJK1VDuo3XWwVhIxjadqhDI1Mc/0ElauRPhDmPRIgiar CeOuV30zLYxeQBM3syztK/00U/A3t/QzHFn6T90YSyUCmbXlJrBkciEnqU2GKD8Pr920 HmjQ== 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=nQkh2An2kFZsAIQLEJuPgVfqt44IAx9vqtUtFyE7/Qo=; b=FCOTYWnJgop1ay1lgjLS1gOd/k+o7FuSUHLnjm1bDuAAYRFoTYJpDfFKDmccVhQcZO QCnlWEbIKOmRAuL0VZYpt/acHIA7lKHY0Hyt+Y9+yCQV/1uKSJ8M5TnW16Fh1xbjPUix HG2CJrhux8QI3HnaB66Ljt71cRZUDkPMHIzA/2MXsA62TV60lm1L55gfAvmEofVNSTzs TfdqLMAFvi7OJidXNK9BE/IoLEfUDPysuroUk+yGyVla3VY56NjNiuEIZtfv3ZZsf8io KwOIh+zNpA3rs7PV5NEandsGh/ubY9q50IQC+HsVZnZQFQZNgJuan6+wMk6c57t45Toe eDmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nHLntBke; 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 m51si37173506qvc.179.2019.07.26.10.52.48 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jul 2019 10:52:49 -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=nHLntBke; 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]:42238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hr4Oa-0001a9-Q6 for patch@linaro.org; Fri, 26 Jul 2019 13:52:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57433) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hr4Mm-0002Pc-Uc for qemu-devel@nongnu.org; Fri, 26 Jul 2019 13:50:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hr4Mj-0007hy-Q4 for qemu-devel@nongnu.org; Fri, 26 Jul 2019 13:50:51 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:42185) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hr4Mj-0007g1-JA for qemu-devel@nongnu.org; Fri, 26 Jul 2019 13:50:49 -0400 Received: by mail-pg1-x542.google.com with SMTP id t132so25100896pgb.9 for ; Fri, 26 Jul 2019 10:50:49 -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=nQkh2An2kFZsAIQLEJuPgVfqt44IAx9vqtUtFyE7/Qo=; b=nHLntBkexNHKSWsXkmEB+IE2sg7znr577TTLhAa2uCifkD4yBhqMItocTfOLYc7eSg bNBDzDu0VhHCU3UnX0pVqWALgpBK/Cp1BTz9mEcn1RATqWNF2NlGAIT3KGGJ98y8HMlF ULMa8sV3oOzMrPKknF6yU9SLmx+aXECNG0s1leBp+3kpURqs+j+wBnwpOt1DbZ4Oz9go os4g/MTQXVloASFGIfbPuRtOgy2ufcTo5ZMA450lETtXaaH1JMhJd/H24AWfpLLIOxxf Lho9Hwd3SpN/FOQx6Zm6FJ6yZ/vOVJ/Qbz8JdTfYxZhyc4TDpzDlHza+9/JO7lZP6JVq BZZw== 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=nQkh2An2kFZsAIQLEJuPgVfqt44IAx9vqtUtFyE7/Qo=; b=GozWpePHFKZMKwTbHttFYAlqhwWnVuw49xBqo3xp/osXLLdxfp3TDw4MUgE5Onv+mp 5WLaBeaoivGw8dLfG24tIdJfe0xKtoWJPFQt7I3k82BCPfo6Qs0C/lYN1OUMV8k0UZ2T eIVwK2e3OMEsqIpxZ4FHFm/7JTrt9D01PviZXZr3Ed/xJxGUVguEAEjU3SmsFDa+HpMK vzGEVYvqo5bYPvQYRncAF1aDyHfbLb5oWrlMggJuHEW65IBznkgWyUOamJZtSlbxUwem t6IbC29bklRyESO2KFVJrLtslNxvPzWmv+1MWKI2VWjOpPT+D+Q3pAWj0rqJNGQaivOM EW5g== X-Gm-Message-State: APjAAAWPffWTMMLgg5wUl46h4PYfEi9MAQmm4fO0pn7kl3Rga5461Ta/ V7Km9dhGGizEkezhOXGAauACwnEKdKo= X-Received: by 2002:a17:90a:b903:: with SMTP id p3mr97691321pjr.79.1564163448309; Fri, 26 Jul 2019 10:50:48 -0700 (PDT) Received: from localhost.localdomain (97-126-117-207.tukw.qwest.net. [97.126.117.207]) by smtp.gmail.com with ESMTPSA id o24sm104287919pfp.135.2019.07.26.10.50.47 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 10:50:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 26 Jul 2019 10:49:37 -0700 Message-Id: <20190726175032.6769-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190726175032.6769-1-richard.henderson@linaro.org> References: <20190726175032.6769-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::542 Subject: [Qemu-devel] [PATCH 12/67] target/arm: Introduce gen_illegal_op 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: peter.maydell@linaro.org, qemu-arm@nongnu.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Unify the code sequence for generating an illegal opcode exception. Signed-off-by: Richard Henderson --- target/arm/translate-vfp.inc.c | 3 +-- target/arm/translate.c | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) -- 2.17.1 Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 4066b2febf..1b08930649 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, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + gen_illegal_op(s); return false; } diff --git a/target/arm/translate.c b/target/arm/translate.c index 4738b91957..0f21ee9ce7 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -1279,6 +1279,12 @@ static void gen_exception_bkpt_insn(DisasContext *s, uint32_t syn) s->base.is_jmp = DISAS_NORETURN; } +static void gen_illegal_op(DisasContext *s) +{ + gen_exception_insn(s, 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) { @@ -1309,8 +1315,7 @@ static inline void gen_hlt(DisasContext *s, int imm) return; } - gen_exception_insn(s, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + gen_illegal_op(s); } static inline void gen_add_data_offset(DisasContext *s, unsigned int insn, @@ -7631,8 +7636,7 @@ static void gen_srs(DisasContext *s, } if (undef) { - gen_exception_insn(s, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + gen_illegal_op(s); return; } @@ -9299,8 +9303,7 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) break; default: illegal_op: - gen_exception_insn(s, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + gen_illegal_op(s); break; } } @@ -10990,8 +10993,7 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) } return; illegal_op: - gen_exception_insn(s, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + gen_illegal_op(s); } static void disas_thumb_insn(DisasContext *s, uint32_t insn) @@ -11816,8 +11818,7 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) return; illegal_op: undef: - gen_exception_insn(s, EXCP_UDEF, syn_uncategorized(), - default_exception_el(s)); + gen_illegal_op(s); } static bool insn_crosses_page(CPUARMState *env, DisasContext *s)