Skip to content

Commit

Permalink
target/arm: Check VSTCR.SW when assigning the stage 2 output PA space
Browse files Browse the repository at this point in the history
As per the AArch64.SS2OutputPASpace() psuedo-code in the ARMv8 ARM when the
PA space of the IPA is non secure, the output PA space is secure if and only
if all of the bits VTCR.<NSW, NSA>, VSTCR.<SW, SA> are not set.

Signed-off-by: Idan Horowitz <idan.horowitz@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220327093427.1548629-2-idan.horowitz@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
IdanHo authored and pm215 committed Apr 1, 2022
1 parent 0da067f commit d3b2d19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/arm/helper.c
Expand Up @@ -12697,7 +12697,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong address,
} else {
attrs->secure =
!((env->cp15.vtcr_el2.raw_tcr & (VTCR_NSA | VTCR_NSW))
|| (env->cp15.vstcr_el2.raw_tcr & VSTCR_SA));
|| (env->cp15.vstcr_el2.raw_tcr & (VSTCR_SA | VSTCR_SW)));
}
}
return 0;
Expand Down

0 comments on commit d3b2d19

Please sign in to comment.