LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] i386: fix merge mistake in i387.c
@ 2008-03-05 8:35 Jan Beulich
2008-03-05 14:36 ` Ingo Molnar
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2008-03-05 8:35 UTC (permalink / raw)
To: mingo, tglx, hpa; +Cc: linux-kernel
convert_fxsr_to_user() in 2.6.24's i387_32.c did this, and
convert_to_fxsr() also does the inverse, so I assume it's an oversight
that it is no longer being done.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
---
arch/x86/kernel/i387.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-2.6.25-rc4/arch/x86/kernel/i387.c 2008-03-05 09:26:15.000000000 +0100
+++ 2.6.25-rc4-i386-fpu-fop/arch/x86/kernel/i387.c 2008-03-04 09:03:19.000000000 +0100
@@ -261,7 +261,7 @@ static void convert_from_fxsr(struct use
}
#else
env->fip = fxsave->fip;
- env->fcs = fxsave->fcs;
+ env->fcs = (u16) fxsave->fcs | ((u32) fxsave->fop << 16);
env->foo = fxsave->foo;
env->fos = fxsave->fos;
#endif
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] i386: fix merge mistake in i387.c
2008-03-05 8:35 [PATCH] i386: fix merge mistake in i387.c Jan Beulich
@ 2008-03-05 14:36 ` Ingo Molnar
0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-03-05 14:36 UTC (permalink / raw)
To: Jan Beulich; +Cc: tglx, hpa, linux-kernel, Roland McGrath
* Jan Beulich <jbeulich@novell.com> wrote:
> convert_fxsr_to_user() in 2.6.24's i387_32.c did this, and
> convert_to_fxsr() also does the inverse, so I assume it's an oversight
> that it is no longer being done.
thanks Jan, applied.
> - env->fcs = fxsave->fcs;
> + env->fcs = (u16) fxsave->fcs | ((u32) fxsave->fop << 16);
we encode it this way because there's no space for the 'FPU Last
Instruction Opcode' (->fop) field in the legacy user_i387_ia32_struct
that ptrace PTRACE_GETFPREGS/PTRACE_SETFPREGS uses.
it's probably pure legacy - i'd be surprised if any user-space relied on
the FPU Last Opcode in any way. But indeed we used to do it previously
so the most conservative thing is to preserve that piece of information.
FXRESTORE ignores the FOP field so the "restore" direction is
meaningless:
fxsave->fop = (u16) ((u32) env->fcs >> 16);
Ingo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-05 14:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-05 8:35 [PATCH] i386: fix merge mistake in i387.c Jan Beulich
2008-03-05 14:36 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).