From patchwork Fri Sep 6 05:16:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 825906 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp639472wrb; Thu, 5 Sep 2024 22:26:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXmw64sXdaRgz2dZCUzNW+uLohoqlanWFsKDopmnsK9GOU0DSfHalsNizDMCIMoqJUdMaICvQ==@linaro.org X-Google-Smtp-Source: AGHT+IHzeLqmPlQ/D9X6yZo/v5AULJZQtXeTyg+TdehyEQg43BYqhOJ0f3d9AzFihg3yr2owvoDT X-Received: by 2002:a05:620a:4591:b0:7a6:7613:3883 with SMTP id af79cd13be357-7a98887363fmr1319855585a.2.1725600408139; Thu, 05 Sep 2024 22:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725600408; cv=none; d=google.com; s=arc-20240605; b=NiO7hwKZbNj2+fhM3Sb/fHwMoPXpxn2k4q1xj7nD+KSh1LdwzV3dVE8ZWuWrFdWUlF 39+0Sk475DjnwATLyXKEQAYp7rk/PBuLt5SGRMmTyc0ujJkBcrFQIFMo947v0/UOD+mX VMa2rcMgUkTS1ymbKbTgyF4p0lKantKZwdjDqGEbrONUbbp63gMRAAhKMdwwUlGAgJnf 8dgTGOitGpLaZHTJK5i4uF/h/sSmtasOdjguRUP2ZFRmePb/fbaKdDYNxESOaMXwN/hC WjLyAe8bWqVcogYkhwTjfo/HJo8YjITO8zD/qRUujjV7EdLmmJ5uYJ8HTCgS6p27At4b 1zlQ== 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=DFVDCpDwaFaSrHrhlC0YU4ttHfIT7MCaKVw+9D945G4=; fh=o/5N7/kxpeWjynMRXgRTkeR2GWte7sLJ7m091+z4hMo=; b=SswxhF/zRFlJvmtVD4G1o2aQcP3tReLTv9G70VJYOJHW4IBz/fuy7qhgsbM2adhbO+ teD8DzizmXEMXosj3gk4ac9RrFXhNMYHtPJQAj+SPG5vulz2+RfTJ7f30XDCoek89X7r NSZb54ErNzBoXt3MmdneCaSV9lqLzAH+PTnJ5Eu6AQP1R7JBxWvmrdoFXJohixWJfPQh Vse4t8PeHdyJ3odU0tCU34pFt/hDjzCz0RyZ6aWxMBS0bMQ0eVNLWF5O30kjWTzfJZz7 J5OSdiJ8hIcHTch4OoCBR3A826dqLZS98krk3J3uzMNXLrryrNwDAeB6j0cjWXFt0jU+ /nfw==; 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 af79cd13be357-7a98f02ce1csi342871585a.676.2024.09.05.22.26.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Sep 2024 22:26:48 -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; 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 1smRLt-0005ob-Ge; Fri, 06 Sep 2024 01:17:45 -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 1smRLQ-00041n-Qi; Fri, 06 Sep 2024 01:17:20 -0400 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 1smRLN-0007v5-Ul; Fri, 06 Sep 2024 01:17:16 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id E86A88C120; Fri, 6 Sep 2024 08:15:16 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 98C67133366; Fri, 6 Sep 2024 08:16:34 +0300 (MSK) Received: (nullmailer pid 10420 invoked by uid 1000); Fri, 06 Sep 2024 05:16:33 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Thomas Huth , Michael Tokarev Subject: [Stable-7.2.14 12/40] target/rx: Use target_ulong for address in LI Date: Fri, 6 Sep 2024 08:16:00 +0300 Message-Id: <20240906051633.10288-12-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 Using int32_t meant that the address was sign-extended to uint64_t when passing to translator_ld*, triggering an assert. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2453 Signed-off-by: Richard Henderson Tested-by: Thomas Huth (cherry picked from commit 83340193b991e7a974f117baa86a04db1fd835a9) Signed-off-by: Michael Tokarev diff --git a/target/rx/translate.c b/target/rx/translate.c index 87a3f54adb..4233622c4e 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -83,7 +83,8 @@ static uint32_t decode_load_bytes(DisasContext *ctx, uint32_t insn, static uint32_t li(DisasContext *ctx, int sz) { - int32_t tmp, addr; + target_ulong addr; + uint32_t tmp; CPURXState *env = ctx->env; addr = ctx->base.pc_next;