mbox series

[0/3] arm64: Make NOP handling a whitelist

Message ID 20200324194822.15682-1-broonie@kernel.org (mailing list archive)
Headers show
Series arm64: Make NOP handling a whitelist | expand

Message

Mark Brown March 24, 2020, 7:48 p.m. UTC
Currently we default to assuming any unrecognized instruction in the
hint space can be safely handled as a NOP.  This is not robust and any
code that really wants a NOP should be using the explicitly defined NOP
so let's instead invert this and whitelist those instructions which it
is safe to handle as NOPs.

Mark Brown (3):
  arm64: insn: Don't assume unrecognized HINTs are NOPs
  arm64: insn: Add constants for PAC and BTI instruction decode
  arm64: insn: Report PAC and BTI instructions as NOPs

 arch/arm64/include/asm/insn.h | 22 ++++++++++++++++++++--
 arch/arm64/kernel/insn.c      | 32 ++++++++++++++++++++++++--------
 2 files changed, 44 insertions(+), 10 deletions(-)


base-commit: f8788d86ab28f61f7b46eb6be375f8a726783636

Comments

Catalin Marinas April 22, 2020, 5:27 p.m. UTC | #1
On Tue, Mar 24, 2020 at 07:48:19PM +0000, Mark Brown wrote:
> Currently we default to assuming any unrecognized instruction in the
> hint space can be safely handled as a NOP.  This is not robust and any
> code that really wants a NOP should be using the explicitly defined NOP
> so let's instead invert this and whitelist those instructions which it
> is safe to handle as NOPs.
> 
> Mark Brown (3):
>   arm64: insn: Don't assume unrecognized HINTs are NOPs
>   arm64: insn: Add constants for PAC and BTI instruction decode
>   arm64: insn: Report PAC and BTI instructions as NOPs
> 
>  arch/arm64/include/asm/insn.h | 22 ++++++++++++++++++++--
>  arch/arm64/kernel/insn.c      | 32 ++++++++++++++++++++++++--------
>  2 files changed, 44 insertions(+), 10 deletions(-)

IIRC, we concluded [1] there is no problem for PAC and BTI instruction
in the NOP space. For this series:

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

[1] https://lore.kernel.org/linux-arm-kernel/20200312184211.GA3849205@arrakis.emea.arm.com/