From patchwork Mon Jul 2 15:10:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 10501821 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5244D60325 for ; Mon, 2 Jul 2018 15:16:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4125126246 for ; Mon, 2 Jul 2018 15:16:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 335652625B; Mon, 2 Jul 2018 15:16:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CF0B226246 for ; Mon, 2 Jul 2018 15:16:47 +0000 (UTC) Received: from localhost ([::1]:33473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa0ZK-0000UM-Qq for patchwork-qemu-devel@patchwork.kernel.org; Mon, 02 Jul 2018 11:16:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa0Tg-0003wB-6k for qemu-devel@nongnu.org; Mon, 02 Jul 2018 11:10:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fa0Tc-0007oD-Td for qemu-devel@nongnu.org; Mon, 02 Jul 2018 11:10:56 -0400 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:44825) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fa0Tc-0007nv-Oz for qemu-devel@nongnu.org; Mon, 02 Jul 2018 11:10:52 -0400 Received: by mail-pl0-x241.google.com with SMTP id m16-v6so8092925pls.11 for ; Mon, 02 Jul 2018 08:10:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zwROJDNO19y8L4571rd5vDDy9iKL7GFmoIWAnXAcLlA=; b=uBXka7WOeUxYjPVDmvdAb3OdlZcnDQtBf5zCwNOCRoGsCMbLxBhBsWMcXSQ71bYGme ivHEiHoOfGTby823FH4nGyiONTzSj+8xs+3bvFG0HHFV1ug3W014B0BDBwh49TBt2qto aqTpJfg7VUdEruO/EMTkwnXjUXM9sXz7UBx5VKoqZhCJUQF1g2H3Mc/ErJT9MSEwySY1 MUVqggSdZ+/9ITzIoYzgvchKQSN/nXsoKK+60tjGqhBcZfePT9GLO1tPvgBNKimC8OJc bQfUdaI0lS9CgCDFb/HLPoBKRygLAwi5slExX+V5jA242c6kG1XrELxutbzx/0a73Szj 0Jag== 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=zwROJDNO19y8L4571rd5vDDy9iKL7GFmoIWAnXAcLlA=; b=mfJZ4E/LvpKVP7CTUdKvhvQpZLTvXwPqJk4kWLxxY+s6aclmSLYbcaWD0ridgseFwN K/zw6yUKfm9OczjMVWy22X3n+1bWHF2WL7VzUfE4zFtGGKG2fmcMh6w6nrcx/f3nDhMz ouE2+FMsgtAXnMoNXKWFmCmP+/XReAoWBi5WGiTgMY6/olSd3Ix8JvBZK19igV+3NXzN xTtF2iVkWbP4uwKKUXHfTrzupxY5Ft5ftF19sPfMjctUBFw5WA43o6rwGi+zLouv53s8 y7nB7qMuOnOYCAdo5wTLlA41FfQgY3U2IoHXrpG0IycurzFWZUZXcW2bx+xdaM4co6Ev 8axQ== X-Gm-Message-State: APt69E0vxoWdu8sGDqOYJ9K7khrFtjQvmkSTQYYV+Xz6TImSt4dA52TW WawctFG8OnxwQweJy0XaR3c= X-Google-Smtp-Source: ADUXVKIInjZtVUVE7r9C4zvSwui5Xa88e45mXosD7+nwG/gOgdqASG+IoMqi5DxTo6kEOoqAMhBUkg== X-Received: by 2002:a17:902:a518:: with SMTP id s24-v6mr26577031plq.144.1530544251929; Mon, 02 Jul 2018 08:10:51 -0700 (PDT) Received: from localhost (g90.124-44-6.ppp.wakwak.ne.jp. [124.44.6.90]) by smtp.gmail.com with ESMTPSA id v15-v6sm24454562pff.120.2018.07.02.08.10.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 08:10:51 -0700 (PDT) From: Stafford Horne To: Peter Maydell Date: Tue, 3 Jul 2018 00:10:03 +0900 Message-Id: <20180702151023.24532-6-shorne@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180702151023.24532-1-shorne@gmail.com> References: <20180702151023.24532-1-shorne@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::241 Subject: [Qemu-devel] [PULL v2 05/25] 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: Stafford Horne , Richard Henderson , QEMU Development Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Richard Henderson No need to use the interrupt mechanisms when we can simply exit the tb directly. Reviewed-by: Stafford Horne Signed-off-by: Richard Henderson Signed-off-by: Stafford Horne --- target/openrisc/interrupt_helper.c | 3 +-- target/openrisc/translate.c | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) 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: