From patchwork Mon Jul 2 13:57:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 10501475 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 6E8676035E for ; Mon, 2 Jul 2018 14:03:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D3342878F for ; Mon, 2 Jul 2018 14:03:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51CE92899F; Mon, 2 Jul 2018 14:03:07 +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 EDF312878F for ; Mon, 2 Jul 2018 14:03:06 +0000 (UTC) Received: from localhost ([::1]:32967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzQ2-00062k-6K for patchwork-qemu-devel@patchwork.kernel.org; Mon, 02 Jul 2018 10:03:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZzLX-0002EZ-LU for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:58:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZzLW-0007z4-KW for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:58:27 -0400 Received: from mail-pl0-x242.google.com ([2607:f8b0:400e:c01::242]:38072) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZzLW-0007xj-EF for qemu-devel@nongnu.org; Mon, 02 Jul 2018 09:58:26 -0400 Received: by mail-pl0-x242.google.com with SMTP id d10-v6so8003557plo.5 for ; Mon, 02 Jul 2018 06:58:26 -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=CASCIR4jbNK3pkgy8D66JklU1KJOm7IZMD5iHxUouFSyXOKOh3SqaIJAoNNDcPVad6 9QqB7o2OnQYdhx1YlkG+sLCWzsJuj/J/qGpiqU03QLo1DNYCz8T5OeLziIEAfYQ9ZSig pgyovPhgJk0H2wLAHFgbT0YzvINbR+R4t0hCa3eKZtf39JpMXtKLO7VQiIZrPGp2UCVb RDUjPbvealypM/bVTwXYI7+47JAsKzmVr4yUCbs/9hnk8map2wbIIdTPWmq7HGxTyva+ DIgWrL6+JP2nquZLM0zNoFuRv6KIXfMyTtS+307fPLGKJ6cZM7o47pDOiXORRxYhm8cK +u8A== 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=c5Ia47XGRZh993lE2xje75MQWOs0PWUr8Kjj1Als6851LE55vH55KFZQN3EwNJSgZr B8rZx6s2ujs2bsQP4U5LBOLzFbpUP41I+KYHm42DM3MSedzdKzvmUJZoyFR4GLf7QUhh waf1fe1tLT/O8RDGS/z013eWub9giHWYc+w7NZKUSIiLvD6JK2oA+lN5ioVUcG0Z66M2 Fgx6pSY1NoMkXlvHnAFLY+tuXH/WNwP4MbSL6zb7p+deycJ8GqVg8v/+ez3043Ia0/8R TMJe0QaVDFcoe8y+o+58xBKBX2aUFDXAzFvG+Tb48gsq/3J5mlubcSFCQZVCTW0EJ/pL 4Sfw== X-Gm-Message-State: APt69E3wRz5gwXQmao9w5mrDMf/WNTMw5DG/ENQyCfWS6Gmz2iS1jYX7 9CBx/ea7hvroeOnF0JQ3VXM= X-Google-Smtp-Source: ADUXVKL7PyMwynSqL3vfsuTC9Me8UNdkQIWK7J48BXLKHYfYXRygdytJXfoUU11b8iBEeqMH4u6ybw== X-Received: by 2002:a17:902:e00a:: with SMTP id ca10-v6mr25840759plb.224.1530539905377; Mon, 02 Jul 2018 06:58:25 -0700 (PDT) Received: from localhost (g90.124-44-6.ppp.wakwak.ne.jp. [124.44.6.90]) by smtp.gmail.com with ESMTPSA id u13-v6sm22236004pgr.36.2018.07.02.06.58.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 06:58:24 -0700 (PDT) From: Stafford Horne To: Peter Maydell Date: Mon, 2 Jul 2018 22:57:46 +0900 Message-Id: <20180702135806.7087-6-shorne@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180702135806.7087-1-shorne@gmail.com> References: <20180702135806.7087-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::242 Subject: [Qemu-devel] [PULL 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: