arm64: Add support for SB barrier and patch in over DSB; ISB sequences
authorWill Deacon <will.deacon@arm.com>
Thu, 14 Jun 2018 10:21:34 +0000 (11:21 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 6 Dec 2018 16:47:04 +0000 (16:47 +0000)
commitbd4fb6d270bc423a9a4098108784f7f9254c4e6d
treeb795cee624fd00a3274c5d6efd89df71288cf1ff
parent0b587c84e42151fc5a636c7cebf7b03b281dc672
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>
arch/arm64/include/asm/assembler.h
arch/arm64/include/asm/barrier.h
arch/arm64/include/asm/cpucaps.h
arch/arm64/include/asm/sysreg.h
arch/arm64/include/asm/uaccess.h
arch/arm64/include/uapi/asm/hwcap.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/cpuinfo.c