Commit 73839798 authored by Julien Thierry's avatar Julien Thierry Committed by Russell King

ARM: 8790/1: signal: always use __copy_to_user to save iwmmxt context

When setting a dummy iwmmxt context, create a local instance and
use __copy_to_user both cases whether iwmmxt is being used or not.
This has the benefit of disabling/enabling PAN once for the whole copy
intead of once per write.
Signed-off-by: default avatarJulien Thierry <julien.thierry@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent 5ca451cf
...@@ -77,8 +77,6 @@ static int preserve_iwmmxt_context(struct iwmmxt_sigframe __user *frame) ...@@ -77,8 +77,6 @@ static int preserve_iwmmxt_context(struct iwmmxt_sigframe __user *frame)
kframe->magic = IWMMXT_MAGIC; kframe->magic = IWMMXT_MAGIC;
kframe->size = IWMMXT_STORAGE_SIZE; kframe->size = IWMMXT_STORAGE_SIZE;
iwmmxt_task_copy(current_thread_info(), &kframe->storage); iwmmxt_task_copy(current_thread_info(), &kframe->storage);
err = __copy_to_user(frame, kframe, sizeof(*frame));
} else { } else {
/* /*
* For bug-compatibility with older kernels, some space * For bug-compatibility with older kernels, some space
...@@ -86,10 +84,14 @@ static int preserve_iwmmxt_context(struct iwmmxt_sigframe __user *frame) ...@@ -86,10 +84,14 @@ static int preserve_iwmmxt_context(struct iwmmxt_sigframe __user *frame)
* Set the magic and size appropriately so that properly * Set the magic and size appropriately so that properly
* written userspace can skip it reliably: * written userspace can skip it reliably:
*/ */
__put_user_error(DUMMY_MAGIC, &frame->magic, err); *kframe = (struct iwmmxt_sigframe) {
__put_user_error(IWMMXT_STORAGE_SIZE, &frame->size, err); .magic = DUMMY_MAGIC,
.size = IWMMXT_STORAGE_SIZE,
};
} }
err = __copy_to_user(frame, kframe, sizeof(*kframe));
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment