* [Qemu-devel] [PATCH] target-ppc: gdbstub: Add VSX support
@ 2015-03-24 8:59 Anton Blanchard
2015-03-24 9:05 ` Alexander Graf
0 siblings, 1 reply; 4+ messages in thread
From: Anton Blanchard @ 2015-03-24 8:59 UTC (permalink / raw)
To: agraf, qemu-devel, qemu-ppc
Add the XML and functions to get and set VSX registers.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
configure | 6 +++---
gdb-xml/power-vsx.xml | 44 ++++++++++++++++++++++++++++++++++++++++++++
target-ppc/translate_init.c | 22 ++++++++++++++++++++++
3 files changed, 69 insertions(+), 3 deletions(-)
create mode 100644 gdb-xml/power-vsx.xml
diff --git a/configure b/configure
index 589798e..235b3d2 100755
--- a/configure
+++ b/configure
@@ -5182,20 +5182,20 @@ case "$target_name" in
ppc64)
TARGET_BASE_ARCH=ppc
TARGET_ABI_DIR=ppc
- gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
+ gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml"
;;
ppc64le)
TARGET_ARCH=ppc64
TARGET_BASE_ARCH=ppc
TARGET_ABI_DIR=ppc
- gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
+ gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml"
;;
ppc64abi32)
TARGET_ARCH=ppc64
TARGET_BASE_ARCH=ppc
TARGET_ABI_DIR=ppc
echo "TARGET_ABI32=y" >> $config_target_mak
- gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml"
+ gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml"
;;
sh4|sh4eb)
TARGET_ARCH=sh4
diff --git a/gdb-xml/power-vsx.xml b/gdb-xml/power-vsx.xml
new file mode 100644
index 0000000..fd290e9
--- /dev/null
+++ b/gdb-xml/power-vsx.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<!-- Copyright (C) 2008-2015 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved. -->
+
+<!-- POWER7 VSX registers that do not overlap existing FP and VMX
+ registers. -->
+<!DOCTYPE feature SYSTEM "gdb-target.dtd">
+<feature name="org.gnu.gdb.power.vsx">
+ <reg name="vs0h" bitsize="64" type="uint64"/>
+ <reg name="vs1h" bitsize="64" type="uint64"/>
+ <reg name="vs2h" bitsize="64" type="uint64"/>
+ <reg name="vs3h" bitsize="64" type="uint64"/>
+ <reg name="vs4h" bitsize="64" type="uint64"/>
+ <reg name="vs5h" bitsize="64" type="uint64"/>
+ <reg name="vs6h" bitsize="64" type="uint64"/>
+ <reg name="vs7h" bitsize="64" type="uint64"/>
+ <reg name="vs8h" bitsize="64" type="uint64"/>
+ <reg name="vs9h" bitsize="64" type="uint64"/>
+ <reg name="vs10h" bitsize="64" type="uint64"/>
+ <reg name="vs11h" bitsize="64" type="uint64"/>
+ <reg name="vs12h" bitsize="64" type="uint64"/>
+ <reg name="vs13h" bitsize="64" type="uint64"/>
+ <reg name="vs14h" bitsize="64" type="uint64"/>
+ <reg name="vs15h" bitsize="64" type="uint64"/>
+ <reg name="vs16h" bitsize="64" type="uint64"/>
+ <reg name="vs17h" bitsize="64" type="uint64"/>
+ <reg name="vs18h" bitsize="64" type="uint64"/>
+ <reg name="vs19h" bitsize="64" type="uint64"/>
+ <reg name="vs20h" bitsize="64" type="uint64"/>
+ <reg name="vs21h" bitsize="64" type="uint64"/>
+ <reg name="vs22h" bitsize="64" type="uint64"/>
+ <reg name="vs23h" bitsize="64" type="uint64"/>
+ <reg name="vs24h" bitsize="64" type="uint64"/>
+ <reg name="vs25h" bitsize="64" type="uint64"/>
+ <reg name="vs26h" bitsize="64" type="uint64"/>
+ <reg name="vs27h" bitsize="64" type="uint64"/>
+ <reg name="vs28h" bitsize="64" type="uint64"/>
+ <reg name="vs29h" bitsize="64" type="uint64"/>
+ <reg name="vs30h" bitsize="64" type="uint64"/>
+ <reg name="vs31h" bitsize="64" type="uint64"/>
+</feature>
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index d74f4f0..efde425 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -8870,6 +8870,24 @@ static int gdb_set_spe_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
return 0;
}
+static int gdb_get_vsx_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
+{
+ if (n < 32) {
+ stq_p(mem_buf, env->vsr[n]);
+ return 8;
+ }
+ return 0;
+}
+
+static int gdb_set_vsx_reg(CPUPPCState *env, uint8_t *mem_buf, int n)
+{
+ if (n < 32) {
+ env->vsr[n] = ldq_p(mem_buf);
+ return 8;
+ }
+ return 0;
+}
+
static int ppc_fixup_cpu(PowerPCCPU *cpu)
{
CPUPPCState *env = &cpu->env;
@@ -8967,6 +8985,10 @@ static void ppc_cpu_realizefn(DeviceState *dev, Error **errp)
gdb_register_coprocessor(cs, gdb_get_spe_reg, gdb_set_spe_reg,
34, "power-spe.xml", 0);
}
+ if (pcc->insns_flags2 & PPC2_VSX) {
+ gdb_register_coprocessor(cs, gdb_get_vsx_reg, gdb_set_vsx_reg,
+ 32, "power-vsx.xml", 0);
+ }
qemu_init_vcpu(cs);
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] target-ppc: gdbstub: Add VSX support
2015-03-24 8:59 [Qemu-devel] [PATCH] target-ppc: gdbstub: Add VSX support Anton Blanchard
@ 2015-03-24 9:05 ` Alexander Graf
2015-03-24 9:50 ` Anton Blanchard
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2015-03-24 9:05 UTC (permalink / raw)
To: Anton Blanchard, qemu-devel, qemu-ppc
On 24.03.15 09:59, Anton Blanchard wrote:
> Add the XML and functions to get and set VSX registers.
Awesome, thanks. Have you verified that this works for LE as well as BE
guests?
Alex
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] target-ppc: gdbstub: Add VSX support
2015-03-24 9:05 ` Alexander Graf
@ 2015-03-24 9:50 ` Anton Blanchard
2015-03-24 9:57 ` Alexander Graf
0 siblings, 1 reply; 4+ messages in thread
From: Anton Blanchard @ 2015-03-24 9:50 UTC (permalink / raw)
To: Alexander Graf; +Cc: qemu-ppc, qemu-devel
Hi Alex,
> On 24.03.15 09:59, Anton Blanchard wrote:
> > Add the XML and functions to get and set VSX registers.
>
> Awesome, thanks. Have you verified that this works for LE as well as
> BE guests?
Unfortunately all our XML gdbstub routines have endian issues (FPU,
Altivec and now VMX). I only caught that the other day.
I can work on reusing maybe_bswap_register() from gdbstub.c.
Anton
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] target-ppc: gdbstub: Add VSX support
2015-03-24 9:50 ` Anton Blanchard
@ 2015-03-24 9:57 ` Alexander Graf
0 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2015-03-24 9:57 UTC (permalink / raw)
To: Anton Blanchard; +Cc: qemu-ppc, qemu-devel
On 24.03.15 10:50, Anton Blanchard wrote:
> Hi Alex,
>
>> On 24.03.15 09:59, Anton Blanchard wrote:
>>> Add the XML and functions to get and set VSX registers.
>>
>> Awesome, thanks. Have you verified that this works for LE as well as
>> BE guests?
>
> Unfortunately all our XML gdbstub routines have endian issues (FPU,
> Altivec and now VMX). I only caught that the other day.
>
> I can work on reusing maybe_bswap_register() from gdbstub.c.
Ouch. So I think we should fix the endianness issues for 2.3 (which is
in rc right now), but enable VMX for 2.4 since it's really a new feature.
Would you mind to work on and send at least the endian fixes reasonably
soon, so that we can still get them into the release?
Thanks a lot,
Alex
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-03-24 9:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-24 8:59 [Qemu-devel] [PATCH] target-ppc: gdbstub: Add VSX support Anton Blanchard
2015-03-24 9:05 ` Alexander Graf
2015-03-24 9:50 ` Anton Blanchard
2015-03-24 9:57 ` Alexander Graf
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).