From patchwork Thu Jun 28 03:03:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 140385 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1643088ljj; Wed, 27 Jun 2018 20:04:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeYmLys5EfbjH6B6PZnj3lNm0wY6b7wLKYX/7cuUnIZz490RDxZ9N+jFqp0Ytr5ZDIY+A0z X-Received: by 2002:a0c:be15:: with SMTP id k21-v6mr2281438qvg.1.1530155053593; Wed, 27 Jun 2018 20:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530155053; cv=none; d=google.com; s=arc-20160816; b=iOCrOKYWjJdNQzixrkdyJIevpv3cL0lXqBVEzW+a+meDGAjrXn6YTJ/RQ63ah0jOzF 5bJemwVCjl+nl35qYGYOK4Dd+Tg+Bh77borBHGnxscrmMQiotNwVACgDWRaAlB4pLJSC ZijwgMZSg15zjMpaLETDXQmtfBmTG4DCooYMwymjpeg6IP96aw5cAuCYvBpkhoKcdKpk +mJRsjn97QfL14gPV14BtaTM6LkqajAQ+L2a9OuS+FUR9gCDxc24bEanSALct3kBqxAo yYaTojcoR9mTNtMTmNlChrc72O9yIEM0FJhPwNfGsD0KvW+bmGMc4Scwxmm2+M8Rll2N 3SXg== 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:arc-authentication-results; bh=aJQOgLhmdjBLyZG1/Zx4n3oTLHrsOdzZdDsXgKO1Fbs=; b=HtFcd4PI5UbDSOi+E92R+d37guyFmJ8k/EBjAHfmA6M37C6Z8N3Mx7wBC+Gm3WCskD EooqW4ILBLMi7NkkoH3m7b+2Yp0UG4Bgkq4eOGz8fsLxLuPwhz3vU2aDLFclFq2oMPAE MsPVrH6KpZSPf0X0DwVpz3XMcCGOdva/x64f003Z9PvCg3RWDIkeceXTuR2ODyZu2+iY afh8TwAGCndYu+cI6aG1gk2SL6fN4tj1DmzR6FZo+Nq4FBq6Hx6PwaFREXCvcoACwNd3 CpM6jRlWcfjLaq3F+vmq6c3rAB2piOXPvzQSMfrIC8SamdERd5b5a3idQO56Bc7hPwJX XaaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Qc1QHJBt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 48-v6si2860484qvl.72.2018.06.27.20.04.13 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 27 Jun 2018 20:04:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Qc1QHJBt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:34238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYNED-0004x2-2P for patch@linaro.org; Wed, 27 Jun 2018 23:04:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYNDh-0004uh-UT for qemu-devel@nongnu.org; Wed, 27 Jun 2018 23:03:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYNDg-0007eQ-Tl for qemu-devel@nongnu.org; Wed, 27 Jun 2018 23:03:41 -0400 Received: from mail-pl0-x242.google.com ([2607:f8b0:400e:c01::242]:40768) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fYNDg-0007eC-O1 for qemu-devel@nongnu.org; Wed, 27 Jun 2018 23:03:40 -0400 Received: by mail-pl0-x242.google.com with SMTP id t6-v6so2010179plo.7 for ; Wed, 27 Jun 2018 20:03: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=aJQOgLhmdjBLyZG1/Zx4n3oTLHrsOdzZdDsXgKO1Fbs=; b=Qc1QHJBtiIAfPJ1ApE6hveDp9rhMdhl1MedtecbTxilS1nfyRlJr/k6f8WSpV/2OeN U+4zHrxE+BDZa6HD4qpSj7hG+lUcQuAEnH6Xp339i/789BNZRCfojwuslBWkiyeRalu7 i3SKq0uVDJAsqpdh/IrbnSA/Xid6o/ZumSZz0= 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=aJQOgLhmdjBLyZG1/Zx4n3oTLHrsOdzZdDsXgKO1Fbs=; b=G3ZbDhMpxyyedY/2RMXxD0KhEF9GfoHtKLOgDWGLBvInjXcMf9dKJ+lDCQ1+nsPRNk eFx6ouRqWJAn/xdOQ0pd7AzKHBtBTBIxzq83NCyoL8G/3dhDpPuoympSTebq5ZJPFn/c zaobl0axvosixOuM4olSTRlSYONs662lPlXYTlnmyRylp1q+6xmxqe1Nvcv2ZFD+RAHd HxVSfyWJe8d1f7UZUdQn3R4TfWBzElDPC6SW2Y3Xzd9GYC+u1xdkbypLRuH3Di+OUiyz FCk3ueGr+QX2EWcKjD8cgRvxXsx0o5e8iWlsDOuJWYmiUl0yo17n9bO+c8L/RXCdy/JN zDwQ== X-Gm-Message-State: APt69E0BxqCpcHD5Vws5GgYcquBkHzZGZwwwsThL5GZuHLowIZkXYvqI Zp3XfL/4YQJRkNhigygtYcm1uEMGOig= X-Received: by 2002:a17:902:7b95:: with SMTP id w21-v6mr8703843pll.150.1530155019461; Wed, 27 Jun 2018 20:03:39 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-112-211.tukw.qwest.net. [97.126.112.211]) by smtp.gmail.com with ESMTPSA id y15-v6sm8030489pfm.136.2018.06.27.20.03.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Jun 2018 20:03:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 27 Jun 2018 20:03:12 -0700 Message-Id: <20180628030330.15615-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180628030330.15615-1-richard.henderson@linaro.org> References: <20180628030330.15615-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::242 Subject: [Qemu-devel] [PATCH v3 05/23] target/openrisc: Use exit_tb instead of CPU_INTERRUPT_EXITTB 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: shorne@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" No need to use the interrupt mechanisms when we can simply exit the tb directly. Reviewed-by: Stafford Horne Signed-off-by: Richard Henderson --- target/openrisc/interrupt_helper.c | 3 +-- target/openrisc/translate.c | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/target/openrisc/interrupt_helper.c b/target/openrisc/interrupt_helper.c index 56620e0571..b865738f8b 100644 --- a/target/openrisc/interrupt_helper.c +++ b/target/openrisc/interrupt_helper.c @@ -26,7 +26,6 @@ void HELPER(rfe)(CPUOpenRISCState *env) { OpenRISCCPU *cpu = openrisc_env_get_cpu(env); - CPUState *cs = CPU(cpu); #ifndef CONFIG_USER_ONLY int need_flush_tlb = (cpu->env.sr & (SR_SM | SR_IME | SR_DME)) ^ (cpu->env.esr & (SR_SM | SR_IME | SR_DME)); @@ -53,8 +52,8 @@ void HELPER(rfe)(CPUOpenRISCState *env) } if (need_flush_tlb) { + CPUState *cs = CPU(cpu); tlb_flush(cs); } #endif - cs->interrupt_request |= CPU_INTERRUPT_EXITTB; } diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index f5af515979..43bdf378eb 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -37,6 +37,7 @@ #include "exec/log.h" /* is_jmp field values */ +#define DISAS_EXIT DISAS_TARGET_0 /* force exit to main loop */ #define DISAS_UPDATE DISAS_TARGET_1 /* cpu state was modified dynamically */ typedef struct DisasContext { @@ -1133,7 +1134,7 @@ static bool trans_l_rfe(DisasContext *dc, arg_l_rfe *a, uint32_t insn) gen_illegal_exception(dc); } else { gen_helper_rfe(cpu_env); - dc->base.is_jmp = DISAS_UPDATE; + dc->base.is_jmp = DISAS_EXIT; } #endif return true; @@ -1353,8 +1354,7 @@ static void openrisc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) case DISAS_NORETURN: break; case DISAS_UPDATE: - /* indicate that the hash table must be used - to find the next TB */ + case DISAS_EXIT: tcg_gen_exit_tb(NULL, 0); break; default: