Commit 1c203efa authored by Mark Brown's avatar Mark Brown Committed by Jie Liu
Browse files

arm64/asm: Introduce assembly macros for managing ALLINT

kunpeng inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I90N2C
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc.git/commit/?h=arm64-nmi&id=4f8ecfa5830f4605a34d0982937351940147e4ef



----------------------------------------------------------------------

In order to allow assembly code to ensure that not even superpriorty
interrupts can preempt it provide macros for enabling and disabling
ALLINT.ALLINT.  This is not integrated into the existing DAIF macros
since we do not always wish to manage ALLINT along with DAIF and the
use of DAIF in the naming of the existing macros might lead to surprises
if ALLINT is also managed.

Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarJie Liu <liujie375@h-partners.com>
parent abffad0b
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -34,6 +34,22 @@
	wx\n	.req	w\n
	.endr

	.macro	disable_allint
#ifdef CONFIG_ARM64_NMI
alternative_if ARM64_HAS_NMI
	msr_s	SYS_ALLINT_SET, xzr
alternative_else_nop_endif
#endif
	.endm

	.macro	enable_allint
#ifdef CONFIG_ARM64_NMI
alternative_if ARM64_HAS_NMI
	msr_s	SYS_ALLINT_CLR, xzr
alternative_else_nop_endif
#endif
	.endm

	.macro disable_daif
	msr	daifset, #0xf
	.endm