]> git.baikalelectronics.ru Git - kernel.git/commit
x86 uaccess: Introduce __put_user_goto
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 22 May 2016 04:44:51 +0000 (21:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 5 Jan 2019 02:00:49 +0000 (18:00 -0800)
commitdb1aa5a2181e5cc98bc610c72ace89e902af0400
tree1e6775ba2fc12cb9893f09b203c85e2014de256b
parente111b200d102deacbf068f0888cb6424eefc24ab
x86 uaccess: Introduce __put_user_goto

This is finally the actual reason for the odd error handling in the
"unsafe_get/put_user()" functions, introduced over three years ago.

Using a "jump to error label" interface is somewhat odd, but very
convenient as a programming interface, and more importantly, it fits
very well with simply making the target be the exception handler address
directly from the inline asm.

The reason it took over three years to actually do this? We need "asm
goto" support for it, which only became the default on x86 last year.
It's now been a year that we've forced asm goto support (see commit
6b7836651e59 "x86: Force asm-goto"), and so let's just do it here too.

[ Side note: this commit was originally done back in 2016. The above
  commentary about timing is obviously about it only now getting merged
  into my real upstream tree     - Linus ]

Sadly, gcc still only supports "asm goto" with asms that do not have any
outputs, so we are limited to only the put_user case for this.  Maybe in
several more years we can do the get_user case too.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/include/asm/uaccess.h