From nobody Mon Feb 9 17:25:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@quicinc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=quicinc.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1647116075752626.1939293250592; Sat, 12 Mar 2022 12:14:35 -0800 (PST) Received: from localhost ([::1]:53742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nT88I-0005jc-R7 for importer@patchew.org; Sat, 12 Mar 2022 15:14:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nT87C-0003YC-1o for qemu-devel@nongnu.org; Sat, 12 Mar 2022 15:13:26 -0500 Received: from alexa-out.qualcomm.com ([129.46.98.28]:18817) by eggs.gnu.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1nT879-0008NS-KR for qemu-devel@nongnu.org; Sat, 12 Mar 2022 15:13:25 -0500 Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 12 Mar 2022 12:13:21 -0800 Received: from hu-tsimpson-lv.qualcomm.com (HELO hu-devc-lv-u18-c.qualcomm.com) ([10.47.235.220]) by ironmsg08-lv.qualcomm.com with ESMTP; 12 Mar 2022 12:13:21 -0800 Received: by hu-devc-lv-u18-c.qualcomm.com (Postfix, from userid 47164) id 9896E5005B6; Sat, 12 Mar 2022 12:13:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1647116004; x=1678652004; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QNONfYEJWFj0i/4dIkqVtZ5sociMkPaKaQ5x88qIYFk=; b=bWdutLBEelRmBITWWrk0UWWvUSSRytoxibIMmA9cdFfIJFXgKeYhidBZ MK4Yy9KxsP6mbmn6FI1kBTgAaR48VLraTiO7+CYBZkRKgQE1VR0hIeN+9 bCSP4nijhEpd9XXXVnok72k8DqtpRfhMZKHBJKgcfyuHle+37DcGO6sBr A=; X-QCInternal: smtphost From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [PULL v2 01/12] Hexagon (target/hexagon) fix bug in circular addressing Date: Sat, 12 Mar 2022 12:13:08 -0800 Message-Id: <20220312201319.29040-2-tsimpson@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220312201319.29040-1-tsimpson@quicinc.com> References: <20220312201319.29040-1-tsimpson@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=129.46.98.28; envelope-from=tsimpson@qualcomm.com; helo=alexa-out.qualcomm.com X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_MED=-2.3, 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: , Cc: peter.maydell@linaro.org, richard.henderson@linaro.org, f4bug@amsat.org, tsimpson@quicinc.com, zongyuan.li@smartx.com, Michael Lambert Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1647116092516100001 From: Michael Lambert Versions V3 and earlier should treat the "K_const" and "length" values as unsigned. Modified circ_test_v3() in tests/tcg/hexagon/circ.c to reproduce the bug Signed-off-by: Michael Lambert Signed-off-by: Taylor Simpson Message-Id: <20220210021556.9217-2-tsimpson@quicinc.com> Reviewed-by: Richard Henderson --- target/hexagon/op_helper.c | 6 +++--- tests/tcg/hexagon/circ.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index 057baf9a48..47bd51e0ca 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -1,5 +1,5 @@ /* - * Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights Res= erved. + * Copyright(c) 2019-2022 Qualcomm Innovation Center, Inc. All Rights Res= erved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -304,8 +304,8 @@ void HELPER(debug_commit_end)(CPUHexagonState *env, int= has_st0, int has_st1) =20 int32_t HELPER(fcircadd)(int32_t RxV, int32_t offset, int32_t M, int32_t C= S) { - int32_t K_const =3D sextract32(M, 24, 4); - int32_t length =3D sextract32(M, 0, 17); + uint32_t K_const =3D extract32(M, 24, 4); + uint32_t length =3D extract32(M, 0, 17); uint32_t new_ptr =3D RxV + offset; uint32_t start_addr; uint32_t end_addr; diff --git a/tests/tcg/hexagon/circ.c b/tests/tcg/hexagon/circ.c index 67a1aa3054..354416eb6d 100644 --- a/tests/tcg/hexagon/circ.c +++ b/tests/tcg/hexagon/circ.c @@ -1,5 +1,5 @@ /* - * Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights Res= erved. + * Copyright(c) 2019-2022 Qualcomm Innovation Center, Inc. All Rights Res= erved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -415,7 +415,8 @@ static void circ_test_v3(void) { int *p =3D wbuf; int size =3D 15; - int K =3D 4; /* 64 bytes */ + /* set high bit in K to test unsigned extract in fcirc */ + int K =3D 8; /* 1024 bytes */ int element; int i; =20 --=20 2.17.1