target/arm: Handle trapping to EL2 of AArch32 VMRS instructions
commit9ca1d776cb49c09b09579d9edd0447542970c834
authorMarc Zyngier <maz@kernel.org>
Sun, 1 Dec 2019 12:20:16 +0000 (1 12:20 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 16 Dec 2019 10:46:34 +0000 (16 10:46 +0000)
tree4c138b049175213a279178e8463f77d9469902cb
parent93fbc983b29a2eb84e2f6065929caf14f99c3681
target/arm: Handle trapping to EL2 of AArch32 VMRS instructions

HCR_EL2.TID3 requires that AArch32 reads of MVFR[012] are trapped to
EL2, and HCR_EL2.TID0 does the same for reads of FPSID.
In order to handle this, introduce a new TCG helper function that
checks for these control bits before executing the VMRC instruction.

Tested with a hacked-up version of KVM/arm64 that sets the control
bits for 32bit guests.

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20191201122018.25808-4-maz@kernel.org
[PMM: move helper declaration to helper.h; make it
 TCG_CALL_NO_WG]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/helper.h
target/arm/translate-vfp.inc.c
target/arm/vfp_helper.c