From patchwork Wed Oct 16 19:31:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 835829 Delivered-To: patch@linaro.org Received: by 2002:a5d:6804:0:b0:37d:45d0:187 with SMTP id w4csp604521wru; Wed, 16 Oct 2024 12:35:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV6eHt/+O8NDjtYqlMKe92TseOGmclLPhehKSr43OZg1kvCsNZSgpQBO4xb+YHzg4kx0eObtA==@linaro.org X-Google-Smtp-Source: AGHT+IEYcs3p0SCGMt9EEhU3qvczWOT48IZErZI2CIXVMjKIjv+8WemiPp7GxEKdKfYwxgwVh2QX X-Received: by 2002:a05:622a:5c91:b0:458:4c4f:8088 with SMTP id d75a77b69052e-4608a4a6c01mr81045631cf.17.1729107319703; Wed, 16 Oct 2024 12:35:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729107319; cv=none; d=google.com; s=arc-20240605; b=Y5Gxn3b1KYtOdXG0ZcnJaBDxf5gH2rzaWbgy7DvxHdsGtmkG20ay0Wj2CPVcL53gvX +BOsfSEu18B5bS3068X34ClrdtfRq1qsMuy57P0alu6LVuHe0xjlX6MGQpLZ2WHXwzp+ nZ9oeSfoneukWXFL8HQyD7P8QsUSimXVsiwbGTTcTiEifIlN+cofEwmKPe/+ENqW2uU4 3UwkNKLBNh4j79/TqAaVzhv4yp+jtflfIcBaVFXbOeR6hIro1CbjwCZJidLO7qUE+dK4 QSniP1FHrSfkE0lwiBRoswzV4NiUrcC6NJ1ZAYaTka6zLBiT4+maCsrTbyQuHzWMe7R/ 8G8Q== 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:dkim-signature; bh=pAS56LpJLEvFceTFCBsO+yMHFwJ+VtaFv7L9YjE7ffs=; fh=JWUledwuIo29+yfO5j5zISL7nuTrlt+PJUK+0FeRjh4=; b=D3nHvK8qFCmKIfE1bXMOIS0Ix+Qn4CBzjyKjP/UD03WC6LPhSuzbIPEzachDaibdY8 RREgBIhqxkETSsLq19DTdjyWU/n5u+5+e13yeakRyxkDEuKGfSbowAKOSM4SGSQG34Wr LHZF2KJBRojFEto05aYJZksNMruNJ6lBSnYlm4mUZPCtYdYkY3/Oh9j1+6OcujGFAeNO XD/xAXo66sJpCS6jG51MjuTcyxxW8ini+HmJgjs6TcN8hi55gsVyroB8fQXEuHLbmtds OvCR9ZX+4dWNz7UzbdtELheOCHY4Ik5yURTlmHGgYTDzi3JgwFwzgA9U3RJAIfgId2VK Vgpg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OSvF6fMo; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4607b0eda35si45956411cf.72.2024.10.16.12.35.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Oct 2024 12:35:19 -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=OSvF6fMo; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t19kL-0002di-67; Wed, 16 Oct 2024 15:31:49 -0400 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 1t19kI-0002cZ-N5 for qemu-devel@nongnu.org; Wed, 16 Oct 2024 15:31:46 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t19kF-0003nJ-JK for qemu-devel@nongnu.org; Wed, 16 Oct 2024 15:31:46 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-208cf673b8dso1747495ad.3 for ; Wed, 16 Oct 2024 12:31:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729107102; x=1729711902; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pAS56LpJLEvFceTFCBsO+yMHFwJ+VtaFv7L9YjE7ffs=; b=OSvF6fMopQgsmWmUSA1xiO/3gUZlMxSse5XxAPZAbgtx4sOFZHk5H97BEPKWyKShSS 71tTJIzSEn8cIuDvk+gKqdOCrYDCXGDzvfhc7siB8EaeoJ0naaAAcDRxEAwYPwPUeGpe B34FAsMFA+QyXXNHlx3Tyhj6xTRX99/YisLQT5wo836Q8QfpjP1eIIwarr3sOHz8VWNz Vv1/zcWifzEw3ROTqUFX1Moi23qAGtyZqauSZBN48hODn+NEuZfYPktrpX+tqL881fPt SLQKezYzN7vxMjV8hltQPh438vsPyuOi9EiXaADJgCRQvIAbVzPP++ce+c/gaqqOps0v vWtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729107102; x=1729711902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pAS56LpJLEvFceTFCBsO+yMHFwJ+VtaFv7L9YjE7ffs=; b=V0k35BOwbB2Rnm/QEIDsXK2EIyzFWnrMmW/qKsxfXz/6VxGGpgpvxtUnbnrwGtAxMu eBEprxnBRPJO+eQNOvE8wy9CZvpH7l+3Wp6gqMfYK786q4gXIFvprVIjhuHzdwdjTx4w a4jaMOUFI3T8e6rtRZzJGaWevgZQeZkC7LQSq5kyAxhtwt4Qx2T8My+mz+kJ0Z+J2Jyw 0mDttyFdoYEUW8PqIDlI3n3h50secODq67EzsFVt+YbGZntDxJ+gTYBmw+8vxPSpxj1K Aah8f4NGB22IiT0bslxNYOvXxfLoCLbgF/8cuOeXUB9DTBv6DE4GAkqKguXYvDlU4MtG eLlA== X-Gm-Message-State: AOJu0Yye0chYvJUrsXMxye/78OKRDXRuc1ZZdYtkiE59jOBX59vaMf9Q mc98gpTIfy7CZpRg6IBiUraxfKGI5XMwC5ErFbQsaSzrnDeFiOlBzHIvlKNij49CAO2aqpjhGWv W X-Received: by 2002:a17:903:1c9:b0:20c:9d8d:1f65 with SMTP id d9443c01a7336-20d27ef315dmr71489035ad.30.1729107102081; Wed, 16 Oct 2024 12:31:42 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20d1804b6b1sm32323945ad.189.2024.10.16.12.31.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 12:31:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, zhiwei_liu@linux.alibaba.com, qemu-stable@nongnu.org Subject: [PATCH v6 01/14] tcg: Reset data_gen_ptr correctly Date: Wed, 16 Oct 2024 12:31:27 -0700 Message-ID: <20241016193140.2206352-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241016193140.2206352-1-richard.henderson@linaro.org> References: <20241016193140.2206352-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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=unavailable 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 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") Signed-off-by: Richard Henderson Acked-by: Alistair Francis Reviewed-by: Pierrick Bouvier Reviewed-by: LIU Zhiwei --- tcg/tcg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 5decd83cf4..0babae1b88 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1399,7 +1399,6 @@ TranslationBlock *tcg_tb_alloc(TCGContext *s) goto retry; } qatomic_set(&s->code_gen_ptr, next); - s->data_gen_ptr = NULL; return tb; } @@ -6172,6 +6171,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t 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);