diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-05-21 21:55:19 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-04 18:15:25 -0800 |
commit | a959dc88f9c8900296ccf13e2f3e1cbc555a8917 (patch) | |
tree | 8a8d5219ad5b7430107c92fe1ec3082611a5ce05 /kernel/rseq.c | |
parent | 4a789213c9a54c8b618924d3421e56e98df8a447 (diff) | |
download | blackbird-obmc-linux-a959dc88f9c8900296ccf13e2f3e1cbc555a8917.tar.gz blackbird-obmc-linux-a959dc88f9c8900296ccf13e2f3e1cbc555a8917.zip |
Use __put_user_goto in __put_user_size() and unsafe_put_user()
This actually enables the __put_user_goto() functionality in
unsafe_put_user().
For an example of the effect of this, this is the code generated for the
unsafe_put_user(signo, &infop->si_signo, Efault);
in the waitid() system call:
movl %ecx,(%rbx) # signo, MEM[(struct __large_struct *)_2]
It's just one single store instruction, along with generating an
exception table entry pointing to the Efault label case in case that
instruction faults.
Before, we would generate this:
xorl %edx, %edx
movl %ecx,(%rbx) # signo, MEM[(struct __large_struct *)_3]
testl %edx, %edx
jne .L309
with the exception table generated for that 'mov' instruction causing us
to jump to a stub that set %edx to -EFAULT and then jumped back to the
'testl' instruction.
So not only do we now get rid of the extra code in the normal sequence,
we also avoid unnecessarily keeping that extra error register live
across it all.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/rseq.c')
0 files changed, 0 insertions, 0 deletions