summaryrefslogtreecommitdiff
path: root/target/s390x/arch_dump.c
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2017-03-08 10:36:04 +0100
committerChristian Borntraeger <borntraeger@de.ibm.com>2017-07-14 12:29:49 +0200
commit21a106904b5336b6ea60c22a95feb7d61c664d7f (patch)
tree07250d11e81fb9ff0add72bd19b5fd7836e952d6 /target/s390x/arch_dump.c
parent62deb62d999cf9e2be61272c6b720104f764bd6a (diff)
downloadqemu-21a106904b5336b6ea60c22a95feb7d61c664d7f.tar.gz
s390x/arch_dump: also dump guarded storage control block
Write the new note section of type 30b (guarded storage control block). Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'target/s390x/arch_dump.c')
-rw-r--r--target/s390x/arch_dump.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c
index 105ae9a5d8..96c9fb97cb 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}
};