aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
authorLinus Torvalds <[email protected]>2018-05-01 13:55:51 +0000
committerThomas Gleixner <[email protected]>2018-05-03 11:55:45 +0000
commit1aa7a5735a41418d8e01fa7c9565eb2657e2ea3f (patch)
treec0338b0662f114ed45903a5d4ccaf5a7e6868cdf /fs/proc/array.c
parentx86/cpu: Restore CPUID_8000_0008_EBX reload (diff)
downloadkernel-1aa7a5735a41418d8e01fa7c9565eb2657e2ea3f.tar.gz
kernel-1aa7a5735a41418d8e01fa7c9565eb2657e2ea3f.zip
x86/nospec: Simplify alternative_msr_write()
The macro is not type safe and I did look for why that "g" constraint for the asm doesn't work: it's because the asm is more fundamentally wrong. It does movl %[val], %%eax but "val" isn't a 32-bit value, so then gcc will pass it in a register, and generate code like movl %rsi, %eax and gas will complain about a nonsensical 'mov' instruction (it's moving a 64-bit register to a 32-bit one). Passing it through memory will just hide the real bug - gcc still thinks the memory location is 64-bit, but the "movl" will only load the first 32 bits and it all happens to work because x86 is little-endian. Convert it to a type safe inline function with a little trick which hands the feature into the ALTERNATIVE macro. Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'fs/proc/array.c')
0 files changed, 0 insertions, 0 deletions