From patchwork Mon Jul 10 19:21:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 107318 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp3838132qge; Mon, 10 Jul 2017 12:24:22 -0700 (PDT) X-Received: by 10.55.99.76 with SMTP id x73mr6290307qkb.219.1499714662187; Mon, 10 Jul 2017 12:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499714662; cv=none; d=google.com; s=arc-20160816; b=yT8hUWuFkvfDyTTyelyEGqiDQnyGpoW10MNuXiHDPac1Xs2tizqTI5wSlErDAi4Cju 8T1dxy25B/D1VdAvE/6j6BbjhBPQlbHYrUaH57uFTeAEuuzK3A9xIjTf4NmQpBWYAzcu 6q6lSkHS6c/oTW2f/cXbFXI/Vpo206zkKcNe9+xs33LhPBGMOIBpfnwZPKY1ycx08Vwc 28wg5j7jPGE1SaazqcRTrY/YYMX99jQ/CLExlylUH/VliXgzZc7nNqzMeDPpwmNF91c7 4L2hhOXze1EWjoUcBei5O78/Q0KRdEcn9DpZ93zmddl1ETBw48XPD3VtaTzBDpBXmlrC VHpw== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=dbtvMLbGFELVf1orPK9hygDsZgqdY3uvuUXVoJvEohs=; b=GCv3gGoHF9pn5FwKXKvqC8wrERYRmsc3pIxt2s/v/uxfPl8ZAvR6y7k9Cz30ntze50 xLEK9tGnF7jU7ioLOpdhxeaT5vxGbl0UZJKpHormc55cF46kduPIEcaQStKURpCT6vEl 9y/CVBwww2reXLs7uAgW3uveHYmsBUYKfUV+J16xxZVTdnhzyLu2ZCW61T8Npdr2Dp7q 07gRWJRxd9dLEB719DOoArwaRA0pbqqn6F2h6znuA89dC6UImJufbxQ5RZvXc0kmB9J8 hWOzf6uIwaWtYe93vYAfGc/M86zT1xoaiqVjTiXiTb5ZAKiGCW04Mu8TxUPOD5Un3+fB gajw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.b=F8wjoW5R; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 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. [208.118.235.17]) by mx.google.com with ESMTPS id 68si6956076qkq.318.2017.07.10.12.24.21 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 10 Jul 2017 12:24:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.b=F8wjoW5R; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 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]:42627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUeI7-0000ga-PC for patch@linaro.org; Mon, 10 Jul 2017 15:24:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUeGR-000876-ED for qemu-devel@nongnu.org; Mon, 10 Jul 2017 15:22:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUeGO-00076S-9m for qemu-devel@nongnu.org; Mon, 10 Jul 2017 15:22:35 -0400 Received: from mail-wr0-f169.google.com ([209.85.128.169]:34786) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUeGO-00076A-3l for qemu-devel@nongnu.org; Mon, 10 Jul 2017 15:22:32 -0400 Received: by mail-wr0-f169.google.com with SMTP id 77so151753088wrb.1 for ; Mon, 10 Jul 2017 12:22: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 :mime-version:content-transfer-encoding; bh=dbtvMLbGFELVf1orPK9hygDsZgqdY3uvuUXVoJvEohs=; b=F8wjoW5Ron8Q8kD5M0IcO1ddAtGuUYy7uVygM23WgQw9Q9LZONgVJNB04ztvwAm8pb 7cEei3HeC3p7bA86AJLpKa0axNZ93wDFZZeV2RaRc510iQljXpG7NI3YrxWBNP1FDjRA nVNwzD2pgSF0X/ejqq09hT8mjIyttnv9uHhAA= 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:mime-version:content-transfer-encoding; bh=dbtvMLbGFELVf1orPK9hygDsZgqdY3uvuUXVoJvEohs=; b=pkVVAvvgbJzejMnr1Wq7QKSzjfMzKkvtGmnTSweob+i48OBsVOj7zag5rqDYhyi7UY 0bKGB4BiyKYmH0ANDm48DepcY3+xx4F0QxUlE7IPm02iWxLFs6KKM/dv2H1v1/4XCO6t jqWL0ISIkOY2xTfBHMfOMJjMNXwdNkTHdRDXUXjNayHYbsM43JObD74Zewj4v79dXYrj Tnk7AhSO1gXf8x3Qia6YqzMjkBkMTRmLHF8+og1BezEn1tu3+oVSDPsTbmrQyIKBfFIZ 1oeT4vy3uD7g5x7sdi9oq8XkU+B20WbScuDHakiiU5S03kRpVEDgCYbB2Uck6hqKCXo1 Fkyg== X-Gm-Message-State: AIVw113wXjgPcpXQsgMJmQVEVwNbgTUcNWH+Svjq/cq12OwsN40dMn92 hkeyXfMxL95mndwv X-Received: by 10.223.162.219 with SMTP id t27mr8662390wra.68.1499714491110; Mon, 10 Jul 2017 12:21:31 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 24sm16248217wrw.0.2017.07.10.12.21.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jul 2017 12:21:28 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 922493E03FE; Mon, 10 Jul 2017 20:21:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, rth@twiddle.net, cota@braap.org Date: Mon, 10 Jul 2017 20:21:25 +0100 Message-Id: <20170710192128.9048-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170710192128.9048-1-alex.bennee@linaro.org> References: <20170710192128.9048-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.128.169 Subject: [Qemu-devel] [PATCH v2 2/5] target/arm/translate: make DISAS_UPDATE match declared semantics 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: "open list:ARM" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" DISAS_UPDATE should be used when the wider CPU state other than just the PC has been updated and we should therefor exit the TCG runtime and return to the main execution loop rather assuming DISAS_JUMP would do that. Signed-off-by: Alex Bennée --- target/arm/translate-a64.c | 14 +++++++------- target/arm/translate.c | 5 ++--- 2 files changed, 9 insertions(+), 10 deletions(-) -- 2.13.0 Reviewed-by: Richard Henderson diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index e55547d95d..66139b6046 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -11364,16 +11364,9 @@ void gen_intermediate_code_a64(ARMCPU *cpu, TranslationBlock *tb) case DISAS_NEXT: gen_goto_tb(dc, 1, dc->pc); break; - default: - case DISAS_UPDATE: - gen_a64_set_pc_im(dc->pc); - /* fall through */ case DISAS_JUMP: tcg_gen_lookup_and_goto_ptr(cpu_pc); break; - case DISAS_EXIT: - tcg_gen_exit_tb(0); - break; case DISAS_TB_JUMP: case DISAS_EXC: case DISAS_SWI: @@ -11397,6 +11390,13 @@ void gen_intermediate_code_a64(ARMCPU *cpu, TranslationBlock *tb) */ tcg_gen_exit_tb(0); break; + case DISAS_UPDATE: + gen_a64_set_pc_im(dc->pc); + /* fall through */ + case DISAS_EXIT: + default: + tcg_gen_exit_tb(0); + break; } } diff --git a/target/arm/translate.c b/target/arm/translate.c index 0862f9e4aa..ccc4768b2e 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -12095,12 +12095,11 @@ void gen_intermediate_code(CPUARMState *env, TranslationBlock *tb) case DISAS_NEXT: gen_goto_tb(dc, 1, dc->pc); break; - case DISAS_UPDATE: - gen_set_pc_im(dc, dc->pc); - /* fall through */ case DISAS_JUMP: gen_goto_ptr(); break; + case DISAS_UPDATE: + gen_set_pc_im(dc, dc->pc); default: /* indicate that the hash table must be used to find the next TB */ tcg_gen_exit_tb(0);