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 05/10] s390x: gdb updates for vector registers
Date: Thu, 28 May 2015 10:43:00 +0200 [thread overview]
Message-ID: <1432802585-10765-6-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>
gdb allows registers to be displayed/modified, and is being updated
to account for the new vector registers. Mirror these changes in
the gdb stub in qemu so that this can be performed when gdb is
attached to the qemu gdbserver.
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>
---
configure | 2 +-
target-s390x/gdbstub.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 9852aef..b707429 100755
--- a/configure
+++ b/configure
@@ -5292,7 +5292,7 @@ case "$target_name" in
echo "TARGET_ABI32=y" >> $config_target_mak
;;
s390x)
- gdb_xml_files="s390x-core64.xml s390-acr.xml s390-fpr.xml"
+ gdb_xml_files="s390x-core64.xml s390-acr.xml s390-fpr.xml s390-vx.xml"
;;
tricore)
;;
diff --git a/target-s390x/gdbstub.c b/target-s390x/gdbstub.c
index 40bdfe7..ddc14a6 100644
--- a/target-s390x/gdbstub.c
+++ b/target-s390x/gdbstub.c
@@ -131,6 +131,48 @@ static int cpu_write_fp_reg(CPUS390XState *env, uint8_t *mem_buf, int n)
}
}
+/* the values represent the positions in s390-vx.xml */
+#define S390_V0L_REGNUM 0
+#define S390_V15L_REGNUM 15
+#define S390_V16_REGNUM 16
+#define S390_V31_REGNUM 31
+/* total number of registers in s390-vx.xml */
+#define S390_NUM_VREGS 32
+
+static int cpu_read_vreg(CPUS390XState *env, uint8_t *mem_buf, int n)
+{
+ int ret;
+
+ switch (n) {
+ case S390_V0L_REGNUM ... S390_V15L_REGNUM:
+ ret = gdb_get_reg64(mem_buf, env->vregs[n][1].ll);
+ break;
+ case S390_V16_REGNUM ... S390_V31_REGNUM:
+ ret = gdb_get_reg64(mem_buf, env->vregs[n][0].ll);
+ ret += gdb_get_reg64(mem_buf + 8, env->vregs[n][1].ll);
+ break;
+ default:
+ ret = 0;
+ }
+
+ return ret;
+}
+
+static int cpu_write_vreg(CPUS390XState *env, uint8_t *mem_buf, int n)
+{
+ switch (n) {
+ case S390_V0L_REGNUM ... S390_V15L_REGNUM:
+ env->vregs[n][1].ll = ldtul_p(mem_buf + 8);
+ return 8;
+ case S390_V16_REGNUM ... S390_V31_REGNUM:
+ env->vregs[n][0].ll = ldtul_p(mem_buf);
+ env->vregs[n][1].ll = ldtul_p(mem_buf + 8);
+ return 16;
+ default:
+ return 0;
+ }
+}
+
void s390_cpu_gdb_init(CPUState *cs)
{
gdb_register_coprocessor(cs, cpu_read_ac_reg,
@@ -140,4 +182,8 @@ void s390_cpu_gdb_init(CPUState *cs)
gdb_register_coprocessor(cs, cpu_read_fp_reg,
cpu_write_fp_reg,
S390_NUM_FP_REGS, "s390-fpr.xml", 0);
+
+ gdb_register_coprocessor(cs, cpu_read_vreg,
+ cpu_write_vreg,
+ S390_NUM_VREGS, "s390-vx.xml", 0);
}
--
2.4.2
next prev 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 ` Cornelia Huck [this message]
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 ` [Qemu-devel] [PULL 08/10] s390x: Add vector registers to ELF dump Cornelia Huck
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-6-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).