From patchwork Mon Jun 18 18:40:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 139044 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4281710lji; Mon, 18 Jun 2018 11:43:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIQ+uyQZW0z4xH9hyXUyi9EOGtyu6UEv0qshKYUf+JETDsbHBRmPqQ0B528Q6e+4NlmYtH/ X-Received: by 2002:a37:2117:: with SMTP id h23-v6mr10896018qkh.49.1529347438693; Mon, 18 Jun 2018 11:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529347438; cv=none; d=google.com; s=arc-20160816; b=LDlRVhthSmGj5w4sAM4BTVsu3Ggx1R760PHWjjyOECokgFfQ2CKIsW/MKGFI+vCDmv nSbHeedKyOnhHjPbF2AJcDi7fj+97LelVOLTxysoip+tHL0TPHiFDmZbJST21uvhp6rK xW57r+Qwsdq8lMuM16KdahIm+yzm/4dcn55MxP17UPVdL/+0bMUpwBNB3UaC91fuQTe2 /PZFq/NCRUpJaND8u8vv2dSHjpvpiQJ7f8IcF7ohukL82+16tyh5QPVK5iIsh4wXZFk5 NL8TQJSsYCGZG3dvnLif6C/v0SfclLWiLH/wOpRf8aJX6RSW5f60v88f+W43hnO1rest +xwA== 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=/UPpLQKJjB4WlC3Mt7cbg+cnQYnU8YCz/2dtHJ2hEe8=; b=dVY17y06X24f8m4g7nd3oCfi5MbtFn55CTKpc5wy11lm7C418FZzx7HpmaruRFtzWE ISTfxex/WcAIIMSrR4gkhyQ9QnIgKMo6WdqZCg1MKubs2uzdf5Lm901hWtS+aveEUZwg wlXOChcnJA3ie35ntnSK/9SalEZf0QgQ7h6eINA4NSMfoof3Bmx2H4sgkoU8o7zhaQ1Q A21ISt8/FzonJlvo79fXst9kStwBLufA4JBH6WtRce9Y067dQdTuCF6sYQIYV4rX3lCu wTbUK8yG6AMAw7VT388Fuxaz9YJHWsXJZQZiN0jWgnj6Rsevge/OG1rFUd9lYc7Is0dS An3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WvZVaOzG; 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 z5-v6si2425003qkf.162.2018.06.18.11.43.58 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Jun 2018 11:43:58 -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=WvZVaOzG; 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]:36474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUz8A-0005dW-6M for patch@linaro.org; Mon, 18 Jun 2018 14:43:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57255) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUz5F-0003LG-7R for qemu-devel@nongnu.org; Mon, 18 Jun 2018 14:40:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUz5E-0004L7-5H for qemu-devel@nongnu.org; Mon, 18 Jun 2018 14:40:57 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:35480) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fUz5D-0004J0-VW for qemu-devel@nongnu.org; Mon, 18 Jun 2018 14:40:56 -0400 Received: by mail-pg0-x242.google.com with SMTP id 15-v6so7928000pge.2 for ; Mon, 18 Jun 2018 11:40:55 -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=/UPpLQKJjB4WlC3Mt7cbg+cnQYnU8YCz/2dtHJ2hEe8=; b=WvZVaOzG7ExIVl893ySN1XT44icmngnyMdIJJM+AcVoCuuijW5NNVD1zZvWrtMHNQV r4Cv7t9x19Tj6jZ7ReEVsB7gzmKQLGNrj8WOkUCCgJDQILzwGpTFJfV+E2gxvagc+pCZ /EWmtLTewf45N/3MWq2y6VfTJk8JkHOOLycug= 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=/UPpLQKJjB4WlC3Mt7cbg+cnQYnU8YCz/2dtHJ2hEe8=; b=VxEYfAAEp1cnZovFKYHbfupo5YcDka7RIm8xHIxQ1GjzniPU4L3uJ4V9pODZSYY4RW rPQDiZ5SBUTpDvr7eRAM4knPiFGvDHn5HXQK8byfZ+oLTmWzg27PYk5zQZWaO5RTJJVA sODsUlT1WSCWAl2NcpnSIEqFmtMPnVZyEZfZNitrhVfIs2jw/6wCzgzD0yBSG7DNYk6M TVSh5G18Vez5B0HLFYduGiI+6Cg7jaTw4SLh/qnzmBOR4UPO+eZrsKnwUR6/nwg9XZzS ci+7t+Xi1/p6X3llBgHoznwGdyKiHJ8CiK1EviUhxPEYSstz2Miv2dsZfA0G+b4vGwvk 4myQ== X-Gm-Message-State: APt69E3VVHDHoe+ohsm8T6AqgjcH72zRfFnBfuIbb5GeWBvAQNhj1kdi pdqL81iUDJX8gHxHTVTBqjC5HwAWmIU= X-Received: by 2002:a62:e401:: with SMTP id r1-v6mr14710985pfh.172.1529347254732; Mon, 18 Jun 2018 11:40:54 -0700 (PDT) Received: from cloudburst.twiddle.net (mta-98-147-121-51.hawaii.rr.com. [98.147.121.51]) by smtp.gmail.com with ESMTPSA id i65-v6sm49457254pfd.17.2018.06.18.11.40.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Jun 2018 11:40:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 18 Jun 2018 08:40:26 -1000 Message-Id: <20180618184046.6270-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618184046.6270-1-richard.henderson@linaro.org> References: <20180618184046.6270-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:c05::242 Subject: [Qemu-devel] [PATCH v2 02/22] 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 2d7588a3eb..c7c1f40782 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(NULL, 0); break; default: