Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2221102/?format=api
{ "id": 2221102, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2221102/?format=api", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.0/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260408041953.1899532-26-brian.cain@oss.qualcomm.com>", "date": "2026-04-08T04:19:50", "name": "[v4,25/28] target/hexagon: Add PC to raise_exception, use fTRAP() helper", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "4855e3fb3eba70518edac1eb9a0be8c831ba852a", "submitter": { "id": 89839, "url": "http://patchwork.ozlabs.org/api/1.0/people/89839/?format=api", "name": "Brian Cain", "email": "brian.cain@oss.qualcomm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260408041953.1899532-26-brian.cain@oss.qualcomm.com/mbox/", "series": [ { "id": 499179, "url": "http://patchwork.ozlabs.org/api/1.0/series/499179/?format=api", "date": "2026-04-08T04:19:31", "name": "Hexagon system emulation - Part 2/3", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/499179/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2221102/checks/", "tags": {}, "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=OTU2X7M6;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=VJFjKyqb;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4frXZT2tjnz1yD6\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 05:05:21 +1000 (AEST)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wAYD6-0001aR-Jg; Wed, 08 Apr 2026 15:05:09 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <brian.cain@oss.qualcomm.com>)\n id 1wAYCb-0001Rk-RY\n for qemu-devel@nongnu.org; Wed, 08 Apr 2026 15:04:37 -0400", "from mx0a-0031df01.pphosted.com ([205.220.168.131])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <brian.cain@oss.qualcomm.com>)\n id 1wAKP7-0005cO-37\n for qemu-devel@nongnu.org; Wed, 08 Apr 2026 00:20:38 -0400", "from pps.filterd (m0279866.ppops.net [127.0.0.1])\n by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 637J857s3362755\n for <qemu-devel@nongnu.org>; Wed, 8 Apr 2026 04:20:35 GMT", "from mail-dl1-f70.google.com (mail-dl1-f70.google.com\n [74.125.82.70])\n by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dd7tkheyt-1\n (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n for <qemu-devel@nongnu.org>; Wed, 08 Apr 2026 04:20:35 +0000 (GMT)", "by mail-dl1-f70.google.com with SMTP id\n a92af1059eb24-12c21dbc9c1so1093532c88.0\n for <qemu-devel@nongnu.org>; Tue, 07 Apr 2026 21:20:35 -0700 (PDT)", "from hu-bcain-lv.qualcomm.com (Global_NAT1.qualcomm.com.\n [129.46.96.20]) by smtp.gmail.com with ESMTPSA id\n a92af1059eb24-12c14a371b1sm6480362c88.13.2026.04.07.21.20.33\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 07 Apr 2026 21:20:33 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n cc:content-transfer-encoding:content-type:date:from:in-reply-to\n :message-id:mime-version:references:subject:to; s=qcppdkim1; bh=\n sW27XZh/polIRJ6zGlVRtPePAkF7zmzsx2Pd7RqkvxI=; b=OTU2X7M6vdsdAb4p\n NpF5DjBsV9BchO9kVrXnjwdB6jOruQREy3OxsQ5aA05RufiRAtZrDWlNPeihdesz\n TQAbHmmaGORU0ioZQd1q4nMoJHyHfsMoj4FaZ1P/Y0lu/Vn0GbWDSiMGhpLcx5gN\n uneKnPDh6SKH+FR7NGiQevLj70Zj4mw4RjqcGChIMEbLzrgTtVns2TDZGE0Yben6\n lQpKm9GXChAlXeW2/XmiHQ8tqSe9/WyGU/I4jHJfSnP0mow/7U+7LTfHTvdmTthc\n eDwhzgiSEjH7Fwt3pFAYYCyeZWOAHBuE0v2kCgP2SjEtcsDiVtX4Y373kBkTeqCD\n cZ+Lwg==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oss.qualcomm.com; s=google; t=1775622035; x=1776226835; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=sW27XZh/polIRJ6zGlVRtPePAkF7zmzsx2Pd7RqkvxI=;\n b=VJFjKyqb7Y/W+nDYdPKw9wOkUzqKkdEATzRCpdFblJYA8tVmbQk8mC7O3DkEEtQdnz\n jVDcpzX7+E4C6POw4PZPrC2NWTvZfpnpAUlGOTVGJGbqxbPCQM9WLMhII+KxfU/X+p3f\n 2tZZhLLXdDXarhd9bidSxS+vtD+s7598gyh/c0fdWhCd/qjs7oDomEVyyckrN3NjVgwE\n SzkQMTOcyW3DUbq0GEVgoX7p/Feo83/Z3rrQBLukmd1lcHIVL3DIgur47p1jOjeioi9D\n sUBUsPj8SScl6D+EPjlqla3QvEqn0UBB98/b7JrmKOUl0oNCL+gxnHvr9H7XqbWtWVcu\n hAKQ==" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775622035; x=1776226835;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=sW27XZh/polIRJ6zGlVRtPePAkF7zmzsx2Pd7RqkvxI=;\n b=G1tuLrTR5V2+E7GPRITmLE7GVFUPLkJWkTta5U9pn8v8dhKnF2t0iF1MyZOiuihAtk\n QF6wUI9tt5CwOju+rB/doyb56PfTfVb/BPY67c9uJLPrkgvVsBWcL/ZkV2pgZHRGMXoH\n exPN6I+caOYWcPgT75dNKJfWzmLaEcyYgLl2oQpkjaVRftszeQuESLtl2FNKgUHETm2r\n UJpE55PSYCBVaR67jHGjladRaWzxCuOU3Knfnzwk9dMi9LuhjALdbL3X10xPAb7RPoEN\n pelfvpLcldPnSlDUFLYt4kzHM6CkZ0oGaUTYN+/F1d4oKHQHxFTRMb6AYv63HiBZANKX\n sCiw==", "X-Gm-Message-State": "AOJu0YzLMAMPwS4VcH9IIaZcqSVGA+6n04GJWC8rOv7QxxrvXPMIHqnN\n NWYSMfGhSTHTfp28hLTZ6T1n2QVH6PgzBVjCHnq2S1+p77/5y0tCPjk3RthftvSEKUz/k06vnGW\n 7APw7wfoZLbNqG0iGZZjzhY5Drw3hdqaR85B5G6rtLaiQ8kgCfC/MCbPb+tus0Q3Bdg==", "X-Gm-Gg": "AeBDiesmie3hZvctH+XRW8+pOUvZttaUMnBChiiwEg8Imchcm+FEvVuRWBq14iaFytF\n meuixtQWm4AuZpvA6MogWZKxLJtLjbxBCCHj8Cw9skD7WSGJsKvGTCDMSz3eMzjzi9LRNl/0vA5\n cgM0u9tvn2joKFoZjppDMVpuFTfCu84w1JZ9L0GACqJygTEI0nt0eZzh7QLYFymwgol6Acg+Qbb\n kenzcOfoo41wKSWiqieEXYYeb4FZPIkiakQuxWw9C7t3IPKFELus3FL0t3da1vsEW0b2HnFevvE\n IG13TtLNo+zoliRRS/CZv7HH8H6AoRkGMyVogoOWc/VAkUJnhehNMkc40q1/OPQlYG42vZiAasY\n l1i7MCLWORVdun7Pq9C3x0xcdFR7BvqyDxQEBdMt4EZg9p7QEeV9E4raywdsppzGh2tAYOA==", "X-Received": [ "by 2002:a05:7022:6997:b0:128:d7a7:526b with SMTP id\n a92af1059eb24-12bfb745137mr11122791c88.22.1775622034686;\n Tue, 07 Apr 2026 21:20:34 -0700 (PDT)", "by 2002:a05:7022:6997:b0:128:d7a7:526b with SMTP id\n a92af1059eb24-12bfb745137mr11122773c88.22.1775622034098;\n Tue, 07 Apr 2026 21:20:34 -0700 (PDT)" ], "From": "Brian Cain <brian.cain@oss.qualcomm.com>", "To": "qemu-devel@nongnu.org", "Cc": "brian.cain@oss.qualcomm.com, philmd@linaro.org, ltaylorsimpson@gmail.com,\n matheus.bernardino@oss.qualcomm.com, marco.liebel@oss.qualcomm.com,\n quic_mburton@quicinc.com, sid.manning@oss.qualcomm.com, ale@rev.ng,\n anjo@rev.ng, Brian Cain <bcain@quicinc.com>", "Subject": "[PATCH v4 25/28] target/hexagon: Add PC to raise_exception,\n use fTRAP() helper", "Date": "Tue, 7 Apr 2026 21:19:50 -0700", "Message-Id": "<20260408041953.1899532-26-brian.cain@oss.qualcomm.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20260408041953.1899532-1-brian.cain@oss.qualcomm.com>", "References": "<20260408041953.1899532-1-brian.cain@oss.qualcomm.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "X-Authority-Analysis": "v=2.4 cv=drPrzVg4 c=1 sm=1 tr=0 ts=69d5d793 cx=c_pps\n a=SvEPeNj+VMjHSW//kvnxuw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17\n a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10\n a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22\n a=COk6AnOGAAAA:8 a=pGLkceISAAAA:8 a=EUspDBNiAAAA:8 a=4FQt9sIIQT5CW9ciUtIA:9\n a=QEXdDO2ut3YA:10 a=Kq8ClHjjuc5pcCNDwlU0:22 a=TjNXssC_j7lpFel5tvFf:22", "X-Proofpoint-ORIG-GUID": "T-_7nGHyZGK8A0L1vZyMuks5KqE9m3HX", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDA4MDAzNiBTYWx0ZWRfX/gXQ7huijtTv\n zZy8i12L9AGR/sMVodYIhsr6PXhcSLeMJlAKImgUW8Rjh/qA2XvnNcoe2dpoCmf5vTMfZLCDiGd\n b6F1/kVBqtkC9xRg3IDUuVxYSLn9+7bTytLu5mYI8dFFYJrK+re/1IJmqiS7F7QxCSTfQgJ3WCT\n 8SwfB08TJdlo1nw/qLlzC91ap+5Y/EmA4bqyCdfqcmXspxBCvvUJ+BPMXoh8AtRKKHERjjvpq6D\n v504xWj0km+Y0qkp8PWOWWDsRIxnRssRGq0nZkGD+k9PTf0p7OxgJa7M4HQ2/hT/nAu8yEWFhVV\n R/GLI0S/avjNS7WyDaBWhJDIDTfSdurPxZHwPwWgEnjhNeydWIU+RYuUqkZhNQ0iJpcMttK1DCU\n OlhWQgukptvlq7fUo+8pPsBkclIkhTp0+KWsWNpa4wxBekN0Lmkp/Ueh3FR6fHKko0CwadcRK4R\n TydSlu1WW9CVsGQ5BBQ==", "X-Proofpoint-GUID": "T-_7nGHyZGK8A0L1vZyMuks5KqE9m3HX", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-08_02,2026-04-07_05,2025-10-01_01", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n adultscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 malwarescore=0\n bulkscore=0 impostorscore=0 phishscore=0 priorityscore=1501 suspectscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604080036", "Received-SPF": "pass client-ip=205.220.168.131;\n envelope-from=brian.cain@oss.qualcomm.com; helo=mx0a-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,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,\n RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001,\n 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 <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "From: Brian Cain <bcain@quicinc.com>\n\nAdd PC to raise_exception helper\n\nReplace the fGEN_TCG_J2_trap0 macro override with the fTRAP()-generated\nsystem helper instead.\n\nReviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com>\nSigned-off-by: Brian Cain <brian.cain@oss.qualcomm.com>\n---\n target/hexagon/gen_tcg.h | 7 -------\n target/hexagon/helper.h | 2 +-\n target/hexagon/op_helper.c | 10 ++++------\n target/hexagon/translate.c | 21 ++++++++++++++++-----\n 4 files changed, 21 insertions(+), 19 deletions(-)", "diff": "diff --git a/target/hexagon/gen_tcg.h b/target/hexagon/gen_tcg.h\nindex 86d74ed259c..a28af0c245b 100644\n--- a/target/hexagon/gen_tcg.h\n+++ b/target/hexagon/gen_tcg.h\n@@ -1349,13 +1349,6 @@\n #define fGEN_TCG_S2_storew_rl_st_vi(SHORTCODE) SHORTCODE\n #define fGEN_TCG_S4_stored_rl_st_vi(SHORTCODE) SHORTCODE\n \n-#define fGEN_TCG_J2_trap0(SHORTCODE) \\\n- do { \\\n- uiV = uiV; \\\n- tcg_gen_movi_tl(hex_gpr[HEX_REG_PC], ctx->pkt->pc); \\\n- TCGv excp = tcg_constant_tl(HEX_EVENT_TRAP0); \\\n- gen_helper_raise_exception(tcg_env, excp); \\\n- } while (0)\n #endif\n \n #define fGEN_TCG_A2_nop(SHORTCODE) do { } while (0)\ndiff --git a/target/hexagon/helper.h b/target/hexagon/helper.h\nindex 17e74b12f3c..a89758b5df5 100644\n--- a/target/hexagon/helper.h\n+++ b/target/hexagon/helper.h\n@@ -18,7 +18,7 @@\n #include \"internal.h\"\n #include \"helper_protos_generated.h.inc\"\n \n-DEF_HELPER_FLAGS_2(raise_exception, TCG_CALL_NO_RETURN, noreturn, env, i32)\n+DEF_HELPER_FLAGS_3(raise_exception, TCG_CALL_NO_RETURN, noreturn, env, i32, i32)\n DEF_HELPER_2(commit_store, void, env, int)\n DEF_HELPER_3(gather_store, void, env, i32, int)\n DEF_HELPER_1(commit_hvx_stores, void, env)\ndiff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c\nindex aeea4715372..c4ad6015689 100644\n--- a/target/hexagon/op_helper.c\n+++ b/target/hexagon/op_helper.c\n@@ -65,15 +65,13 @@ G_NORETURN void hexagon_raise_exception_err(CPUHexagonState *env,\n uint32_t exception,\n uintptr_t pc)\n {\n- CPUState *cs = env_cpu(env);\n- qemu_log_mask(CPU_LOG_INT, \"%s: %d\\n\", __func__, exception);\n- cs->exception_index = exception;\n- cpu_loop_exit_restore(cs, pc);\n+ do_raise_exception(env, exception, pc, 0);\n }\n \n-G_NORETURN void HELPER(raise_exception)(CPUHexagonState *env, uint32_t excp)\n+G_NORETURN void HELPER(raise_exception)(CPUHexagonState *env, uint32_t excp,\n+ uint32_t PC)\n {\n- hexagon_raise_exception_err(env, excp, 0);\n+ hexagon_raise_exception_err(env, excp, PC);\n }\n \n void log_store32(CPUHexagonState *env, target_ulong addr,\ndiff --git a/target/hexagon/translate.c b/target/hexagon/translate.c\nindex 38721d74007..ae980c087f0 100644\n--- a/target/hexagon/translate.c\n+++ b/target/hexagon/translate.c\n@@ -126,12 +126,19 @@ intptr_t ctx_tmp_vreg_off(DisasContext *ctx, int regnum,\n return offset;\n }\n \n-static void gen_exception_raw(int excp)\n+static void gen_exception(int excp, uint32_t PC)\n {\n- gen_helper_raise_exception(tcg_env, tcg_constant_i32(excp));\n+ gen_helper_raise_exception(tcg_env, tcg_constant_i32(excp),\n+ tcg_constant_i32(PC));\n }\n \n #ifndef CONFIG_USER_ONLY\n+static inline void gen_precise_exception(int excp, uint32_t PC)\n+{\n+ tcg_gen_movi_i32(hex_cause_code, excp);\n+ gen_exception(HEX_EVENT_PRECISE, PC);\n+}\n+\n static void gen_pcycle_counters(DisasContext *ctx)\n {\n if (ctx->pcycle_enabled) {\n@@ -140,6 +147,7 @@ static void gen_pcycle_counters(DisasContext *ctx)\n }\n #endif\n \n+\n static void gen_exec_counters(DisasContext *ctx)\n {\n tcg_gen_addi_tl(hex_gpr[HEX_REG_QEMU_PKT_CNT],\n@@ -213,8 +221,11 @@ static void gen_end_tb(DisasContext *ctx)\n void hex_gen_exception_end_tb(DisasContext *ctx, int excp)\n {\n gen_exec_counters(ctx);\n- tcg_gen_movi_tl(hex_gpr[HEX_REG_PC], ctx->next_PC);\n- gen_exception_raw(excp);\n+#ifdef CONFIG_USER_ONLY\n+ gen_exception(excp, ctx->pkt->pc);\n+#else\n+ gen_precise_exception(excp, ctx->pkt->pc);\n+#endif\n ctx->base.is_jmp = DISAS_NORETURN;\n }\n \n@@ -228,7 +239,7 @@ static void gen_exception_decode_fail(DisasContext *ctx, int nwords, int excp)\n \n gen_exec_counters(ctx);\n tcg_gen_movi_tl(hex_gpr[HEX_REG_PC], fail_pc);\n- gen_exception_raw(excp);\n+ gen_exception(excp, fail_pc);\n ctx->base.is_jmp = DISAS_NORETURN;\n ctx->base.pc_next = fail_pc;\n }\n", "prefixes": [ "v4", "25/28" ] }