From patchwork Sat Nov 9 06:38:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 842070 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp2030052wru; Fri, 8 Nov 2024 22:47:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVkQTlwM0RLTLUdcy5pLltWHLWOVMzBf1qtZC3otahC/rdJL4Eev/CrhcVeqYyZcT1GWrBLrQ==@linaro.org X-Google-Smtp-Source: AGHT+IEUOqxZ4VFTh0LFNVcspasdmDm0jjJz1zK/tW6gTY5Bx0iS7Efcv1cZUiJKIPQp0uGu9/m/ X-Received: by 2002:a05:622a:13ca:b0:461:20b0:9909 with SMTP id d75a77b69052e-4630935ccf7mr78411771cf.29.1731134858366; Fri, 08 Nov 2024 22:47:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731134858; cv=none; d=google.com; s=arc-20240605; b=DQTCllvBDwR9RDm3jDLrPg3WjOWwP1SMfXEgOpSHuW2vAWGdJw+T5aBE8VRObGUf7q MTgreAXfWwvy4jOKcFs8gurl/e5NaEEX92/7AwaAWxBLNFTCreS2VEj7fjIIQuNJmAZV qXihs1tIh/9gbbhUnNGmaGrpk/s89CsizdoACV6Pi2W/kpHINrkooi6BK/aa1Iqfym4Z x0TmDCRZZqSBi5SXVcHpMVL5HodBHjPUPSSZB3Js8bV9VdGZTosbdKqECOzkaHrE/CeT JQvIfjy+yygyzE8fQ4fPdJ412RU8JS4yWvsJ9T8mjTvpvd5UkAOLyMT/6HmTu0XJxwIf fKgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to: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:cc:to :from; bh=gBZN0nJOG5+3fXJtYDlkUQ0Qew6bIqgwSyCBRtxVPug=; fh=vuhzQW7LNVNfoCzrQU/zlJ6j/7aL6vBNEyQhm6VZot4=; b=FYVGRQrJwPSs1sSUenPc5fXD1auWg9mBTu2BlT91bODYMLThkiWzXMp09IL8J0FYLM dV9hQSsmbwZ/U+Y6+gJVkwmqL1kU/ZPU4MP/dklQm492J8jn5jSmcHg5HosTKJs0Gd+o e4ztsuz3I0UBLeN9pCU9ImQgbRndqUB9AqQ8T5FC2JB6xYbDidkTQK3pNh3xnto0Pjz4 yfn+GAURQpZO2OZs2Jvq+DRjnOb81J9w583fdmnUL83JvD3CYGlrzHFQf4sTXtNRrlou HLk7IDou2xffz6W9SlkQf3SccqwtPzuNDGYkSz86pfJIy27vlOFe5QNdzmvV3rj1q1m8 0vmQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-462ff680c98si57144071cf.594.2024.11.08.22.47.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Nov 2024 22:47:38 -0800 (PST) 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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9f9V-00058R-St; Sat, 09 Nov 2024 01:40:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9f8m-0003yI-V5; Sat, 09 Nov 2024 01:40:14 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9f8k-0002Qx-5x; Sat, 09 Nov 2024 01:40:11 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 5F819A12F6; Sat, 9 Nov 2024 09:38:10 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id C6A58167DDA; Sat, 9 Nov 2024 09:39:04 +0300 (MSK) Received: (nullmailer pid 3272537 invoked by uid 1000); Sat, 09 Nov 2024 06:39:03 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Alistair Francis , Pierrick Bouvier , LIU Zhiwei , Michael Tokarev Subject: [Stable-7.2.15 15/33] tcg: Reset data_gen_ptr correctly Date: Sat, 9 Nov 2024 09:38:41 +0300 Message-Id: <20241109063903.3272404-15-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson This pointer needs to be reset after overflow just like code_buf and code_ptr. Cc: qemu-stable@nongnu.org Fixes: 57a269469db ("tcg: Infrastructure for managing constant pools") Acked-by: Alistair Francis Reviewed-by: Pierrick Bouvier Reviewed-by: LIU Zhiwei Signed-off-by: Richard Henderson (cherry picked from commit a7cfd751fb269de4a93bf1658cb13911c7ac77cc) Signed-off-by: Michael Tokarev diff --git a/tcg/tcg.c b/tcg/tcg.c index 436fcf6ebd..e7aa02c447 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -716,7 +716,6 @@ TranslationBlock *tcg_tb_alloc(TCGContext *s) goto retry; } qatomic_set(&s->code_gen_ptr, next); - s->data_gen_ptr = NULL; return tb; } @@ -4249,6 +4248,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb, target_ulong pc_start) */ s->code_buf = tcg_splitwx_to_rw(tb->tc.ptr); s->code_ptr = s->code_buf; + s->data_gen_ptr = NULL; #ifdef TCG_TARGET_NEED_LDST_LABELS QSIMPLEQ_INIT(&s->ldst_labels);