From patchwork Mon Oct 16 17:26:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 115977 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3968953qgn; Mon, 16 Oct 2017 11:06:13 -0700 (PDT) X-Received: by 10.200.4.169 with SMTP id s41mr15910822qtg.212.1508177173515; Mon, 16 Oct 2017 11:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508177173; cv=none; d=google.com; s=arc-20160816; b=VzvlUOoPzMEBfzzXGhszt2QF6A14ZtO3xAvtH/vmJ24q3OSlIFubTnTtfaNehQ645+ g69uTafOhocIL7Jjq64WRyrGLp3PjWm1cOkbGSj4rP5sHqxI4c1GOh+HBnUAlMv5phBf 4X6tBH2PiRHS41IQwWmDJ/PvmOVd/7jf9J0aGyL2VkJx0egxzqwxvBw9btk8emvpK+v5 BxPIS1cErxXCWRElsBL+qfpQKvAQ/i3wUobSHIEb3uGlnRZyW9Zss1IqaB63SgTEAScT U3xd9QjJu3JssheLArCbTb+iVnOoHViGaas56GyvASTuv4y4/LGBy8tlfR/0M0oCavOR icyA== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=vCy259Hd0iPkc7/74Haae/g7ny02+7f0iEMwV2uAIVI=; b=YG3s4LuYY4PQ/zU8nCw+VorqNLroVv9l3sasR5CLe+22fTStpuPSOpjpWHjVSmV6yj iI/FTqacElxkoYQNa91YOMmLd+KupmRImEF5cy2OLAGz/lrqN/LoIqdr+3/kGpfAVFh6 RQucKQDcT9T2YViheJkTgsPMr9VbutnDfd9jFAhb0oQJPoGCVdSTODpHHjDsWE8g90kY gEVRkRzh4Hw6Q5UY+4aGoKbIudBQ8d3BSnkBDomqOccwr39FGAh5YJwByRc52dnLyHtB 3b1cnu1X7QCLkG/rLb0+YbJ/nOwgNA77ajr++bWZSU0qk4W7R/1zGq1iE8/5SW/DDrUg 6kqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VlBO/fdE; 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 d129si2372573qka.305.2017.10.16.11.06.13 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 16 Oct 2017 11:06:13 -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.s=google header.b=VlBO/fdE; 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]:34479 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e49mF-0002Ba-Ee for patch@linaro.org; Mon, 16 Oct 2017 14:06:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e49Ab-0002pM-5b for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:27:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e49Aa-00041e-By for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:27:17 -0400 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]:46254) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e49Aa-00040w-5j for qemu-devel@nongnu.org; Mon, 16 Oct 2017 13:27:16 -0400 Received: by mail-pf0-x234.google.com with SMTP id p87so16296522pfj.3 for ; Mon, 16 Oct 2017 10:27:16 -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; bh=vCy259Hd0iPkc7/74Haae/g7ny02+7f0iEMwV2uAIVI=; b=VlBO/fdEoBeNW3MLqaJPlq8nTgP+umFv5Wxbv3869MeYD/pDSqWrk6blyXbUXkPtig IyBOt6Su8WWydsWMwqPO0Nwh+gUVgq94HCFQ2bQhSxINqQviVazSGs1wxsP2gbwySNLT +GrFhmudMN/vNuCbtJfvIN9XbWGbuphzuTTeQ= 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; bh=vCy259Hd0iPkc7/74Haae/g7ny02+7f0iEMwV2uAIVI=; b=Ewm/k4rUmwUuI39VO76vhAVjrAOGpjrzx33qZr7r2vmhiEjoAFseKplB0HP8VLlmUh MJMUAQ2DNV1ix/eKym2H0QSAlcQ/hy/w2yOmKkDzp8AawN2sYjqwGI7wCMsPaGadhVjn RWbLbQQfKceTXBDLpneC1HKQ2Lp/zmwGBpPJGXQP63KvGGXNbAm5m5zp/fbqFymSLYWr vYNQI9UgIsZOEWvnHYzX/h0tz2wqhrsJouS2WuwkX5lPUxjC5aeQnh08FgGtImzIOQPn MRWT6zNdig+xuOXB3rXgNubBZlWqgcwKsmyLh3pNh2Z4QRxh4vPbV2X/bAOcJjtFM1ow KJKQ== X-Gm-Message-State: AMCzsaW24vW0dx2s/Tq6GLN3ZNKtzE25T1ce310XTbn9vAl/pdmEFrJJ eixvg3cf+jvIU2mnp6x7SFQ7LDPtXqo= X-Google-Smtp-Source: AOwi7QAX+ZaUtKa5sek9Yydp2EsPj9/feRCwvtw/9Jqq0pxbEYI74nZCFRuTAbL1+uxlcloj8DSyZQ== X-Received: by 10.98.58.69 with SMTP id h66mr9275093pfa.121.1508174835064; Mon, 16 Oct 2017 10:27:15 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-104-76.tukw.qwest.net. [97.126.104.76]) by smtp.gmail.com with ESMTPSA id i187sm5594249pfc.96.2017.10.16.10.27.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2017 10:27:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 10:26:03 -0700 Message-Id: <20171016172609.23422-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171016172609.23422-1-richard.henderson@linaro.org> References: <20171016172609.23422-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::234 Subject: [Qemu-devel] [PATCH v6 44/50] tcg: introduce **tcg_ctxs to keep track of all TCGContext's 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: cota@braap.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Groundwork for supporting multiple TCG contexts. Note that having n_tcg_ctxs is unnecessary. However, it is convenient to have it, since it will simplify iterating over the array: we'll have just a for loop instead of having to iterate over a NULL-terminated array (which would require n+1 elems) or having to check with ifdef's for usermode/softmmu. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- tcg/tcg.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.13.6 diff --git a/tcg/tcg.c b/tcg/tcg.c index e509fdc255..225e7cccea 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -118,6 +118,9 @@ static bool tcg_out_ldst_finalize(TCGContext *s); #define TCG_HIGHWATER 1024 +static TCGContext **tcg_ctxs; +static unsigned int n_tcg_ctxs; + static TCGRegSet tcg_target_available_regs[2]; static TCGRegSet tcg_target_call_clobber_regs; @@ -387,6 +390,8 @@ void tcg_context_init(TCGContext *s) } tcg_ctx = s; + tcg_ctxs = &tcg_ctx; + n_tcg_ctxs = 1; } /*