From patchwork Thu Jul 13 14:19:23 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: 107692 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2281322qge; Thu, 13 Jul 2017 07:25:04 -0700 (PDT) X-Received: by 10.55.150.193 with SMTP id y184mr5113115qkd.113.1499955904352; Thu, 13 Jul 2017 07:25:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499955904; cv=none; d=google.com; s=arc-20160816; b=Kmo5UkE74Fin5H7yLGXF4uRp2kqlMt/HaTxmbqeu3km4x9mhzFmzndDZVTVpFrGgDF dS+fcY78y4NBu4LaeyYqPPspeZBT5Z1sgLwpO/juiyjHf+3iNNI4SLvjwJ1eyHu+BZeS wBc62PSkFWDDNOa4VlhgvSS4OFfJA/yvXBl0deHqFoMf4hAYHO1iOUf2rmdJ6pcdjcti /rMu/YTtrOHacS5BTXR1yaYudmxDls7zjmXzy93VsqB9V5gOd0/qolZT3Ca6QZf+eFHA eA1E2hGS3b4MImKy1Ml0JCxQ2arqb59gilQG09H0ecwIwAITlzMsAtme0BIwzzCZ2+nr DrSA== 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=GX78zWPDX8+8rg6HXIAfNrRYuxdLAVkpZVVTP63GZpc=; b=sGrSdiSUAUbpiex0ZSypqRPXc45iQdbtmPvKQLoaN4yWHUZoFC7X8cl37JhVxymgu6 WgkPpbYdd3IgQcqRMxo+BOBCpt6hizByC3Xy7ZMMBn5Jp55hjh5OcOg384dbVyWmJFD9 HxDtJH8fmpMvW9jki1wMCqfMiDlK66Bst1hbeZhR0Xc/oK8lU96HeHYC3nxpXjTgZ/6c xIVafjmni0j2XRizccBmRfoC51vgdkUWvxGMITrZl/XzrfR1jVvguYHTcSuUYvOYYBhJ sDO2ddOG4EpKMeQiK/AXD9h1jfgIDyKdiMaZaqjNBBb+fZOeJ6SlMLlnoGvSwiZLT4cm 4StA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.b=T0gmLx+o; 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 j14si5126722qtc.324.2017.07.13.07.25.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 13 Jul 2017 07:25:04 -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=T0gmLx+o; 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]:60356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVf37-0008PQ-Jj for patch@linaro.org; Thu, 13 Jul 2017 10:25:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeyr-000522-0E for qemu-devel@nongnu.org; Thu, 13 Jul 2017 10:20:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVeym-00076j-Fy for qemu-devel@nongnu.org; Thu, 13 Jul 2017 10:20:36 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:36768) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVeym-00075m-9L for qemu-devel@nongnu.org; Thu, 13 Jul 2017 10:20:32 -0400 Received: by mail-wm0-f49.google.com with SMTP id 62so25143198wmw.1 for ; Thu, 13 Jul 2017 07:20: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=GX78zWPDX8+8rg6HXIAfNrRYuxdLAVkpZVVTP63GZpc=; b=T0gmLx+o4TtpDDjL8VOlY8G5Rk2Y5nx+jZQThr6Q+swkwWT/Y67aBLSPJMPHE08EU/ 52r0OpZ3OK1B2Lc7zLf4Rx8Tb70ngPn/DP2FLsfyWz9HOJXuLiSdY7D0wW1Y4JMjomL1 WQG+ohUX3IFg+g9qLYFGcxvhhKeV8p5LRcWrE= 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=GX78zWPDX8+8rg6HXIAfNrRYuxdLAVkpZVVTP63GZpc=; b=QJEqedKtVYqM/pNJX3uc8r+0WTl46QGwxe1xeZisfrZtMR4KM3lz7lVcMJx16HJLW+ ntIr18QaglgrBerU66stI83itj4vYguqAqAt7d0iCJdWrN1atDT3waOTyPBlWIDqrMGF GF5uPOCRk0qfYFKADpIp9ZStbSYy9L6U9zrWDQmcYq61oBoCaM6NJW4wzvrwX0xln0Z3 HN6bZdNk8gmEwsxUh0S4lPGvG/DiSMRcQGeJ2MlVoFpBSTsNXLaD2RvXc+gxydPNf+QS Caku7hKbjdMAXU46iSA6NWqA4nHFVtqibXBr6Vd0S+kJSQe3NetoHOf2ke7lS3n6OAi5 2oOA== X-Gm-Message-State: AIVw113GDSAsQYTsSgAUhYTnIz1tJ3435tTE2XJOsM69Z+SjeQAs8Qek 3AqS7v+FzrStHM/l X-Received: by 10.28.209.70 with SMTP id i67mr2299934wmg.3.1499955571259; Thu, 13 Jul 2017 07:19:31 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c2sm4420103wre.22.2017.07.13.07.19.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 07:19:29 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id EBDF83E06FF; Thu, 13 Jul 2017 15:19:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Thu, 13 Jul 2017 15:19:23 +0100 Message-Id: <20170713141928.25419-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170713141928.25419-1-alex.bennee@linaro.org> References: <20170713141928.25419-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: 74.125.82.49 Subject: [Qemu-devel] [PATCH v4 1/6] 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: , Cc: "Emilio G . Cota" , Peter Crosthwaite , qemu-devel@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Llu=C3=ADs_Vilanova?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 --- include/exec/exec-all.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) -- 2.13.0 diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 8096d64a1d..a23894f687 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"