Skip to content

Commit

Permalink
arm: Don't let no-MPU PMSA cores write to SCTLR.M
Browse files Browse the repository at this point in the history
If the CPU is a PMSA config with no MPU implemented, then the
SCTLR.M bit should be RAZ/WI, so that the guest can never
turn on the non-existent MPU.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 1493122030-32191-7-git-send-email-peter.maydell@linaro.org
  • Loading branch information
pm215 committed Jun 2, 2017
1 parent f50cd31 commit 06312fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions target/arm/helper.c
Expand Up @@ -3258,6 +3258,11 @@ static void sctlr_write(CPUARMState *env, const ARMCPRegInfo *ri,
return;
}

if (arm_feature(env, ARM_FEATURE_PMSA) && !cpu->has_mpu) {
/* M bit is RAZ/WI for PMSA with no MPU implemented */
value &= ~SCTLR_M;
}

raw_write(env, ri, value);
/* ??? Lots of these bits are not implemented. */
/* This may enable/disable the MMU, so do a TLB flush. */
Expand Down

0 comments on commit 06312fe

Please sign in to comment.