Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: fix percpu_write with 64-bit constants

Impact: slightly better code generation for percpu_to_op()

The processor will sign-extend 32-bit immediate values in 64-bit
operations. Use the 'e' constraint ("32-bit signed integer constant,
or a symbolic reference known to fit that range") for 64-bit constants.

Signed-off-by: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Brian Gerst and committed by
Tejun Heo
299e2699 06deef89

+1 -1
+1 -1
arch/x86/include/asm/percpu.h
··· 75 75 case 8: \ 76 76 asm(op "q %1,"__percpu_arg(0) \ 77 77 : "+m" (var) \ 78 - : "r" ((T__)val)); \ 78 + : "re" ((T__)val)); \ 79 79 break; \ 80 80 default: __bad_percpu_size(); \ 81 81 } \