Commit 8888a342 authored by Zeng Heng's avatar Zeng Heng
Browse files

Revert "arm64: head.S: Initialise MPAM EL2 registers and disable traps"

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9OXPO



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

This reverts commit a01fda35.

If BIOS firmware doesn't enable MPAM function under EL3 environment, while
the hardware has the MPAM ability, that would cause illegal instruction
fault when access MPAM registers.

It should be noted that this will bring potential risks to Kdump. If the
previous kernel has an unhandled MPAM exception interrupt, it would cause
Kdump crash after re-enable interrupt capability.

Fixes: a01fda35 ("arm64: head.S: Initialise MPAM EL2 registers and disable traps")
Signed-off-by: default avatarZeng Heng <zengheng4@huawei.com>
parent d25e57f4
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -209,21 +209,6 @@
	msr	spsr_el2, x0
.endm

.macro __init_el2_mpam
#ifdef CONFIG_ARM64_MPAM
	/* Memory Partioning And Monitoring: disable EL2 traps */
	mrs	x1, id_aa64pfr0_el1
	ubfx	x0, x1, #ID_AA64PFR0_EL1_MPAM_SHIFT, #4
	cbz	x0, .Lskip_mpam_\@		// skip if no MPAM
	msr_s	SYS_MPAM2_EL2, xzr		// use the default partition
						// and disable lower traps
	mrs_s	x0, SYS_MPAMIDR_EL1
	tbz	x0, #17, .Lskip_mpam_\@		// skip if no MPAMHCR reg
	msr_s	SYS_MPAMHCR_EL2, xzr		// clear TRAP_MPAMIDR_EL1 -> EL2
.Lskip_mpam_\@:
#endif /* CONFIG_ARM64_MPAM */
.endm

/**
 * Initialize EL2 registers to sane values. This should be called early on all
 * cores that were booted in EL2. Note that everything gets initialised as
@@ -241,7 +226,6 @@
	__init_el2_stage2
	__init_el2_gicv3
	__init_el2_hstr
	__init_el2_mpam
	__init_el2_nvhe_idregs
	__init_el2_cptr
	__init_el2_fgt