From patchwork Mon Jul 10 19:21:24 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: 107315 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp3835685qge; Mon, 10 Jul 2017 12:21:53 -0700 (PDT) X-Received: by 10.200.34.2 with SMTP id o2mr5923276qto.67.1499714513121; Mon, 10 Jul 2017 12:21:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499714513; cv=none; d=google.com; s=arc-20160816; b=0tO8wPjcfnazbsiBqvCSAgo8EYgIFGc/Q8qfQvM5cwsSHfqC6lK64oAQOLrJmZ8ZXi QNhPCFXW0GRgqNeYLFOv2LRfxAwRHdLMLstXHApZb0uhidX1Wvp6+xP0yYU7F+h9BCLS VD1/LNrml4yN2sk0DDd1To6DP+EuJ0ZsMxvbW1dDp7Ho2gl6HBedZQkMFDUQlLg97V1L Q5Qv5S48WEUagF2d1bXSZVUilAHelJPwk6oPj90AYxukdoXCIRw0gzqkrxmKXVtdPzQZ MeKKAUTPDgea7u2xY7BqgeFia29JXbi2uzUoaKg+I2wGL7PCTDHcnlWBOu9q2hkaeHbn TeyQ== 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=KNKJK0le4zAqT+m6TEhuUC8FaTYOr85oadf3U4/zoimEGH/ihqvKrpdbeW5d9qVg0v bmYqkBIFWFI299ruppg5UysoOx6FhxQVxhGgYbKc0xYPKMjM/fTV0BMQFtJcaR7L79q7 c/7wQYM+lKS25DXWmdeN/uJax4JC5tX9+w+Kx1PJo7wdgUoLP7X7guTcwQQUutjFGjlW nJYQFdS56bNfehiEU/iuIdnQISmezuI5IE53dH80K16Qe9xsDqVSlaubrp/SzvsMLqqf VOqHJ2dJGiRo7d7lCxAu6aAQFpNr1htsuYO2/YGdF68zivIZoWB6B4+5l99ReDmkfLt9 DZrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.b=boKLD7M2; 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 n94si11582497qtd.151.2017.07.10.12.21.52 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 10 Jul 2017 12:21:53 -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; dkim=fail header.i=@linaro.org header.b=boKLD7M2; 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]:42615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUeFi-0007dD-Nm for patch@linaro.org; Mon, 10 Jul 2017 15:21:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUeFT-0007bY-S7 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 15:21:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUeFR-0006aD-OE for qemu-devel@nongnu.org; Mon, 10 Jul 2017 15:21:35 -0400 Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]:35480) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUeFR-0006a1-Hg for qemu-devel@nongnu.org; Mon, 10 Jul 2017 15:21:33 -0400 Received: by mail-wr0-x235.google.com with SMTP id k67so151272813wrc.2 for ; Mon, 10 Jul 2017 12:21:33 -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=boKLD7M2Y79sGtiJYTBS1rnqgyAKZ2GkmuEYXs3PI7gqKMENEEWBUlvoilxNImf4aW 2ETZrNRAOjpn5lcyJghV75A0BZM1QNxjM/lAJ98a3zsFCMbD07vykAAF+eobnWmTZ4vO YiwPwOoDjrzz2fJKk1IrSuRmWLQdVSgLCRoOU= 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=kCZJ0pUWjOMYyw6KWM8SYn6gizjfFdJJmYI42EcZe6a0NLjqVc2OR1OEDu9pss4JmS WWw899PJvhm29mj0ejtPWPZDebFJKthmW6z69KbeULtizT9o51d2ypRHp5xmojRI5BKc mcCN4m7vGNRa5DazN0lUcqtaDuVcyLZpsT5q2hx0Rm3crVoZnEDedR1V0xtEdwwq3cJY RB6W9K9v8yAKuvq8NhwxT0pSuaYbEb1+kfhzYBW7eqir+l3w5QW8lCCyHayTWlUFRhGO 9lchik/EMyLDHATYkmeq65xjrfcUHlHyzHHNFi496EOA0/qNewXIWTwYXvXgUqOjttxC x5Jg== X-Gm-Message-State: AIVw112ESFhbdcOJk71yv1WFAtSOjMFEbzaVC046FOJwhhDV0LuGqyR1 X7LGcRgrVazqr9zNQT99MA== X-Received: by 10.28.8.144 with SMTP id 138mr8997226wmi.8.1499714492447; Mon, 10 Jul 2017 12:21:32 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id u135sm655915wmu.12.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 7F7EF3E0258; 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:24 +0100 Message-Id: <20170710192128.9048-2-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: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::235 Subject: [Qemu-devel] [PATCH v2 1/5] 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"