* [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define
@ 2007-10-11 9:57 Paul Mackerras
2007-10-12 5:32 ` [PATCH 1/2] [V3] " Mark Nelson
0 siblings, 1 reply; 4+ messages in thread
From: Paul Mackerras @ 2007-10-11 9:57 UTC (permalink / raw)
To: akpm; +Cc: linux-arch, markn
From: Mark Nelson <markn@au1.ibm.com>
Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code which
allows for more flexibility in the note type for the state of 'extended
floating point' implementations in coredumps. New note types can now be
added with an appropriate #define.
This does #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all
current users so there's are no change in behaviour.
This will let us use different note types on powerpc for the
Altivec/VMX state that some PowerPC cpus have (G4, PPC970, POWER6) and
for the SPE (signal processing extension) state that some embedded
PowerPC cpus from Freescale have.
Signed-off-by: Mark Nelson <markn@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
Andrew: if you ack this I can push it through my tree along with the
following patch that adds Altivec/VMX state to core dumps. -- Paul.
arch/ia64/ia32/elfcore32.h | 1 +
arch/x86_64/ia32/ia32_binfmt.c | 1 +
fs/binfmt_elf.c | 4 ++--
include/asm-i386/elf.h | 1 +
4 files changed, 5 insertions(+), 2 deletions(-)
Index: linux/arch/ia64/ia32/elfcore32.h
===================================================================
--- linux.orig/arch/ia64/ia32/elfcore32.h
+++ linux/arch/ia64/ia32/elfcore32.h
@@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st
}
#define ELF_CORE_COPY_XFPREGS 1
+#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
static inline int
elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu)
{
Index: linux/arch/x86_64/ia32/ia32_binfmt.c
===================================================================
--- linux.orig/arch/x86_64/ia32/ia32_binfmt.c
+++ linux/arch/x86_64/ia32/ia32_binfmt.c
@@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st
}
#define ELF_CORE_COPY_XFPREGS 1
+#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
static inline int
elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu)
{
Index: linux/fs/binfmt_elf.c
===================================================================
--- linux.orig/fs/binfmt_elf.c
+++ linux/fs/binfmt_elf.c
@@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s
#ifdef ELF_CORE_COPY_XFPREGS
if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
- fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
- &t->xfpu);
+ fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE,
+ sizeof(t->xfpu), &t->xfpu);
t->num_notes++;
sz += notesize(&t->notes[2]);
}
Index: linux/include/asm-i386/elf.h
===================================================================
--- linux.orig/include/asm-i386/elf.h
+++ linux/include/asm-i386/elf.h
@@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struc
#define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
#define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)
#define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs)
+#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG
#define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO))
#define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso)
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 1/2] [V3] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define 2007-10-11 9:57 [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define Paul Mackerras @ 2007-10-12 5:32 ` Mark Nelson 0 siblings, 0 replies; 4+ messages in thread From: Mark Nelson @ 2007-10-12 5:32 UTC (permalink / raw) To: Andrew Morton; +Cc: Paul Mackerras, linux-arch Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code which allows for more flexibility in the note type for the state of 'extended floating point' implementations in coredumps. New note types can now be added with an appropriate #define. This does #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all current users so there's are no change in behaviour. This will let us use different note types on powerpc for the Altivec/VMX state that some PowerPC cpus have (G4, PPC970, POWER6) and for the SPE (signal processing extension) state that some embedded PowerPC cpus from Freescale have. Signed-off-by: Mark Nelson <markn@au1.ibm.com> --- arch/ia64/ia32/elfcore32.h | 1 + arch/x86_64/ia32/ia32_binfmt.c | 1 + fs/binfmt_elf.c | 8 ++++---- fs/binfmt_elf_fdpic.c | 8 ++++---- include/asm-i386/elf.h | 1 + 5 files changed, 11 insertions(+), 8 deletions(-) Index: linux/arch/ia64/ia32/elfcore32.h =================================================================== --- linux.orig/arch/ia64/ia32/elfcore32.h +++ linux/arch/ia64/ia32/elfcore32.h @@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st } #define ELF_CORE_COPY_XFPREGS 1 +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG static inline int elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu) { Index: linux/arch/x86_64/ia32/ia32_binfmt.c =================================================================== --- linux.orig/arch/x86_64/ia32/ia32_binfmt.c +++ linux/arch/x86_64/ia32/ia32_binfmt.c @@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st } #define ELF_CORE_COPY_XFPREGS 1 +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu) { Index: linux/fs/binfmt_elf.c =================================================================== --- linux.orig/fs/binfmt_elf.c +++ linux/fs/binfmt_elf.c @@ -1411,7 +1411,7 @@ struct elf_thread_status elf_fpregset_t fpu; /* NT_PRFPREG */ struct task_struct *thread; #ifdef ELF_CORE_COPY_XFPREGS - elf_fpxregset_t xfpu; /* NT_PRXFPREG */ + elf_fpxregset_t xfpu; /* ELF_CORE_XFPREG_TYPE */ #endif struct memelfnote notes[3]; int num_notes; @@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(p, &t->xfpu)) { - fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu), - &t->xfpu); + fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE, + sizeof(t->xfpu), &t->xfpu); t->num_notes++; sz += notesize(&t->notes[2]); } @@ -1624,7 +1624,7 @@ static int elf_core_dump(long signr, str #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(current, xfpu)) fill_note(notes + numnote++, - "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu); + "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu); #endif fs = get_fs(); Index: linux/fs/binfmt_elf_fdpic.c =================================================================== --- linux.orig/fs/binfmt_elf_fdpic.c +++ linux/fs/binfmt_elf_fdpic.c @@ -1417,7 +1417,7 @@ struct elf_thread_status elf_fpregset_t fpu; /* NT_PRFPREG */ struct task_struct *thread; #ifdef ELF_CORE_COPY_XFPREGS - elf_fpxregset_t xfpu; /* NT_PRXFPREG */ + elf_fpxregset_t xfpu; /* ELF_CORE_XFPREG_TYPE */ #endif struct memelfnote notes[3]; int num_notes; @@ -1453,8 +1453,8 @@ static int elf_dump_thread_status(long s #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(p, &t->xfpu)) { - fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu), - &t->xfpu); + fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE, + sizeof(t->xfpu), &t->xfpu); t->num_notes++; sz += notesize(&t->notes[2]); } @@ -1690,7 +1690,7 @@ static int elf_fdpic_core_dump(long sign #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(current, xfpu)) fill_note(notes + numnote++, - "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu); + "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu); #endif fs = get_fs(); Index: linux/include/asm-i386/elf.h =================================================================== --- linux.orig/include/asm-i386/elf.h +++ linux/include/asm-i386/elf.h @@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struc #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs) +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) #define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso) ^ permalink raw reply [flat|nested] 4+ messages in thread
* [patch 0/2] add Altivec/VMX state to coredumps @ 2007-10-11 7:15 markn 2007-10-11 7:15 ` [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define markn 0 siblings, 1 reply; 4+ messages in thread From: markn @ 2007-10-11 7:15 UTC (permalink / raw) To: linuxppc-dev -- Here's the new and improved patch to add Altivec/VMX state into the coredump. It's now two patches: * the first patch makes the note type of the state dumped by elf_core_copy_task_xfpregs() a #define and adds the appropriate #defines so that archs that support SSE still have their note type as NT_PRXFPREG * the second patch actually adds the Altivec/VMX state to the coredumps and uses a note type of NT_PPC_VMX that's #defined as 0x100. Thus SPE could use a note type of NT_PPC_SPE and 0x101, for example. The second patch is essentially the same as the single patch that was posted on 2007-09-25, but with the addition of the new NT_PPC_VMX note type. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define 2007-10-11 7:15 [patch 0/2] add Altivec/VMX state to coredumps markn @ 2007-10-11 7:15 ` markn 2007-10-11 13:04 ` Kumar Gala 0 siblings, 1 reply; 4+ messages in thread From: markn @ 2007-10-11 7:15 UTC (permalink / raw) To: linuxppc-dev Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code which allows for more flexibility in the note type for the state of 'extended floating point' implementations in coredumps. New note types can now be added with an appropriate #define. #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all current users so there's are no change in behaviour. Signed-off-by: Mark Nelson <markn@au1.ibm.com> --- arch/ia64/ia32/elfcore32.h | 1 + arch/x86_64/ia32/ia32_binfmt.c | 1 + fs/binfmt_elf.c | 4 ++-- include/asm-i386/elf.h | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) Index: linux/arch/ia64/ia32/elfcore32.h =================================================================== --- linux.orig/arch/ia64/ia32/elfcore32.h +++ linux/arch/ia64/ia32/elfcore32.h @@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st } #define ELF_CORE_COPY_XFPREGS 1 +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG static inline int elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu) { Index: linux/arch/x86_64/ia32/ia32_binfmt.c =================================================================== --- linux.orig/arch/x86_64/ia32/ia32_binfmt.c +++ linux/arch/x86_64/ia32/ia32_binfmt.c @@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st } #define ELF_CORE_COPY_XFPREGS 1 +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu) { Index: linux/fs/binfmt_elf.c =================================================================== --- linux.orig/fs/binfmt_elf.c +++ linux/fs/binfmt_elf.c @@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(p, &t->xfpu)) { - fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu), - &t->xfpu); + fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE, + sizeof(t->xfpu), &t->xfpu); t->num_notes++; sz += notesize(&t->notes[2]); } Index: linux/include/asm-i386/elf.h =================================================================== --- linux.orig/include/asm-i386/elf.h +++ linux/include/asm-i386/elf.h @@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struc #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs) +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) #define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso) -- ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define 2007-10-11 7:15 ` [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define markn @ 2007-10-11 13:04 ` Kumar Gala 2007-10-12 1:37 ` Mark Nelson 0 siblings, 1 reply; 4+ messages in thread From: Kumar Gala @ 2007-10-11 13:04 UTC (permalink / raw) To: markn; +Cc: PowerPC dev list, Linux Kernel Mailing List On Oct 11, 2007, at 2:15 AM, markn@au1.ibm.com wrote: > Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code > which > allows for more flexibility in the note type for the state of > 'extended > floating point' implementations in coredumps. New note types can > now be > added with an appropriate #define. > > #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all current users so > there's are no change in behaviour. Can we make this ELF_CORE_VECREG_TYPE or something that is so coupled to the x86 specific name? > > Signed-off-by: Mark Nelson <markn@au1.ibm.com> > --- > arch/ia64/ia32/elfcore32.h | 1 + > arch/x86_64/ia32/ia32_binfmt.c | 1 + > fs/binfmt_elf.c | 4 ++-- > include/asm-i386/elf.h | 1 + > 4 files changed, 5 insertions(+), 2 deletions(-) > > Index: linux/arch/ia64/ia32/elfcore32.h > =================================================================== > --- linux.orig/arch/ia64/ia32/elfcore32.h > +++ linux/arch/ia64/ia32/elfcore32.h > @@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st > } > > #define ELF_CORE_COPY_XFPREGS 1 > +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG > static inline int > elf_core_copy_task_xfpregs(struct task_struct *tsk, > elf_fpxregset_t *xfpu) > { > Index: linux/arch/x86_64/ia32/ia32_binfmt.c > =================================================================== > --- linux.orig/arch/x86_64/ia32/ia32_binfmt.c > +++ linux/arch/x86_64/ia32/ia32_binfmt.c > @@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st > } > > #define ELF_CORE_COPY_XFPREGS 1 > +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG > static inline int > elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t > *xfpu) > { > Index: linux/fs/binfmt_elf.c > =================================================================== > --- linux.orig/fs/binfmt_elf.c > +++ linux/fs/binfmt_elf.c > @@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s > > #ifdef ELF_CORE_COPY_XFPREGS > if (elf_core_copy_task_xfpregs(p, &t->xfpu)) { > - fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu), > - &t->xfpu); > + fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE, > + sizeof(t->xfpu), &t->xfpu); > t->num_notes++; > sz += notesize(&t->notes[2]); > } You've only fixed up one of 4 NT_PRXFPREG uses in the kernel. Also, I'm not a fan of your proposed mechanism to "overload" the elf_fpxregset_t. I'd rather see us introduce a new elf_vecregset_t and have it typedef'd to be elf_fpxregset_t on i386, x86_64, ia64 > Index: linux/include/asm-i386/elf.h > =================================================================== > --- linux.orig/include/asm-i386/elf.h > +++ linux/include/asm-i386/elf.h > @@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struc > #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, > elf_regs) > #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, > elf_fpregs) > #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) > dump_task_extended_fpu(tsk, elf_xfpregs) > +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG > > #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) > #define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso) > > -- > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@ozlabs.org > https://ozlabs.org/mailman/listinfo/linuxppc-dev ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define 2007-10-11 13:04 ` Kumar Gala @ 2007-10-12 1:37 ` Mark Nelson 2007-10-12 2:40 ` Mark Nelson 0 siblings, 1 reply; 4+ messages in thread From: Mark Nelson @ 2007-10-12 1:37 UTC (permalink / raw) To: Kumar Gala; +Cc: PowerPC dev list, Linux Kernel Mailing List Kumar Gala wrote: > > On Oct 11, 2007, at 2:15 AM, markn@au1.ibm.com wrote: > >> Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code which >> allows for more flexibility in the note type for the state of 'extended >> floating point' implementations in coredumps. New note types can now be >> added with an appropriate #define. >> >> #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all current users so >> there's are no change in behaviour. > > Can we make this ELF_CORE_VECREG_TYPE or something that is so coupled to > the x86 specific name? > >> >> Signed-off-by: Mark Nelson <markn@au1.ibm.com> >> --- >> arch/ia64/ia32/elfcore32.h | 1 + >> arch/x86_64/ia32/ia32_binfmt.c | 1 + >> fs/binfmt_elf.c | 4 ++-- >> include/asm-i386/elf.h | 1 + >> 4 files changed, 5 insertions(+), 2 deletions(-) >> >> Index: linux/arch/ia64/ia32/elfcore32.h >> =================================================================== >> --- linux.orig/arch/ia64/ia32/elfcore32.h >> +++ linux/arch/ia64/ia32/elfcore32.h >> @@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st >> } >> >> #define ELF_CORE_COPY_XFPREGS 1 >> +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG >> static inline int >> elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t >> *xfpu) >> { >> Index: linux/arch/x86_64/ia32/ia32_binfmt.c >> =================================================================== >> --- linux.orig/arch/x86_64/ia32/ia32_binfmt.c >> +++ linux/arch/x86_64/ia32/ia32_binfmt.c >> @@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st >> } >> >> #define ELF_CORE_COPY_XFPREGS 1 >> +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG >> static inline int >> elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu) >> { >> Index: linux/fs/binfmt_elf.c >> =================================================================== >> --- linux.orig/fs/binfmt_elf.c >> +++ linux/fs/binfmt_elf.c >> @@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s >> >> #ifdef ELF_CORE_COPY_XFPREGS >> if (elf_core_copy_task_xfpregs(p, &t->xfpu)) { >> - fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu), >> - &t->xfpu); >> + fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE, >> + sizeof(t->xfpu), &t->xfpu); >> t->num_notes++; >> sz += notesize(&t->notes[2]); >> } > > You've only fixed up one of 4 NT_PRXFPREG uses in the kernel. Ooops... Right you are - very good pickup :) Fixed in a new version (will send promptly). Thanks! Mark. > > Also, I'm not a fan of your proposed mechanism to "overload" the > elf_fpxregset_t. I'd rather see us introduce a new elf_vecregset_t and > have it typedef'd to be elf_fpxregset_t on i386, x86_64, ia64 > >> Index: linux/include/asm-i386/elf.h >> =================================================================== >> --- linux.orig/include/asm-i386/elf.h >> +++ linux/include/asm-i386/elf.h >> @@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struc >> #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, >> elf_regs) >> #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, >> elf_fpregs) >> #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) >> dump_task_extended_fpu(tsk, elf_xfpregs) >> +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG >> >> #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) >> #define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso) >> >> -- >> _______________________________________________ >> Linuxppc-dev mailing list >> Linuxppc-dev@ozlabs.org >> https://ozlabs.org/mailman/listinfo/linuxppc-dev > ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] [V3] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define 2007-10-12 1:37 ` Mark Nelson @ 2007-10-12 2:40 ` Mark Nelson 0 siblings, 0 replies; 4+ messages in thread From: Mark Nelson @ 2007-10-12 2:40 UTC (permalink / raw) To: Kumar Gala; +Cc: PowerPC dev list, Paul Mackerras, Linux Kernel Mailing List Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code which allows for more flexibility in the note type for the state of 'extended floating point' implementations in coredumps. New note types can now be added with an appropriate #define. This does #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all current users so there's are no change in behaviour. This will let us use different note types on powerpc for the Altivec/VMX state that some PowerPC cpus have (G4, PPC970, POWER6) and for the SPE (signal processing extension) state that some embedded PowerPC cpus from Freescale have. Signed-off-by: Mark Nelson <markn@au1.ibm.com> --- arch/ia64/ia32/elfcore32.h | 1 + arch/x86_64/ia32/ia32_binfmt.c | 1 + fs/binfmt_elf.c | 8 ++++---- fs/binfmt_elf_fdpic.c | 8 ++++---- include/asm-i386/elf.h | 1 + 5 files changed, 11 insertions(+), 8 deletions(-) Index: linux/arch/ia64/ia32/elfcore32.h =================================================================== --- linux.orig/arch/ia64/ia32/elfcore32.h +++ linux/arch/ia64/ia32/elfcore32.h @@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st } #define ELF_CORE_COPY_XFPREGS 1 +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG static inline int elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu) { Index: linux/arch/x86_64/ia32/ia32_binfmt.c =================================================================== --- linux.orig/arch/x86_64/ia32/ia32_binfmt.c +++ linux/arch/x86_64/ia32/ia32_binfmt.c @@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st } #define ELF_CORE_COPY_XFPREGS 1 +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu) { Index: linux/fs/binfmt_elf.c =================================================================== --- linux.orig/fs/binfmt_elf.c +++ linux/fs/binfmt_elf.c @@ -1411,7 +1411,7 @@ struct elf_thread_status elf_fpregset_t fpu; /* NT_PRFPREG */ struct task_struct *thread; #ifdef ELF_CORE_COPY_XFPREGS - elf_fpxregset_t xfpu; /* NT_PRXFPREG */ + elf_fpxregset_t xfpu; /* ELF_CORE_XFPREG_TYPE */ #endif struct memelfnote notes[3]; int num_notes; @@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(p, &t->xfpu)) { - fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu), - &t->xfpu); + fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE, + sizeof(t->xfpu), &t->xfpu); t->num_notes++; sz += notesize(&t->notes[2]); } @@ -1624,7 +1624,7 @@ static int elf_core_dump(long signr, str #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(current, xfpu)) fill_note(notes + numnote++, - "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu); + "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu); #endif fs = get_fs(); Index: linux/fs/binfmt_elf_fdpic.c =================================================================== --- linux.orig/fs/binfmt_elf_fdpic.c +++ linux/fs/binfmt_elf_fdpic.c @@ -1417,7 +1417,7 @@ struct elf_thread_status elf_fpregset_t fpu; /* NT_PRFPREG */ struct task_struct *thread; #ifdef ELF_CORE_COPY_XFPREGS - elf_fpxregset_t xfpu; /* NT_PRXFPREG */ + elf_fpxregset_t xfpu; /* ELF_CORE_XFPREG_TYPE */ #endif struct memelfnote notes[3]; int num_notes; @@ -1453,8 +1453,8 @@ static int elf_dump_thread_status(long s #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(p, &t->xfpu)) { - fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu), - &t->xfpu); + fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE, + sizeof(t->xfpu), &t->xfpu); t->num_notes++; sz += notesize(&t->notes[2]); } @@ -1690,7 +1690,7 @@ static int elf_fdpic_core_dump(long sign #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(current, xfpu)) fill_note(notes + numnote++, - "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu); + "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu); #endif fs = get_fs(); Index: linux/include/asm-i386/elf.h =================================================================== --- linux.orig/include/asm-i386/elf.h +++ linux/include/asm-i386/elf.h @@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struc #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs) +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) #define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso) ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] [V3] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define @ 2007-10-12 2:40 ` Mark Nelson 0 siblings, 0 replies; 4+ messages in thread From: Mark Nelson @ 2007-10-12 2:40 UTC (permalink / raw) To: Kumar Gala; +Cc: PowerPC dev list, Linux Kernel Mailing List, Paul Mackerras Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code which allows for more flexibility in the note type for the state of 'extended floating point' implementations in coredumps. New note types can now be added with an appropriate #define. This does #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all current users so there's are no change in behaviour. This will let us use different note types on powerpc for the Altivec/VMX state that some PowerPC cpus have (G4, PPC970, POWER6) and for the SPE (signal processing extension) state that some embedded PowerPC cpus from Freescale have. Signed-off-by: Mark Nelson <markn@au1.ibm.com> --- arch/ia64/ia32/elfcore32.h | 1 + arch/x86_64/ia32/ia32_binfmt.c | 1 + fs/binfmt_elf.c | 8 ++++---- fs/binfmt_elf_fdpic.c | 8 ++++---- include/asm-i386/elf.h | 1 + 5 files changed, 11 insertions(+), 8 deletions(-) Index: linux/arch/ia64/ia32/elfcore32.h =================================================================== --- linux.orig/arch/ia64/ia32/elfcore32.h +++ linux/arch/ia64/ia32/elfcore32.h @@ -117,6 +117,7 @@ elf_core_copy_task_fpregs(struct task_st } #define ELF_CORE_COPY_XFPREGS 1 +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG static inline int elf_core_copy_task_xfpregs(struct task_struct *tsk, elf_fpxregset_t *xfpu) { Index: linux/arch/x86_64/ia32/ia32_binfmt.c =================================================================== --- linux.orig/arch/x86_64/ia32/ia32_binfmt.c +++ linux/arch/x86_64/ia32/ia32_binfmt.c @@ -188,6 +188,7 @@ elf_core_copy_task_fpregs(struct task_st } #define ELF_CORE_COPY_XFPREGS 1 +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregset_t *xfpu) { Index: linux/fs/binfmt_elf.c =================================================================== --- linux.orig/fs/binfmt_elf.c +++ linux/fs/binfmt_elf.c @@ -1411,7 +1411,7 @@ struct elf_thread_status elf_fpregset_t fpu; /* NT_PRFPREG */ struct task_struct *thread; #ifdef ELF_CORE_COPY_XFPREGS - elf_fpxregset_t xfpu; /* NT_PRXFPREG */ + elf_fpxregset_t xfpu; /* ELF_CORE_XFPREG_TYPE */ #endif struct memelfnote notes[3]; int num_notes; @@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long s #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(p, &t->xfpu)) { - fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu), - &t->xfpu); + fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE, + sizeof(t->xfpu), &t->xfpu); t->num_notes++; sz += notesize(&t->notes[2]); } @@ -1624,7 +1624,7 @@ static int elf_core_dump(long signr, str #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(current, xfpu)) fill_note(notes + numnote++, - "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu); + "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu); #endif fs = get_fs(); Index: linux/fs/binfmt_elf_fdpic.c =================================================================== --- linux.orig/fs/binfmt_elf_fdpic.c +++ linux/fs/binfmt_elf_fdpic.c @@ -1417,7 +1417,7 @@ struct elf_thread_status elf_fpregset_t fpu; /* NT_PRFPREG */ struct task_struct *thread; #ifdef ELF_CORE_COPY_XFPREGS - elf_fpxregset_t xfpu; /* NT_PRXFPREG */ + elf_fpxregset_t xfpu; /* ELF_CORE_XFPREG_TYPE */ #endif struct memelfnote notes[3]; int num_notes; @@ -1453,8 +1453,8 @@ static int elf_dump_thread_status(long s #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(p, &t->xfpu)) { - fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu), - &t->xfpu); + fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE, + sizeof(t->xfpu), &t->xfpu); t->num_notes++; sz += notesize(&t->notes[2]); } @@ -1690,7 +1690,7 @@ static int elf_fdpic_core_dump(long sign #ifdef ELF_CORE_COPY_XFPREGS if (elf_core_copy_task_xfpregs(current, xfpu)) fill_note(notes + numnote++, - "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu); + "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu); #endif fs = get_fs(); Index: linux/include/asm-i386/elf.h =================================================================== --- linux.orig/include/asm-i386/elf.h +++ linux/include/asm-i386/elf.h @@ -129,6 +129,7 @@ extern int dump_task_extended_fpu (struc #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs) #define ELF_CORE_COPY_XFPREGS(tsk, elf_xfpregs) dump_task_extended_fpu(tsk, elf_xfpregs) +#define ELF_CORE_XFPREG_TYPE NT_PRXFPREG #define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO)) #define VDSO_CURRENT_BASE ((unsigned long)current->mm->context.vdso) ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-10-12 5:33 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-10-11 9:57 [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define Paul Mackerras 2007-10-12 5:32 ` [PATCH 1/2] [V3] " Mark Nelson -- strict thread matches above, loose matches on Subject: below -- 2007-10-11 7:15 [patch 0/2] add Altivec/VMX state to coredumps markn 2007-10-11 7:15 ` [patch 1/2] Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define markn 2007-10-11 13:04 ` Kumar Gala 2007-10-12 1:37 ` Mark Nelson 2007-10-12 2:40 ` [PATCH 1/2] [V3] " Mark Nelson 2007-10-12 2:40 ` Mark Nelson
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.