From patchwork Mon Feb 11 01:08:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 157949 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2060740jaa; Sun, 10 Feb 2019 17:17:50 -0800 (PST) X-Google-Smtp-Source: AHgI3IYd8T+8EO/npusv5LfYSkas34Ipinn+jw1VsCWibFm7FMkYeUNQ7R9TQgbM/3pySqEdZ/N6 X-Received: by 2002:a5d:44d1:: with SMTP id z17mr20767914wrr.271.1549847869949; Sun, 10 Feb 2019 17:17:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549847869; cv=none; d=google.com; s=arc-20160816; b=RALJFO1Jg6HcApouZTWP3TPmK93LP0qGJOoERuy9O6Uvbx3Gaat3o82ub62d9/cVOE aTmchDzMjK7ITB2uUXsrVjRTQIGWKpHuH1y/bbfBSgO7vjhrr9n3MBSJf85GWAQqrtzD gtVXpt9ceghdAboKIGeITEpyg3o5KW08ICJGIDUG9fI+EKwijD8/jw/Wlm7rtEBDmjO4 8xMn0DlK/LMB7OnNPWhlJgrQxjZpVORaOheKLhyBmP0Pafi2atQEl5yyyZti6QbmatqR ab0T2kB3h3sV+OtW07r+H12OT2/emcAgwmWN18SLeDoF8ObdhMwzQ2cX+VSfq8TQAL6h kD8w== 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=ItNJF+IPQ2RCWNqC/N6zjDNVc+cTfSXBzvGik2fXPgw=; b=Khle+JikHqN0exxM5CbqTLDjj8JFlQMQLYx1Ii5BMEuDrakb+1M/fv4nVxzbI5R5iU AcGT3u+wIEv446Har5qK4OHtCzIY2Op685p6ZLnHnpV6bz7o9GBBInlfDVbrtOOwhnHA xHzzXvQI/F0avW/sR1da0oij4JdKh4fXevN7XfMURjRsNttWKU7KxWyv1qr5q7+2cUHe Uz20VGlaFcMj0YkGwy/iD6VWR+c/ZxM2M79g6hH3GzII3M0HGzve/7CKTvFRheHwqqJ2 FR1wmUGnz2nICyDAwsy1YddcD19yBC7x9N1+NlvvAUe3Pojw1MmpXsFV2ZEgnTrK00rC cgPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EQslcFme; 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 s12si6121305wrw.100.2019.02.10.17.17.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 10 Feb 2019 17:17:49 -0800 (PST) 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=EQslcFme; 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 ([127.0.0.1]:42187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gt0EG-0003RN-QG for patch@linaro.org; Sun, 10 Feb 2019 20:17:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gt05l-0005ik-6h for qemu-devel@nongnu.org; Sun, 10 Feb 2019 20:09:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gt05i-0008O3-Ib for qemu-devel@nongnu.org; Sun, 10 Feb 2019 20:09:01 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:40736) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gt05i-0007za-5I for qemu-devel@nongnu.org; Sun, 10 Feb 2019 20:08:58 -0500 Received: by mail-pf1-x442.google.com with SMTP id h1so1653993pfo.7 for ; Sun, 10 Feb 2019 17:08:37 -0800 (PST) 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=ItNJF+IPQ2RCWNqC/N6zjDNVc+cTfSXBzvGik2fXPgw=; b=EQslcFmeP6zD+i79OugPlC+uJRaMb1tZ+Y2s3/tMfGfvNocqaYyxRqxeWUpHPTAXUJ c/3ZYRKIdW3jyTPYwtN1qwJzls3DqxaNXON2BSlmIVzsQIWD8XIahQeKuWYUxQamMey3 F54jNjMPVaOj2Cqf+CH8fin2KBtA7AC/4d4FX73Www23h3AVN9yzQMpkoWyydVZkOh7e 28WDmyxFVjRJ4OzyxvK8qdPat1C661UBo8MqyO6Gd97iQOcmEEiE3MEeaSdLwBCVV9MW l2iJAycJqwBCkif/OQj5P5iQ+B4BrHE0hwYDTWWUQ+ujMS7tiw9NRsLi19+u3bCaOfoD ycPA== 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=ItNJF+IPQ2RCWNqC/N6zjDNVc+cTfSXBzvGik2fXPgw=; b=ul+RfAplHa5IuKgQIMe83mC/52Ic2vM/pQxZMUYugdeDN5W9YZhUeMu+7eo1ePKaiK 9QcMldDq4bssjaG8UfliDZD+UMXGHxk6+6RYWeox6KrUXSCxoFZ9ThJpAf6L2GCsIoMa mzWDQ9bRJK4SrmQcDUSDLwMAG+R1s4ZjfXqRxOHCZqBqAP8A1LVEFwjBHvEJTk5NWzYX dyM2Mfk54jzEClxw/043ybVsKIzhCMdzFAWmQr3s7OcTb4mBI2hUO0lqb5rnzY+Ktx2g 4l6JlyT0Kxnxs/kX1VQrrLQHbxLyEMnoYHtMEYsYrySLUNhq/cjzjJrybl5r+hKY80Sf /7iQ== X-Gm-Message-State: AHQUAuZDOKWY0fhpbEbK/F5zLS3q0hl3D+JA5aWPQYz3I1GTLV3/jG6o ufzxnCIDz0xCv0jlPPn8MqmvJmBmO5Q= X-Received: by 2002:a63:580f:: with SMTP id m15mr26451747pgb.342.1549847315806; Sun, 10 Feb 2019 17:08:35 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id g14sm17177630pfg.27.2019.02.10.17.08.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Feb 2019 17:08:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 10 Feb 2019 17:08:06 -0800 Message-Id: <20190211010829.29869-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190211010829.29869-1-richard.henderson@linaro.org> References: <20190211010829.29869-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::442 Subject: [Qemu-devel] [PATCH v2 03/26] target/arm: Add clear_pstate_bits, share gen_ss_advance X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We do not need an out-of-line helper for clearing bits in pstate. While changing things, share the implementation of gen_ss_advance. Signed-off-by: Richard Henderson --- target/arm/helper.h | 2 -- target/arm/translate.h | 19 +++++++++++++++++++ target/arm/op_helper.c | 5 ----- target/arm/translate-a64.c | 11 ----------- target/arm/translate.c | 11 ----------- 5 files changed, 19 insertions(+), 29 deletions(-) -- 2.17.2 diff --git a/target/arm/helper.h b/target/arm/helper.h index 28b1dd6252..c21fa2edfe 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -77,8 +77,6 @@ DEF_HELPER_2(get_cp_reg, i32, env, ptr) DEF_HELPER_3(set_cp_reg64, void, env, ptr, i64) DEF_HELPER_2(get_cp_reg64, i64, env, ptr) -DEF_HELPER_1(clear_pstate_ss, void, env) - DEF_HELPER_2(get_r13_banked, i32, env, i32) DEF_HELPER_3(set_r13_banked, void, env, i32, i32) diff --git a/target/arm/translate.h b/target/arm/translate.h index 17748ddfb9..33af50a13f 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -202,6 +202,25 @@ static inline TCGv_i32 get_ahp_flag(void) return ret; } +/* Clear bits within PSTATE. */ +static inline void clear_pstate_bits(uint32_t bits) +{ + TCGv_i32 p = tcg_temp_new_i32(); + + tcg_gen_ld_i32(p, cpu_env, offsetof(CPUARMState, pstate)); + tcg_gen_andi_i32(p, p, ~bits); + tcg_gen_st_i32(p, cpu_env, offsetof(CPUARMState, pstate)); + tcg_temp_free_i32(p); +} + +/* If the singlestep state is Active-not-pending, advance to Active-pending. */ +static inline void gen_ss_advance(DisasContext *s) +{ + if (s->ss_active) { + s->pstate_ss = 0; + clear_pstate_bits(PSTATE_SS); + } +} /* Vector operations shared between ARM and AArch64. */ extern const GVecGen3 bsl_op; diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c index c5721a866d..8698b4dc83 100644 --- a/target/arm/op_helper.c +++ b/target/arm/op_helper.c @@ -861,11 +861,6 @@ uint64_t HELPER(get_cp_reg64)(CPUARMState *env, void *rip) return res; } -void HELPER(clear_pstate_ss)(CPUARMState *env) -{ - env->pstate &= ~PSTATE_SS; -} - void HELPER(pre_hvc)(CPUARMState *env) { ARMCPU *cpu = arm_env_get_cpu(env); diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 13e010d27b..ba139bba26 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -421,17 +421,6 @@ static void gen_exception_bkpt_insn(DisasContext *s, int offset, s->base.is_jmp = DISAS_NORETURN; } -static void gen_ss_advance(DisasContext *s) -{ - /* If the singlestep state is Active-not-pending, advance to - * Active-pending. - */ - if (s->ss_active) { - s->pstate_ss = 0; - gen_helper_clear_pstate_ss(cpu_env); - } -} - static void gen_step_complete_exception(DisasContext *s) { /* We just completed step of an insn. Move from Active-not-pending diff --git a/target/arm/translate.c b/target/arm/translate.c index 66cf28c8cb..baf6068ec1 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -298,17 +298,6 @@ static void gen_exception(int excp, uint32_t syndrome, uint32_t target_el) tcg_temp_free_i32(tcg_excp); } -static void gen_ss_advance(DisasContext *s) -{ - /* If the singlestep state is Active-not-pending, advance to - * Active-pending. - */ - if (s->ss_active) { - s->pstate_ss = 0; - gen_helper_clear_pstate_ss(cpu_env); - } -} - static void gen_step_complete_exception(DisasContext *s) { /* We just completed step of an insn. Move from Active-not-pending