From patchwork Sun May 27 14:13:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 137009 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1783428lji; Sun, 27 May 2018 07:14:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIgAjvz0vqFjIof4+AMV2zCUr05wnw3prSl1kjhlOAv0kIDx9VbYuSJxxZ0q8jWjbkNfcbZ X-Received: by 2002:ac8:534b:: with SMTP id d11-v6mr9234111qto.141.1527430445748; Sun, 27 May 2018 07:14:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527430445; cv=none; d=google.com; s=arc-20160816; b=FKQru9T3NvxWdt3Ca23KeLGX+RlxTokUSP6PeLsr4Nku+HhpC6aS/AdG4dJmiIOhJg 0OC6Qx/lYL/bungSCZmiC/3LCrJGZXKBGWnw1+aaAOPqUXdu5Rw76EH97NcSzYJdOCSx cHRh1Mhab6Xl6ftsHWGvTB4+Z2/76fAOAJJFqfjCGLGL6xHV45yv9xv0X8a6Fy4ZIoxu HERFmIANSsMUxv+eIF9LoUEUtT11jRsh5tL+tOQFCxwBOkdoM6rqdC70KkeEq8AhMC5x trZ7jurZrrUHGYHJNnUW5SNDBCnCpaBBtoJzi4Wbn1s5awI5GR7OvDAKCXdEZga6JUrx 1sCw== 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=v5a5CtWLlrTHKhlg23p0wCWnGJn/uksZC6j3BEgsUGQ=; b=QaH3iU+QB7Pv3IKikW0HNvcUnRtg9MvyfI+XW0JtB9oMYvzqSd6tz5lmmKWcJqy12c j9aPDNvf+xfzYaw3TKLNvy85rMtOPkR/jdxblHt6xZ3Y09KmVr9xygehV18GDshaAHZj WEN5lpbJ3pFRhL19puqqv6+SvIpvWfc4q2Wr6VyxjGUG1hhdUSQpoVZmo/8R/3FyXIF2 vC9dS5e40S9s291CVAkRcxCHH5Et2M7UvrWK5666n0T+aTFlBMHrXIlwcmSbr7zecjuw 5CBV4BEvUfiBdSAJW7Z/+YTrZM1KC34JfBLqdsNdtOOAbxD/5VqkHuyQBjRGVeqqYbUp Lhlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=AFTgsBhx; 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 l20-v6si4661403qtb.184.2018.05.27.07.14.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 27 May 2018 07:14:05 -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=AFTgsBhx; 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]:52197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMwQv-0008Q1-4L for patch@linaro.org; Sun, 27 May 2018 10:14:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMwQP-0008PS-Ko for qemu-devel@nongnu.org; Sun, 27 May 2018 10:13:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMwQO-0004Mq-MQ for qemu-devel@nongnu.org; Sun, 27 May 2018 10:13:33 -0400 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]:33576) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMwQO-0004Mm-GJ for qemu-devel@nongnu.org; Sun, 27 May 2018 10:13:32 -0400 Received: by mail-pl0-x243.google.com with SMTP id n10-v6so5737119plp.0 for ; Sun, 27 May 2018 07:13:32 -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=v5a5CtWLlrTHKhlg23p0wCWnGJn/uksZC6j3BEgsUGQ=; b=AFTgsBhxoSXJawc9yjQbS53jNugjQrm8QXKRlPvwZLqQKSOt3xxnIfBL0LgpPMrTHV CFpaUdFfhJELdSA/PkgbPqlOMf+X1F1Im8hu0xEOk4YThUVwof//hSLZvvSJ91IFXBpB 60/VCOuDvFBf+5VIKPJ58wA27050GnJRIcDuI= 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=v5a5CtWLlrTHKhlg23p0wCWnGJn/uksZC6j3BEgsUGQ=; b=ctV13gwN8TAXRfl0MwWefJJczcp1uw/+zw1zPTsQ8GOOkiH0mr21pPZF+M7I+iQG6d Gqhz9VFNtZEaJjtROJImYnpiU3DCBcVLy8l9OVkqpxD9XKEzrb/5Low01RCNuPakpcO/ S7jcBVzcQO9/3EUDyeTr5CkbiEaBkFl1yflkGbhTRxcYSLVwng0sOegxD54tH1MNXEZz vxVD58PhZkkX4CkLXfFIzTfOgYreVWDbTKNPHQkYGel8FppY3Uoz74LjixHlf7Xo3TFx +5I7Yab/yEZo3J2nR5b116Oj3OWbgtXwaXkTRlbV8d7VZfD+ye9aN4fQz6hkGgYOejxe Zm/Q== X-Gm-Message-State: ALKqPweLUNefPCjEVg2xfKtOAkM46BwFr71vq+Uh/daNhASbnUaTNxLG w8S1k0k+IP808O0TE5e085nVz5Rl/ZM= X-Received: by 2002:a17:902:8303:: with SMTP id bd3-v6mr9918822plb.290.1527430411334; Sun, 27 May 2018 07:13:31 -0700 (PDT) Received: from cloudburst.twiddle.net (50-233-235-3-static.hfc.comcastbusiness.net. [50.233.235.3]) by smtp.gmail.com with ESMTPSA id b89-v6sm66680075pfd.85.2018.05.27.07.13.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 May 2018 07:13:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 27 May 2018 09:13:06 -0500 Message-Id: <20180527141324.11937-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180527141324.11937-1-richard.henderson@linaro.org> References: <20180527141324.11937-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::243 Subject: [Qemu-devel] [PATCH 02/20] 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 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. 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.0 Reviewed-by: Stafford Horne 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 f4f2f37e28..dae673afa4 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -41,6 +41,7 @@ ## __VA_ARGS__) /* 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 { @@ -1233,7 +1234,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; @@ -1467,8 +1468,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(0); break; default: