]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
powerpc: Fix swapcontext system for VSX + old ucontext size
authorMichael Neuling <mikey@neuling.org>
Thu, 23 Oct 2008 00:42:36 +0000 (00:42 +0000)
committerPaul Mackerras <paulus@samba.org>
Fri, 31 Oct 2008 05:12:00 +0000 (16:12 +1100)
commit16c29d180becc5bdf92fd0fc7314a44a671b5f4e
treecf8ed40be5a456dd6b61eda6d339cd4b8341f655
parentb160544cccb403310cf38ddb3ebc156ea454848a
powerpc: Fix swapcontext system for VSX + old ucontext size

Since VSX support was added, we now have two sizes of ucontext_t;
the older, smaller size without the extra VSX state, and the new
larger size with the extra VSX state.  A program using the
sys_swapcontext system call and supplying smaller ucontext_t
structures will currently get an EINVAL error if the task has
used VSX (e.g. because of calling library code that uses VSX) and
the old_ctx argument is non-NULL (i.e. the program is asking for
its current context to be saved).  Thus the program will start
getting EINVAL errors on calls that previously worked.

This commit changes this behaviour so that we don't send an EINVAL in
this case.  It will now return the smaller context but the VSX MSR bit
will always be cleared to indicate that the ucontext_t doesn't include
the extra VSX state, even if the task has executed VSX instructions.

Both 32 and 64 bit cases are updated.

[paulus@samba.org - also fix some access_ok() and get_user() calls]

Thanks to Ben Herrenschmidt for noticing this problem.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/signal_64.c