aboutsummaryrefslogtreecommitdiff
path: root/target/i386/arch_dump.c
diff options
context:
space:
mode:
authorViktor Prutyanov <viktor.prutyanov@virtuozzo.com>2018-07-14 15:30:00 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2018-07-16 16:13:34 +0200
commit46fac17dca19e52506e05530ad3bd01f6d5722e3 (patch)
treed45820f850b9355bc6009751711b594afcc6adb0 /target/i386/arch_dump.c
parent9277d81f5c2c6f4d0b5e47c8476eb7ee7e5c0beb (diff)
dump: add kernel_gs_base to QEMU CPU state
This patch adds field with content of KERNEL_GS_BASE MSR to QEMU note in ELF dump. On Windows, if all vCPUs are running usermode tasks at the time the dump is created, this can be helpful in the discovery of guest system structures during conversion ELF dump to MEMORY.DMP dump. Signed-off-by: Viktor Prutyanov <viktor.prutyanov@virtuozzo.com> Message-Id: <20180714123000.11326-1-viktor.prutyanov@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target/i386/arch_dump.c')
-rw-r--r--target/i386/arch_dump.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c
index 35b55fc200..004141fc04 100644
--- a/target/i386/arch_dump.c
+++ b/target/i386/arch_dump.c
@@ -258,6 +258,12 @@ struct QEMUCPUState {
QEMUCPUSegment cs, ds, es, fs, gs, ss;
QEMUCPUSegment ldt, tr, gdt, idt;
uint64_t cr[5];
+ /*
+ * Fields below are optional and are being added at the end without
+ * changing the version. External tools may identify their presence
+ * by checking 'size' field.
+ */
+ uint64_t kernel_gs_base;
};
typedef struct QEMUCPUState QEMUCPUState;
@@ -315,6 +321,10 @@ static void qemu_get_cpustate(QEMUCPUState *s, CPUX86State *env)
s->cr[2] = env->cr[2];
s->cr[3] = env->cr[3];
s->cr[4] = env->cr[4];
+
+#ifdef TARGET_X86_64
+ s->kernel_gs_base = env->kernelgsbase;
+#endif
}
static inline int cpu_write_qemu_note(WriteCoreDumpFunction f,