diff options
author | Will Deacon <will.deacon@arm.com> | 2018-06-14 11:21:34 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2018-12-06 16:47:04 +0000 |
commit | bd4fb6d270bc423a9a4098108784f7f9254c4e6d (patch) | |
tree | b795cee624fd00a3274c5d6efd89df71288cf1ff /arch/arm64/include/asm/uaccess.h | |
parent | 0b587c84e42151fc5a636c7cebf7b03b281dc672 (diff) | |
download | lwn-bd4fb6d270bc423a9a4098108784f7f9254c4e6d.tar.gz lwn-bd4fb6d270bc423a9a4098108784f7f9254c4e6d.zip |
arm64: Add support for SB barrier and patch in over DSB; ISB sequences
We currently use a DSB; ISB sequence to inhibit speculation in set_fs().
Whilst this works for current CPUs, future CPUs may implement a new SB
barrier instruction which acts as an architected speculation barrier.
On CPUs that support it, patch in an SB; NOP sequence over the DSB; ISB
sequence and advertise the presence of the new instruction to userspace.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/include/asm/uaccess.h')
-rw-r--r-- | arch/arm64/include/asm/uaccess.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h index 07c34087bd5e..fad33f5fde47 100644 --- a/arch/arm64/include/asm/uaccess.h +++ b/arch/arm64/include/asm/uaccess.h @@ -45,8 +45,7 @@ static inline void set_fs(mm_segment_t fs) * Prevent a mispredicted conditional call to set_fs from forwarding * the wrong address limit to access_ok under speculation. */ - dsb(nsh); - isb(); + spec_bar(); /* On user-mode return, check fs is correct */ set_thread_flag(TIF_FSCHECK); |