aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-08-31 02:56:20 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-31 04:42:22 -0400
commitd1254b12c93e1e586137a2ffef71fd33cf273f35 (patch)
treeb122f08030c920608996eb52cce1068030ffd3b6 /arch/um/os-Linux
parentc7ec16da5adc1c1b341b2a83bde7add17dcf811a (diff)
uml: fix x86_64 core dump crash
Stop UML crashing when trying to dump a process core on x86_64. This is the minimal fix to stop the crash - more things are broken here, and patches are forthcoming. The immediate thing to do is define ELF_CORE_COPY_REGS and ELF_CORE_COPY_FPREGS. Defining ELF_CORE_COPY_FPREGS allows dump_fpu to go away. It is defined in terms of save_fp_registers, so that needs to be added. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r--arch/um/os-Linux/sys-x86_64/registers.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/um/os-Linux/sys-x86_64/registers.c b/arch/um/os-Linux/sys-x86_64/registers.c
index e6fc2179d1bc..9467315b8059 100644
--- a/arch/um/os-Linux/sys-x86_64/registers.c
+++ b/arch/um/os-Linux/sys-x86_64/registers.c
@@ -4,6 +4,7 @@
4 */ 4 */
5 5
6#include <errno.h> 6#include <errno.h>
7#include <sys/ptrace.h>
7#include <string.h> 8#include <string.h>
8#include "ptrace_user.h" 9#include "ptrace_user.h"
9#include "uml-config.h" 10#include "uml-config.h"
@@ -17,6 +18,20 @@
17static unsigned long exec_regs[MAX_REG_NR]; 18static unsigned long exec_regs[MAX_REG_NR];
18static unsigned long exec_fp_regs[HOST_FP_SIZE]; 19static unsigned long exec_fp_regs[HOST_FP_SIZE];
19 20
21int save_fp_registers(int pid, unsigned long *fp_regs)
22{
23 if(ptrace(PTRACE_GETFPREGS, pid, 0, fp_regs) < 0)
24 return -errno;
25 return 0;
26}
27
28int restore_fp_registers(int pid, unsigned long *fp_regs)
29{
30 if(ptrace(PTRACE_SETFPREGS, pid, 0, fp_regs) < 0)
31 return -errno;
32 return 0;
33}
34
20void init_thread_registers(union uml_pt_regs *to) 35void init_thread_registers(union uml_pt_regs *to)
21{ 36{
22 memcpy(to->skas.regs, exec_regs, sizeof(to->skas.regs)); 37 memcpy(to->skas.regs, exec_regs, sizeof(to->skas.regs));