From nobody Fri Apr 4 04:15:41 2025 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=1740807072; cv=none; d=zohomail.com; s=zohoarc; b=Gqw+kl45Gx6xtcppmEfAz56gC+QB7xjGmZpPAs9djt2x4HI3XVpeG3eSfvtqBbsMiYGGGZrc7qgS2e6oeELJG8ei3hVsIOP3mIMiHv5t+67acpTHa1VPP98HSxoDHez4EUUyXxSi2fD1aB1NNwz/M/E7YVN0B/mvooOQ0XjSUns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1740807072; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ahHIV6BCVwDBuw3XkaPs46Y4JOBTvn8AwBXLM/Zq4fw=; b=HAD0EORQatfBlyhops7ixqP00ahRDtAfyYEHZIKUgNOVM1EF9gd3n133ZK0K9OZHVHAxcU39P04CAFBlZ/rOyCaugndvc6+Odg6rVNTx/gKK5cDyhPABoONikjo6IKbHs4Xz311DNPgA4vrIdjABYuK0Y7J3b40qYOPi2c/aJiA= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1740807072015906.109514215003; Fri, 28 Feb 2025 21:31:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1toFNU-0002uj-GI; Sat, 01 Mar 2025 00:27:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1toFNS-0002u5-8q for qemu-devel@nongnu.org; Sat, 01 Mar 2025 00:27:06 -0500 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 1toFNQ-00087b-P3 for qemu-devel@nongnu.org; Sat, 01 Mar 2025 00:27:06 -0500 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5213LK0q029173 for ; Sat, 1 Mar 2025 05:27:04 GMT Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 453t89r637-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sat, 01 Mar 2025 05:27:03 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-2fee4c7ef4dso22546a91.0 for ; Fri, 28 Feb 2025 21:27:03 -0800 (PST) Received: from hu-bcain-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2fe825bb346sm6930596a91.18.2025.02.28.21.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2025 21:27:01 -0800 (PST) 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= ahHIV6BCVwDBuw3XkaPs46Y4JOBTvn8AwBXLM/Zq4fw=; b=VnyEzRweDjdKyQVs A70nZ51aZoxxLjhNde+L2+QTv7cwP0Ub+ukXkqHYCpncMAvwHdKvr5UqX147l3oZ SYTBFT/Q7MM7ojqSoplVp5+mRBEKSdWxY7U/NpnWGjWmvWgOYQgE33sqapNUVskX hBOM+JwQygsDSCrZu9VnbLd1gjAO9isW99XNriSfnw5J4gWZw/Gvjt+TmKyT93aC vmxrEOBHV2M6IXpfdVOwi+7S/s1XUTJ2s/CTYNCUQADhqqBoRPaLBeGfXi62AsZr OeQITtbZ9plfka9ensPmhMYwWOEeJQdN49A0qR8TxJPWRpXCQHzJy/GzMLjKOf8e ZIdD4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740806822; x=1741411622; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ahHIV6BCVwDBuw3XkaPs46Y4JOBTvn8AwBXLM/Zq4fw=; b=TtTxZaXFVsQe/nVNTg2cXklY+pIUMGxLfP5mH6O9hsRmDK0Q1OOzN0ftZvQGv3gHje X7syvgCx5hLH0qnHJlz9MDbwxG9HSeoB9HWtPYjbg9aGgv1xTMVPijh1eM5TQj1l80FX xdZt5F10JfU2I1WuO5ppx4mHDtx/VbVLhfupsiftrBivNZsRgCVXormTaoVa5Js03SJD lFU/M9WlzrNyYfWgkOwQxRA67y3Q+VqFu10snyIOXxtR28/kZa6oJyZVLL43AoTg4WvB PXM7lHCOdfq6kCZmA8f1Jt+KT18NH3SB2k6ckua44BYv2Tk+LYMV3O36IJfvW1oY1FvG QdtA== X-Gm-Message-State: AOJu0YzL8/wAN/5bnQrL+OlmuR9TsVtAlNcup5rKZP/TfPRR2J5XgPjo X8aKJUHdUjjRcFYu7qPFWGNYfVtETaF9e1qip2HAXEdD7JVD1sECu/5NoFdyJSDJVPN8feRNnVk ipKiAbbLBFYt0VAcLhVphhH1ycoctcxXmPw45q9Vy7WuzBa2Eg6K9Ax4AQ3ciMg== X-Gm-Gg: ASbGncvvgwdaK0rs0u9+A/QjilK/FiY8I4jJbHKJtzR16RCuxnUNcCORsJkkUlGrI8+ ltFC5cQERRxY/4PfZjW1eJ9Plx2NCUNNEWxZTpZzvYconaWmfqD1tJF0LJpvXsM/GNYMhDj6zTt 1OcYSMK0Bz8soe643aErnN+hPAgiuYPPlNAhpZo1YytMKuRw2FNP3ZJtZ4zsvdujsxAgZxLKs0Z bPKtMb9YK9BRmlf3UCObvvMPjClO8tNUaWB05Pw1qI95/O1kaSrsQF0GKAHD3L9zw0i+0Y832jI he9r8zeitzHBmN0ZVsotIyAYtut+90sK5BG+6jqzXMUwaqfR4WOinuOIB5ui3pV1 X-Received: by 2002:a17:90b:3c88:b0:2ee:ee77:2263 with SMTP id 98e67ed59e1d1-2febab2ecd6mr10866212a91.7.1740806822351; Fri, 28 Feb 2025 21:27:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGd5pCQhVLzSbywtIB/TaqQYdT54MxjULCFy1TM9GJaEGqDT4ad3laDCgYmMAhkHQ49Eu34UA== X-Received: by 2002:a17:90b:3c88:b0:2ee:ee77:2263 with SMTP id 98e67ed59e1d1-2febab2ecd6mr10866180a91.7.1740806821962; Fri, 28 Feb 2025 21:27:01 -0800 (PST) From: Brian Cain To: qemu-devel@nongnu.org Cc: brian.cain@oss.qualcomm.com, richard.henderson@linaro.org, philmd@linaro.org, quic_mathbern@quicinc.com, ale@rev.ng, anjo@rev.ng, quic_mliebel@quicinc.com, ltaylorsimpson@gmail.com, alex.bennee@linaro.org, quic_mburton@quicinc.com, sidneym@quicinc.com, Brian Cain Subject: [PATCH 11/38] target/hexagon: Add guest/sys reg writes to DisasContext Date: Fri, 28 Feb 2025 21:26:01 -0800 Message-Id: <20250301052628.1011210-12-brian.cain@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250301052628.1011210-1-brian.cain@oss.qualcomm.com> References: <20250301052628.1011210-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: O-SRAhQ_zrApoo6qPNloJuX7PxSq8gRi X-Proofpoint-GUID: O-SRAhQ_zrApoo6qPNloJuX7PxSq8gRi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-01_01,2025-02-28_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 spamscore=0 phishscore=0 suspectscore=0 malwarescore=0 clxscore=1015 adultscore=0 bulkscore=0 mlxlogscore=844 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2503010039 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=brian.cain@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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: 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: 1740807073966019000 From: Brian Cain Signed-off-by: Brian Cain Reviewed-by: Taylor Simpson --- target/hexagon/translate.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/target/hexagon/translate.h b/target/hexagon/translate.h index f611c854dc..0eaa3db03e 100644 --- a/target/hexagon/translate.h +++ b/target/hexagon/translate.h @@ -39,6 +39,14 @@ typedef struct DisasContext { int reg_log_idx; DECLARE_BITMAP(regs_written, TOTAL_PER_THREAD_REGS); DECLARE_BITMAP(predicated_regs, TOTAL_PER_THREAD_REGS); +#ifndef CONFIG_USER_ONLY + int greg_log[GREG_WRITES_MAX]; + int greg_log_idx; + int sreg_log[SREG_WRITES_MAX]; + int sreg_log_idx; + TCGv t_sreg_new_value[NUM_SREGS]; + TCGv greg_new_value[NUM_GREGS]; +#endif int preg_log[PRED_WRITES_MAX]; int preg_log_idx; DECLARE_BITMAP(pregs_written, NUM_PREGS); @@ -79,6 +87,34 @@ typedef struct DisasContext { =20 bool is_gather_store_insn(DisasContext *ctx); =20 +#ifndef CONFIG_USER_ONLY +static inline void ctx_log_greg_write(DisasContext *ctx, int rnum) +{ + if (rnum <=3D HEX_GREG_G3) { + ctx->greg_log[ctx->greg_log_idx] =3D rnum; + ctx->greg_log_idx++; + } +} + +static inline void ctx_log_greg_write_pair(DisasContext *ctx, int rnum) +{ + ctx_log_greg_write(ctx, rnum); + ctx_log_greg_write(ctx, rnum + 1); +} + +static inline void ctx_log_sreg_write(DisasContext *ctx, int rnum) +{ + ctx->sreg_log[ctx->sreg_log_idx] =3D rnum; + ctx->sreg_log_idx++; +} + +static inline void ctx_log_sreg_write_pair(DisasContext *ctx, int rnum) +{ + ctx_log_sreg_write(ctx, rnum); + ctx_log_sreg_write(ctx, rnum + 1); +} +#endif + static inline void ctx_log_pred_write(DisasContext *ctx, int pnum) { if (!test_bit(pnum, ctx->pregs_written)) { --=20 2.34.1