Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AF2DAC44529 for ; Mon, 20 Jul 2026 17:32:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wlrqb-0001YC-MV; Mon, 20 Jul 2026 13:32:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlrqZ-0001WJ-Vg for qemu-devel@nongnu.org; Mon, 20 Jul 2026 13:32:08 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wlrqX-0001Qq-29 for qemu-devel@nongnu.org; Mon, 20 Jul 2026 13:32:07 -0400 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66KH6aHa3338636 for ; Mon, 20 Jul 2026 17:32:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=mt3LKU8Wm0ow7dJvqiSdA3wL LDdEHtXC8G3HYUw9Sy8=; b=HqdMVC2Ygw0rCwK+Fm2JzIwr++wS28b12JxOujvU QKmjJZ8yosXckb4g1NzxzwZMRgklJsUGGaRLJL8mjm8rPzY14b7NOmP7owL+FgZD U+aTzfFF5fVmuY0hG1lVlfkj7rhLsX+m8wWNOvR6abVkeTEfTTAbH5FrCPjZQkCK aKjjJKS6HHq8wj0kVcZ0vwxg+8GkUICc44++MTf3Tb6y+SIQ3rZ9cDUE0RIBG9md u+6nNcbcEPgAX0lFFfSWoVIPV4Lew8MGEyT2m4JbAjZeBQwxTlXbfpLxBVcRkjwi fI/X7W8nnAI/L5Ns6Z1b/L7u/KtJaykJgxfJYkSdlyQb3g== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fhqff07x4-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 20 Jul 2026 17:32:02 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-92e8004d60eso1579256085a.1 for ; Mon, 20 Jul 2026 10:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784568722; x=1785173522; darn=nongnu.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=mt3LKU8Wm0ow7dJvqiSdA3wLLDdEHtXC8G3HYUw9Sy8=; b=gRvqfi+4oJPLLJVaPhSRwfdb/Qtk4YeP/txjVg2Pc/qk00BT6+NtPodCRfhtzN/ka0 sDLjR6sFW92ZLXZn2zBlOCZ0EqxBhFGZjrPa9m32V/VhLOrkqn/ijE3EsWBnoIFObEXy hlURruIcgInVyeVIsTMNZU6ExIFnc3tn/lGNclFzZa98CEMbM4yRklO2UpyHkZS1xIbX QjMtYFhoIHcmkkn+CN7wuClLI6HXWENgGSsjq5U/Y0bbJ5brcmxAIVVS7pkqn/Jazqsb ZK4koYSGiVpHaiyQlx2l/eH/TCA5AaafUw4H/HuqV61tTw5p5GH2sCKbQhjsEfyweYP/ xRkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784568722; x=1785173522; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mt3LKU8Wm0ow7dJvqiSdA3wLLDdEHtXC8G3HYUw9Sy8=; b=OfN+dpM1vQWjA0uY/9l9evTV9WiIxkTWQZHtRMXp3Bn4OHkg8uJH97C+70oznWJQ/N wb+5ClvKGXF1JeLIQu7Q/7YcapR5vZ4T52Rj+oqv52UFAlumTNRFvJ444lZ1wBnsf1XO FnUeOULcaYA/fFaLkaQT0cUjY7wGm/08kM0YLE9Hg8ElW9iQF5fvbfDyPuJyqOV8HsAB 7jxx/QCz9iYu3pzW/GvB0Au81Gjz9kQWLWmNb4mYN/xG96PcwFqFqAW8QFAbEbw+E1YX 41kgDNvopjpnZLAsBKa4h+xLlEW3GKFSa0RdFVPWLXgCmmctfHDsphOQzudE4jFBUhHI KVQQ== X-Gm-Message-State: AOJu0YzfFx3Mii185P4xg3dWUTAF30/cvxzV2kutG9gO+o4MNQYx2F1I xllLQB2QQRPeEeWlne+ccXgzGX5rf6hjv84+2XKi0FMsGc4jCsSmEay1z/S+S22JTkaAmuw0DHB GbT49H4rRdVZoI2+1uifeGS9q12fCWPGtY8wXwdAJi+DSBnT9ViyVJVnM5g== X-Gm-Gg: AfdE7cl0oDWpb3hkLED+CRuQE3sc9MpjPB+OpbPKwGeTJEUgpU7+d0U3dnfJQm+oL8c /I2yPDIV4LUE6/6Zfs2s3someQRGMGZ0fEZkYrgU1UIikyVAmQr++4+0v6JmWAhqfUszXeGcxZH +UQPIYswTM9XwZMADGKpoS3jH46sIfo4uVdAN07edxbwdU+NIYgeIN9Zgt7VlSMKEDPm3jrbi4C hBQDKFznZECxuHuiEbpEP7Gw/vqvS+HLFIoMvne8OAneaLmmov6AilbqnuqfLLzHN3GglC3gIck XLPKGGb7q83PUvSPkuz2ewwEoKCltEZb2hjQDavTdZJfWRVrJKyPv1lC1FEIyeX2vUOky5UtBmk X81YRyqdZqXEexj4aYtIRt1a6ff6B7JeIqVgjH0ugCSGfN+PJ3x5PeP23dtwcYG// X-Received: by 2002:a05:620a:40d1:b0:92e:daed:8198 with SMTP id af79cd13be357-930b41fac01mr1462220985a.77.1784568722402; Mon, 20 Jul 2026 10:32:02 -0700 (PDT) X-Received: by 2002:a05:620a:40d1:b0:92e:daed:8198 with SMTP id af79cd13be357-930b41fac01mr1462217985a.77.1784568721992; Mon, 20 Jul 2026 10:32:01 -0700 (PDT) Received: from [10.222.168.219] (Global_NAT1_IAD_FW.qualcomm.com. [129.46.232.65]) by smtp.gmail.com with ESMTPSA id af79cd13be357-930b52fb1fdsm933445785a.13.2026.07.20.10.32.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jul 2026 10:32:01 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------cpvgHAP0C9mvDDZal7FAkxQS" Message-ID: Date: Mon, 20 Jul 2026 12:31:59 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/7] target/hexagon: fix PC not advancing for non-COF TB-ending packets To: Taylor Simpson Cc: qemu-devel@nongnu.org, philmd@oss.qualcomm.com, pierrick.bouvier@oss.qualcomm.com, Paolo Bonzini , =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= , peter.maydell@linaro.org, matheus.bernardino@oss.qualcomm.com, Thomas Huth , Laurent Vivier , Fabiano Rosas , =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= References: <20260715185701.1287176-1-brian.cain@oss.qualcomm.com> <20260715185701.1287176-3-brian.cain@oss.qualcomm.com> Content-Language: en-US From: Brian Cain In-Reply-To: X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDE5MiBTYWx0ZWRfXyCo08JIBY57b V23ILxJ0sLIQMixz7yoT9kBO3iLmfPoyMsYFdvm0O/geLJCRoFS3r+/WXE1iXhw8K6NRQSQynZN UE/A/n1xb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fYUsqvfQ== X-Proofpoint-ORIG-GUID: x_ASQbWgKkCMx4kJL3yv3BSwQWScUl98 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-20_04,2026-07-20_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 spamscore=0 suspectscore=0 bulkscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 adultscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200192 Received-SPF: pass client-ip=205.220.180.131; envelope-from=brian.cain@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This is a multi-part message in MIME format. --------------cpvgHAP0C9mvDDZal7FAkxQS Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/19/2026 4:31 PM, Taylor Simpson wrote: > > > On Wed, Jul 15, 2026 at 12:57 PM Brian Cain > wrote: > > Add hex_next_PC, a global mirroring CPUHexagonState::next_PC, > and ctx->need_next_pc, so that gen_write_new_pc_addr() can write the > branch target through hex_next_PC instead of hex_gpr[HEX_REG_PC] > when a later unconditional write of PC is expected. gen_end_tb() > then commits hex_next_PC into hex_gpr[HEX_REG_PC] at the end of the > packet. > > Previously, non-COF instructions that still end a TB did not > advance the > PC, since next_PC's value was never written back into the PC register. > > Reviewed-by: Pierrick Bouvier > Signed-off-by: Brian Cain > --- >  target/hexagon/translate.h |  3 +++ >  target/hexagon/genptr.c    | 14 ++++++++--- >  target/hexagon/translate.c | 51 > ++++++++++++++++++++++++++------------ >  3 files changed, 49 insertions(+), 19 deletions(-) > > > @@ -1327,6 +1344,8 @@ void hexagon_translate_init(void) >      } >      hex_new_value_usr = tcg_global_mem_new(tcg_env, >          offsetof(CPUHexagonState, new_value_usr), "new_value_usr"); > +    hex_next_PC = tcg_global_mem_new(tcg_env, > +        offsetof(CPUHexagonState, next_PC), "next_PC"); > > > This only lives within the context of a single packet, so it shouldn't > be global. > > Put it into DisasContext and make it a tmp similar to new_value. Taylor - this patch was included for the sake of testing the l2vic series, but landed recently - https://lore.kernel.org/qemu-devel/20260720100107.GA816167@fedora/ So I'll send a new independent series with updates suggested for "target/hexagon: fix PC not advancing for non-COF TB-ending packets" and "target/hexagon: initialize deferred sreg-write temps to current value". -Brian --------------cpvgHAP0C9mvDDZal7FAkxQS Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 7/19/2026 4:31 PM, Taylor Simpson wrote:


On Wed, Jul 15, 2026 at 12:57 PM Brian Cain <brian.cain@oss.qualcomm.com> wrote:
Add hex_next_PC, a global mirroring CPUHexagonState::next_PC,
and ctx->need_next_pc, so that gen_write_new_pc_addr() can write the
branch target through hex_next_PC instead of hex_gpr[HEX_REG_PC]
when a later unconditional write of PC is expected. gen_end_tb()
then commits hex_next_PC into hex_gpr[HEX_REG_PC] at the end of the
packet.

Previously, non-COF instructions that still end a TB did not advance the
PC, since next_PC's value was never written back into the PC register.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Signed-off-by: Brian Cain <brian.cain@oss.qualcomm.com>
---
 target/hexagon/translate.h |  3 +++
 target/hexagon/genptr.c    | 14 ++++++++---
 target/hexagon/translate.c | 51 ++++++++++++++++++++++++++------------
 3 files changed, 49 insertions(+), 19 deletions(-)


@@ -1327,6 +1344,8 @@ void hexagon_translate_init(void)
     }
     hex_new_value_usr = tcg_global_mem_new(tcg_env,
         offsetof(CPUHexagonState, new_value_usr), "new_value_usr");
+    hex_next_PC = tcg_global_mem_new(tcg_env,
+        offsetof(CPUHexagonState, next_PC), "next_PC");

This only lives within the context of a single packet, so it shouldn't be global.

Put it into DisasContext and make it a tmp similar to new_value.
 


Taylor - this patch was included for the sake of testing the l2vic series, but landed recently - https://lore.kernel.org/qemu-devel/20260720100107.GA816167@fedora/

So I'll send a new independent series with updates suggested for "target/hexagon: fix PC not advancing for non-COF TB-ending packets" and "target/hexagon: initialize deferred sreg-write temps to current value".

-Brian

--------------cpvgHAP0C9mvDDZal7FAkxQS--