diff --git a/qemu/target/arm/helper.c b/qemu/target/arm/helper.c index ad5a7df6..eee3adb6 100644 --- a/qemu/target/arm/helper.c +++ b/qemu/target/arm/helper.c @@ -2984,6 +2984,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. */