Commit 611b58ad authored by Mark Brown's avatar Mark Brown Committed by Jie Liu
Browse files

arm64/hyp-stub: Enable access to 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=6a7b89e1878322de4f87351ad382635618f9d03a



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

In order to use NMIs we need to ensure that traps are disabled for it so
update HCRX_EL2 to ensure that TALLINT is not set when we detect support
for NMIs.

Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarJie Liu <liujie375@h-partners.com>
parent 1c203efa
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -76,6 +76,18 @@ SYM_CODE_END(elx_sync)
SYM_CODE_START_LOCAL(__finalise_el2)
	finalise_el2_state

	// NMIs
	check_override id_aa64pfr1 ID_AA64PFR1_EL1_NMI_SHIFT .Linit_nmi .Lskip_nmi x1 x2
.Linit_nmi:
	mrs	x1, id_aa64mmfr1_el1		// HCRX_EL2 present?
	ubfx	x1, x1, #ID_AA64MMFR1_EL1_HCX_SHIFT, #4
	cbz	x1, .Lskip_nmi

	mrs_s	x1, SYS_HCRX_EL2
	bic	x1, x1, #HCRX_EL2_TALLINT_MASK	// Don't trap ALLINT
	msr_s	SYS_HCRX_EL2, x1
.Lskip_nmi:

	// nVHE? No way! Give me the real thing!
	// Sanity check: MMU *must* be off
	mrs	x1, sctlr_el2