From patchwork Tue Nov 7 03:03:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 741828 Delivered-To: patch@linaro.org Received: by 2002:adf:fd90:0:b0:32d:baff:b0ca with SMTP id d16csp1421656wrr; Mon, 6 Nov 2023 19:13:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxev/IkgSvBxsGayD2BEo9PvZJz3gr3yfORb1IIRhXRUmLr4hPQuwEx1T7XducrOe7KM+1 X-Received: by 2002:a05:620a:4085:b0:778:a0f6:24b2 with SMTP id f5-20020a05620a408500b00778a0f624b2mr35298083qko.68.1699326835317; Mon, 06 Nov 2023 19:13:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699326835; cv=none; d=google.com; s=arc-20160816; b=REHM2L2lpkMgILimllrmBzvYDM19UglJqw2KOQq6pfm83LMazdtJnWDY1yPPe2ehU5 MTndbKaSHySrN2XYaT/08ay1rLzLOzdS4Xl7L5/nGqci+pAvt65LbZFj+NNmRnj9oa62 y1jj6ig9QOzAncvhUCweIW6mpsg3QvgNWgI5HF6yqPJs7mpnhjExM9AI/TB561XHkVgM jaw2E2oaR2kC1grmFuq09szk/3gjZsC8EbSF/OBeVcBFN75wWkMKzCN7BpSjBNioyCbL ttsj+2XNAmVGWmsttPKz7vdG9ZGEv5Ui58qPSZ9kfPczTPlVIz55LoUlXMl6JZ9ILz4O qb9A== 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=bwAWQA8/GuVM2/E4PyfEdsUUm5Pmb1ysDSj4ZwY6m/s=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=frmZ49sdvuSZfsAuwFfdDn7q3ekGT3lu5UfYA69XKCE839lj1JMCAgRoDPom8WXCSC utH7POlGBaNfTUSCNhcvA2kBaSbOUmD8Xu03TGi4oxf+2GLV4JdtP/QcXJCzn5BYBoG6 9dCJpLKtxWFW06uKp55HXlAaa6olu81/8kfX+t3O/Udm700dFW3xj9PLuTSv2OgTEQ1b FHZw/tDEvfKLJsES4H5jVHyT1zw6z6T78ju236VDyBKm3sVyr/aq9GdhcDJpDCACYbFs aS/xtHx2YllOhQGVgsZfh3cN6LxpkKAt2jkpPcCo1/THbBQ43mUl6eo7K4SNWOXlapO8 2K+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="xjl/alRt"; 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 d20-20020a05620a241400b007789724e9ecsi6625226qkn.597.2023.11.06.19.13.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2023 19:13:55 -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="xjl/alRt"; 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 1r0CPK-0000FX-Jr; Mon, 06 Nov 2023 22:05:38 -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 1r0COW-00077q-R5 for qemu-devel@nongnu.org; Mon, 06 Nov 2023 22:04:52 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0COL-0000gJ-6N for qemu-devel@nongnu.org; Mon, 06 Nov 2023 22:04:48 -0500 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1cc9784dbc1so30248955ad.2 for ; Mon, 06 Nov 2023 19:04:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699326266; x=1699931066; 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=bwAWQA8/GuVM2/E4PyfEdsUUm5Pmb1ysDSj4ZwY6m/s=; b=xjl/alRtLO5lCjOVpUNQ8OuTiUZI5VCGOUh6cDkAZyL/1KYIxE9xiYrShNQ8ULNxL2 5Vhyychcth0MxJ0S1wKpZKBAwt4LXEznieOc+Zke2/8b6sEdDWi0uIqrVSuyA89IRL13 fSRCu9IyO8xRDCDBT7U88Bxs0owueOCTaDEEEc0VyzRMmZESQAyMLWN3stAWMYsXgOrR UsTG+LczvcusI4WREpRRmE68mitSsacpBcitfeGE2R9RoGDsSVQad0bIPQqsKov/cwdl UIE//IUdnZAuav1J7F1qjEqZXIMT/jZ4l7Ea8uRT1bGSjiieaCOo2Qq7QxZKjixzE43B OPLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699326266; x=1699931066; 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=bwAWQA8/GuVM2/E4PyfEdsUUm5Pmb1ysDSj4ZwY6m/s=; b=ZIl9AZdUwQEKXe/VbROwamzqFcdhuLeo9vYrpDpzfgmJMdfOuol7wEgcVdjq0tCouq tmaylJEIIwttetYl3BSYpOq01QqRVfQUSx9op11cE/PYQ97Z4Ypn3td6GXxErundEzFQ 2X8QAG57tMheN5ilVHXhp3YZa/jgKeWlEWEY/kWhaNfWNL9C8NCUTzd5WZ7SR2XQE7+x lyV6ekfyQcSJqHTMDeJ/B7eC8y0RgZViYUFjVooWl8yjEOZkCtEwS1DJ/PUAwuCp10Qs wI2lCrenrI62beCKKd8eBaPYDbrUMvMyN8xvA1ZQXfNAKLjgOAvBXPJjjoBvR9A7skTM ZwAg== X-Gm-Message-State: AOJu0YwVjl7jYbiwj1zycLutaNvw9XvZP2guDzRgXWf+w8rAaRejxQmm 8ML7FMGNRXb+7p0GNcshY1KahWZKGDfUttA8rt4= X-Received: by 2002:a17:902:c951:b0:1cc:70dd:62c3 with SMTP id i17-20020a170902c95100b001cc70dd62c3mr17744951pla.30.1699326265815; Mon, 06 Nov 2023 19:04:25 -0800 (PST) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id u9-20020a17090282c900b001c72d5e16acsm6518012plz.57.2023.11.06.19.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 19:04:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 23/85] target/hppa: Adjust hppa_cpu_dump_state for hppa64 Date: Mon, 6 Nov 2023 19:03:05 -0800 Message-Id: <20231107030407.8979-24-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::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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 Dump all 64 bits for pa2.0 and low 32 bits for pa1.x. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/hppa/helper.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/target/hppa/helper.c b/target/hppa/helper.c index fa17fe6931..c973b65bea 100644 --- a/target/hppa/helper.c +++ b/target/hppa/helper.c @@ -111,18 +111,26 @@ void cpu_hppa_put_psw(CPUHPPAState *env, target_ureg psw) void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) { - HPPACPU *cpu = HPPA_CPU(cs); - CPUHPPAState *env = &cpu->env; + CPUHPPAState *env = cpu_env(cs); target_ureg psw = cpu_hppa_get_psw(env); target_ureg psw_cb; char psw_c[20]; - int i; + int i, w; + uint64_t m; + + if (hppa_is_pa20(env)) { + w = 16; + m = UINT64_MAX; + } else { + w = 8; + m = UINT32_MAX; + } qemu_fprintf(f, "IA_F " TARGET_FMT_lx " IA_B " TARGET_FMT_lx - " IIR " TREG_FMT_lx "\n", + " IIR %0*" PRIx64 "\n", hppa_form_gva_psw(psw, env->iasq_f, env->iaoq_f), hppa_form_gva_psw(psw, env->iasq_b, env->iaoq_b), - env->cr[CR_IIR]); + w, m & env->cr[CR_IIR]); psw_c[0] = (psw & PSW_W ? 'W' : '-'); psw_c[1] = (psw & PSW_E ? 'E' : '-'); @@ -143,13 +151,15 @@ void hppa_cpu_dump_state(CPUState *cs, FILE *f, int flags) psw_c[16] = (psw & PSW_D ? 'D' : '-'); psw_c[17] = (psw & PSW_I ? 'I' : '-'); psw_c[18] = '\0'; - psw_cb = ((env->psw_cb >> 4) & 0x01111111) | (env->psw_cb_msb << 28); + psw_cb = ((env->psw_cb >> 4) & ((target_ureg)-1 / 0xf)) + | (env->psw_cb_msb << (TARGET_REGISTER_BITS - 4)); - qemu_fprintf(f, "PSW " TREG_FMT_lx " CB " TREG_FMT_lx " %s\n", - psw, psw_cb, psw_c); + qemu_fprintf(f, "PSW %0*" PRIx64 " CB %0*" PRIx64 " %s\n", + w, m & psw, w, m & psw_cb, psw_c); for (i = 0; i < 32; i++) { - qemu_fprintf(f, "GR%02d " TREG_FMT_lx "%c", i, env->gr[i], + qemu_fprintf(f, "GR%02d %0*" PRIx64 "%c", + i, w, m & env->gr[i], (i & 3) == 3 ? '\n' : ' '); } #ifndef CONFIG_USER_ONLY