[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/12] s390x/arch_dump: pass cpuid into notes sectio
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PATCH 12/12] s390x/arch_dump: pass cpuid into notes sections |
Date: |
Mon, 20 Feb 2017 10:57:34 +0100 |
From: Christian Borntraeger <address@hidden>
we need to pass the cpuid into the pid field of the notes
section, otherwise the notes for different CPUs all have 0:
e.g. objdump -h shows:
old:
5 .reg-s390-prefix/0 00000004 0000000000000000 0000000000000000
6 .reg-s390-prefix 00000004 0000000000000000 0000000000000000
21 .reg-s390-prefix/0 00000004 0000000000000000 0000000000000000
new:
5 .reg-s390-prefix/1 00000004 0000000000000000 0000000000000000
6 .reg-s390-prefix 00000004 0000000000000000 0000000000000000
21 .reg-s390-prefix/2 00000004 0000000000000000 0000000000000000
Reported-by: Philipp Rudo <address@hidden>
Signed-off-by: Christian Borntraeger <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
target/s390x/arch_dump.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c
index 887cae947e..105ae9a5d8 100644
--- a/target/s390x/arch_dump.c
+++ b/target/s390x/arch_dump.c
@@ -73,7 +73,7 @@ typedef struct noteStruct {
} contents;
} QEMU_PACKED Note;
-static void s390x_write_elf64_prstatus(Note *note, S390CPU *cpu)
+static void s390x_write_elf64_prstatus(Note *note, S390CPU *cpu, int id)
{
int i;
S390xUserRegs *regs;
@@ -87,9 +87,10 @@ static void s390x_write_elf64_prstatus(Note *note, S390CPU
*cpu)
regs->acrs[i] = cpu_to_be32(cpu->env.aregs[i]);
regs->gprs[i] = cpu_to_be64(cpu->env.regs[i]);
}
+ note->contents.prstatus.pid = id;
}
-static void s390x_write_elf64_fpregset(Note *note, S390CPU *cpu)
+static void s390x_write_elf64_fpregset(Note *note, S390CPU *cpu, int id)
{
int i;
CPUS390XState *cs = &cpu->env;
@@ -101,7 +102,7 @@ static void s390x_write_elf64_fpregset(Note *note, S390CPU
*cpu)
}
}
-static void s390x_write_elf64_vregslo(Note *note, S390CPU *cpu)
+static void s390x_write_elf64_vregslo(Note *note, S390CPU *cpu, int id)
{
int i;
@@ -111,7 +112,7 @@ static void s390x_write_elf64_vregslo(Note *note, S390CPU
*cpu)
}
}
-static void s390x_write_elf64_vregshi(Note *note, S390CPU *cpu)
+static void s390x_write_elf64_vregshi(Note *note, S390CPU *cpu, int id)
{
int i;
S390xElfVregsHi *temp_vregshi;
@@ -125,25 +126,25 @@ static void s390x_write_elf64_vregshi(Note *note, S390CPU
*cpu)
}
}
-static void s390x_write_elf64_timer(Note *note, S390CPU *cpu)
+static void s390x_write_elf64_timer(Note *note, S390CPU *cpu, int id)
{
note->hdr.n_type = cpu_to_be32(NT_S390_TIMER);
note->contents.timer = cpu_to_be64((uint64_t)(cpu->env.cputm));
}
-static void s390x_write_elf64_todcmp(Note *note, S390CPU *cpu)
+static void s390x_write_elf64_todcmp(Note *note, S390CPU *cpu, int id)
{
note->hdr.n_type = cpu_to_be32(NT_S390_TODCMP);
note->contents.todcmp = cpu_to_be64((uint64_t)(cpu->env.ckc));
}
-static void s390x_write_elf64_todpreg(Note *note, S390CPU *cpu)
+static void s390x_write_elf64_todpreg(Note *note, S390CPU *cpu, int id)
{
note->hdr.n_type = cpu_to_be32(NT_S390_TODPREG);
note->contents.todpreg = cpu_to_be32((uint32_t)(cpu->env.todpr));
}
-static void s390x_write_elf64_ctrs(Note *note, S390CPU *cpu)
+static void s390x_write_elf64_ctrs(Note *note, S390CPU *cpu, int id)
{
int i;
@@ -154,7 +155,7 @@ static void s390x_write_elf64_ctrs(Note *note, S390CPU *cpu)
}
}
-static void s390x_write_elf64_prefix(Note *note, S390CPU *cpu)
+static void s390x_write_elf64_prefix(Note *note, S390CPU *cpu, int id)
{
note->hdr.n_type = cpu_to_be32(NT_S390_PREFIX);
note->contents.prefix = cpu_to_be32((uint32_t)(cpu->env.psa));
@@ -163,7 +164,7 @@ static void s390x_write_elf64_prefix(Note *note, S390CPU
*cpu)
typedef struct NoteFuncDescStruct {
int contents_size;
- void (*note_contents_func)(Note *note, S390CPU *cpu);
+ void (*note_contents_func)(Note *note, S390CPU *cpu, int id);
} NoteFuncDesc;
static const NoteFuncDesc note_core[] = {
@@ -199,7 +200,7 @@ static int s390x_write_elf64_notes(const char *note_name,
note.hdr.n_namesz = cpu_to_be32(strlen(note_name) + 1);
note.hdr.n_descsz = cpu_to_be32(nf->contents_size);
strncpy(note.name, note_name, sizeof(note.name));
- (*nf->note_contents_func)(¬e, cpu);
+ (*nf->note_contents_func)(¬e, cpu, id);
note_size = sizeof(note) - sizeof(note.contents) + nf->contents_size;
ret = f(¬e, note_size, opaque);
--
2.11.0
- [Qemu-devel] [PATCH 02/12] s390x/kvm: detect some program check loops, (continued)
- [Qemu-devel] [PATCH 02/12] s390x/kvm: detect some program check loops, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 01/12] s390x/s390-virtio: get rid of DPRINTF, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 05/12] virtio-ccw: add virtio-crypto-ccw device, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 03/12] s390x/flic: fail migration on source already, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 08/12] virtio-ccw: check flic->adapter_routes_max_batch, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 07/12] s390x: add property adapter_routes_max_batch, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 06/12] virtio-ccw: Check the number of vqs in CCW_CMD_SET_IND, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 04/12] virtio-ccw: handle virtio 1 only devices, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 09/12] s390x: bump ADAPTER_ROUTES_MAX_GSI, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 11/12] s390x/arch_dump: use proper note name and note size, Cornelia Huck, 2017/02/20
- [Qemu-devel] [PATCH 12/12] s390x/arch_dump: pass cpuid into notes sections,
Cornelia Huck <=
- [Qemu-devel] [PATCH 10/12] virtio-ccw: support VIRTIO_QUEUE_MAX virtqueues, Cornelia Huck, 2017/02/20