From patchwork Tue Jul 11 17:59:32 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: 107409 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp5274obm; Tue, 11 Jul 2017 11:01:24 -0700 (PDT) X-Received: by 10.55.10.11 with SMTP id 11mr1333585qkk.251.1499796084158; Tue, 11 Jul 2017 11:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499796084; cv=none; d=google.com; s=arc-20160816; b=pAX/Va+FpdVF7vHcFmjOXih+dacCpkIeiWvYX7QwoFE9rEonebwbbla8QkTB+UY58P tTLxwOSlt7OF83CX4yYhSxxrEKEc+8PZ7VJ7p7P4ndpYE5hgwvLa1wSlxFjvc0ST8Hwc H2Q78dBAu5GkMrg12pAZH2lQn5Griil3pdnwYxKSgQzRFBOEXOGWd5NvvRAKtAhXsHQ6 +1q+YTtk1MTN2scrTcfaDCWk2R5H2NFtx0V9CGJfb3646Hgt7+1kgq8J97HNj1D+L7SW OqFiXqkCY+1NE8JGjsJyf1ruSK8OFIeGRZXZ36NR1QzoTPxHT3vCU5A9UIyJIjAH/OPR ks/w== 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=oiYY7L6CJhTMaujluKlhbW1IrGWZZrdUFXSimciraWk=; b=wKB4avregVphT+/EZGzsir/Ve11BFMRFxoomhbfe8/tEmW8uAw5BF+RcJH5IzrY6Yg O5qRE309cy/IoB4LKvo2rAcmanUvtzr+/b3URPLnOOvIS4lyuVFopystzjWIu26iWW0O AygScJSPJpGlScpsfbs0JAnw28KlRygOIkatRhjmzjjL7/hl9z7Y3FAppiQmwZB+z48J mZbIiCl/s/aLHU37Jv+PXlMyotamTDldx6gIO8wfHNZVIDTyQimXS1sc1ZDTWsqtD1EK I2EQkxDYEc45k3NQPKhuA3jD3cJHsOXlYj/+pIzYdpwyIhyaKYvxjK5pFPBeDdZCChNy Rj/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.b=UsVp6F6R; 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 q7si522348qkl.241.2017.07.11.11.01.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 11 Jul 2017 11:01:24 -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=UsVp6F6R; 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]:48109 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUzTN-0002UR-Mw for patch@linaro.org; Tue, 11 Jul 2017 14:01:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUzRo-0001hl-9C for qemu-devel@nongnu.org; Tue, 11 Jul 2017 13:59:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUzRm-0003kx-33 for qemu-devel@nongnu.org; Tue, 11 Jul 2017 13:59:44 -0400 Received: from mail-wr0-x22f.google.com ([2a00:1450:400c:c0c::22f]:36423) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUzRl-0003jC-SB for qemu-devel@nongnu.org; Tue, 11 Jul 2017 13:59:42 -0400 Received: by mail-wr0-x22f.google.com with SMTP id c11so9457938wrc.3 for ; Tue, 11 Jul 2017 10:59:41 -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=oiYY7L6CJhTMaujluKlhbW1IrGWZZrdUFXSimciraWk=; b=UsVp6F6RAalrUKNbeMmxUqhbgDFXS9Qg1F24JwkcTNs5VjKyvIiyvfGMm2jvr2OsCO rUBL23Bs02ck6CPrMApqr5+qVayouTMFFcbcQw8GNbSmI+NGYGm1qEHm7aqA5nvPCxO9 vRW8TFOclGxA362MA/OGGswVGMu1IjXUrJPyU= 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=oiYY7L6CJhTMaujluKlhbW1IrGWZZrdUFXSimciraWk=; b=RpJKez6otC5kChgCB4WYAb6enQxy5lOb4sYbYsfGgjLZ3BFnHwZcSI9ZCI9DwyJ0ON m4atl83MJZ6touQQMeIGzpBxsB71uXJRULdQ/I1bfqLm+EqSaNsQy2J+Z+mA0uO0Mm9h 8uisOA6vaYzdfgLW0SAkLSRokEPgO09vxJxK++BBr5wWysulDmMhllLfp7c5Ne5tEmVJ sxh80tfDERdS3fOb1N4S/Wk/ySQfTyt4y0zCpEJEh3DGWiCdbxy806ortkeOgWO6x+VV Pbks3/uQhOT1Qelecx0rWBlnA1Fv2GukHqodYtxy3kSoEny3J0bXwPvckACEmkxck82T iFuA== X-Gm-Message-State: AIVw111VOlErrdPL5JMNb9DBFD9lqcZ545eqQDlHcjfsg5YhGQza6sap HYHtD8OMowCTaIVs X-Received: by 10.223.162.219 with SMTP id t27mr675349wra.68.1499795980681; Tue, 11 Jul 2017 10:59:40 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id q24sm519958wra.16.2017.07.11.10.59.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jul 2017 10:59:38 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 045E83E06FF; Tue, 11 Jul 2017 18:59:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, rth@twiddle.net, cota@braap.org Date: Tue, 11 Jul 2017 18:59:32 +0100 Message-Id: <20170711175937.23140-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170711175937.23140-1-alex.bennee@linaro.org> References: <20170711175937.23140-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22f Subject: [Qemu-devel] [PATCH v3 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: Paolo Bonzini , Peter Crosthwaite , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, =?utf-8?q?Llu=C3=ADs_Vilanova?= 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 --- include/exec/exec-all.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) -- 2.13.0 Reviewed-by: Richard Henderson Reviewed-by: Emilio G. Cota 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"