Re: [PATCH] x86_64 ptrace orig_ax on ia32 task

From: Linus Torvalds
Date: Fri Mar 07 2008 - 18:20:59 EST



On Fri, 7 Mar 2008, Roland McGrath wrote:
>
> This makes 64-bit ptrace calls setting the 64-bit orig_ax field
> for a 32-bit task sign-extend the low 32 bits up to 64. This
> matches what a 64-bit debugger expects when tracing a 32-bit task.

Hmm. Why make this conditional on CONFIG_IA32_EMULATION and TIF_IA32?

That field is never really 64-bit anyway. The only allowable values are
- system call number (== small positive value)
- a small negative number for traps

So I'd suggest just making it entirely unconditionally just do

case offsetof(struct user_regs_struct, orig_ax):
value = (long) (s32) value;
break;

and be done with it. Why have arbitrarily different code on x86 and x86-64
when there is no real reason for it?

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/