[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] i386/cpu_dump: support AVX512 ZMM regs dump
From: |
Robert Hoo |
Subject: |
[PATCH] i386/cpu_dump: support AVX512 ZMM regs dump |
Date: |
Mon, 22 Mar 2021 18:59:56 +0800 |
Since commit fa4518741e (target-i386: Rename struct XMMReg to ZMMReg),
CPUX86State.xmm_regs[] has already been extended to 512bit to support
AVX512.
Also, other qemu level supports for AVX512 registers are there for
years.
But in x86_cpu_dump_state(), still only dump XMM registers.
This patch is just to complement this part, let it dump ZMM of 512bits.
Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
---
target/i386/cpu-dump.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/target/i386/cpu-dump.c b/target/i386/cpu-dump.c
index aac21f1..789e774 100644
--- a/target/i386/cpu-dump.c
+++ b/target/i386/cpu-dump.c
@@ -499,17 +499,20 @@ void x86_cpu_dump_state(CPUState *cs, FILE *f, int flags)
else
qemu_fprintf(f, " ");
}
- if (env->hflags & HF_CS64_MASK)
- nb = 16;
- else
- nb = 8;
- for(i=0;i<nb;i++) {
- qemu_fprintf(f, "XMM%02d=%08x%08x%08x%08x",
+
+ nb = sizeof(env->xmm_regs) / sizeof(env->xmm_regs[0]);
+ for (i = 0; i < nb; i++) {
+ qemu_fprintf(f, "ZMM%02d=0x%016lx %016lx %016lx %016lx %016lx "
+ "%016lx %016lx %016lx",
i,
- env->xmm_regs[i].ZMM_L(3),
- env->xmm_regs[i].ZMM_L(2),
- env->xmm_regs[i].ZMM_L(1),
- env->xmm_regs[i].ZMM_L(0));
+ env->xmm_regs[i].ZMM_Q(7),
+ env->xmm_regs[i].ZMM_Q(6),
+ env->xmm_regs[i].ZMM_Q(5),
+ env->xmm_regs[i].ZMM_Q(4),
+ env->xmm_regs[i].ZMM_Q(3),
+ env->xmm_regs[i].ZMM_Q(2),
+ env->xmm_regs[i].ZMM_Q(1),
+ env->xmm_regs[i].ZMM_Q(0));
if ((i & 1) == 1)
qemu_fprintf(f, "\n");
else
--
1.8.3.1
- [PATCH] i386/cpu_dump: support AVX512 ZMM regs dump,
Robert Hoo <=