]> git.proxmox.com Git - mirror_qemu.git/commit
target/arm: Implement FEAT_NV2 redirection of sysregs to RAM
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 9 Jan 2024 14:43:53 +0000 (14:43 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 9 Jan 2024 14:43:53 +0000 (14:43 +0000)
commitdaf9b4a00fd19dcab8df9091080367889befa4c2
tree4e95b2e48adfd912c8740a9b1240ccb848623c65
parentc35da11df40678d606064f75a7c2d747efa1b302
target/arm: Implement FEAT_NV2 redirection of sysregs to RAM

FEAT_NV2 requires that when HCR_EL2.{NV,NV2} == 0b11 then accesses by
EL1 to certain system registers are redirected to RAM.  The full list
of affected registers is in the table in rule R_CSRPQ in the Arm ARM.
The registers may be normally accessible at EL1 (like ACTLR_EL1), or
normally UNDEF at EL1 (like HCR_EL2).  Some registers redirect to RAM
only when HCR_EL2.NV1 is 0, and some only when HCR_EL2.NV1 is 1;
others trap in both cases.

Add the infrastructure for identifying which registers should be
redirected and turning them into memory accesses.

This code does not set the correct syndrome or arrange for the
exception to be taken to the correct target EL if the access via
VNCR_EL2 faults; we will do that in the next commit.

Subsequent commits will mark up the relevant regdefs to set their
nv2_redirect_offset, and if relevant one of the two flags which
indicates that the redirect happens only for a particular value of
HCR_EL2.NV1.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Miguel Luis <miguel.luis@oracle.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
target/arm/cpregs.h
target/arm/cpu.h
target/arm/tcg/hflags.c
target/arm/tcg/translate-a64.c
target/arm/tcg/translate.h