Re: [RFC] x86: xsave/xrstor support, ucontext_t extensions

From: Suresh Siddha
Date: Thu May 22 2008 - 20:42:19 EST


On Thu, May 22, 2008 at 05:33:30PM -0700, H. Peter Anvin wrote:
> Mikael Pettersson wrote:
> >
> > > > While restoring from the user, kernel also need to find out what
> > layout
> > > > the user is passing. So it's bi-directional. I prefer the same
> > mechanism
> > > > (using cookies/magic numbers etc inaddition to uc_flags or cpuid
> > checks) to
> > > > interpret the fpstate for both user/kernel.
> > >
> > > No, it really doesn't: the kernel only needs to be able to read the
> > same > format as it itself wrote.
> >
> >The kernel needs to accept one(*) of the formats it can produce, which
> >is not necessarily what it last produced. It's not inconceivable that
> >user-space will construct sigframes on the fly (to emulate setcontext),
> >or that it will mangle sigframes (e.g. to map non-rt to rt before
> >sigreturn).
> >
> >(*) The format is determined by which version of sys_sigreturn the
> >user invokes.
> >
>
> No. You CANNOT restore from a frame that doesn't have the full state -
> you don't have enough information to do so!

What I was doing in the RFC is: restore the state what ever that was present and
init the state that was not present in the stack frame.
--
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/