summaryrefslogtreecommitdiffstats
path: root/Documentation/tpm
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-12-28 01:52:47 +0100
committerH. Peter Anvin <hpa@zytor.com>2013-12-28 02:02:53 +0100
commita740576a4abf933de8f50787f24f24456cebd761 (patch)
treee46ad30a727de5f0b8d91b381f1c67f05ebfb260 /Documentation/tpm
parentx86: Replace assembly access_ok() with a C variant (diff)
downloadlinux-a740576a4abf933de8f50787f24f24456cebd761.tar.xz
linux-a740576a4abf933de8f50787f24f24456cebd761.zip
x86: Slightly tweak the access_ok() C variant for better code
gcc can under very specific circumstances realize that the code sequence: foo += bar; if (foo < bar) ... ... is equivalent to a carry out from the addition. Tweak the implementation of access_ok() (specifically __chk_range_not_ok()) to make it more likely that gcc will make that connection. It isn't fool-proof (sometimes gcc seems to think it can make better code with lea, and ends up with a second comparison), still, but it seems to be able to connect the two more frequently this way. Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/CA%2B55aFzPBdbfKovMT8Edr4SmE2_=%2BOKJFac9XW2awegogTkVTA@mail.gmail.com Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions