diff options
author | Phil Edworthy <Phil.Edworthy@renesas.com> | 2011-03-18 14:16:31 +0000 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-03-23 22:17:52 +0900 |
commit | c49b6ecf0870e78fa40497cd8b142915c1d5c7c9 (patch) | |
tree | 17a0bb980bbf9ce734f62068016e69d4f46175ac /arch/sh/kernel/ptrace_64.c | |
parent | 3f4caa8157449b96f8b166c7a98ee40c4bc35a55 (diff) | |
download | blackbird-op-linux-c49b6ecf0870e78fa40497cd8b142915c1d5c7c9.tar.gz blackbird-op-linux-c49b6ecf0870e78fa40497cd8b142915c1d5c7c9.zip |
sh: Fix ptrace fpu state initialisation
Commit 0ea820cf introduced the PTRACE_GETFPREGS/SETFPREGS cmds,
but gdb-server still accesses the FPU state using the
PTRACE_PEEKUSR/POKEUSR commands. In this case, xstate was not
initialised.
Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Cc: stable@kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/ptrace_64.c')
-rw-r--r-- | arch/sh/kernel/ptrace_64.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c index 4436eacddb15..c8f97649f354 100644 --- a/arch/sh/kernel/ptrace_64.c +++ b/arch/sh/kernel/ptrace_64.c @@ -403,6 +403,9 @@ long arch_ptrace(struct task_struct *child, long request, else if ((addr >= offsetof(struct user, fpu)) && (addr < offsetof(struct user, u_fpvalid))) { unsigned long index; + ret = init_fpu(child); + if (ret) + break; index = addr - offsetof(struct user, fpu); tmp = get_fpu_long(child, index); } else if (addr == offsetof(struct user, u_fpvalid)) { @@ -442,6 +445,9 @@ long arch_ptrace(struct task_struct *child, long request, else if ((addr >= offsetof(struct user, fpu)) && (addr < offsetof(struct user, u_fpvalid))) { unsigned long index; + ret = init_fpu(child); + if (ret) + break; index = addr - offsetof(struct user, fpu); ret = put_fpu_long(child, index, data); } |