From patchwork Wed Oct 25 09:35:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 830212 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="BpRBKZzN"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yMQqJ3Csbz9sDB for ; Wed, 25 Oct 2017 21:09:48 +1100 (AEDT) Received: from localhost ([::1]:47450 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7Id8-0003Ax-FX for incoming@patchwork.ozlabs.org; Wed, 25 Oct 2017 06:09:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7I70-0000K8-Fu for qemu-devel@nongnu.org; Wed, 25 Oct 2017 05:36:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7I6z-0000Ft-Bp for qemu-devel@nongnu.org; Wed, 25 Oct 2017 05:36:34 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:46648) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e7I6z-0000Ex-5B for qemu-devel@nongnu.org; Wed, 25 Oct 2017 05:36:33 -0400 Received: by mail-wr0-x244.google.com with SMTP id l1so23340136wrc.3 for ; Wed, 25 Oct 2017 02:36: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; bh=cCLYEN0BkUUqXfwOTShC5+1BY1Prd9d45RgDSzkEIo4=; b=BpRBKZzNx4YKEVePUAT7p5yRUjOHnMv3nwOw+g0WuiCunPNxhkkUBLZ3ThIK33cxRk rKhQy/Mp6GaaEG2avQRQAoodXcAPmVipEGJIBZpnGh6mz9p0UNUFzjZCoUQK2W6qVCaT WDy0JMpx3bvyZX9vI0O24V86G3CN5JnVrfuGI= 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=cCLYEN0BkUUqXfwOTShC5+1BY1Prd9d45RgDSzkEIo4=; b=lo1xqsGs9mQqT2yrXWlmZSePviMXbwZhsMGluYydn7upN1vb0u9jy9vWOgDeT08UhA 5UeARSGQPBpmqM2B8VKkB6YnPYHgjTWNz41Brtv02uG1bZ9gwG21+OLmZ+zztCIbx21+ ny6dW7HInQbdDed624MuLvFRDs5ygH1yGXcZmBq4OrPl3p3Q5OYtb5In9hEMVUGjREMd S8+Y25sO3kZeq1q2SQBCY3ZrObwMVI2SXorzueONwiOIJr8RCEZABNKi9oc22x4u/qV9 PmihoxLCUhNG1K9mw38HI/hmV1h0gaj3x/KHYzLIwBnq4hilu2/bXiqwi4Z6FpllDnma OQfg== X-Gm-Message-State: AMCzsaXx6CeNYKAsWr+q4VTlMFTusRM5H6H/6CwNsxEO0LsS/KqNm/eC mZhJkgJlVDnBQmM+RHJbuG2F8+aIbhA= X-Google-Smtp-Source: ABhQp+SxZYwd0uWaj6iujw3+E4olb0R4O1ybhiGAoEiEI+fQQvU7NmCF+/1IdFEr6pZI99JHEzLB7Q== X-Received: by 10.223.139.18 with SMTP id n18mr1435616wra.223.1508924191943; Wed, 25 Oct 2017 02:36:31 -0700 (PDT) Received: from cloudburst.twiddle.net ([62.168.35.107]) by smtp.gmail.com with ESMTPSA id v23sm2751025wmh.8.2017.10.25.02.36.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2017 02:36:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 25 Oct 2017 11:35:27 +0200 Message-Id: <20171025093535.10175-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171025093535.10175-1-richard.henderson@linaro.org> References: <20171025093535.10175-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 Subject: [Qemu-devel] [PULL 43/51] 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: peter.maydell@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.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 Signed-off-by: Richard Henderson --- tcg/tcg.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tcg/tcg.c b/tcg/tcg.c index 62f418ac8a..24ef6df6b5 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; @@ -384,6 +387,8 @@ void tcg_context_init(TCGContext *s) } tcg_ctx = s; + tcg_ctxs = &tcg_ctx; + n_tcg_ctxs = 1; } /*