From nobody Thu Oct 22 19:25:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1791573998; cv=none; d=zohomail.com; s=zohoarc; b=BhPAZYmug8CHUcAw89JOi3vI7pHhswfvkEkYqPaz7FATZUZ/jK6Xlv+8zITirTjq/vOzEb0DUx9g+TN6khpP6qUBWufjwgPaTkRaEZHfuqweJMC7BxOdYRECrnPQTvO6GygdXicScS0PQWCadbrThv5IH8ElW4mgRrl0hM2gZI4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791573998; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DY93txGs/9EAP8+0vosjtY9tFRWnog9owtguusM6Ogo=; b=YVVTZK6Hl+JUZZ81uNCfEjqfz4qIoIPK3sXUEUlNw8A2AlJUkDrWT4/4LTdjM6S1Nn4hgCPgwzAB/Q2MBvdHm+qd8FGDjKdwla8+kychU0sYg/XJF8HWQs+m0N0IbHsxdIw1yLJJrBvy4GG92I/by6MqVAOM2xnwg3z7iGz3jao= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1791573998800838.1901516551932; Fri, 9 Oct 2026 12:26:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xFGE3-0007Lx-9k; Fri, 09 Oct 2026 15:25:51 -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 1xFGE0-0007LJ-A2 for qemu-devel@nongnu.org; Fri, 09 Oct 2026 15:25:48 -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 1xFGDy-0007cE-Kc for qemu-devel@nongnu.org; Fri, 09 Oct 2026 15:25:48 -0400 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 699HZd9U2967899 for ; Fri, 9 Oct 2026 19:25:45 GMT Received: from mail-dl1-f70.google.com (mail-dl1-f70.google.com [74.125.82.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4h74t8gegh-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 09 Oct 2026 19:25:45 +0000 (GMT) Received: by mail-dl1-f70.google.com with SMTP id a92af1059eb24-155a75f91e1so5585542c88.1 for ; Fri, 09 Oct 2026 12:25:45 -0700 (PDT) Received: from hu-bcain-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3537ca6d202sm7652822eec.13.2026.10.09.12.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2026 12:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= DY93txGs/9EAP8+0vosjtY9tFRWnog9owtguusM6Ogo=; b=mzF9pl1U3fheyL5g fLWlCbOeXbp7v4CSf0lw3WgP2HaZi/3GTnT40xG81HCdX+LjnARYxdYGza5+98HM OlNxOT0wrXNl4gEHezNWBDPkiq69Vhuq6QzOX2pRX1z+OJhhHgNGCNadhu1TkVu4 7Bc34+dlyyeKb2o2MPlpkn+drjV/CEOds3rzv3XwtGTDMc5p1Usr7YXh0StdOmzs wLWGKo2J6CdpiNJTsjTA4t4qhUdsJKjy41+tLnypbrDc5lwuiN/e2vgSx96TTIMW VEOPXFStz5ZAjt4dQ5hvmiBp1J+DqzE5ksqbwVXFAaq3EjlMt71M/M3GTe5qEWhq 5ydBAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1791573944; x=1792178744; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=DY93txGs/9EAP8+0vosjtY9tFRWnog9owtguusM6Ogo=; b=dbBQahZZXnHgx3y+l2fK0qJrBlqiZNLM+RskAPDImc/M30d0z8oU1NyC9pVLKEilrY 7S48/Ifz3SksAQhlMbp4R3WkQICQzEVg+AFKBQwVEwvxI8McFnurouvH9x7Xah7VsCxo BSNQIBxVTOiTF8WVTA+QWkb3nzFta1ena2PFDLNd7MgD/hl80bkBiAF9j2/RCKAWInHg dYpgg63+/VCYAlf7ok/DgY/S+TlxW+CgBEBCtaDrEpDfxEs3qPY7xA0G/Rp5n9dUWk/7 eUxohMjYe5HQOWIW4o0D5T58yVrr6iODM2SLmcV7r8QkcUWQvXJAFSxWQj+NkTLDmeJn dBPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791573944; x=1792178744; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=DY93txGs/9EAP8+0vosjtY9tFRWnog9owtguusM6Ogo=; b=gIsxVQ1NEQIUqb5JA7530+zL760ZqUqjy44rVuPmsBbF4qjqk/CyAXJMLFdsQDrJtA YkN3PtQ8rQwgB7fN/I42kIaEklsi4kVQWa589fVcaJ6ZEuBBITYnESGSXkL8jlgWKz27 I3SfMfda9BeqKo/Uew/rQdPMmlgp/XmNuV27qDQ2feWm+rM3A5zFIV5sb9nfi0UDdVNm sU2uE97yT7quGTc+OChgqoXNSY0VAAWC/f7Dpwn1rEu6OkXwyk76Zv/vq3lWE7mrSGNc 5QJquNi4b2QELjibJi+7TFq13rhLOmB0LmXg0/egf7YTDQQr9ef46fjRuaKF+i38IcIx vUgg== X-Gm-Message-State: AFuF++kdR4c0JN6DRwPGyWXQNnrciS2FUdQZPyabmBckdakZung4KA9x 8MPHbT5rOdw/8Wjuva2jby5bxbywZCDItLLSAEpubN0w/OJynP0esL0ojsoB7YXBgRbRssHkDur tfIyKl43RcNeZGxA0hfRs4f3+9BP2t01hwGDrF+FUKJWVpoNLHs39ibCq2CyeAgNeTg== X-Gm-Gg: AYBFou0mStwqOoTspO0qgO1J7JE2K26z26//0768mBTeSyYypYJMQUHlC47ay+dAbz8 i+0JJUiJVPZgPbrBCKyLvUVWQLzJ4aQHS5N5UIZRhwVlcXeVjhNqxSdz6I/ymdXF+NCQCm5LzLK g+ILSGS/JJAGV7x2m1PZZCG8FhqBH87eo5NJGDJ8Tp0Z3Dk1qPqEQYELAl9AnoNtc8Df3ifRPL6 QvHhBm43CyfNMZH8Sf3o9DzvAzpfVEXVzYzuopqPPyG0XQvhFTqWRl7GnALpe6UFJJrs+AvO97o 2Blg+7B4fBouJ59bJoClRzSHxbYezd9ETc1I0YIYdyvS1WOqKKTX9d1oSwePjAXiHxLhV8lB3uo +XiGwTa0z+r95kEiW1x02+m1bXmHS3mJVRbiaNASDhWIXKKE= X-Received: by 2002:a05:7022:1711:b0:148:bce6:429b with SMTP id a92af1059eb24-16a10f29724mr3545309c88.8.1791573944114; Fri, 09 Oct 2026 12:25:44 -0700 (PDT) X-Received: by 2002:a05:7022:1711:b0:148:bce6:429b with SMTP id a92af1059eb24-16a10f29724mr3545286c88.8.1791573943480; Fri, 09 Oct 2026 12:25:43 -0700 (PDT) From: Brian Cain To: qemu-devel@nongnu.org Cc: Brian Cain , Pierrick Bouvier Subject: [PATCH 1/6] target/hexagon: check privilege mode for system instructions Date: Fri, 9 Oct 2026 12:25:35 -0700 Message-Id: <20261009192541.4163758-2-brian.cain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261009192541.4163758-1-brian.cain@oss.qualcomm.com> References: <20261009192541.4163758-1-brian.cain@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYxMDA5MDA3NyBTYWx0ZWRfX1QP61/p62cn7 fzPFwZCyBNMel+FSXE3xCh9lftEs6WZHm02dfzsb0m7gpmG6YCaJdjSf3twS4o3/XNdMfRQ/ROp RszGgONU+Nh6sobVEshtd8fCH9JOD/k= X-Proofpoint-GUID: j3q6bAODaljmC7thrMcX2zMLwNsWRJA_ X-Proofpoint-ORIG-GUID: j3q6bAODaljmC7thrMcX2zMLwNsWRJA_ X-Authority-Analysis: v=2.4 cv=AMIlxa6n c=1 sm=1 tr=0 ts=6ac93fb9 cx=c_pps a=SvEPeNj+VMjHSW//kvnxuw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=660iZSQnnn4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=BTrIe76cHL4Dmed7cV0A:9 a=+jEqtf1s3R9VXZ0wqowq2kgwd+I=:19 a=QEXdDO2ut3YA:10 a=Kq8ClHjjuc5pcCNDwlU0:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDA5MDA3NyBTYWx0ZWRfX8PThyLI8ziLz psEArA7/RHcVZYufMSAGs8tAHqcQvBEqZ9WSwTDW7DW/qm8w/sDvowRQP6VpqaxCqjEiCMTopX+ Nrjhi8/UQHLk9PRkGEssV19m3zhQ9YISGljXQS/9Ll93QG1LGboZpzPr3yDyR4QuAy7de5HxXdf JsaaZk44FQ2SFOKxoJqFdShOFEEy1Ly+dkk/4wDkTPHDcKW/hKwOnhCf4bmgchyQazb3S7uWe+z a8VlZFX4sBVhGxZWEyPKsgM3dnsigS+ZoEPPQSl1nsL1XRPR0iAwHvLrsy9gxBJv2j0LV+1BxlX nB4UfL7YdKn1uorf1ei54EeYuN1yZiXHYIid/3G95IhjN7fHRruVf73mpMNvNmAeiX1PUj2tWEV x1PLJqjNrZzl14yn7bqAJoGaQXQtSvaWqZOFiFlhF+mWSE2tmztPYYNUpZrVmtHv9niY44vP+zk 5LHdB+4mBiC7E+ha7+g== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-09_05,2026-10-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 phishscore=0 malwarescore=0 spamscore=0 adultscore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610080000 definitions=main-2610090077 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=lists1p.gnu.org; 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1791573999702158500 Fixes: 9831d3cab168 ("target/hexagon: Add privilege check, use tag_ignore()= ") Signed-off-by: Brian Cain Reviewed-by: Pierrick Bouvier --- target/hexagon/cpu.h | 1 + target/hexagon/translate.h | 1 + target/hexagon/cpu.c | 2 ++ target/hexagon/translate.c | 15 +++++++++++++++ target/hexagon/gen_tcg_funcs.py | 16 ++++++++++------ 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index df4c0182247..2a5514d512a 100644 --- a/target/hexagon/cpu.h +++ b/target/hexagon/cpu.h @@ -229,6 +229,7 @@ FIELD(TB_FLAGS, IS_TIGHT_LOOP, 0, 1) FIELD(TB_FLAGS, MMU_INDEX, 1, 3) FIELD(TB_FLAGS, PCYCLE_ENABLED, 4, 1) FIELD(TB_FLAGS, HVX_COPROC_ENABLED, 5, 1) +FIELD(TB_FLAGS, CPU_MODE, 6, 2) =20 G_NORETURN void hexagon_raise_exception_err(CPUHexagonState *env, uint32_t exception, diff --git a/target/hexagon/translate.h b/target/hexagon/translate.h index e17261761b2..aad296485d0 100644 --- a/target/hexagon/translate.h +++ b/target/hexagon/translate.h @@ -45,6 +45,7 @@ typedef struct DisasContext { DECLARE_BITMAP(gpr_uncond, TOTAL_PER_THREAD_REGS); bool implicit_usr_write; #ifndef CONFIG_USER_ONLY + uint32_t cpu_mode; int greg_log[GREG_WRITES_MAX]; int greg_log_idx; DECLARE_BITMAP(gregs_written, NUM_GREGS); diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 1f7d8a8df70..89b16a0d713 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -353,6 +353,8 @@ static TCGTBCPUState hexagon_get_tb_cpu_state(CPUState = *cs) hex_flags =3D FIELD_DP32(hex_flags, TB_FLAGS, HVX_COPROC_ENABLED, cpu->hvx_ctx[0] && GET_SSR_FIELD(SSR_XE, env->t_sreg[HEX_SREG_SSR]= )); + hex_flags =3D FIELD_DP32(hex_flags, TB_FLAGS, CPU_MODE, + get_cpu_mode(env)); #else hex_flags =3D FIELD_DP32(hex_flags, TB_FLAGS, MMU_INDEX, MMU_USER_IDX); #endif diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c index 827859e052c..35f1e47b7a7 100644 --- a/target/hexagon/translate.c +++ b/target/hexagon/translate.c @@ -1280,6 +1280,20 @@ static void decode_and_translate_packet(CPUHexagonSt= ate *env, DisasContext *ctx) HEX_CAUSE_REG_WRITE_CONFLICT); return; } +#ifndef CONFIG_USER_ONLY + if (check_for_attrib(&ctx->pkt, A_PRIV) && + ctx->cpu_mode !=3D HEX_CPU_MODE_MONITOR) { + hex_gen_exception_end_tb(ctx, HEX_CAUSE_PRIV_USER_NO_SINSN); + ctx->base.pc_next +=3D ctx->pkt.encod_pkt_size_in_bytes; + return; + } + if (check_for_attrib(&ctx->pkt, A_GUEST) && + ctx->cpu_mode =3D=3D HEX_CPU_MODE_USER) { + hex_gen_exception_end_tb(ctx, HEX_CAUSE_PRIV_USER_NO_GINSN); + ctx->base.pc_next +=3D ctx->pkt.encod_pkt_size_in_bytes; + return; + } +#endif gen_start_packet(ctx); for (i =3D 0; i < ctx->pkt.num_insns; i++) { ctx->insn =3D &ctx->pkt.insn[i]; @@ -1314,6 +1328,7 @@ static void hexagon_tr_init_disas_context(DisasContex= tBase *dcbase, ctx->hvx_coproc_enabled =3D FIELD_EX32(hex_flags, TB_FLAGS, HVX_COPROC_ENABLED); ctx->hvx_check_emitted =3D false; + ctx->cpu_mode =3D FIELD_EX32(hex_flags, TB_FLAGS, CPU_MODE); #endif } =20 diff --git a/target/hexagon/gen_tcg_funcs.py b/target/hexagon/gen_tcg_funcs= .py index 2592acf21eb..f793ceb9dc9 100755 --- a/target/hexagon/gen_tcg_funcs.py +++ b/target/hexagon/gen_tcg_funcs.py @@ -58,16 +58,20 @@ def gen_tcg_func(f, tag, regs, imms): =20 f.write(" Insn *insn G_GNUC_UNUSED =3D ctx->insn;\n") =20 - if "A_PRIV" in hex_common.attribdict[tag]: + if ( + "A_PRIV" in hex_common.attribdict[tag] + or "A_GUEST" in hex_common.attribdict[tag] + ): f.write(dedent("""\ #ifdef CONFIG_USER_ONLY - hex_gen_exception_end_tb(ctx, HEX_CAUSE_PRIV_USER_NO_SINSN); -#else """)) - if "A_GUEST" in hex_common.attribdict[tag]: + if "A_PRIV" in hex_common.attribdict[tag]: + f.write(" hex_gen_exception_end_tb(ctx, " + "HEX_CAUSE_PRIV_USER_NO_SINSN);\n") + else: + f.write(" hex_gen_exception_end_tb(ctx, " + "HEX_CAUSE_PRIV_USER_NO_GINSN);\n") f.write(dedent("""\ -#ifdef CONFIG_USER_ONLY - hex_gen_exception_end_tb(ctx, HEX_CAUSE_PRIV_USER_NO_GINSN); #else """)) if hex_common.need_ea(tag): --=20 2.34.1 From nobody Thu Oct 22 19:25:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1791574003; cv=none; d=zohomail.com; s=zohoarc; b=mV2pdc4GNin+prkEnhHxY9qn6B/5PVs9lsmclgbnu7b0Y9ACxlCNtLJXH3dkxDgOI1HTwY/sSAPk8g9ss71DIiggtsy1I/2e/1LzzbWU1YOY2XIqG+sUWXceIrneHeJArvGWzXzJJYrWGn4+J0c9Feh1S+w58iO2nW+2M1UDSKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791574003; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=e2lTbLsq2k0/N2eb6rjI97sjHa1wyyn22/E1UZ9+fNI=; b=W4QLJk4R6mhOktvoGWXhxRtQzglA89G1qm86Kla+UsD1YSlO3UaWf+OcKK0KPhRphngBOqzXYFVUuqLh/S94J4Nojhlu87KlqHPYr9wP1r8iBLTMf9ok738Etn1HTp3MG9ZmTKYH3mP0LRwPjuDOeEnnMXC3nD6baJAqFNkz+hs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1791574003460179.31902164893336; Fri, 9 Oct 2026 12:26:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xFGEC-0007Mj-IC; Fri, 09 Oct 2026 15:26:01 -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 1xFGE8-0007MM-BR for qemu-devel@nongnu.org; Fri, 09 Oct 2026 15:25:56 -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 1xFGE6-0007dW-Lw for qemu-devel@nongnu.org; Fri, 09 Oct 2026 15:25:56 -0400 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 699HZcfd2144338 for ; Fri, 9 Oct 2026 19:25:53 GMT Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4h74t7rdtk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 09 Oct 2026 19:25:53 +0000 (GMT) Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-341eff9e381so69775eec.1 for ; Fri, 09 Oct 2026 12:25:53 -0700 (PDT) Received: from hu-bcain-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3537ca6d202sm7652822eec.13.2026.10.09.12.25.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2026 12:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= e2lTbLsq2k0/N2eb6rjI97sjHa1wyyn22/E1UZ9+fNI=; b=XGHP91OorySih0T2 cbb30x//KyFRu/rxn9gETwkFLour74nNh6pf5YTxHnE6IrPb1m1tAqJy+6uOoS9y 4HnTGN1VYjDAEHawu5H1jJjkNFfCxBa3/cpVWaMkZbGOfKGPbjZU6kb6R7PYgSbq NBGALHzgDeYR4aP4MPNyhHM04NI6JH5+wGVyVUwhGnbYNxWiZVltjxNJxlUPilPc EMpa2BetOV5IUJaWQ5AWjyHmhrfJ6aBonfNSsThF1LCQtmlNoGF79fz0FZbq9qrS ldX556Bsw5vQpRCOzyu7QiWv5L8dc3g/VHbTk2K4E+wZhdqUEso3u+rUvP7LVL3r 2ga52g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1791573952; x=1792178752; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=e2lTbLsq2k0/N2eb6rjI97sjHa1wyyn22/E1UZ9+fNI=; b=bBrm2QCKzwethRilpAYzM8MTh+KhEkVOzNV0gvlSRlc2wMRJA8oydhP56Fx76Zf+eo uOMw4QcVD0A69LtEIYGjB1Zi3HB13QBYpLIiGJDZcN4PVNaUTNP0vvkb6xXqfJ+SdLfR o6/KGK8BZYho5pl3A3FlqsOfNS8Mcl3yfGeRBv5LMeIfryM1Fo506dXwnLVTk15nRNu7 /XZp+WWT7xffikpl8f9/QHqEWuvnVyDhF2IQsm5xIMtR6Zm7IAvzFILEKGJRFBD6ZYMs 3W7JAASZioHrXUNxEP3ujrPrCasXP+2fXQigQR+BTI5Ol4fRX6vKiMtGwwpJ9lAxk2tD 0IGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791573952; x=1792178752; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=e2lTbLsq2k0/N2eb6rjI97sjHa1wyyn22/E1UZ9+fNI=; b=nWDugCQRG0cinRSWR4qJpXyeBGI7ikAVg2VqVCEV/2hcvj2PtFPv5k/tENukwcMjre JURvAes0Z4cD5JS+IqHzVvihmvWsb+NevswEJ9XGWD12z0iDZ0X4oRVfZ1nXjhro/gs7 HWyu6QNI2HAvGoL0BxB7gpCsPAgtMHIBd8Bgaqi/ES+WqgwZWxVLoqg1figwAY4wmg+v 22ajFGCvYFMI+eyz5hkCTVgwVr8PMS2krKtAgf4OzsX9g3rdePrz33+/9qzNUwpIBMiZ iocd7vrym5L5+dg3eYdY8vmTU2J7f//ugSPSa3RXKvcLYd5S1NXFBzCfwUQKL0gx1rsQ 8AJQ== X-Gm-Message-State: AFuF++mQH6Kz6MTFo/YOqV+YuWwqq0ExePCWHc0vjZu8dZl4Y8DIg21P SO4ezk5a1T+zebU0vyog8p1z9kQsh1Pu7owH7wv9VuGQR0Qf6LFvroQi19yZEKO5pQgUNlk/Hm+ vD9bwUXJrwRo4JtzNC7qR113hhrx3QhFcUrULajHQARFVCfTofuloF4lDpLyma/sU+A== X-Gm-Gg: AYBFou3DrHmKqXkaVTZFV5UxluJXoMBOA6IRdcU+D/UOkPQfe8xfLGqbJ8VwqupHap2 HLOKJ26V1J1SYabRHDRkUnXR6dC7g/rwkgWGm+z6iNNxlnzTWXvpE9qwkc4GzEb0878SGAixFS8 XRBjnZrek+i53HvXtsm07Q3C4jXxkCxELXXIeH9NC4unt5YpdE+FwEaibPU3/TsL3W/XMhY7flm xIL9uOlyvBYbnSkg3g9DzByKEMDg+sGSROEQ9ZphtnvoReQF4cvqvU07kmHlEfBxhSarJCV+F0e i7WfA5SGww9IgxSYdMSTtDAjZLePvlp9W2limWS9uPL4jY/r6JwlwCA76mBw/w6nJSIVO2jEBF/ VfeOsye7FV+3aIdRonEK9A/mIgt+Or/sr4ANFmVaNMvNROP8= X-Received: by 2002:a05:693c:80db:b0:353:5d25:1de7 with SMTP id 5a478bee46e88-3537e0abb18mr4364838eec.33.1791573952288; Fri, 09 Oct 2026 12:25:52 -0700 (PDT) X-Received: by 2002:a05:693c:80db:b0:353:5d25:1de7 with SMTP id 5a478bee46e88-3537e0abb18mr4364781eec.33.1791573951502; Fri, 09 Oct 2026 12:25:51 -0700 (PDT) From: Brian Cain To: qemu-devel@nongnu.org Cc: Brian Cain , Pierrick Bouvier Subject: [PATCH 2/6] target/hexagon: wake K0 and TLB lock waiters Date: Fri, 9 Oct 2026 12:25:36 -0700 Message-Id: <20261009192541.4163758-3-brian.cain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261009192541.4163758-1-brian.cain@oss.qualcomm.com> References: <20261009192541.4163758-1-brian.cain@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDA5MDA3NyBTYWx0ZWRfXyelf0H/+4C66 /8rndyZDd5g/ieqq8OTJPbPw2RGy8ZlHNe1gu/q27gxQoSCtcnwafS9y5GcS1P/jM84XHcg9PIS BslJKEej2y3jZH8yXlWVaC6QEFlfIrexNQZbFdKamkpsZOd9fEADafMO3xJkg2DzaG+hYleWJtF J6qfS/pZ7MVT9MfbZjnczar9/ZW4L4ZZcxwrteLFOThWhB9Dt0iYCTCxPwjfkzWp8yRji46DBu+ deQa01vdpitxmjM9rn1TXsYtQezhEs5lN14s11UxRwzxD6Ud2h42K1jAI/0qZ6zEjZCNCkF3Kf3 ZH8XGeDRQPT7AugK8QpRZoMinLPaKh1Kn07edrbHLRkXeaS5C/cPvTJkvis1hqnGog6fNJruTEL ZnS/3Cdc/R2mehG73hO4N68QNYW5pZgzad33x3WLUWAFfjzyfO4az74ccvKVo5Oy7qhy/s+cP+8 rfWCHy2r0UEyKkVJRAQ== X-Proofpoint-ORIG-GUID: fUlKSfYVUbJzMv-9gvOV9_8S_m8tQ9fG X-Proofpoint-Spam-Info: AW1haW4tMjYxMDA5MDA3NyBTYWx0ZWRfX7o4IKJvihcPU yKbl/GH57l41CxGl7u+4QEGMwY1HEmxgpPNLIDpWe2mAw/JxUxyOx8RtF7IUEPKj6WN1zhntL09 6vlS8KeHeJrdhd1zJQVJ/4U6iXe4wms= X-Authority-Analysis: v=2.4 cv=PaFqFShd c=1 sm=1 tr=0 ts=6ac93fc1 cx=c_pps a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=660iZSQnnn4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=B3wVGE7vzLrs5E8uOrsA:9 a=Qc5_LKlSlzfzbCtC:21 a=QEXdDO2ut3YA:10 a=O8hF6Hzn-FEA:10 a=bBxd6f-gb0O0v-kibOvt:22 X-Proofpoint-GUID: fUlKSfYVUbJzMv-9gvOV9_8S_m8tQ9fG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-09_05,2026-10-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 impostorscore=0 clxscore=1015 phishscore=0 suspectscore=0 bulkscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610080000 definitions=main-2610090077 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=lists1p.gnu.org; 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1791574005760158500 Wake the selected K0 or TLB lock waiter when ownership passes. Update its interrupt state and kick the vCPU. Signed-off-by: Brian Cain Reviewed-by: Pierrick Bouvier --- target/hexagon/cpu_helper.c | 2 ++ target/hexagon/hex_interrupts.c | 8 ++++++-- target/hexagon/hex_mmu.c | 3 +++ target/hexagon/op_helper.c | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/target/hexagon/cpu_helper.c b/target/hexagon/cpu_helper.c index cf0762ff05f..0cc8ec890da 100644 --- a/target/hexagon/cpu_helper.c +++ b/target/hexagon/cpu_helper.c @@ -460,6 +460,7 @@ static uint32_t set_enable_mask(CPUHexagonState *env) thread_enabled_mask =3D GET_FIELD(MODECTL_E, modectl); thread_enabled_mask |=3D 0x1 << env->threadId; SET_SYSTEM_FIELD(env, HEX_SREG_MODECTL, MODECTL_E, thread_enabled_mask= ); + hex_interrupt_update(env); return thread_enabled_mask; } =20 @@ -480,6 +481,7 @@ static uint32_t clear_enable_mask(CPUHexagonState *env) thread_enabled_mask =3D GET_FIELD(MODECTL_E, modectl); thread_enabled_mask &=3D ~(0x1 << env->threadId); SET_SYSTEM_FIELD(env, HEX_SREG_MODECTL, MODECTL_E, thread_enabled_mask= ); + hex_interrupt_update(env); return thread_enabled_mask; } static void do_start_thread(CPUState *cs, run_on_cpu_data tbd) diff --git a/target/hexagon/hex_interrupts.c b/target/hexagon/hex_interrupt= s.c index 0b714b73831..01fe1896203 100644 --- a/target/hexagon/hex_interrupts.c +++ b/target/hexagon/hex_interrupts.c @@ -240,8 +240,10 @@ static bool hex_is_qualified_for_int(CPUHexagonState *= env, int int_num) bool ssr_ie =3D get_ssr_ie(env); bool ssr_ex =3D get_ssr_ex(env); bool imask =3D get_imask_bit(env, int_num); + bool lock_pending =3D env->k0_lock_state !=3D HEX_LOCK_UNLOCKED || + env->tlb_lock_state !=3D HEX_LOCK_UNLOCKED; =20 - return syscfg_gie && !iad && ssr_ie && !ssr_ex && !imask; + return syscfg_gie && !iad && ssr_ie && !ssr_ex && !imask && !lock_pend= ing; } =20 static void clear_pending_locks(CPUHexagonState *env) @@ -257,7 +259,9 @@ static void clear_pending_locks(CPUHexagonState *env) =20 static bool should_not_exec(CPUHexagonState *env) { - return (get_exe_mode(env) =3D=3D HEX_EXE_MODE_WAIT); + return get_exe_mode(env) =3D=3D HEX_EXE_MODE_WAIT || + env->k0_lock_state =3D=3D HEX_LOCK_WAITING || + env->tlb_lock_state =3D=3D HEX_LOCK_WAITING; } =20 static void restore_state(CPUHexagonState *env, bool int_accepted) diff --git a/target/hexagon/hex_mmu.c b/target/hexagon/hex_mmu.c index d6ee7c40798..bdcfa057c21 100644 --- a/target/hexagon/hex_mmu.c +++ b/target/hexagon/hex_mmu.c @@ -19,6 +19,7 @@ #include "sys_macros.h" #include "hw/hexagon/hexagon_tlb.h" #include "hw/hexagon/hexagon_globalreg.h" +#include "hex_interrupts.h" =20 static inline void hex_log_tlbw(uint32_t index, uint64_t entry) { @@ -271,6 +272,8 @@ void hex_tlb_unlock(CPUHexagonState *env) unlock_thread->tlb_lock_state =3D HEX_LOCK_QUEUED; SET_SYSCFG_FIELD(unlock_thread, SYSCFG_TLBLOCK, 1); cpu_interrupt(cs, CPU_INTERRUPT_TLB_UNLOCK); + hex_interrupt_update(unlock_thread); + qemu_cpu_kick(cs); } =20 if (qemu_loglevel_mask(CPU_LOG_MMU)) { diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index 4f00ca773f3..6784efddc9f 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -1395,6 +1395,8 @@ static void hex_k0_unlock(CPUHexagonState *env) unlock_thread->k0_lock_state =3D HEX_LOCK_QUEUED; SET_SYSCFG_FIELD(unlock_thread, SYSCFG_K0LOCK, 1); cpu_interrupt(cs, CPU_INTERRUPT_K0_UNLOCK); + hex_interrupt_update(unlock_thread); + qemu_cpu_kick(cs); } =20 } --=20 2.34.1 From nobody Thu Oct 22 19:25:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1791574019; cv=none; d=zohomail.com; s=zohoarc; b=eJU7/SysA2OfeR5C+RMr2UvMBSLj+bI94IQHgYRFTiVF79NVPdz/XZemBKBMGY7sGNlLuO1LkdddYmCG+uZagLAKuSzUGPj5a4XSsa8SQ14Q98BL2U30esYusqARohdr3YfvQGsklf3yySbUwrR/hW/U+Fh1kcdEBfgEDkUFOCw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791574019; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Q+z5M8hsKVn0/G5nooMb8C4quXa4PfN/N/zU2UYHLBM=; b=oJwCKnyhP3eMUgosGB0FhFgMVujRh/7LF9jYggg5D/tnoJMO2YN56Xgj49RvcIpzqNIJiusdxvFTbYr5djZ1TL13sUjzxob5shOodwcIR2ubI7+AEqBFPUyYosEMfo6/5gV9BLtESmqmVsm3Sgv1sNvu+W2+xL0s1i7mz1tESf4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1791574019335804.1884363217721; Fri, 9 Oct 2026 12:26:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xFGEH-0007Ns-OJ; Fri, 09 Oct 2026 15:26:05 -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 1xFGE8-0007MV-LI for qemu-devel@nongnu.org; Fri, 09 Oct 2026 15:25:56 -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 1xFGE7-0007de-8e for qemu-devel@nongnu.org; Fri, 09 Oct 2026 15:25:56 -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 699HZZCe2870436 for ; Fri, 9 Oct 2026 19:25:54 GMT Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4h74t7gev8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 09 Oct 2026 19:25:54 +0000 (GMT) Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-34d62bb27a1so91187eec.0 for ; Fri, 09 Oct 2026 12:25:54 -0700 (PDT) Received: from hu-bcain-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3537ca6d202sm7652822eec.13.2026.10.09.12.25.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2026 12:25:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Q+z5M8hsKVn0/G5nooMb8C4quXa4PfN/N/zU2UYHLBM=; b=PjBqzp7ZffnVkXkM dAF56hD/hizfA198gJ8mwHM99+FHp/ZW0tnd0TOyjuCNqchQPxnlOP1IXdQhQ+Sm 7vbQX+7xjiooaFyy9V5PhkoUL5g2hJ7k+zfqubMoviycdjMxmlRFKuOfeJR4/Xo5 cyhBeRfFWSdGIUDsGpfobSqwc0OdnU5/ezA/46K2H+LDn1Psk7hXWozYDi5tIh+n cokP3wCpETjMu4Vwc1CTSwi6DccTrLp6cIkkWEg20AQcAXvgOoErDpgp8U7pYCMZ /oPPSEUU938KB/54f7RaTdwDbF44390enR7hlHhR25HgvIvNnSk67a2xT8Dctex+ 2xz4cQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1791573953; x=1792178753; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=Q+z5M8hsKVn0/G5nooMb8C4quXa4PfN/N/zU2UYHLBM=; b=bq3LsqK7uoJWFHGfqohs6WumcJC8CWn4t9xNX0y2Xmr0Q5p5zoCmX2sjs1cj1TGuEa kuf1Cf5Tns+0GnxjYG2fRAy9nT/XLj4vuwANaW5eAjB0Dh+ZZTq5zN9uYc9zQ0oetbD2 xMBtSSNzll5Uz414l/NuGhhHhL3vPPNAqqkKu2r87kUcdZOp3Ad1bWsGqR+t99ZNroGA 2b/CFDgZS4X+HYXnzaHH5RZsnowfKuGkL0mFiHJjNor3IrJ/omOvHtxoXPHrlzvIxsZv QImfG77NXmERUPc8v7RmFmeJzkLTSE0WsWrpMdeKyDtm9K3qcQLnnMCH7GzG1T0OeIvm 7VkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791573953; x=1792178753; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Q+z5M8hsKVn0/G5nooMb8C4quXa4PfN/N/zU2UYHLBM=; b=w1Xw6mujwSioiLk6yRxDPphyhKaG9DLp4VbF8fMQVfdZLQJxZH+jeuwxBp2orILSbN XX5t7VYjtrfJ32NYx4HaI0g4mQJYbrBP4NjlJvN1dol9SXCW6Lg1s8qX9xlLXY7YucUn CFsjbrDNM0Axeq6KBd3VX1YuRoMVlJorIc2JUjQFxkmLETMphmuqAuv5gSiNzOJLpD8l XdIC5fp+kKwcro4BMq4zTw6ah+b1Y0bEQye11ViuWeav3EeoWHdI0EBsN1SsWLd4cwMB +l9mrBibAAOhjwCRv79S1OUgkNgZUyQ9+kWTzPToCaOqScfNw9VyxWGEQrnIoolCa4Yn 9ksw== X-Gm-Message-State: AFuF++myZd0N/HAZACtengraaIvIzek82Mjy2SVp+LYLUqs+CeMPh6/Q fM+AbeQDKpaJ6PjaU029gl3jKi/mMZSBL3vsEZ+A05ilURUIXl+N4XsufE9qts618OY2ZxlSAQs ZCqbX/zLoN6T1dzCsVmb2qtFTiMpIincm+0REsmGyqgS7fuDIJLIo4t3BmA4P9fMQlA== X-Gm-Gg: AYBFou3S4asU4blbLUjvZ61tstXVQESuE69d43/w4u4bSphXZQ5VwLYkVVLnGI8U/WS /ig20lWDbbWUHpGskeDeqSG7j72WvLQhkv/Fg02ZMxrKsikPftqehvXK4s3UUygFowBVA+zZOj+ NlBpc6q4YYqcLXq9AKAYMMHP0DEv/JmPIBRgC+r6Z8zthAqo3swv/ty5sb57n8hR495zjj8WH5T MFXhl9ANnD3oct5dmVv3o4B6U495YPAqSGeWCgUnAwry3Bg0UDOTv0ywGcOeHdKCLolQ444T8Q5 UFlIZtGQpmEN5lqhfJfGOW/kwe/1gwS/H5ZFUI9q4ZwLlhzQspkF8Zn+ovSXsFbV1hQyoYHWNkp 7oOvyBn/VfKXv885NJ20FTht3ndTih2gnCQvhyl4ckPwq0L8= X-Received: by 2002:a05:7300:fc12:b0:351:2f08:8547 with SMTP id 5a478bee46e88-3537dde5db3mr3734320eec.3.1791573952921; Fri, 09 Oct 2026 12:25:52 -0700 (PDT) X-Received: by 2002:a05:7300:fc12:b0:351:2f08:8547 with SMTP id 5a478bee46e88-3537dde5db3mr3734288eec.3.1791573952420; Fri, 09 Oct 2026 12:25:52 -0700 (PDT) From: Brian Cain To: qemu-devel@nongnu.org Cc: Brian Cain , Pierrick Bouvier Subject: [PATCH 3/6] target/hexagon: fix stale PC on k0lock wait resume Date: Fri, 9 Oct 2026 12:25:37 -0700 Message-Id: <20261009192541.4163758-4-brian.cain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261009192541.4163758-1-brian.cain@oss.qualcomm.com> References: <20261009192541.4163758-1-brian.cain@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=W8atxhWk c=1 sm=1 tr=0 ts=6ac93fc2 cx=c_pps a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=660iZSQnnn4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=3l8XzFyHuKoT-FFnaxoA:9 a=QEXdDO2ut3YA:10 a=bBxd6f-gb0O0v-kibOvt:22 X-Proofpoint-GUID: 4kMMJleSszKFj0U3KIHNhXb-eJfDoea4 X-Proofpoint-ORIG-GUID: 4kMMJleSszKFj0U3KIHNhXb-eJfDoea4 X-Proofpoint-Spam-Info: AW1haW4tMjYxMDA5MDA3NyBTYWx0ZWRfX3bzXjezX8V0U Tc+Y57BVENdUCrNth3ar1OWidmAc0LYpamuVx1lDsizXAVOkOjjlVcQ/QNxE6/O2p+BS70cJBLY kNkB6kgsrOzeH8AM96Nv2seJZvsRRAM= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDA5MDA3NyBTYWx0ZWRfX/1wcoIduHkHo ot2rFhVoZtP2s8GGXb9qeKI34hZADy/LpKnaqw3CQtLxNF2L9FWzynEMtDRr67qHToEEJmYhN/J 8QURSO6xPL1HaLPg14E61jbzSOcZ0lTmbYq6gQHyuGL199yTqBD3o3MSeJe6RyxB8Bw1YsGe7KQ hERAlm/LonVyWzeQa/zzhCI6fiZmzX/jOimI0S7JYDq85Yg16HfKNWhG36rKBSHC93F6PA41TSK np0lauMgzQuubPle3MV2oGJmGyYjDt8Y/dSjFBu3h3a0eKUPEo2rjlL5Ww3kyaG1eKzQ2vvnX71 2/TvFBdMWLkbNFahf37PHZItTJAF08Boxg6qGidUao5eA9OlsTyyiLLOh1RnlViRtYU/RAzU5Uf A8PC8UZ5M3w2KNAzHelXk38vI0KV2X6ksOAf41zU6fny3iAeCOSbcRLEwIpORGqTMknDeydx1c1 XkpxDhRfkLYBMp5gz/w== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-09_05,2026-10-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 phishscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 adultscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610080000 definitions=main-2610090077 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=lists1p.gnu.org; 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1791574019926158500 Set PC to the k0lock instruction before halting a contended thread. A stale PC can skip the acquired lock or resume at unrelated guest code. Signed-off-by: Brian Cain Reviewed-by: Pierrick Bouvier --- target/hexagon/op_helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index 6784efddc9f..56cf601ef1d 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -1314,6 +1314,7 @@ static void hex_k0_lock(CPUHexagonState *env) return; } env->k0_lock_state =3D HEX_LOCK_WAITING; + env->gpr[HEX_REG_PC] =3D env->next_PC - 4; cpu_interrupt(cs, CPU_INTERRUPT_HALT); cpu_loop_exit(cs); } else { --=20 2.34.1 From nobody Thu Oct 22 19:25:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1791573999; cv=none; d=zohomail.com; s=zohoarc; b=B7BvCFENe8jsTbD3wL50LixnlnfY2kun571zT5rzFg5a0oH0cPXpVqKM+F/V1V9Vw52gF24j+g7Sa6ST0WfYTOyiEc3ZA6qTvWPo5WZ9HxL8VRz786dWfyPzKYWR7BBg4IOaLvx7Q50b1vVIW1p7njxUO0cQEG+jvE/fgE5wl+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791573999; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JBjdMmKpfNYTW3P1v1p5pggnmyc6LtgU9PJXn64XCGs=; b=lOcAiLD0Eei7vt9DA2oGMVtt8Kp32RImlponUq639OpC75O5jR6QnLAP7qEyFTD4/g0C/3UlhWTi1dWlU/qBfSO8FHFEoovqtd0p8QbnmbXcU8uNdxqbBG7NZPo1dM74fR3GveaiXTFIrtjNCnYnomDwmUyEWeoq+TPNvpUOf7U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1791573999243757.3043649502591; Fri, 9 Oct 2026 12:26:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xFGEF-0007NX-RI; Fri, 09 Oct 2026 15:26:03 -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 1xFGEA-0007Md-0M for qemu-devel@nongnu.org; Fri, 09 Oct 2026 15:25:58 -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 1xFGE8-0007dl-IK for qemu-devel@nongnu.org; Fri, 09 Oct 2026 15:25:57 -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 699HnDJf2901095 for ; Fri, 9 Oct 2026 19:25:55 GMT Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4h74t7geve-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 09 Oct 2026 19:25:55 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-357e2bc3b1bso71319eec.0 for ; Fri, 09 Oct 2026 12:25:55 -0700 (PDT) Received: from hu-bcain-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3537ca6d202sm7652822eec.13.2026.10.09.12.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2026 12:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= JBjdMmKpfNYTW3P1v1p5pggnmyc6LtgU9PJXn64XCGs=; b=TX0vygYMntS1h1UJ ST9whHZM/IlKpWKTqc4sHGH0JKMgDcWRxUigqLr8YmmbjT8ZfzaE3ekhy9LkUQV9 mLeGkS8ECgxHtqu3sm+95Udid1jdwiw6H4C+/6VUjv1yWXNleMR8CKiID1AX+WDV GsO85uSRb9xTxn+EbQMaeeJIwqNI1j9581sanzZ30gqMhTqFt3Kd0yqoO9xIeRMH lxgwip2LY5xJM+egdSfkogLJg4e5WjopXVEjIKlSwJyivJ9BlCglE9gn2UG+fTch bMXn0iJK2DOvnz9tw8XusuWDIgCTgZgioUqxOInEYhGc993ZAqKdWixwEj/SGKbF cl4+Yg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1791573955; x=1792178755; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=JBjdMmKpfNYTW3P1v1p5pggnmyc6LtgU9PJXn64XCGs=; b=Ok7YbpmMHiXytJKjXBMcEv0MY0kdBOTspMhkWuF7vJz3IK8pPI/QaL+szEK0AO/8iv 5X2HJn6I2lnrqIYWGmC7XQNNMNyJobmvw6jlb0uT3OQheBe+hYSA4ki/gQlxva2ahzdu DMhb+ZqVVhdaqpl4Ce9i+POymdENBtBxxuhXBzloTrce3/zZPTfANaR4TNCHP8p9hndo psfLWsG3RzA/WXUMLyDsRikqKNm2PUxaHPKNFlbptOQR0iBzd7WKY8pTGxN6dnTZsb16 LUG68XuEBVFhUXC8hiCzhr1CUZCtmvxIa35P3DHZCvXH1rGOka/a4ftFwLv3QQzzshdB zWqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791573955; x=1792178755; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=JBjdMmKpfNYTW3P1v1p5pggnmyc6LtgU9PJXn64XCGs=; b=r//hLrJxwSqTAuEUOlY5bgX3tTSAD8JqHKvey9Jo6DkmOiJBA6nBdXzgjmRumDylBt dlXIUd55X9Y/BguTDpVLie+4+m4Z1O0HiTa7uksZuo8j5rgdwkiKHsAwpo9IFL9dFrft Hk+TqtR240QpfrhLhzJ48Za+rQEsEAokJJBbGPlmlm2kzTNQhQddn7oXH1vEZEqAe0Om Tq1opcEk64Udf504VQTOeA1LYv6VcJxAjg6fWTOiPkQWeDuOr5nFJVZ//aM2QKhiTPsF zbx/hH/VGVL7ZjvYbGQsMv2PFJT1XufJWE/2uWqbC66NZxkK/DuDfrQekmmYQ4J++zet 0pBw== X-Gm-Message-State: AFq9FYK0Zi/wvMEQToC2tw6d8qJ4baU9j0SRhnKuepFD6a52YFXPy2XR 6Vi/1MRdqujnXQ04Ply5QGYMgY6fiSbM8bctreBep6NFKg2IOZLNplMq9pELRnS/GieCDfB47nJ bqjCMFAw8x7YX8zMeX3H47/GUsHqSGTmeNFOMg2aXAEuje4kmEPdjkvScX9gej4x0AA== X-Gm-Gg: AYBFou1Efxn/HD0xejC3tfjFWKXyUvuW5PZ9+rOPvTESuRoqWhHxmpTYB5j9m1dGgtq jdsxLIwLcuw8CrGl1JOhEBc1oSz4ZbDSbD2lemlzHyGC26aWGcGbIlHkQFOB5D3linxNEGrvOj+ 7KW0Q7vk6L7KwmuVDWuYorKDkfP76q8QVtzMWVI8UMbqoA8D7JnsNE2RbNkb0SOyO/F+PruwD2I dhoBRuDQD39GHAw/KZZLzE3NcxR8rFC6AQKUzh5+G/zugj8WYuPZYeAMfi/cuRZjDv/Z5AXfJuE qe7TZfv1P0Yj6sPnZ7BXmwjtQM9lo8zNtYdP2GUn7TOOArjXUWyoWRp0fJUdITKfx0IvJCCohnS IjF6TUp0Cf4FLOILaX7H1GY/9DpF3UxH93xlJh7dK+LUuBx4= X-Received: by 2002:a05:7301:7d06:b0:351:4d03:c6a with SMTP id 5a478bee46e88-3537df51463mr3371954eec.12.1791573954571; Fri, 09 Oct 2026 12:25:54 -0700 (PDT) X-Received: by 2002:a05:7301:7d06:b0:351:4d03:c6a with SMTP id 5a478bee46e88-3537df51463mr3371915eec.12.1791573953908; Fri, 09 Oct 2026 12:25:53 -0700 (PDT) From: Brian Cain To: qemu-devel@nongnu.org Cc: Brian Cain , Pierrick Bouvier Subject: [PATCH 4/6] target/hexagon: halt on tlblock when the TLB lock is contended Date: Fri, 9 Oct 2026 12:25:38 -0700 Message-Id: <20261009192541.4163758-5-brian.cain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261009192541.4163758-1-brian.cain@oss.qualcomm.com> References: <20261009192541.4163758-1-brian.cain@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=W8atxhWk c=1 sm=1 tr=0 ts=6ac93fc3 cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=660iZSQnnn4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=n7pvLpctYYjJJk5sxiwA:9 a=QEXdDO2ut3YA:10 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-GUID: L72_Lsx-ss9jCT0xjknZHv2Lo2MD1z2j X-Proofpoint-ORIG-GUID: L72_Lsx-ss9jCT0xjknZHv2Lo2MD1z2j X-Proofpoint-Spam-Info: AW1haW4tMjYxMDA5MDA3NyBTYWx0ZWRfX/nSZFc3hzCeO VjAZAqCYBK+Sjv4bxeRG8GvCEyRbuu7mlO3CWiaUfYgYQkyOOVCkhvpyp/OuUcZsup0kvwfgJ2D 1pJJHejjAiKdKFEP8+PsiKDuhklcnPk= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDA5MDA3NyBTYWx0ZWRfX1mpGkkqWoLil 6dXZIz9NMLvGZTryHh76RvSAm+WFBj53iOg0qKHCKM1SmbRt8qzQtVA1yXPGPVUzKSbMFsO7cW4 uW+NROeaXt5AI43YS2qPUdkFTei941IPME1AuuJjvjLMy6ZQI9FV9wKrE5pvg0NmjODBMxFmqmx 2CBSOXKNcuuOa74Zk1XV/ljxaLpT8LZv3mKXnpoz9gxEKCVwe/Ec61tQgwUSHpWtcCtAejA7tZO Ngty/wz7SsBrQS3IV3XDf4gv1TSkCyIHNZQDCW7EWm5ggs9al3+oROx60vTyycm6HAXmIBrtIbj xjdhFADsbEQI3YqSGQHtSkVv6aJX03ciDxRzUUNpiEzGsjdstPfogqqiYcKE/6uSsUmP6LWtwzG X5nw3IdO35UDs9dWWId1lQ05lyWUi9b+VitA2uzpbCZZDG+mb0t3exW7MIe9DoSIOHAPHKzmElA XpGhskpsqxHUfWG6hpQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-09_05,2026-10-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 phishscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 adultscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610080000 definitions=main-2610090077 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=lists1p.gnu.org; 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1791574001537158500 Set PC to the tlblock instruction and leave the CPU loop when the lock is contended. This retries tlblock after ownership is passed and prevents execution without the lock. Signed-off-by: Brian Cain Reviewed-by: Pierrick Bouvier --- target/hexagon/hex_mmu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/hexagon/hex_mmu.c b/target/hexagon/hex_mmu.c index bdcfa057c21..b9fab949d0f 100644 --- a/target/hexagon/hex_mmu.c +++ b/target/hexagon/hex_mmu.c @@ -12,6 +12,7 @@ #include "system/cpus.h" #include "internal.h" #include "exec/cpu-interrupt.h" +#include "accel/tcg/cpu-loop.h" #include "cpu_helper.h" #include "exec/cputlb.h" #include "hex_mmu.h" @@ -185,11 +186,14 @@ void hex_tlb_lock(CPUHexagonState *env) env->next_PC +=3D 4; CPUState *cs =3D env_cpu(env); cpu_interrupt(cs, CPU_INTERRUPT_HALT); + cpu_loop_exit(cs); return; } env->tlb_lock_state =3D HEX_LOCK_WAITING; + env->gpr[HEX_REG_PC] =3D env->next_PC - 4; CPUState *cs =3D env_cpu(env); cpu_interrupt(cs, CPU_INTERRUPT_HALT); + cpu_loop_exit(cs); } else { env->next_PC +=3D 4; env->tlb_lock_count++; --=20 2.34.1 From nobody Thu Oct 22 19:25:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1791573998; cv=none; d=zohomail.com; s=zohoarc; b=JseqQedKWCi1dpovJV/lKBHqs8LQkD7LjigxzCxxDiWCv84haXTRtNIlb+LvEhGW1AL4kvHlmAQgAIPysmvqeTaIG4+QUyalUPHJq9Cnw7qLaZRMnnFnXLRpKuMKjbJNxwWqkBa+29iOTZ6SZTHT+WbyyK4kPST8JnKcuG0mZXA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791573998; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=In8vci4v76thQFPF77fQlRu22pjnMqcJ0oLZQnueqWE=; b=ku9trPc/+U/3khUF6ivE+rw/HthPz3Kt4qTSo+abdiDNfVYEcdgtWTIwJh8gRBifJSm2O8oVueV/QrYczG/m2NrTw/TbQzf+nzw4OFLsmDdTW3DyAZO/7wAN/XL0l99djDtwUTr5lQMV+6++8G9tv5egRviCKgHGnMNMzxrtUSY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1791573998800181.6723722382295; Fri, 9 Oct 2026 12:26:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xFGEK-0007OM-Lc; Fri, 09 Oct 2026 15:26:08 -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 1xFGED-0007N8-5I for qemu-devel@nongnu.org; Fri, 09 Oct 2026 15:26:01 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xFGEB-0007e9-7U for qemu-devel@nongnu.org; Fri, 09 Oct 2026 15:26:00 -0400 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 699HZWfV3584200 for ; Fri, 9 Oct 2026 19:25:57 GMT Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4h74t70e8y-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 09 Oct 2026 19:25:57 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-3425098ae4bso7277322eec.0 for ; Fri, 09 Oct 2026 12:25:57 -0700 (PDT) Received: from hu-bcain-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3537ca6d202sm7652822eec.13.2026.10.09.12.25.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2026 12:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= In8vci4v76thQFPF77fQlRu22pjnMqcJ0oLZQnueqWE=; b=IDyOCS11ATy8+spc WhTt6FZnvUA5GJwoGZiY42Ofbzf4Yaj2JivukKXHJqxTmR96j44oQnIvGGvgLXs8 M5beVxoNhaRC3KTGT6thSUp+O+n4ED/A051s8gDklu0A6ECTvNtQrdOKq9qemYC4 9+i63jgvzHPcce8C62jKE46XYLDKzk8OZFonOZM8pvCZeYJV0kQeOrQmlkXQ/4j0 RpDdYXUwilPcOVSSpbm8sDScWrpTWJ9nTRAWQ+2fMy3GZUBNl7jYkwAfzRNplCFv zI78fiPutsJpeDecvn1XQcRkGg+OG4rrAnVdSxFVy2+tMYz6pVGUYbQgTqWs1mQL Zf1/XA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1791573956; x=1792178756; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=In8vci4v76thQFPF77fQlRu22pjnMqcJ0oLZQnueqWE=; b=JGM97UkV1A8URymNp4lDi+KCh0FHNZRoOEYFlR7O5pVPt8QcO2GYh94qTgMC7Ky5pl gHzqN4m/R3ltFK1yK8HYTrT1w2y0Ue8+VIk1zjgd8bRtaGhwARO2xmtez3gBKpVR7cIF vTxuGE0sABrVdY6rpWHTpp8tIycD3mMpmwZ0Yq4GP22KssUBQ3t0z4lDdOE7VPzQ3Nd3 aTPH2aQl3Tfd/EGZaNOKwS86GWw8od3kpL+/+dsm1cZGuinDk/JApZsSjLr8uDDGQ+8A erB00qpYlVN/1Juh47FGFIqtjpjEq0NjrZZPlMH3SMAZpzqdL8bW+4n2e/Gl1PLvoeZz JIGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791573956; x=1792178756; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=In8vci4v76thQFPF77fQlRu22pjnMqcJ0oLZQnueqWE=; b=GqwVmk2d893TUQaQUSH/yrpUFgYwR/B4y84b1YZjCCkN7ylQoCrPKlW4GtiA9AfjoA J8Siq4YWvuzrVNtNS+MAPSairNmhCserdBdl+/wQwIveTim8FRTRv0Qxk/+MNFXMS5OP HPP9QChSErV3Zw0hGR/afIxj7rzAgqf0VK2pqoVLuIQTyRh42zw0qhFIV1eQRyYEPuJ2 AHdB1AW+M3PMvcWS9yFYljfFRRbl5836u0Kv4CIDr/603IcjtwFwg08mXFILo5/oaACj 9gryYkBrLfMq4BF0KfgoVe48nn4qsNHq74XhfGdcsX880dMiWINZKLFBszsNyG+peULo TkxA== X-Gm-Message-State: AFuF++mt7UxCCC+GqLVBBhOxbnZgunzgghEY7nFSK2KwkbW50j9kueBR Er8nMTSYSO1DTEijY9Aat/yDJKrZcCbBZOm6edHGW3HR6Vym+r+7TKPVcJFlf/ohm/1sI8goGYs xqwq179rzUfI94HCm/680gC5QGLIFpn0nMg0WSl7jtYj1AuWsYrlTktJu6sZZsZMXpw== X-Gm-Gg: AYBFou3l/wUaazXLJGaSqzhEYd92vsOvphf+saexWywsDWbyUVZzm9F6ahH+WNUhjTA tAsJWudTyQq4BpoyfX0qKwOoAGx6xY8Pxe5Hj5CAQdCpVP+vnUlxL15J53fLDMQQ8YUHgGrB1xu aVWXXif+0KoJ3/c7QV6+SicD2z9N1cBiqgx00NrhwxOQ59W+WDTjHHwLxsGIE4zRG8FC+rSVRB/ sVEnWPt1CIsFBzTNJbuuwi1Ree28wI5Zcj+ChTpiCxTaBEkJDGvX/J/kjxU37QdiP315fyorjsB rSvUzefgXEm1kTu2sNeQ5j0TrZImxQS++LAw6xQStNBR3jmEwr2ki5yPS3S6PAKzTI4J6ohOJbw 9FhVsakmSldXhhdFrUvSbcWTax6jHN/VzKNxE/k7M8G8RnNU= X-Received: by 2002:a05:7022:e804:b0:13c:f65c:d5b5 with SMTP id a92af1059eb24-16a0b37d130mr3925908c88.3.1791573956427; Fri, 09 Oct 2026 12:25:56 -0700 (PDT) X-Received: by 2002:a05:7022:e804:b0:13c:f65c:d5b5 with SMTP id a92af1059eb24-16a0b37d130mr3925863c88.3.1791573955704; Fri, 09 Oct 2026 12:25:55 -0700 (PDT) From: Brian Cain To: qemu-devel@nongnu.org Cc: Brian Cain , Pierrick Bouvier Subject: [PATCH 5/6] target/hexagon: set a started thread's enable bit when start retires Date: Fri, 9 Oct 2026 12:25:39 -0700 Message-Id: <20261009192541.4163758-6-brian.cain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261009192541.4163758-1-brian.cain@oss.qualcomm.com> References: <20261009192541.4163758-1-brian.cain@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: s1ykgnh9z5xfA_X1jJhPdrIqQI__4oDY X-Authority-Analysis: v=2.4 cv=Mbr5KJ/f c=1 sm=1 tr=0 ts=6ac93fc5 cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=660iZSQnnn4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=u35ek3RR3RME6NZFTgcA:9 a=QEXdDO2ut3YA:10 a=6Ab_bkdmUrQuMsNx7PHu:22 X-Proofpoint-Spam-Info: AW1haW4tMjYxMDA5MDA3NyBTYWx0ZWRfXyM8+e9WpTwlK 03cyN22PBK6bc1UMQejpvHXd7BQ+VjY7iXvwQ2qMEgpIR8WZhC2xdL8yNiLxDln6+SNM65mGQxC k4stSyRw6wdfsqoVylAXHXP1ML/w+DY= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDA5MDA3NyBTYWx0ZWRfXwu/mnK/YbdJ0 g8e5TwqzCuiFBzC0DiuQjkcXQoJP3lP5z7Ki0aettHwQ4q8hcAmYAWg2Gy4QKDcR14oyVCLihNn SSKmkowMVCFFGXvlBPvFito8Sihd8tyx/QidouBmIFytyZnRkQe8+WBQbDa6TaK4vCmOTck4mii SPkqlABmkpKSDrjdd/EmHxD+HYK8B5XczKXbrCvSa1joLL66EKKTSamZFEHz4IngTCdRYp1c2aP dcRApic0oH7IU+6XqLz7sZ8NzXTeq1xPOwD0B7Q/V7i8YX8TcDsW4L5kpdlKJ97A+D9QU/9O8vF xwGYc7q25Nxga5sQIJjxXStYZzYgm3HnWuBnMkrCh313Gk3lZAotQMCcugKu03L863ez+hy+8fb 3IfOBEykedRUiKZzAQfLepmU2Ae9ciTpksQcIVQAH9vfhZskd5XTMP831vyL1EvU+23Q3PvhUiA SP4vWypUuH1bnV9p02w== X-Proofpoint-GUID: s1ykgnh9z5xfA_X1jJhPdrIqQI__4oDY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-09_05,2026-10-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610080000 definitions=main-2610090077 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; 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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1791573999671158500 Set MODECTL.E when start retires rather than when the target thread runs. T= his makes the thread state visible to software immediately after start. Signed-off-by: Brian Cain Reviewed-by: Pierrick Bouvier --- target/hexagon/cpu_helper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/hexagon/cpu_helper.c b/target/hexagon/cpu_helper.c index 0cc8ec890da..df306fccd6b 100644 --- a/target/hexagon/cpu_helper.c +++ b/target/hexagon/cpu_helper.c @@ -504,6 +504,9 @@ static void do_start_thread(CPUState *cs, run_on_cpu_da= ta tbd) void hexagon_start_threads(CPUHexagonState *current_env, uint32_t mask) { CPUState *cs; + + BQL_LOCK_GUARD(); + CPU_FOREACH(cs) { CPUHexagonState *env =3D cpu_env(cs); if (!(mask & (0x1 << env->threadId))) { @@ -511,6 +514,7 @@ void hexagon_start_threads(CPUHexagonState *current_env= , uint32_t mask) } =20 if (current_env->threadId !=3D env->threadId) { + set_enable_mask(env); async_safe_run_on_cpu(cs, do_start_thread, RUN_ON_CPU_NULL); } } --=20 2.34.1 From nobody Thu Oct 22 19:25:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1791574008; cv=none; d=zohomail.com; s=zohoarc; b=fQ3ByuzYN+AjLNBjH6uTPcna2US0DF1lGlriiL4IhoMuHWNPLDlM/i9rG4HNhBYaLdMDzZRwKNy3JVTTsPFyus4qzNSmr6fJ1egrAvP3g4x2ATil59KAhcKQGhry5L6eU5ZbudRkjqpoBoqg0HnGn7ezF6r0Eil7sBI+Ry50WR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1791574008; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Xq9y0atm6Hwpw2Er27WmyYoW0KM+VqQjsEiPZLJpkpo=; b=ex3fLnSBRZ+dv2AGV5CCXxWqpkHHB9AW2DTjVo5Yiw0Mb5rFEbxDW6NjVQOK9szvbzORfZlbHkauVX2tK1SZv7bsyhUj+CG/xgP446FRt96ZpM1gybi8PEWtKYrJg0l+yjauVpfOhE7cxs5d3fXWQNHfUa4yaJKDHI7kGyHtwyg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1791574008914611.4881862132454; Fri, 9 Oct 2026 12:26:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xFGEJ-0007O6-GP; Fri, 09 Oct 2026 15:26:07 -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 1xFGEE-0007NU-Eh for qemu-devel@nongnu.org; Fri, 09 Oct 2026 15:26:03 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xFGEC-0007eF-4b for qemu-devel@nongnu.org; Fri, 09 Oct 2026 15:26:02 -0400 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 699HZWfW3584200 for ; Fri, 9 Oct 2026 19:25:59 GMT Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4h74t70e92-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 09 Oct 2026 19:25:58 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-341eff9e381so69932eec.1 for ; Fri, 09 Oct 2026 12:25:58 -0700 (PDT) Received: from hu-bcain-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3537ca6d202sm7652822eec.13.2026.10.09.12.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Oct 2026 12:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Xq9y0atm6Hwpw2Er27WmyYoW0KM+VqQjsEiPZLJpkpo=; b=D4FxZQPtWFDryuZJ MO5VgE6kqYam8OvbyC9cfAaTrJZU0GQspErGGJXpYVJrAw5uLEu/N11QlZ2XSRob tlTtj599s81EC2KnUumfHBJBV7LGrv6ZLsswehHK2r3tRCwvjRqZguIlNP0MtonL zF1sSJE/mZ/DstKfC9Wi3K+UCA0/tkO7A0Yjd6w4IQLOJcI6enQi4R1i+lhboipp hkEoT82SKIM/C+OxTVaiqW41IzjmHv62rW2QCNztJ+SKiiGru7dyz4b1hm7S2QJs fvHgr4pmIWRJeIEaKA3vvpSYeQr5KtAErb1V1CdIz10GkERKpLBCHjQ073OHBiEA FTmjpA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1791573958; x=1792178758; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=Xq9y0atm6Hwpw2Er27WmyYoW0KM+VqQjsEiPZLJpkpo=; b=e0yov/eDEEteCv3ywu3nN9kURORGCFe3RMaOO32EaGIJgcen1PSboADASD9kEdIHVf u/eg7e2DSuL0U25rYcd7/ASov6b9hiahuE4BFaCVI167zKcBnI3IyLcwW6b7KUqMukg2 cnhjsMH20O8KcgG5BOIsOiglGSC90Irls2ydeaxcVvCRcdz8g6dSox9W7F1zAXYz+Vqb VxZR5lEHpaYz6pGFQyTkmi5iKg5hYnu80PxOXhFk+cJCXskHM1xSCbla9lycMBrMaDNh qU7DGOtThc9yKLzvAso5LZQ+o1MpYS0V0/CBW1bqs43Y9DDEY0BL25QPk0Ps8PXrnNkU x41w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791573958; x=1792178758; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Xq9y0atm6Hwpw2Er27WmyYoW0KM+VqQjsEiPZLJpkpo=; b=e85XUpYVxUsXGJ6vVxCs6yXMJlXcvfj9UDWEkM+V+XAFgLyxuUdbYZ0tO+yrJyVnP8 74+NevXWZ0O7XaoRtKeTUhbuu6bDPCZWbeo6vmsLBfVL6Y1b3plO0JI3uSSx0vR2Ybji tvWomHKW5hu2IPf1AcUngZ/BX9iK7GDRSIV0Kvjo5o2qv+w2KGIXxLnU2lS9k7rf7y5j vFrEA1XDukNogMfbPm7dqxvs2EOUu2E2kzs4i/HGbLxaHGv07VZUI37415xTnWVYzo6v i2Wor64/KExWIRNhDt85GGF9IaLDWFFHc/GfVV7umcYHxHxpDXRPDkMwOZdee/DLxi9S qQ1w== X-Gm-Message-State: AFq9FYJWIoIZc0nXW14S2iEu1UBOqw6Am+QFGCGb5XAlN63zU1GFtdlg oIWbxd6mo8nuL8DNzA7HcJRYCoRZCbDeJCojKbcLW/RUe2cnJZGfMFF1KtkTU+D964XqtaQE1Zq ddM4rIdHs+J7qWkLfuuEy2vwJACEKexQV377zp0QmmiVufcWNJEgUNSzZUhwYzNDuWQ== X-Gm-Gg: AYBFou2hQAZVuMh2s2/YuVzVC9FNkZlPpFiJKclAC++T6Z9WvSLUK/3usU5kKcf5BOr T0Do5MRTikDrCxOPA/aQ0xSurA8AekSL01UpvC8PebsduojcLhqHiCteaWsckADqnPXIIWaLk0g EdXxzATnd7Lky/XyPLrt2kACt3rbhvtaGy7pQfHbKTqPCpwzi9waYMUn8JEsD/d0YVhv0OZaNcH oO5+bxmnqmLQSeRWkRW+RskvrpVCrs6oPUhxVQ2Ka6XhINyrWglFu517emieHGOckWC7NY5hYce Az9G6Fd3zmFrLkpB5WtG2jTYG2Y36rkbX6yddYnVJxMjAI2te+ms8SzI95BNbnZZ8TeivaTr49G 1IgHsEZ0H7x5nCSA82slvAozWSsirzi96r9vJE3r7v/ejxDU= X-Received: by 2002:a05:7300:4706:b0:34e:3ce1:39f8 with SMTP id 5a478bee46e88-3537e021d3cmr3921213eec.18.1791573957783; Fri, 09 Oct 2026 12:25:57 -0700 (PDT) X-Received: by 2002:a05:7300:4706:b0:34e:3ce1:39f8 with SMTP id 5a478bee46e88-3537e021d3cmr3921185eec.18.1791573957157; Fri, 09 Oct 2026 12:25:57 -0700 (PDT) From: Brian Cain To: qemu-devel@nongnu.org Cc: Brian Cain , Pierrick Bouvier Subject: [PATCH 6/6] tests/functional/hexagon: add MiniVM, lock tests Date: Fri, 9 Oct 2026 12:25:40 -0700 Message-Id: <20261009192541.4163758-7-brian.cain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261009192541.4163758-1-brian.cain@oss.qualcomm.com> References: <20261009192541.4163758-1-brian.cain@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: TL7i12PMleMy3KfMTIUzM4Y0PjTn1KM8 X-Authority-Analysis: v=2.4 cv=Mbr5KJ/f c=1 sm=1 tr=0 ts=6ac93fc6 cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=660iZSQnnn4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=qC_FGOx9AAAA:8 a=EUspDBNiAAAA:8 a=lxC5_JGnJAQX7-PTBzMA:9 a=QEXdDO2ut3YA:10 a=6Ab_bkdmUrQuMsNx7PHu:22 a=fsdK_YakeE02zTmptMdW:22 X-Proofpoint-Spam-Info: AW1haW4tMjYxMDA5MDA3NyBTYWx0ZWRfX0y8R/fj3Zcrx J0c0XDl/i9nG4sdmhkd571m1ZXv6pRebmznC0chfYK1Y5Jf3NpHYKOl11wWOSdpHvcwyzDpUiZN nan3DSdjzyyMY9smvwxEf8QS0RuSoe4= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDA5MDA3NyBTYWx0ZWRfX6sWn68FifHeS bAbTFFCD2dBtycUe+ny6lPztydzgySUXoWGtnWW0dWeTNlyS3NyPjsTDMa+61A9n0fUynCLxqi8 B3Xshvm/Tz03IE1HNtu5DGGfHFAVZgho2INmcLjGlhwH4JMnYE2ZEMT9DbSry370NOzNbih0+UC yqk8WFyeMfEdtx1UsSJ9ySA9pB3UhmrckYNzFd1gEMiJKzvyzwqQ3uHuVNNzIQ5NVxJzB32uTA5 9Vb2TMMjNrbIJk459TGMnwh9LHJYq9ho9M9w+orYbKD9E9VGMC21or+fOomZmJGcHO1jL98b0MV 5vFGIegszB3rlch76jEyvsPlU8pLHfzvSeLGeAG9Nt2ZTyxkUXNMizn+hTFSZlU6fYF8OW2mn/3 o4SkLxxXCF3vgmeIQUtpV7uU1t3mIO81K8gejzbqSUKRNPD1H7ijCvONQwzEvgowxEuZve78G63 rHsIlbSyuu7o5jIAgVA== X-Proofpoint-GUID: TL7i12PMleMy3KfMTIUzM4Y0PjTn1KM8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-10-09_05,2026-10-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610080000 definitions=main-2610090077 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; 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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @qualcomm.com) X-ZM-MESSAGEID: 1791574009776158500 Add the lock_verify test case to verify the k0/tlblock behavior, add the minivm tests to cover start() and more. Signed-off-by: Brian Cain Reviewed-by: Pierrick Bouvier --- tests/functional/hexagon/meson.build | 1 + tests/functional/hexagon/test_minivm.py | 43 +++++++++++++++++++++++ tests/functional/hexagon/test_systests.py | 3 ++ 3 files changed, 47 insertions(+) create mode 100755 tests/functional/hexagon/test_minivm.py diff --git a/tests/functional/hexagon/meson.build b/tests/functional/hexago= n/meson.build index 44053e64676..e182bc98a06 100644 --- a/tests/functional/hexagon/meson.build +++ b/tests/functional/hexagon/meson.build @@ -3,6 +3,7 @@ tests_hexagon_system_thorough =3D [ 'arch_tests', 'systests', + 'minivm', ] =20 test_hexagon_timeouts =3D { diff --git a/tests/functional/hexagon/test_minivm.py b/tests/functional/hex= agon/test_minivm.py new file mode 100755 index 00000000000..a70edbcc987 --- /dev/null +++ b/tests/functional/hexagon/test_minivm.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 +# +# Copyright(c) 2024-2025 Qualcomm Innovation Center, Inc. All Rights Reser= ved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +from qemu_test import QemuSystemTest, Asset, skipBigDataTest + +class MiniVMTest(QemuSystemTest): + ''' + minivm is a Hexagon hypervisor that implements the Hexagon VM + specification. These test cases boot minivm and then load test cases + to the address specified by MiniVMTest.GUEST_ENTRY and + execute a minvm-guest program to exercise minivm virtualization + features. + ''' + timeout =3D 180 + GUEST_ENTRY =3D 0xc0000000 + REPO =3D 'https://artifacts.codelinaro.org/artifactory' + ASSET_TARBALL =3D \ + Asset(f'{REPO}/codelinaro-toolchain-for-hexagon/' + '19.1.5/hexagon_minivm_2024_Dec_15.tar.gz', + 'd7920b5ff14bed5a10b23ada7d4eb927ede08635281f25067e0d5711feee2c2a') + + @skipBigDataTest() + def test_minivm(self): + self.set_machine('sim') + self.archive_extract(self.ASSET_TARBALL) + rootfs_path =3D self.scratch_file('hexagon-unknown-linux-musl-root= fs') + kernel_path =3D f'{rootfs_path}/boot/minivm' + + for test_case in ('test_mmu', 'test_interrupts', 'test_processors'= ): + with self.subTest(test_case=3Dtest_case): + vm =3D self.get_vm(name=3Dtest_case) + vm.add_args('-kernel', kernel_path, '-device', + f'loader,addr=3D{hex(self.GUEST_ENTRY)},' + f'file=3D{rootfs_path}/boot/{test_case}') + vm.launch() + vm.wait() + self.assertEqual(vm.exitcode(), 0) + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() diff --git a/tests/functional/hexagon/test_systests.py b/tests/functional/h= exagon/test_systests.py index c8137a71713..67043488657 100755 --- a/tests/functional/hexagon/test_systests.py +++ b/tests/functional/hexagon/test_systests.py @@ -105,5 +105,8 @@ def test_hvx_multi(self): def test_standalone_vec(self): self.run_exit_zero("standalone_vec") =20 + def test_lock_verify(self): + self.run_exit_zero("lock_verify") + if __name__ =3D=3D "__main__": QemuSystemTest.main() --=20 2.34.1