* FP state in threaded coredumps
@ 2003-06-02 18:30 Anton Blanchard
2003-06-02 18:47 ` Roland McGrath
0 siblings, 1 reply; 2+ messages in thread
From: Anton Blanchard @ 2003-06-02 18:30 UTC (permalink / raw)
To: roland, mingo; +Cc: linux-kernel
Hi,
I was adding threaded coredump support to ppc64 and noticed that the
ELF_CORE_SYNC hook was never called. It looks like we need something
like this on archs that do lazy FP save/restore to ensure the FP state
for threads running on other cpus is up to date.
On ppc64 ELF_CORE_SYNC does an IPI to all cpus that copies FP state into
the thread struct.
I also got rid of an old function prototype that isnt used in
binfmt_elf, dump_fpu.
Anton
===== fs/binfmt_elf.c 1.45 vs edited =====
--- 1.45/fs/binfmt_elf.c Tue May 6 23:16:37 2003
+++ edited/fs/binfmt_elf.c Sun Jun 1 09:02:22 2003
@@ -45,7 +45,6 @@
static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs);
static int load_elf_library(struct file*);
static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, int, int);
-extern int dump_fpu (struct pt_regs *, elf_fpregset_t *);
#ifndef elf_addr_t
#define elf_addr_t unsigned long
@@ -1203,6 +1202,10 @@
elf_fpxregset_t *xfpu = NULL;
#endif
int thread_status_size = 0;
+
+#ifdef ELF_CORE_SYNC
+ ELF_CORE_SYNC();
+#endif
/*
* We no longer stop all VM operations.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: FP state in threaded coredumps
2003-06-02 18:30 FP state in threaded coredumps Anton Blanchard
@ 2003-06-02 18:47 ` Roland McGrath
0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2003-06-02 18:47 UTC (permalink / raw)
To: Anton Blanchard; +Cc: mingo, linux-kernel
> I was adding threaded coredump support to ppc64 and noticed that the
> ELF_CORE_SYNC hook was never called. It looks like we need something
> like this on archs that do lazy FP save/restore to ensure the FP state
> for threads running on other cpus is up to date.
All the threads already synchronize with coredump_wait in __exit_mm. A
thread reaching that point already has control of the CPU that might be
holding its FPU state. It seems to me it would be simplest and most
efficient to just do any necessary copy-in there, before
`complete(mm->core_startup_done)'.
Thanks,
Roland
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-06-02 18:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-02 18:30 FP state in threaded coredumps Anton Blanchard
2003-06-02 18:47 ` Roland McGrath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®