OSDN Git Service

target/arm: Implement FEAT_MOPS enable bits
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 12 Sep 2023 14:04:24 +0000 (15:04 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 21 Sep 2023 15:07:13 +0000 (16:07 +0100)
commitdbc678f90a1dab0d2701b068dd7eab627869d045
treed06e464f1ee5f3dd8f16b752825c6bbcc4f07757
parent903dbefc2b6918c10d12d9aafa0168cee8d287c7
target/arm: Implement FEAT_MOPS enable bits

FEAT_MOPS defines a handful of new enable bits:
 * HCRX_EL2.MSCEn, SCTLR_EL1.MSCEn, SCTLR_EL2.MSCen:
   define whether the new insns should UNDEF or not
 * HCRX_EL2.MCE2: defines whether memops exceptions from
   EL1 should be taken to EL1 or EL2

Since we don't sanitise what bits can be written for the SCTLR
registers, we only need to handle the new bits in HCRX_EL2, and
define SCTLR_MSCEN for the new SCTLR bit value.

The precedence of "HCRX bits acts as 0 if SCR_EL3.HXEn is 0" versus
"bit acts as 1 if EL2 disabled" is not clear from the register
definition text, but it is clear in the CheckMOPSEnabled()
pseudocode(), so we follow that.  We'll have to check whether other
bits we need to implement in future follow the same logic or not.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230912140434.1333369-3-peter.maydell@linaro.org
target/arm/cpu.h
target/arm/helper.c