From patchwork Mon Jul 10 15:47:44 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: 107306 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp3595227qge; Mon, 10 Jul 2017 08:49:50 -0700 (PDT) X-Received: by 10.200.46.253 with SMTP id i58mr5398479qta.89.1499701789524; Mon, 10 Jul 2017 08:49:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499701789; cv=none; d=google.com; s=arc-20160816; b=leBVAqiX5ADabTdqTXvPHmsHqBoBxNf31VUB2XOjic5Nw8htX2BFBAJLY5+CnNnFnm BDvrfthFpW7AfhOVU4k48XRWCEcYId/j/7bFOwsiwr6seOqxFkCGBA67cJnAuztzQZGR fgTdk4nCCO8i2xFmKjWCUsA6Q4hHBLIzCdKN4fEDbcMtzwvtalssnca8PKIAhGZqwRza nntVlIq2ZN3JSjd2hsux8d3Asxb2yvgh0U/3rpwAxxRfkqKRD7syZgxlA8XuwGHQB9i4 rpoiYo9HVC4dCH31mrAEVeQF2ClASE+gWQ7In3FVqfAE0s3QQ8Apsn40gSyJSTq1UObH 4b2Q== 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=OJAkz+7pZdveKsZFixhPC9NjwaDkJrjOHSipqb3lzlMJRL2sJ0rhRGoQP/jX/M+Uxv ycK15MU7x1/WlC6Cq9tq10g4ygHus8ejZbgNTz7CTnaYNp6mtlrSiA541x8h0zHbMC2m QWF7nNqU8WeZmpmXjjQ86VGQXWDjuO5MivqOlbRmNh0n6fYXLVuLyHpZCeQ3b35IL7Dg lLWzN7UMQ9nm9u0zXIIpJj6JzIiEKYIIOE2YCWX7YOZqARrWHVJNCs3cepRobpK7D1JQ p1+6QR/Gpqtm3fM4Hzmtnh5VYO5BCH8hdJfWuhGE3reG/vm12G+yT/MPgDA3S7dHOmm/ K2XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.b=h/7CfWg/; 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 t85si11070781qkl.159.2017.07.10.08.49.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 10 Jul 2017 08:49:49 -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=h/7CfWg/; 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]:41510 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUawV-0006nw-0T for patch@linaro.org; Mon, 10 Jul 2017 11:49:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUauj-00061N-0c for qemu-devel@nongnu.org; Mon, 10 Jul 2017 11:47:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUauf-0003WS-RM for qemu-devel@nongnu.org; Mon, 10 Jul 2017 11:47:57 -0400 Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]:34150) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUauf-0003W7-Ie for qemu-devel@nongnu.org; Mon, 10 Jul 2017 11:47:53 -0400 Received: by mail-wr0-x236.google.com with SMTP id 77so144029784wrb.1 for ; Mon, 10 Jul 2017 08:47:53 -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=h/7CfWg/SKGebGd8i5qjlitz2pxj6Ws0dujvU/W7raGar69kIroM7QEvsHZfuVveFD Y/33jiJ6T6cKPcSjbk0MyjmihvBg2w44gx6l+kSaEvGZlR081HpKV5mIXGsT1I/iifH5 gHD1bQqTHkSe2WgG+Uy6LOw/t4EAFxVBAGmIM= 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=WstPBN+kN7o6vSyWWiVuR7ut57AkJ62Co4cP0SMwPr86TUhmkVfFUKCuknBy8itCs5 PCA97K9ivMwCdKq9IXSAIvlCNr4niCDpgvGeeUVIJjFsf7rsazrsA5xob/JvpRfbEg/Y sV8DF1HkbHH8uZqqt07PwpNTuGxq/VdHvIBVq0yHibCKnN4XjvDzhBLDLvs10VjtKozK gF9ULJ9NLxZwoSNZI2ZQM/jHR25ozgLVU1Rt1jSpc9HeOzwY8Zprxz3fHCJAQsHZZaGH s3qjfvnPlf52VfmHcMspTPoOUaN4ogEAYaEuLBkeJgMoY9nlIxeXY5hn08ChcQa06wZ0 9oww== X-Gm-Message-State: AIVw11054ysTkOvLZO3qbrWMIBtlyf+BxwVbcvTMTq+9qurxl8hGsTsD DeO1gYey+3i9fO3Z X-Received: by 10.223.164.80 with SMTP id e16mr8412000wra.24.1499701672385; Mon, 10 Jul 2017 08:47:52 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id x94sm8938261wrb.47.2017.07.10.08.47.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jul 2017 08:47:49 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 5E6AA3E0258; Mon, 10 Jul 2017 16:47:49 +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 16:47:44 +0100 Message-Id: <20170710154749.13624-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170710154749.13624-1-alex.bennee@linaro.org> References: <20170710154749.13624-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::236 Subject: [Qemu-devel] [PATCH v1 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 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"