From patchwork Sat Jun 19 18:14:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 463919 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1058281jao; Sat, 19 Jun 2021 11:38:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4xv7+bqTJqdQY32EG4T9HS5cMN3ja9AL6ayq/goSIJio+vsGm6LFiFrIU4Yt5yT3HMfGj X-Received: by 2002:ae9:e512:: with SMTP id w18mr15424370qkf.281.1624127913176; Sat, 19 Jun 2021 11:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624127913; cv=none; d=google.com; s=arc-20160816; b=WuhP5l12mNHCAFUGG4NvmFRkWqxCUVgNpsqKO6UkufjQVMBSyimIrv2cx/DMXprpbr j6Glr+JrxRxxvn4YYbS3XsgcVJ0lerOBhhoY2dKJ1TTWT4vtEqvt4Piyq5kWZjMw2r+8 REcTIlatyJ17EwWWoC5PFbGRpla6QExTvz7NNBf9ymEH/Xp0jh+zD+Az3Gb2qvwjmb2h jw/2XA0ePEsARdFh9TD1Kvg8yq+pltfGBh+f7Qu3qDgDnKnkoZ1FDotSohNahStQKXgc wnssoVBpSn+OPe7Dnd9abgxc3EVtBqlny13vlEyDcKdok7EzkgET80fQxjOAMhyMV/PW DCOA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=gsjy1JiJ2x2+FvZgfCJN+MKtpHaomLmEry8fdDvNSE4=; b=Y1ypINmvZFAislYb60QcDYIiErTEE283h3oy3W3dIrEek4w6YDGNOZjnbLbyFj/ZJy T4V6/PR7DrO2BckKRFjfVQ7xmRZOXyFXw9/iYqEWS1rwt4+5ci2xdugiMLtzoxOMBrSU uPhcQ0PEuH4BOXdO8XtZQU3cc92bslzdzxneaZe58TcOxcP70ig97IfCLbfORIfzJ0mB SqTUTBfD1pT63lvsL7mXhtPitcwFTurxS2/cRXR1HrpMO3HmrXWs466YVeiFSmivg3YA +2VpCInBvTtd/AgR/I3ur7K5Hj0VGe4YLrKP5O9GDoJaL5yO6m1IWzHNt50lJqWGMzji Opcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sR3puWTu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bx2si9486885qvb.216.2021.06.19.11.38.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jun 2021 11:38:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sR3puWTu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lufrU-0008PT-KL for patch@linaro.org; Sat, 19 Jun 2021 14:38:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lufV3-0000yU-JV for qemu-devel@nongnu.org; Sat, 19 Jun 2021 14:15:22 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:33355) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lufUu-0002Oz-Hz for qemu-devel@nongnu.org; Sat, 19 Jun 2021 14:15:21 -0400 Received: by mail-pf1-x432.google.com with SMTP id p13so10416254pfw.0 for ; Sat, 19 Jun 2021 11:15:11 -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=gsjy1JiJ2x2+FvZgfCJN+MKtpHaomLmEry8fdDvNSE4=; b=sR3puWTumD4O+ggwV5V+dLFrOpB3SOGZqC+D7xqRYlA+y+XR6UFg1HRmcwOaktsyvK YC2BXdGmz8sLil1nN0ojnZcCvGjDUf16nWz7wm5vKg5rIcjrsPYDWhLH7rsSTPE1e3X5 smfh00sAdcIaPlkx7NkNecm5LdFza7SgiuP2NKcEX9gZ+TkS/BdeAxPlmNUsnOaGvbL1 P+jZKacuUz4w9CwdQF99yYkBqjmtDFl+1dta1OntWO19gPQzNG9/fUgtf72j+uWzOB9H /VsTtLubLKWfrsQk0hQLz49pG95fuXc3LzDWnFtD3TQrzGTxo+mKP7PjO7mvJSlQJQgI olow== 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=gsjy1JiJ2x2+FvZgfCJN+MKtpHaomLmEry8fdDvNSE4=; b=Kdw19uhjcZdY+6v0TeOpR03MMKGwK3WDtgJjJqb8Le6o9dG7RwfAbIkOOmqzW4xdqc O+qKhHjDwueLHAjaSFCymjABpUSmnrsMVUl0TyCgwsab8Q2rDeg60Gfix6995HNq6Goz WBFu2qdUnJsSjenGH/8Nb9EC/VdMBeVXO53i+agpBAT+YrkPr9q2zafNYJX6Hl/Xetem eVvSjfTUzzSFF5zhFpLokq3gC37cfWr/ovb9KSf29Dp3r5TpHTwspJBI5YT4CZjmbFAa cLgaMvwksrQ0+AB96JjqLk3bSvhT7d0sFCfWLSUkkrtkgQTGAV52KsCCpX5dgqFu4gE6 gd2Q== X-Gm-Message-State: AOAM531u9OiF/88G4v02agt/ZpTEA8zEKHu8sSm68ViGV0aG+5XxSChW EcQMKEWJrRvKRxWl1fz8TOjHXTfUGVqgKg== X-Received: by 2002:a63:c2:: with SMTP id 185mr16004604pga.18.1624126510999; Sat, 19 Jun 2021 11:15:10 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id k35sm12059113pgi.21.2021.06.19.11.15.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 11:15:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 31/33] tcg: Restart when exhausting the stack frame Date: Sat, 19 Jun 2021 11:14:50 -0700 Message-Id: <20210619181452.877683-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210619181452.877683-1-richard.henderson@linaro.org> References: <20210619181452.877683-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Assume that we'll have fewer temps allocated after restarting with a fewer number of instructions. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tcg/tcg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/tcg.c b/tcg/tcg.c index 47cc66f159..fec922fa9e 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -3039,7 +3039,11 @@ static void temp_allocate_frame(TCGContext *s, TCGTemp *ts) assert(align <= TCG_TARGET_STACK_ALIGN); off = ROUND_UP(s->current_frame_offset, align); - assert(off + size <= s->frame_end); + + /* If we've exhausted the stack frame, restart with a smaller TB. */ + if (off + size > s->frame_end) { + tcg_raise_tb_overflow(s); + } s->current_frame_offset = off + size; ts->mem_offset = off;