qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org,
	Richard Henderson <richard.henderson@linaro.org>,
	Peter Maydell <peter.maydell@linaro.org>
Subject: [Qemu-devel] [PATCH 10/97] target/arm: Dump SVE state if enabled
Date: Mon,  1 Apr 2019 15:58:44 -0500	[thread overview]
Message-ID: <20190401210011.16009-11-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <20190401210011.16009-1-mdroth@linux.vnet.ibm.com>

From: Richard Henderson <richard.henderson@linaro.org>

Also fold the FPCR/FPSR state onto the same line as PSTATE,
and mention but do not dump disabled FPU state.

Cc: qemu-stable@nongnu.org (3.0.1)
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 2bf5f3f91bb4e3faa2a19aec042138a938afbf6a)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 target/arm/translate-a64.c | 93 +++++++++++++++++++++++++++++++++-----
 1 file changed, 82 insertions(+), 11 deletions(-)

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 358f169c75..b29dc49c4f 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -152,8 +152,7 @@ void aarch64_cpu_dump_state(CPUState *cs, FILE *f,
     } else {
         ns_status = "";
     }
-
-    cpu_fprintf(f, "\nPSTATE=%08x %c%c%c%c %sEL%d%c\n",
+    cpu_fprintf(f, "PSTATE=%08x %c%c%c%c %sEL%d%c",
                 psr,
                 psr & PSTATE_N ? 'N' : '-',
                 psr & PSTATE_Z ? 'Z' : '-',
@@ -163,17 +162,89 @@ void aarch64_cpu_dump_state(CPUState *cs, FILE *f,
                 el,
                 psr & PSTATE_SP ? 'h' : 't');
 
-    if (flags & CPU_DUMP_FPU) {
-        int numvfpregs = 32;
-        for (i = 0; i < numvfpregs; i++) {
+    if (!(flags & CPU_DUMP_FPU)) {
+        cpu_fprintf(f, "\n");
+        return;
+    }
+    cpu_fprintf(f, "     FPCR=%08x FPSR=%08x\n",
+                vfp_get_fpcr(env), vfp_get_fpsr(env));
+
+    if (arm_feature(env, ARM_FEATURE_SVE)) {
+        int j, zcr_len = env->vfp.zcr_el[1] & 0xf; /* fix for system mode */
+
+        for (i = 0; i <= FFR_PRED_NUM; i++) {
+            bool eol;
+            if (i == FFR_PRED_NUM) {
+                cpu_fprintf(f, "FFR=");
+                /* It's last, so end the line.  */
+                eol = true;
+            } else {
+                cpu_fprintf(f, "P%02d=", i);
+                switch (zcr_len) {
+                case 0:
+                    eol = i % 8 == 7;
+                    break;
+                case 1:
+                    eol = i % 6 == 5;
+                    break;
+                case 2:
+                case 3:
+                    eol = i % 3 == 2;
+                    break;
+                default:
+                    /* More than one quadword per predicate.  */
+                    eol = true;
+                    break;
+                }
+            }
+            for (j = zcr_len / 4; j >= 0; j--) {
+                int digits;
+                if (j * 4 + 4 <= zcr_len + 1) {
+                    digits = 16;
+                } else {
+                    digits = (zcr_len % 4 + 1) * 4;
+                }
+                cpu_fprintf(f, "%0*" PRIx64 "%s", digits,
+                            env->vfp.pregs[i].p[j],
+                            j ? ":" : eol ? "\n" : " ");
+            }
+        }
+
+        for (i = 0; i < 32; i++) {
+            if (zcr_len == 0) {
+                cpu_fprintf(f, "Z%02d=%016" PRIx64 ":%016" PRIx64 "%s",
+                            i, env->vfp.zregs[i].d[1],
+                            env->vfp.zregs[i].d[0], i & 1 ? "\n" : " ");
+            } else if (zcr_len == 1) {
+                cpu_fprintf(f, "Z%02d=%016" PRIx64 ":%016" PRIx64
+                            ":%016" PRIx64 ":%016" PRIx64 "\n",
+                            i, env->vfp.zregs[i].d[3], env->vfp.zregs[i].d[2],
+                            env->vfp.zregs[i].d[1], env->vfp.zregs[i].d[0]);
+            } else {
+                for (j = zcr_len; j >= 0; j--) {
+                    bool odd = (zcr_len - j) % 2 != 0;
+                    if (j == zcr_len) {
+                        cpu_fprintf(f, "Z%02d[%x-%x]=", i, j, j - 1);
+                    } else if (!odd) {
+                        if (j > 0) {
+                            cpu_fprintf(f, "   [%x-%x]=", j, j - 1);
+                        } else {
+                            cpu_fprintf(f, "     [%x]=", j);
+                        }
+                    }
+                    cpu_fprintf(f, "%016" PRIx64 ":%016" PRIx64 "%s",
+                                env->vfp.zregs[i].d[j * 2 + 1],
+                                env->vfp.zregs[i].d[j * 2],
+                                odd || j == 0 ? "\n" : ":");
+                }
+            }
+        }
+    } else {
+        for (i = 0; i < 32; i++) {
             uint64_t *q = aa64_vfp_qreg(env, i);
-            uint64_t vlo = q[0];
-            uint64_t vhi = q[1];
-            cpu_fprintf(f, "q%02d=%016" PRIx64 ":%016" PRIx64 "%c",
-                        i, vhi, vlo, (i & 1 ? '\n' : ' '));
+            cpu_fprintf(f, "Q%02d=%016" PRIx64 ":%016" PRIx64 "%s",
+                        i, q[1], q[0], (i & 1 ? "\n" : " "));
         }
-        cpu_fprintf(f, "FPCR: %08x  FPSR: %08x\n",
-                    vfp_get_fpcr(env), vfp_get_fpsr(env));
     }
 }
 
-- 
2.17.1

  parent reply	other threads:[~2019-04-01 21:01 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01 20:58 [Qemu-devel] [PATCH 00/97] Patch Round-up for stable 3.0.1, freeze on 2019-04-08 Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 01/97] target/arm: Fix sign of sve_cmpeq_ppzw/sve_cmpne_ppzw Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 02/97] target/arm: Fix typo in do_sat_addsub_64 Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 03/97] target/arm: Reorganize SVE WHILE Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 04/97] target/arm: Fix typo in helper_sve_movz_d Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 05/97] target/arm: Fix typo in helper_sve_ld1hss_r Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 06/97] target/arm: Fix sign-extension in sve do_ldr/do_str Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 07/97] target/arm: Fix offset for LD1R instructions Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 08/97] target/arm: Fix offset scaling for LD_zprr and ST_zprr Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 09/97] target/arm: Reformat integer register dump Michael Roth
2019-04-01 20:58 ` Michael Roth [this message]
2019-04-01 20:58 ` [Qemu-devel] [PATCH 11/97] target/arm: Add sve-max-vq cpu property to -cpu max Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 12/97] spapr_cpu_core: vmstate_[un]register per-CPU data from (un)realizefn Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 13/97] target/arm: Adjust FPCR_MASK for FZ16 Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 14/97] target/arm: Ignore float_flag_input_denormal from fp_status_f16 Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 15/97] target/arm: Use fp_status_fp16 for do_fmpa_zpzzz_h Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 16/97] target/arm: Use FZ not FZ16 for SVE FCVT single-half and double-half Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 17/97] block/qapi: Fix memory leak in qmp_query_blockstats() Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 18/97] mirror: Fail gracefully for source == target Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 19/97] qemu-img: fix regression copying secrets during convert Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 20/97] nvme: Fix nvme_init error handling Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 21/97] aio-posix: Don't count ctx->notifier as progress when polling Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 22/97] aio: Do aio_notify_accept only during blocking aio_poll Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 23/97] monitor: fix oob command leak Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 24/97] vnc: fix memleak of the "vnc-worker-output" name Michael Roth
2019-04-01 20:58 ` [Qemu-devel] [PATCH 25/97] i386: Disable TOPOEXT by default on "-cpu host" Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 26/97] block: for jobs, do not clear user_paused until after the resume Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 27/97] block: iotest to catch abort on forced blockjob cancel Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 28/97] virtio: update MemoryRegionCaches when guest negotiates features Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 29/97] target/xtensa: fix FPU2000 bugs Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 30/97] kvm: add call to qemu_add_opts() for -overcommit option Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 31/97] slirp: Add sanity check for str option length Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 32/97] vhost: fix invalid downcast Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 33/97] pc: acpi: revert back to 1 SRAT entry for hotpluggable area Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 34/97] tests: update acpi expected files Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 35/97] block: Fix use after free error in bdrv_open_inherit() Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 36/97] job: Fix nested aio_poll() hanging in job_txn_apply Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 37/97] target/xtensa: fix s32c1i TCGMemOp flags Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 38/97] nbd/server: fix bitmap export Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 39/97] clean up callback when del virtqueue Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 40/97] block/rbd: pull out qemu_rbd_convert_options Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 41/97] block/rbd: Attempt to parse legacy filenames Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 42/97] block/rbd: add iotest for rbd legacy keyvalue filename parsing Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 43/97] block/rbd: add deprecation documentation for filename keyvalue pairs Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 44/97] target/arm: Fix cpu_get_tb_cpu_state() for non-SVE CPUs Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 45/97] ne2000: fix possible out of bound access in ne2000_receive Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 46/97] rtl8139: fix possible out of bound access Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 47/97] pcnet: fix possible buffer overflow Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 48/97] net: ignore packet size greater than INT_MAX Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 49/97] virt: Suppress external aborts on virt-2.10 and earlier Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 50/97] virtio: do not take address of packed members Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 51/97] block-backend: Set werror/rerror defaults in blk_new() Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 52/97] target/arm: Correct condition for v8M callee stack push Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 53/97] nbd/server: fix NBD_CMD_CACHE Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 54/97] intel_iommu: introduce vtd_reset_caches() Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 55/97] intel_iommu: better handling of dmar state switch Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 56/97] nbd: fix NBD_FLAG_SEND_CACHE value Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 57/97] migration: Stop postcopy fault thread before notifying Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 58/97] vhost-scsi: prevent using uninitialized vqs Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 59/97] target/xtensa: drop num_[core_]regs from dc232b/dc233c configs Michael Roth
2019-04-01 21:19   ` Max Filippov
2019-04-01 23:28     ` Michael Roth
2019-04-01 23:42       ` Max Filippov
2019-04-01 20:59 ` [Qemu-devel] [PATCH 60/97] make-release: add skiboot .version file Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 61/97] net: drop too large packet early Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 62/97] fdc: fix segfault in fdctrl_stop_transfer() when DMA is disabled Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 63/97] qemu-img: Fix typo Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 64/97] qemu-img: Fix leak Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 65/97] fmops: fix off-by-one in AR_TABLE and DR_TABLE array size Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 66/97] vfio-helpers: Fix qemu_vfio_open_pci() crash Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 67/97] i2c: Move typedef of bitbang_i2c_interface to i2c.h Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 68/97] i2c: Add a length check to the SMBus write handling Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 69/97] nbd/server: Advertise all contexts in response to bare LIST Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 70/97] nbd/client: Make x-dirty-bitmap more reliable Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 71/97] nbd/client: Send NBD_CMD_DISC if open fails after connect Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 72/97] mirror: fix dead-lock Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 73/97] iotests: simple mirror test with kvm on 1G image Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 74/97] iotests: make 235 work on s390 (and others) Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 75/97] Changes requirement for "vsubsbs" instruction Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 76/97] pcie: set link state inactive/active after hot unplug/plug Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 77/97] pc:piix4: Update smbus I/O space after a migration Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 78/97] hw/s390x: Fix bad mask in time2tod() Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 79/97] linux-user: write(fd, NULL, 0) parity with linux's treatment of same Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 80/97] linux-user: make pwrite64/pread64(fd, NULL, 0, offset) return 0 Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 81/97] s390x: Return specification exception for unimplemented diag 308 subcodes Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 82/97] exec.c: Don't reallocate IOMMUNotifiers that are in use Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 83/97] tpm: Zero-init structure to avoid uninitialized variables in valgrind log Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 84/97] tpm: use loop iterator to set sts data field Michael Roth
2019-04-01 20:59 ` [Qemu-devel] [PATCH 85/97] tpm: Make sure new locality passed to tpm_tis_prep_abort() is valid Michael Roth
2019-04-01 21:00 ` [Qemu-devel] [PATCH 86/97] tpm: Make sure the locality received from backend " Michael Roth
2019-04-01 21:00 ` [Qemu-devel] [PATCH 87/97] block: Fix invalidate_cache error path for parent activation Michael Roth
2019-04-01 21:00 ` [Qemu-devel] [PATCH 88/97] acpi: Make TPM 2.0 with TIS available as MSFT0101 Michael Roth
2019-04-01 21:00 ` [Qemu-devel] [PATCH 89/97] hw/rdma: another clang compilation fix Michael Roth
2019-04-01 21:00 ` [Qemu-devel] [PATCH 90/97] slirp: check sscanf result when emulating ident Michael Roth
2019-04-01 21:00 ` [Qemu-devel] [PATCH 91/97] tpm_tis: fix loop that cancels any seizure by a lower locality Michael Roth
2019-04-01 21:00 ` [Qemu-devel] [PATCH 92/97] bitmap: Update count after a merge Michael Roth
2019-04-01 21:00 ` [Qemu-devel] [PATCH 93/97] qga: update docs with systemd suspend support info Michael Roth
2019-04-01 21:00 ` [Qemu-devel] [PATCH 94/97] nvme: fix out-of-bounds access to the CMB Michael Roth
2019-04-01 21:00 ` [Qemu-devel] [PATCH 95/97] 9p: fix QEMU crash when renaming files Michael Roth
2019-04-01 21:00 ` [Qemu-devel] [PATCH 96/97] usb-mtp: outlaw slashes in filenames Michael Roth
2019-04-01 21:00 ` [Qemu-devel] [PATCH 97/97] usb-mtp: use O_NOFOLLOW and O_CLOEXEC Michael Roth
2019-04-02 16:22 ` [Qemu-devel] [Qemu-stable] [PATCH 00/97] Patch Round-up for stable 3.0.1, freeze on 2019-04-08 Cole Robinson
2019-04-04 21:28   ` Michael Roth
2019-04-04 22:31 ` [Qemu-devel] " Philippe Mathieu-Daudé
2019-04-04 22:31   ` Philippe Mathieu-Daudé
2019-04-05 20:28   ` Michael Roth
2019-04-05 20:28     ` Michael Roth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190401210011.16009-11-mdroth@linux.vnet.ibm.com \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).