From patchwork Fri Oct 20 23:20:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 116568 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2234689qgn; Fri, 20 Oct 2017 16:43:40 -0700 (PDT) X-Received: by 10.200.8.239 with SMTP id y44mr10204519qth.341.1508543020492; Fri, 20 Oct 2017 16:43:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508543020; cv=none; d=google.com; s=arc-20160816; b=oIGbaAtc74rb/EXP8rsb0poW4ObHkvyYhLS7vJmr7Rfw6578dmSZKgCJBULwrLkl8A 0ltUSVZorK7TXRJgbXDWsEMqGFTqRjXXALWlDtZ1FAxUAF5EuCxTA5mWUi8l/kwVKXvG tGuVCRK8i+WMIZYVTFPs1I1olsrR48/rLVV7X0+k4j+q/00pcPzzwjpbcref5R+N7Nz5 EmfSTWZ8kcvPb8Q7YCRWv/dI3ypa9msYCfAfyvWqYCGsjVeaSODDUd4RN7ykN6WH/eLh mjz0Zj0oyU8BjGQuCB0841H6kbqnMSEpgAC7/H5vhvRQZL9g6ktc6diTiRWSXWCoZKmw vefA== 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=yVPBYGw9gbjdIMRlIAnJLOfNLUPKbCG2moHkwu+51ciajUAOgOYdZQmvAvN7yhXSVm 6VRwsU2nr6vlmRNGbpS+HFZK1F946RG8EY0+C+rIOWmsOQjxkHyQzj36Pee3ryWJybgn tsJzuUiy3I97AenmOKedYeOM1NBGoKZudtedRxYD0lq4QhB1tNx1YzxA1LGoaL4/cxMU HLXP9/H4iQ70fe9l5TmLpwhMQ75gqDVWZ6WwSJgK1oF4gOAu1Pz9+Zm/TBLowDPQCFxp 2kiT57yFRsGaGYBjgjOGS6+i3c1ScwZBE0cl3trTP6GUEzBC0YRRiAjR6hB5wuUvloLB Qsdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EbG/EdGx; 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 s34si872342qts.242.2017.10.20.16.43.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 20 Oct 2017 16:43:40 -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=EbG/EdGx; 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]:56071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5gx0-0001UC-5a for patch@linaro.org; Fri, 20 Oct 2017 19:43:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5gbc-0006Zw-K1 for qemu-devel@nongnu.org; Fri, 20 Oct 2017 19:21:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5gbb-0007zv-3a for qemu-devel@nongnu.org; Fri, 20 Oct 2017 19:21:32 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:45640) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e5gba-0007zY-Tc for qemu-devel@nongnu.org; Fri, 20 Oct 2017 19:21:31 -0400 Received: by mail-pf0-x244.google.com with SMTP id d28so13079027pfe.2 for ; Fri, 20 Oct 2017 16:21:30 -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=EbG/EdGxJsMGzwFvHJfeGD5FADrj4r/LfmULloSLvEt0KjryJQU4PE7rup2H25ZzSf xiYAdQQ6QbOzapcE4xhk3oqteIk8dFRRGCUkLeweZ8k1/c3E4mu+KXtuHbSWjwFlNNRW ofMmvx4Nj+vZwPSrxgKGGiM4xtwzrk3p1ZvGY= 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=qdvE4dLzmuTiY6lCIARzfQ3oFG79aJ12dRKHzLcls+zdGm38A/PbtzOaV+c8NnpW/W xfqiNhONXE0pKO3sqffY0AQyUjVEzOdcY1dzb4FrqRoZjqPBonTQ+YtDhKOLIJ3xj8+S 3vU5ZCJbjD2FK193rsmf6NkfT07DLQalvjk9hSFkX0ZQpbS7CxEnKu9QGAV+K8Np9gf+ vOo9c/hdCMSb3jT+e85jD7VjSLQSqQcDgstHQbSLx2fRQU4bm/793nQqSll55oagpjUN RYi+lCyMsja3vyckV2lUAfbWwZhPM4eDGiFLUC8vO+i0OXD3CL5zYWFavpV+NnOYFi9U vJsw== X-Gm-Message-State: AMCzsaV/pjli5+iNhruBztJ0bMfdn3PweV90dWOsHN0EEhzSAGWSJXiS Q1MmzY6nODAjHzmCfJcLtBXIyXkaXBQ= X-Google-Smtp-Source: ABhQp+RKEujoaxvOMre64edhjTYKCA+P8wK8sEOfLN5tf7DXjJomURx/vdr/N5krRhYu3aNWzjjN2A== X-Received: by 10.98.196.209 with SMTP id h78mr6400116pfk.249.1508541689739; Fri, 20 Oct 2017 16:21:29 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-165-104.tukw.qwest.net. [97.113.165.104]) by smtp.gmail.com with ESMTPSA id a17sm3532594pfk.173.2017.10.20.16.21.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2017 16:21:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 20 Oct 2017 16:20:15 -0700 Message-Id: <20171020232023.15010-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171020232023.15010-1-richard.henderson@linaro.org> References: <20171020232023.15010-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::244 Subject: [Qemu-devel] [PATCH v7 44/52] 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: pbonzini@redhat.com, cota@braap.org, f4bug@amsat.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 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; } /*