From patchwork Mon Jul 17 12:44:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 107921 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4471094qge; Mon, 17 Jul 2017 05:49:52 -0700 (PDT) X-Received: by 10.200.42.27 with SMTP id k27mr26337883qtk.40.1500295792165; Mon, 17 Jul 2017 05:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500295792; cv=none; d=google.com; s=arc-20160816; b=E3Jp94VflgXqCfeZ6FYkVhOlkNtNI3/1EDS4xMOt6J19j6GiBbk+zhgGXqB0DBBrZh q2lE7I8Erqt2U6tdgiUb5xtt6QgRLX+G6/v8HBewRzZRD3i/aPLXXOHB/X25VyHwINl8 oEaulPGpnwIvgkChjl8Do01ZQ84ASNHNLyrIaYEvBDAfs1t/j7/Wu59y5ULYsqVug8qd 0pM5W5O/n1/8XsS/rIOz9n1kyRHTwHxX693c7perH2NaaXipUQKkittUJ3JZ9tPu0+YF fdvFUbHbfa2Dxzz6m1qq0UMZq48D2DX5aiGdUgDEXyq99m9FtlTE+D/sqGxD0a8Jt8t9 c7DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:arc-authentication-results; bh=GSlpuZiWkWiUR7yaSFTCLKeDuefso4ELCr7NV+NEu8k=; b=xZyg9efNMasLufGBl8yMp5ohdfCD6jOAdoG0qSVIpOL0fQg9G+B77plcPZXKT6ZyaS vmoIoEEPcz19cssnsr75t7+z5CyFOlFihrjXUzYYJ6Ln8xaGH/4SX29pP3mK4yKW4NA5 xjKt7pRpbYe9+AgJta4QCytUjqeZN/7QqH39F8ncgn2pJhSeKHZwNlmtOLLZfAI3+oPp dR3Wmj7JcPbkXmP/lc7u/82TibZ0UQKpwvZ7DGMMW4HSl7Bsq6hnwoZsaL8eSmeKrq32 XzGV6jG8Tvk/v0TbZVjTjkvpd5/ifttXXZJEa6m9f+KFz1gE8qnJnvwnDlk4kHo224/H RZqQ== ARC-Authentication-Results: i=1; mx.google.com; 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 k87si15846747qkh.369.2017.07.17.05.49.51 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 17 Jul 2017 05:49:52 -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; 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]:50178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX5TB-0002oR-Gj for patch@linaro.org; Mon, 17 Jul 2017 08:49:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX5Oh-0007yH-2Y for qemu-devel@nongnu.org; Mon, 17 Jul 2017 08:45:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dX5Og-0002Kc-5D for qemu-devel@nongnu.org; Mon, 17 Jul 2017 08:45:11 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:37639) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dX5Of-00029H-TL for qemu-devel@nongnu.org; Mon, 17 Jul 2017 08:45:10 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1dX5OT-0003SV-4q for qemu-devel@nongnu.org; Mon, 17 Jul 2017 13:44:57 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 17 Jul 2017 13:44:40 +0100 Message-Id: <1500295494-8991-5-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500295494-8991-1-git-send-email-peter.maydell@linaro.org> References: <1500295494-8991-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 04/18] include/exec/exec-all: document common exit conditions 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée As a precursor to later patches attempt to come up with a more concrete wording for what each of the common exit cases would be. CC: Emilio G. Cota CC: Richard Henderson CC: Lluís Vilanova Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-id: 20170713141928.25419-2-alex.bennee@linaro.org Signed-off-by: Peter Maydell --- include/exec/exec-all.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index bf8da2a..6b6e287 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -35,11 +35,34 @@ typedef abi_ulong tb_page_addr_t; typedef ram_addr_t tb_page_addr_t; #endif -/* is_jmp field values */ +/* DisasContext is_jmp field values + * + * is_jmp starts as DISAS_NEXT. The translator will keep processing + * instructions until an exit condition is reached. If we reach the + * exit condition and is_jmp is still DISAS_NEXT (because of some + * other condition) we simply "jump" to the next address. + * The remaining exit cases are: + * + * DISAS_JUMP - Only the PC was modified dynamically (e.g computed) + * DISAS_TB_JUMP - Only the PC was modified statically (e.g. branch) + * + * In these cases as long as the PC is updated we can chain to the + * next TB either by exiting the loop or looking up the next TB via + * the loookup helper. + * + * DISAS_UPDATE - CPU State was modified dynamically + * + * This covers any other CPU state which necessities us exiting the + * TCG code to the main run-loop. Typically this includes anything + * that might change the interrupt state. + * + * Individual translators may define additional exit cases to deal + * with per-target special conditions. + */ #define DISAS_NEXT 0 /* next instruction can be analyzed */ #define DISAS_JUMP 1 /* only pc was modified dynamically */ -#define DISAS_UPDATE 2 /* cpu state was modified dynamically */ -#define DISAS_TB_JUMP 3 /* only pc was modified statically */ +#define DISAS_TB_JUMP 2 /* only pc was modified statically */ +#define DISAS_UPDATE 3 /* cpu state was modified dynamically */ #include "qemu/log.h"