Fix prologue directives for sys_clone() and sys_clone2()]
PATCH 1/1 Fix prologue directives for sys_clone() and sys_clone2()]
To my limited understanding, the GRSAVE portions of the .prologue
directives for sys_clone() and sys_clone2() are incorrect. This patch, against 2.6.0-test3, fixes them.
I also wonder whether the the continued usage of the 2 argument form ofclone() in kernel_thread() should be considered "bad form". Admittedly,
the other arguments are don't-care as long as the various CLONE_ flags (which kernel_thread() does not mask off) are not set , but it just feels wrong. I guess I wouldn't be a programmer if I didn't like to pick nits.
John Byrne
arch/ia64/kernel/entry.S +2 -2
@@ -112,9 +112,9 @@ * sys_clone2(u64 flags, u64 ustack_base, u64 ustack_size, u64 parent_tidptr, u64 child_tidptr, * u64 tls) */ GLOBAL_ENTRY(sys_clone2) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2) + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(6) alloc r16=ar.pfs,6,2,6,0 DO_SAVE_SWITCH_STACK adds r2=PT(R16)+IA64_SWITCH_STACK_SIZE+16,sp mov loc0=rp
@@ -141,9 +141,9 @@ * sys_clone(u64 flags, u64 ustack_base, u64 parent_tidptr, u64 child_tidptr, u64 tls) * Deprecated. Use sys_clone2() instead. */ GLOBAL_ENTRY(sys_clone) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2) + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5) alloc r16=ar.pfs,5,2,6,0 DO_SAVE_SWITCH_STACK adds r2=PT(R16)+IA64_SWITCH_STACK_SIZE+16,sp mov loc0=rp
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · John Byrne
John> To my limited understanding, the GRSAVE portions of the .prologue John> directives for sys_clone() and sys_clone2() are incorrect. This patch, John> against 2.6.0-test3, fixes them.
Thanks, I applied the patch.
John> I also wonder whether the the continued usage of the 2 John> argument form of clone() in kernel_thread() should be John> considered "bad form". Admittedly, the other arguments are John> don't-care as long as the various CLONE_ flags (which John> kernel_thread() does not mask off) are not set , but it just John> feels wrong. I guess I wouldn't be a programmer if I didn't John> like to pick nits.
clone() is a strict subset of clone2(), so some day we may want to remove the former.
--david