qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: peter.maydell@linaro.org
Cc: Eric Farman <farman@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com,
	jfrei@linux.vnet.ibm.com,
	Cornelia Huck <cornelia.huck@de.ibm.com>
Subject: [Qemu-devel] [PULL 08/10] s390x: Add vector registers to ELF dump
Date: Thu, 28 May 2015 10:43:03 +0200	[thread overview]
Message-ID: <1432802585-10765-9-git-send-email-cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1432802585-10765-1-git-send-email-cornelia.huck@de.ibm.com>

From: Eric Farman <farman@linux.vnet.ibm.com>

Create ELF notes for the vector registers where applicable, so that
their contents can be examined by utilities such as crash or readelf.

Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 target-s390x/arch_dump.c | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/target-s390x/arch_dump.c b/target-s390x/arch_dump.c
index 36e8407..dab63eb 100644
--- a/target-s390x/arch_dump.c
+++ b/target-s390x/arch_dump.c
@@ -44,6 +44,18 @@ struct S390xElfFpregsetStruct {
 
 typedef struct S390xElfFpregsetStruct S390xElfFpregset;
 
+struct S390xElfVregsLoStruct {
+    uint64_t vregs[16];
+} QEMU_PACKED;
+
+typedef struct S390xElfVregsLoStruct S390xElfVregsLo;
+
+struct S390xElfVregsHiStruct {
+    uint64_t vregs[16][2];
+} QEMU_PACKED;
+
+typedef struct S390xElfVregsHiStruct S390xElfVregsHi;
+
 typedef struct noteStruct {
     Elf64_Nhdr hdr;
     char name[5];
@@ -51,6 +63,8 @@ typedef struct noteStruct {
     union {
         S390xElfPrstatus prstatus;
         S390xElfFpregset fpregset;
+        S390xElfVregsLo vregslo;
+        S390xElfVregsHi vregshi;
         uint32_t prefix;
         uint64_t timer;
         uint64_t todcmp;
@@ -87,6 +101,29 @@ static void s390x_write_elf64_fpregset(Note *note, S390CPU *cpu)
     }
 }
 
+static void s390x_write_elf64_vregslo(Note *note, S390CPU *cpu)
+{
+    int i;
+
+    note->hdr.n_type = cpu_to_be32(NT_S390_VXRS_LOW);
+    for (i = 0; i <= 15; i++) {
+        note->contents.vregslo.vregs[i] = cpu_to_be64(cpu->env.vregs[i][1].ll);
+    }
+}
+
+static void s390x_write_elf64_vregshi(Note *note, S390CPU *cpu)
+{
+    int i;
+    S390xElfVregsHi *temp_vregshi;
+
+    temp_vregshi = &note->contents.vregshi;
+
+    note->hdr.n_type = cpu_to_be32(NT_S390_VXRS_HIGH);
+    for (i = 0; i <= 15; i++) {
+        temp_vregshi->vregs[i][0] = cpu_to_be64(cpu->env.vregs[i + 16][0].ll);
+        temp_vregshi->vregs[i][1] = cpu_to_be64(cpu->env.vregs[i + 16][1].ll);
+    }
+}
 
 static void s390x_write_elf64_timer(Note *note, S390CPU *cpu)
 {
@@ -135,6 +172,8 @@ static const struct NoteFuncDescStruct {
     {sizeof(((Note *)0)->contents.timer),    s390x_write_elf64_timer},
     {sizeof(((Note *)0)->contents.todcmp),   s390x_write_elf64_todcmp},
     {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},
     { 0, NULL}
 };
 
-- 
2.4.2

  parent reply	other threads:[~2015-05-28  8:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28  8:42 [Qemu-devel] [PULL 00/10] s390x: SIMD support Cornelia Huck
2015-05-28  8:42 ` [Qemu-devel] [PULL 01/10] s390x: Common access to floating point registers Cornelia Huck
2015-05-28  8:42 ` [Qemu-devel] [PULL 02/10] s390x: Vector Register IOCTLs Cornelia Huck
2015-05-28  8:42 ` [Qemu-devel] [PULL 03/10] s390x: Store Additional Status SIGP order Cornelia Huck
2015-05-28  8:42 ` [Qemu-devel] [PULL 04/10] gdb-xml: Include XML for s390 vector registers Cornelia Huck
2015-05-28  8:43 ` [Qemu-devel] [PULL 05/10] s390x: gdb updates for " Cornelia Huck
2015-05-28  8:43 ` [Qemu-devel] [PULL 06/10] s390x: Add vector registers to HMP output Cornelia Huck
2015-05-28  8:43 ` [Qemu-devel] [PULL 07/10] linux/elf.h update Cornelia Huck
2015-05-28  8:43 ` Cornelia Huck [this message]
2015-05-28  8:43 ` [Qemu-devel] [PULL 09/10] s390x: Migrate vector registers Cornelia Huck
2015-05-28  8:43 ` [Qemu-devel] [PULL 10/10] s390x: Enable vector processing capability Cornelia Huck
2015-05-28 15:29 ` [Qemu-devel] [PULL 00/10] s390x: SIMD support Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1432802585-10765-9-git-send-email-cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=farman@linux.vnet.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).