|
@@ -516,7 +516,15 @@ static int fpr_set_msa(struct task_struct *target,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-/* Copy the supplied NT_PRFPREG buffer to the floating-point context. */
|
|
|
+/*
|
|
|
+ * Copy the supplied NT_PRFPREG buffer to the floating-point context.
|
|
|
+ *
|
|
|
+ * We optimize for the case where `count % sizeof(elf_fpreg_t) == 0',
|
|
|
+ * which is supposed to have been guaranteed by the kernel before
|
|
|
+ * calling us, e.g. in `ptrace_regset'. We enforce that requirement,
|
|
|
+ * so that we can safely avoid preinitializing temporaries for
|
|
|
+ * partial register writes.
|
|
|
+ */
|
|
|
static int fpr_set(struct task_struct *target,
|
|
|
const struct user_regset *regset,
|
|
|
unsigned int pos, unsigned int count,
|
|
@@ -524,6 +532,8 @@ static int fpr_set(struct task_struct *target,
|
|
|
{
|
|
|
int err;
|
|
|
|
|
|
+ BUG_ON(count % sizeof(elf_fpreg_t));
|
|
|
+
|
|
|
/* XXX fcr31 */
|
|
|
|
|
|
init_fp_ctx(target);
|