Skip to content

Commit

Permalink
target-arm: fix TTBCR write masking
Browse files Browse the repository at this point in the history
Current implementation is not accurate according to ARMv7-AR reference
manual. See "B4.1.153 TTBCR, Translation Table Base Control Register,
VMSA | TTBCR format when using the Long-descriptor translation table
format". When LPAE feature is supported, EAE, bit[31] selects
translation descriptor format and, therefore, TTBCR format.

Signed-off-by: Sergey Fedorov <s.fedorov@samsung.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1386657709-23399-1-git-send-email-s.fedorov@samsung.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
Sergey Fedorov authored and pm215 committed Dec 10, 2013
1 parent 09f7813 commit 74f1c6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target-arm/helper.c
Expand Up @@ -1173,7 +1173,7 @@ static int vmsa_ttbcr_raw_write(CPUARMState *env, const ARMCPRegInfo *ri,
{
int maskshift = extract32(value, 0, 3);

if (arm_feature(env, ARM_FEATURE_LPAE)) {
if (arm_feature(env, ARM_FEATURE_LPAE) && (value & (1 << 31))) {
value &= ~((7 << 19) | (3 << 14) | (0xf << 3));
} else {
value &= 7;
Expand Down

0 comments on commit 74f1c6d

Please sign in to comment.