From patchwork Tue Nov 7 03:04:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 741829 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1421666wrr; Mon, 6 Nov 2023 19:13:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3eJQ7y6R1ni1Zhx3pV0Zc9UERf8xs3VXTy5xVguMVgTxdWFsh1D4SiMPdm7umoMx+wIcI X-Received: by 2002:a05:6214:21ed:b0:66d:1244:cea5 with SMTP id p13-20020a05621421ed00b0066d1244cea5mr37623957qvj.46.1699326836562; Mon, 06 Nov 2023 19:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699326836; cv=none; d=google.com; s=arc-20160816; b=c9JJG8JjsP6HhobipRkIsaZe7IWBxOztIRynNYv8qfQlFTyUxKFeY4xqG1iR6uCEMo Bu4MjbBVZhuUn9sfFC+1IMpmVHGlJQg5EklU//R0F+In0401643MZxuIFmBt1M+ZPpNa UYaBFLcADaWSTyBbD2U0tvS0i8ICTcfLOcOyjbv8BbnSEPlCZwDKpoGhmKa3Eh9RVpcH gI86qEGwdYimmIdk6zNsjEyCn06Wujnhbhp5HwKNplsBOx44f1LL6uV5E3+WEJoGOTF4 XiH3b6TFQscsr4FszfP5u7vZSXxujhD7DG7P9SYLWFP5XL0NMjgKDJ2YV3OhcDu7WRnH KTlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=RBKs2IAIkMEse1k0yUz0XaeAfVR+6S9yQC7lCh199ew=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=PnbJ/WMgx9qxb3pwDN4ID2vBM0iRWC0pSw70/6wWOaR6cHN/rrtxPyBWL7SYiRtsoe FCSuLXyivX9llTi2aDgrK3MeftHLQ2RK4IaGWGzhue9rQSSZaQL4FRws/QYf8C53JbY6 tFP1Je1rbwA7HmfCw4tz9NVkSBKXxcIX+uMOzdqhQfJ7I5Z01MFWt0qyAzFI59z9D1gf PjGVj+b6F0JW3REHZwYX/kRklnF9ZwDmFjRvjDvQNzov2olcIXS60dzuVZbCEBX1kSDy Gk8kVkZTXP1sWXTh6xhapHkwXEasdOJLwQJ7FG/DxbVxYT5xVXFnnRBm2NpBrhSx3RjB UCEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q00pu0MP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q15-20020a0cfa0f000000b00672531aba05si6610628qvn.15.2023.11.06.19.13.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2023 19:13:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q00pu0MP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0CRv-0005sF-TD; Mon, 06 Nov 2023 22:08:20 -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 1r0CRq-0005aL-56 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 22:08:14 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0CRk-0001Ts-CU for qemu-devel@nongnu.org; Mon, 06 Nov 2023 22:08:13 -0500 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2802c41b716so4331285a91.1 for ; Mon, 06 Nov 2023 19:08:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699326486; x=1699931286; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=RBKs2IAIkMEse1k0yUz0XaeAfVR+6S9yQC7lCh199ew=; b=Q00pu0MPKkWz9gp8/d0BA6jd8mUmYjbACCm2ERxAkl2yUwEm9SWOUcf6RekuB8ySaR pvaUG81sJSiiYEGbJ4MdGxcW8pMPjcRqDP3aQxa8kzUw4xVLTspofedUFbc4arEMklnu lGgaAub2DHE1ixEsc1axL2FV00yrLIwU6v+xPBIG+1GPDcvtA8qh7TkWeqRdHgNp9VUG x4TxGlAKM8lsx8jIBPcap2SGd99FkzBbvnn3wVxig3zTqiAaYiHbscIsPOZKzIHdCL6a Ey+lqQ8x6uVuS/D9VzwLzMNmUVX0IK8dTAeprKkq2E7CH8Pavb5fknFUmuqJ+woG1qHp ZjYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699326486; x=1699931286; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RBKs2IAIkMEse1k0yUz0XaeAfVR+6S9yQC7lCh199ew=; b=iM8n8BPNaBXcpkSGf6KBbqw74UndvtvZoAhOJLsH8DdmrdspHxaYkprzmVU+I6dwFZ 9DbmI78dZ1RVsqeBk6GmtY/2d2bNViRf1ufhoaoBCO0fWfpMv+eTX2lXi2SwQh7rLenb 0EptK6/fXpoTViooaX9dMfnBY1AbXaDipMZT+CMbu95TdfFVOmYkxzcKFJ8WHNSqvFKp D2CqhtRQBSsUFASFvknL9nIJHuY92kkbq+0XTj/L/Uef4CWeZ+ib0FP4Y5y7fX3gYD70 u8nitNx3XwEcIqW+4dAwbjdw7crtGJwrbf2KfH+fB2VaYryuK/blAkXFFLA5BB/OPtoA FfMg== X-Gm-Message-State: AOJu0Yza8hagCury8dM56irB9+5kUVivfKygMjdcmk87ndph25+lVD4r uXN7iYl3QlRRIHb9rhe7DDKd16rOdJQD/ejl66w= X-Received: by 2002:a17:90a:fd01:b0:27f:ebfa:1112 with SMTP id cv1-20020a17090afd0100b0027febfa1112mr25099778pjb.5.1699326486480; Mon, 06 Nov 2023 19:08:06 -0800 (PST) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id 13-20020a17090a004d00b0027782f611d1sm6744883pjb.36.2023.11.06.19.08.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 19:08:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 78/85] target/hppa: Add unwind_breg to CPUHPPAState Date: Mon, 6 Nov 2023 19:04:00 -0800 Message-Id: <20231107030407.8979-79-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231107030407.8979-1-richard.henderson@linaro.org> References: <20231107030407.8979-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Fill in the insn_start value during form_gva, and copy it out to the env field in hppa_restore_state_to_opc. The value is not yet consumed. Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 8 +++++++- target/hppa/cpu.c | 1 + target/hppa/translate.c | 13 ++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index ea8e7e99a4..144794d089 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -45,7 +45,7 @@ #define MMU_IDX_TO_P(MIDX) (((MIDX) - MMU_KERNEL_IDX) & 1) #define PRIV_P_TO_MMU_IDX(PRIV, P) ((PRIV) * 2 + !!(P) + MMU_KERNEL_IDX) -#define TARGET_INSN_START_EXTRA_WORDS 1 +#define TARGET_INSN_START_EXTRA_WORDS 2 /* No need to flush MMU_PHYS_IDX */ #define HPPA_MMU_FLUSH_MASK \ @@ -208,6 +208,12 @@ typedef struct CPUArchState { target_ulong cr_back[2]; /* back of cr17/cr18 */ target_ulong shadow[7]; /* shadow registers */ + /* + * During unwind of a memory insn, the base register of the address. + * This is used to construct CR_IOR for pa2.0. + */ + uint32_t unwind_breg; + /* * ??? The number of entries isn't specified by the architecture. * BTLBs are not supported in 64-bit machines. diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index e1597ba8a5..04de1689d7 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -80,6 +80,7 @@ static void hppa_restore_state_to_opc(CPUState *cs, if (data[1] != (target_ulong)-1) { cpu->env.iaoq_b = data[1]; } + cpu->env.unwind_breg = data[2]; /* * Since we were executing the instruction at IAOQ_F, and took some * sort of action that provoked the cpu_restore_state, we can infer diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 4102f5faf3..bcce65d587 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -44,6 +44,7 @@ typedef struct DisasCond { typedef struct DisasContext { DisasContextBase base; CPUState *cs; + TCGOp *insn_start; uint64_t iaoq_f; uint64_t iaoq_b; @@ -234,6 +235,13 @@ void hppa_translate_init(void) "iasq_b"); } +static void set_insn_breg(DisasContext *ctx, int breg) +{ + assert(ctx->insn_start != NULL); + tcg_set_insn_start_param(ctx->insn_start, 2, breg); + ctx->insn_start = NULL; +} + static DisasCond cond_make_f(void) { return (DisasCond){ @@ -1324,6 +1332,8 @@ static void form_gva(DisasContext *ctx, TCGv_i64 *pgva, TCGv_i64 *pofs, TCGv_i64 ofs; TCGv_i64 addr; + set_insn_breg(ctx, rb); + /* Note that RX is mutually exclusive with DISP. */ if (rx) { ofs = tcg_temp_new_i64(); @@ -4458,7 +4468,8 @@ static void hppa_tr_insn_start(DisasContextBase *dcbase, CPUState *cs) { DisasContext *ctx = container_of(dcbase, DisasContext, base); - tcg_gen_insn_start(ctx->iaoq_f, ctx->iaoq_b); + tcg_gen_insn_start(ctx->iaoq_f, ctx->iaoq_b, 0); + ctx->insn_start = tcg_last_op(); } static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)