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: 117090 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp662172qgn; Wed, 25 Oct 2017 03:10:35 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TyDwrflOBVE4r9mec5FsXOwfTHOlPi3rV5wlYPaQqPPH796010BwwWG+3kNEkKdsVCJo+z X-Received: by 10.13.211.68 with SMTP id v65mr13020156ywd.429.1508926235507; Wed, 25 Oct 2017 03:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508926235; cv=none; d=google.com; s=arc-20160816; b=PGhzzkJAnK0yo+YVhXcHakc64IxnmG1q3RPydXxKDnU/Sktetz/5RfLF2uosPxYdmR lQvUloLLXXdGhETShDMq6QUm8NSm6vWQz3mXuWAA6Kys8e3vjn8ZIgXp3mVLi5YWvEjV K+yXc9sCy+3B9kN3cgTKep+f0TaSj/rhfsqS+FuHjE1jMNLkcIcXBBYHsWXMJr6PknOn FdXAy7INBmaOGoscXem52GykyTOwtqL7td4GqityHQy/ZXf4/ftBFgSujzKBxvwl+7PK CQxrkdnKiee/wRY4dwA8bsxdNWnw2c484gzQOq5OXbHJ7jH5r0pN/GM5SyTsb3CtujSW BTuw== 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=cCLYEN0BkUUqXfwOTShC5+1BY1Prd9d45RgDSzkEIo4=; b=pmM/5miUxHYfpjZA2EmLjFUkqYHiflllL2dLXRBMMDQnplxtFJKBr0XC92z2v+Et6Z v8xU6e+VjLNxg6N2wR7p8WGyntURXdOoA2Mmf8hZUFuZ65oMVgsrPTybyRurF2CtbA9K uwYnEEvpqcoDZ59kPVLtf2QlvD5mTsCOjcz36s37HndvaANrT/FnKMnvCyDwEFm5UvfR 0Qd5FXc4o2jpoMiSFSxjS6/K0bvZ47wenl2niFcZngcwMoCYlHqpDm1XkNJdQPOX9qEy G52vi9X6vvvDOmr7tC196cyEyhBsykTpMsN3RDGW2auoCNY1QBpcQzHFcN9FTnKK/gVn zzLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BpRBKZzN; 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 i1si386801ywl.682.2017.10.25.03.10.35 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 25 Oct 2017 03:10:35 -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=BpRBKZzN; 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]:47454 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7Idv-0003s2-0w for patch@linaro.org; Wed, 25 Oct 2017 06:10:35 -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-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+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 Signed-off-by: Richard Henderson --- tcg/tcg.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.13.6 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; } /*