From patchwork Thu Nov 2 01:30:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740374 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp595243wrv; Wed, 1 Nov 2023 18:38:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6lrY1cHbjn8TNSajAXZdkfhW8RuJdYea/VV7SPbMVRHabm9VQS+4srvki4wchT9atT3Q5 X-Received: by 2002:ad4:5aea:0:b0:671:92a4:6a52 with SMTP id c10-20020ad45aea000000b0067192a46a52mr10721937qvh.12.1698889098831; Wed, 01 Nov 2023 18:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889098; cv=none; d=google.com; s=arc-20160816; b=dbBttMFbaxM1uTGLapGFBGwsWBRu9ZkPP7Ggyszn9wvHSX5sYqkLmkKKLyBx8++y23 NT8u7ODLnxzd3QEV64zRBYUEwBgDc1UmllRc0tFfmZebNnyrKiC7baWrQDpetXHgx7ZK TDgNCiobNsJjaam+8Xs/1NXUUKdgqc5f6O80lh4RdcGB4p803wN5tUSwHz/T+Bw16LJA TElav9TE6EmChYT4iZ69MIE1ps2TehRViGPj/wbismUPxqaob699MHNcf8n5Z3pLTkFb khidA6hfZAL+cANyhoPAVr+o0H/AMpYhb7jVZFnMOEj35vpR9hPzwwxzHyY0mEk9qTu1 E/BQ== 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:cc:to :from:dkim-signature; bh=M7+4SBqNUCdb83UyaUX4TiYteHeHosFCPYbW+VU+89Y=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=e+/RhFXJMFxUNBSaw4dPWc9zVUrPSmNHNL1qq2gxgu5Dnvrl2ZqxAlGN0PmhEspzEs 7kegX4aj9y+FuYbvA+tAMZYv0JJC9RICW/AlXD5F/KBmF1IIRRD/W4fV2q3rkZ1RKtV4 1NJ9VueRgx5gIWCR2obRIS1ANM+FX7FIJpjTtzSKyRBV48ouH+ernOoyKdVpZNh4kCeS W4y8BrjLcZCJMKQ3yGqxF85x1nvl/C285y0mhr9a6B2Z8+ZnlLyzJoi3jbZ6X3BXJBKj AKqBNDPHz9ew3oMHg/Ab4VTNOyrtsU9nl5CggE3ROEt9QyG7gk5fAEl4J1Todj9Fz5Nb gKCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sBOWiJ2G; 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 el17-20020ad459d1000000b006562a20b82bsi3438659qvb.327.2023.11.01.18.38.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:38:18 -0700 (PDT) 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=sBOWiJ2G; 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 1qyMeN-0006K6-D3; Wed, 01 Nov 2023 21:37:35 -0400 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 1qyMeG-0005xd-JV for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:28 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMeE-0004IH-Vm for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:28 -0400 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6ba54c3ed97so493501b3a.2 for ; Wed, 01 Nov 2023 18:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698889045; x=1699493845; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M7+4SBqNUCdb83UyaUX4TiYteHeHosFCPYbW+VU+89Y=; b=sBOWiJ2GnrUePOmASQ6Xa3iFuugnWMczNPDwjwyqQWEgjE2Uveu1sKrGzbDFUDh2O9 xIWLI0m+HUONXIIlFDQKW89k9r2O8w0FX6TLkP5R+Xgw0z9U5jHkHRwSjmSMjOq5gbtU jwEWAYhR1WOZMbSUvfuPmF1lLglH3rzK6VJSSnL4uwimIOgSU7QZEKcu1Skiiny5QeSe rvPXXxpZN5ViRyOqFywkWb6oWOgvzJopqT6pnFIvg68uHvG53T0fDXgdZ0JJU32vydi8 J2epGxPuHu2MXjjRI7d6KIlHruY4KWNKT+0dYwRGJ7OkCftbN4051zDWSdDIX/Zixnr3 rYXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698889045; x=1699493845; 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=M7+4SBqNUCdb83UyaUX4TiYteHeHosFCPYbW+VU+89Y=; b=OSaIsyZlACIDpIiiF3VYDCSSNvWMVVq9pBboWDQhhz3H8dDp+rvDTnYWKudJFZbI9f pkDiVSYxWeFMKiR51Bwo4/iBr/mcr4vZhqjqIN5JVsVYgBLWY8V3eN+NIDqvHRSR2uy1 XzI/ZAz6CyqY/87jmTQkTuQOB05+KVxOyfwVxYI8pqdwzbEb0R6VhkLE3AvpB75AXl7z e60hI/cAPHH9zrml8vfedHrDQeh9rHKt4s15EHymP8038DCtZltLpqL1w2Jn8zxewJ25 OJvqs9xqaWW7ImLb5AaGhBz28Rm0/yQk/lyzIHuelbyulJm2QeI/1/B5R/Of7CD/BKI2 bTvA== X-Gm-Message-State: AOJu0Yzrsmyvo6PTZsEoZcxeV5q4WGLPUBHBWjqHLUsQ8AY7vtOMJoIx SCQTiItqdDByOXlHzs03IFde6i7I8Zb3kLWnxZY= X-Received: by 2002:a05:6a21:27a4:b0:170:3e5b:bccd with SMTP id rn36-20020a056a2127a400b001703e5bbccdmr14877986pzb.30.1698889045602; Wed, 01 Nov 2023 18:37:25 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v20-20020aa78514000000b006934e7ceb79sm1800230pfn.32.2023.11.01.18.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:37:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 80/88] target/hppa: Add unwind_breg to CPUHPPAState Date: Wed, 1 Nov 2023 18:30:08 -0700 Message-Id: <20231102013016.369010-81-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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 f7621590e4..27846f5ad8 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(); @@ -4455,7 +4465,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)