From patchwork Fri Sep 6 11:12:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 825931 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp744633wrb; Fri, 6 Sep 2024 04:15:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUy/CcKc3qWDqmSYVJFFSnhcfM8x4iMOkSgdaRI+QLpYzYG3A5YSQzV+SCfCIYICKs+8QCK5g==@linaro.org X-Google-Smtp-Source: AGHT+IEAtZb8BoUAQkDa11ZFm/RIFt3uw0rnDiJoXZzwwDtqj9mXNk69mFwrpOvP2ShUyn4FZlvO X-Received: by 2002:a05:620a:450a:b0:7a6:56f7:7b2a with SMTP id af79cd13be357-7a997331b99mr296827185a.26.1725621359197; Fri, 06 Sep 2024 04:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725621359; cv=none; d=google.com; s=arc-20240605; b=NBdmdn2fngOM3OtY0LeyttsME157jgYmRxzYyFfX2WHbEx92QUYCDWPtFcP1qdpq4r 0h8110ye/Fm+VM9H5AvbajWVRuQIqn3+LLMonOmHwec8j4ImcG4dCE4flJ9EcGw1avph Hem5FPRP6Y3nArxCt8K5kJ29FJogPo+9Z+diwterZXhT/jQ8OhnmbLjJUUyqI62Opc0b 4xkoCF68ccgk5cAQl4fI3zKMcYnZdJvPphFuC4olpAq5GFvt+qjDAZkGbmadjMVynkpV +4bKW/Nqbuf647o0zQjtICnHENUnPqTSM2A/7cp1FKKYRJ9QAN/V0Kp5rk1J5DE2j/jY qIKw== 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=MmdrbkmAv/D/0qlb5/k65O2mQHAFbFRl6/byTdfhs08=; fh=o/5N7/kxpeWjynMRXgRTkeR2GWte7sLJ7m091+z4hMo=; b=ImdmCnPyh/Szeqs4Q7KMg5fCUNMM4EbJy3FhOTSj/8nvmJEDzmZU/xF3Z0zwKCEo8J R+flCzbiA9MDxPbz5mne8igo55iW43C1msHjqFzPRiCGVYGftQV6ghMGEZsHeArwj6Fx Kjq5g0qWqfQ9McgyGSKu4XR+0T4A5HVr2K/BJ9KAELJg4aWpEiifhJ9ESqU3eCzcYAO/ 0Ous46rHYyTNgwXLrKMoU+4rfNwlGaHiqzTVziFWy4GO3PdZkgZcJq4EGGkUgTQsovV0 eGRmIOhNhvlqomfCQrKyl7E4WNz0YApvyksLG6lZjsn95bfBt8oFMfIyh8OmpAa0e6xI FCkg==; 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-7a9a106a1adsi5194985a.345.2024.09.06.04.15.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Sep 2024 04:15:59 -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 1smWwS-0002d2-Jl; Fri, 06 Sep 2024 07:15:54 -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 1smWvp-0000Hz-Bk; Fri, 06 Sep 2024 07:15:16 -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 1smWvl-0007yG-PF; Fri, 06 Sep 2024 07:15:11 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id F09C48C486; Fri, 6 Sep 2024 14:12:07 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 095171336F0; Fri, 6 Sep 2024 14:13:26 +0300 (MSK) Received: (nullmailer pid 353610 invoked by uid 1000); Fri, 06 Sep 2024 11:13:24 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Thomas Huth , Michael Tokarev Subject: [Stable-9.0.3 22/69] target/rx: Use target_ulong for address in LI Date: Fri, 6 Sep 2024 14:12:31 +0300 Message-Id: <20240906111324.353230-22-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 f6e9e0ec90..30d30770ac 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -86,7 +86,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;