From e564ed6311f4a3061597996d6eaf97563e2c52df Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 2 Mar 2018 19:10:42 -0500 Subject: [PATCH] arm: Don't clear ARM_FEATURE_PMSA for no-mpu configs Fix the handling of QOM properties for PMSA CPUs with no MPU: Allow no-MPU to be specified by either: * has-mpu = false * pmsav7_dregion = 0 and make setting one imply the other. Don't clear the PMSA feature bit in this situation. Backports commit f50cd31413d8bc9d1eef8edd1f878324543bf65d from qemu --- qemu/target/arm/cpu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qemu/target/arm/cpu.c b/qemu/target/arm/cpu.c index af6bac40..e7367f81 100644 --- a/qemu/target/arm/cpu.c +++ b/qemu/target/arm/cpu.c @@ -574,8 +574,14 @@ static int arm_cpu_realizefn(struct uc_struct *uc, DeviceState *dev, Error **err cpu->id_pfr1 &= ~0xf000; } + /* MPU can be configured out of a PMSA CPU either by setting has-mpu + * to false or by setting pmsav7-dregion to 0. + */ if (!cpu->has_mpu) { - unset_feature(env, ARM_FEATURE_PMSA); + cpu->pmsav7_dregion = 0; + } + if (cpu->pmsav7_dregion == 0) { + cpu->has_mpu = false; } if (arm_feature(env, ARM_FEATURE_PMSA) &&