Add the BTI instructions and the associated note to make the AArch64 asm objects compatible with BTI enforcement. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
		
			
				
	
	
		
			35 lines
		
	
	
		
			704 B
		
	
	
	
		
			ArmAsm
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			704 B
		
	
	
	
		
			ArmAsm
		
	
	
	
	
	
| ##------------------------------------------------------------------------------
 | |
| #
 | |
| # SpeculationBarrier() for AArch64
 | |
| #
 | |
| # Copyright (c) 2019, Linaro Ltd. All rights reserved.
 | |
| #
 | |
| # SPDX-License-Identifier: BSD-2-Clause-Patent
 | |
| #
 | |
| ##------------------------------------------------------------------------------
 | |
| 
 | |
| .text
 | |
| .p2align 2
 | |
| 
 | |
| GCC_ASM_EXPORT(SpeculationBarrier)
 | |
| 
 | |
| 
 | |
| #/**
 | |
| #  Uses as a barrier to stop speculative execution.
 | |
| #
 | |
| #  Ensures that no later instruction will execute speculatively, until all prior
 | |
| #  instructions have completed.
 | |
| #
 | |
| #**/
 | |
| #VOID
 | |
| #EFIAPI
 | |
| #SpeculationBarrier (
 | |
| #  VOID
 | |
| #  );
 | |
| #
 | |
| ASM_PFX(SpeculationBarrier):
 | |
|     AARCH64_BTI(c)
 | |
|     dsb  sy
 | |
|     isb
 | |
|     ret
 |