[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 40/40] s390x/gdb: add gs registers
From: |
Christian Borntraeger |
Subject: |
[Qemu-devel] [PULL 40/40] s390x/gdb: add gs registers |
Date: |
Fri, 14 Jul 2017 12:41:07 +0200 |
Let's provide the guarded storage registers via gdb server.
Signed-off-by: Christian Borntraeger <address@hidden>
---
configure | 2 +-
gdb-xml/s390-gs.xml | 14 ++++++++++++++
target/s390x/gdbstub.c | 24 ++++++++++++++++++++++++
3 files changed, 39 insertions(+), 1 deletion(-)
create mode 100644 gdb-xml/s390-gs.xml
diff --git a/configure b/configure
index 902653a..8cc4afb 100755
--- a/configure
+++ b/configure
@@ -6231,7 +6231,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 s390-vx.xml
s390-cr.xml s390-virt.xml"
+ gdb_xml_files="s390x-core64.xml s390-acr.xml s390-fpr.xml s390-vx.xml
s390-cr.xml s390-virt.xml s390-gs.xml"
;;
tilegx)
;;
diff --git a/gdb-xml/s390-gs.xml b/gdb-xml/s390-gs.xml
new file mode 100644
index 0000000..0487d31
--- /dev/null
+++ b/gdb-xml/s390-gs.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!-- Copyright 2017 IBM Corp.
+
+ This work is licensed under the terms of the GNU GPL, version 2 or
+ (at your option) any later version. See the COPYING file in the
+ top-level directory. -->
+
+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
+<feature name="org.gnu.gdb.s390.gs">
+ <reg name="gs_reserved" bitsize="64" type="uint64" group="system"/>
+ <reg name="gsd" bitsize="64" type="uint64" group="system"/>
+ <reg name="gssm" bitsize="64" type="uint64" group="system"/>
+ <reg name="gsepla" bitsize="64" type="data_ptr" group="system"/>
+</feature>
diff --git a/target/s390x/gdbstub.c b/target/s390x/gdbstub.c
index 94ab74d..a7efafe 100644
--- a/target/s390x/gdbstub.c
+++ b/target/s390x/gdbstub.c
@@ -286,6 +286,26 @@ static int cpu_write_virt_reg(CPUS390XState *env, uint8_t
*mem_buf, int n)
}
#endif
+/* the values represent the positions in s390-gs.xml */
+#define S390_GS_RESERVED_REGNUM 0
+#define S390_GS_GSD_REGNUM 1
+#define S390_GS_GSSM_REGNUM 2
+#define S390_GS_GSEPLA_REGNUM 3
+/* total number of registers in s390-gs.xml */
+#define S390_NUM_GS_REGS 4
+
+static int cpu_read_gs_reg(CPUS390XState *env, uint8_t *mem_buf, int n)
+{
+ return gdb_get_regl(mem_buf, env->gscb[n]);
+}
+
+static int cpu_write_gs_reg(CPUS390XState *env, uint8_t *mem_buf, int n)
+{
+ env->gscb[n] = ldtul_p(mem_buf);
+ cpu_synchronize_post_init(ENV_GET_CPU(env));
+ return 8;
+}
+
void s390_cpu_gdb_init(CPUState *cs)
{
gdb_register_coprocessor(cs, cpu_read_ac_reg,
@@ -300,6 +320,10 @@ void s390_cpu_gdb_init(CPUState *cs)
cpu_write_vreg,
S390_NUM_VREGS, "s390-vx.xml", 0);
+ gdb_register_coprocessor(cs, cpu_read_gs_reg,
+ cpu_write_gs_reg,
+ S390_NUM_GS_REGS, "s390-gs.xml", 0);
+
#ifndef CONFIG_USER_ONLY
gdb_register_coprocessor(cs, cpu_read_c_reg,
cpu_write_c_reg,
--
2.7.4
- [Qemu-devel] [PULL 05/40] s390x/cpumodel: clean up spacing and comments, (continued)
- [Qemu-devel] [PULL 05/40] s390x/cpumodel: clean up spacing and comments, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 01/40] s390x/kvm: Rework cmma management, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 03/40] s390x/migration: Storage attributes device, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 17/40] s390x/css: use SubchDev.orb, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 18/40] pc-bios/s390-ccw: Move libc functions to separate header, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 20/40] pc-bios/s390-ccw: Move virtio-block related functions into a separate file, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 39/40] s390x/arch_dump: also dump guarded storage control block, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 35/40] s390x/cpumodel: we are always in zarchitecture mode, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 28/40] pc-bios/s390-ccw: Link libnet into the netboot image and do the TFTP load, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 38/40] s390x/kvm: enable guarded storage, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 40/40] s390x/gdb: add gs registers,
Christian Borntraeger <=
- [Qemu-devel] [PULL 27/40] pc-bios/s390-ccw: Add virtio-net driver code, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 26/40] pc-bios/s390-ccw: Add core files for the network bootloading program, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 25/40] roms/SLOF: Update submodule to latest status, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 22/40] pc-bios/s390-ccw: Move byteswap functions to a separate header, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 19/40] pc-bios/s390-ccw: Move ebc2asc to sclp.c, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 23/40] pc-bios/s390-ccw: Remove unused structs from virtio.h, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 36/40] s390x/cpumodel: add esop/esop2 to z12 model, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 06/40] s390x/cpumodel: provide compat handling for new cpu features, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 15/40] s390x/css: add ORB to SubchDev, Christian Borntraeger, 2017/07/14
- [Qemu-devel] [PULL 37/40] s390x/kvm: Enable KSS facility for nested virtualization, Christian Borntraeger, 2017/07/14