[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/7] s390x/arch_dump: also dump guarded storage cont
From: |
Christian Borntraeger |
Subject: |
[Qemu-devel] [PATCH 6/7] s390x/arch_dump: also dump guarded storage control block |
Date: |
Thu, 13 Jul 2017 18:03:08 +0200 |
Write the new note section of type 30b (guarded storage control block).
Signed-off-by: Christian Borntraeger <address@hidden>
---
include/elf.h | 1 +
target/s390x/arch_dump.c | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/include/elf.h b/include/elf.h
index 0dbd3e9..cd51434 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -1476,6 +1476,7 @@ typedef struct elf64_shdr {
#define NT_TASKSTRUCT 4
#define NT_AUXV 6
#define NT_PRXFPREG 0x46e62b7f /* copied from
gdb5.1/include/elf/common.h */
+#define NT_S390_GS_CB 0x30b /* s390 guarded storage registers */
#define NT_S390_VXRS_HIGH 0x30a /* s390 vector registers 16-31 */
#define NT_S390_VXRS_LOW 0x309 /* s390 vector registers 0-15 (lower
half) */
#define NT_S390_PREFIX 0x305 /* s390 prefix register */
diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c
index 105ae9a..96c9fb9 100644
--- a/target/s390x/arch_dump.c
+++ b/target/s390x/arch_dump.c
@@ -57,6 +57,12 @@ struct S390xElfVregsHiStruct {
typedef struct S390xElfVregsHiStruct S390xElfVregsHi;
+struct S390xElfGSCBStruct {
+ uint64_t gsregs[4];
+} QEMU_PACKED;
+
+typedef struct S390xElfGSCBStruct S390xElfGSCB;
+
typedef struct noteStruct {
Elf64_Nhdr hdr;
char name[8];
@@ -65,6 +71,7 @@ typedef struct noteStruct {
S390xElfFpregset fpregset;
S390xElfVregsLo vregslo;
S390xElfVregsHi vregshi;
+ S390xElfGSCB gscb;
uint32_t prefix;
uint64_t timer;
uint64_t todcmp;
@@ -126,6 +133,16 @@ static void s390x_write_elf64_vregshi(Note *note, S390CPU
*cpu, int id)
}
}
+static void s390x_write_elf64_gscb(Note *note, S390CPU *cpu, int id)
+{
+ int i;
+
+ note->hdr.n_type = cpu_to_be32(NT_S390_GS_CB);
+ for (i = 0; i < 4; i++) {
+ note->contents.gscb.gsregs[i] = cpu_to_be64(cpu->env.gscb[i]);
+ }
+}
+
static void s390x_write_elf64_timer(Note *note, S390CPU *cpu, int id)
{
note->hdr.n_type = cpu_to_be32(NT_S390_TIMER);
@@ -181,6 +198,7 @@ static const NoteFuncDesc note_linux[] = {
{sizeof(((Note *)0)->contents.todpreg), s390x_write_elf64_todpreg},
{sizeof(((Note *)0)->contents.vregslo), s390x_write_elf64_vregslo},
{sizeof(((Note *)0)->contents.vregshi), s390x_write_elf64_vregshi},
+ {sizeof(((Note *)0)->contents.gscb), s390x_write_elf64_gscb},
{ 0, NULL}
};
--
2.7.4
- [Qemu-devel] [PATCH 0/7] s390: remaining patches, Christian Borntraeger, 2017/07/13
- [Qemu-devel] [PATCH 7/7] s390x/gdb: add gs registers, Christian Borntraeger, 2017/07/13
- [Qemu-devel] [PATCH 6/7] s390x/arch_dump: also dump guarded storage control block,
Christian Borntraeger <=
- [Qemu-devel] [PATCH 4/7] s390x/kvm: Enable KSS facility for nested virtualization, Christian Borntraeger, 2017/07/13
- [Qemu-devel] [PATCH 1/7] s390x/cpumodel: wire up new hardware features, Christian Borntraeger, 2017/07/13
- [Qemu-devel] [PATCH 3/7] s390x/cpumodel: add esop/esop2 to z12 model, Christian Borntraeger, 2017/07/13
- [Qemu-devel] [PATCH 5/7] s390x/kvm: enable guarded storage, Christian Borntraeger, 2017/07/13