[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH 06/13] arm: Don't let no-MPU PMSA cores write to SCTLR
From: |
Peter Maydell |
Subject: |
[Qemu-arm] [PATCH 06/13] arm: Don't let no-MPU PMSA cores write to SCTLR.M |
Date: |
Tue, 25 Apr 2017 13:07:03 +0100 |
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 <address@hidden>
---
target/arm/helper.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 404bfdb..f0f25c8 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -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. */
--
2.7.4
- [Qemu-arm] [PATCH 00/13] armv7m: Implement MPU support, Peter Maydell, 2017/04/25
- [Qemu-arm] [PATCH 06/13] arm: Don't let no-MPU PMSA cores write to SCTLR.M,
Peter Maydell <=
- [Qemu-arm] [PATCH 08/13] armv7m: Improve "-d mmu" tracing for PMSAv7 MPU, Peter Maydell, 2017/04/25
- [Qemu-arm] [PATCH 13/13] arm: Implement HFNMIENA support for M profile MPU, Peter Maydell, 2017/04/25
- [Qemu-arm] [PATCH 11/13] armv7m: Classify faults as MemManage or BusFault, Peter Maydell, 2017/04/25
- [Qemu-arm] [PATCH 10/13] arm: All M profile cores are PMSA, Peter Maydell, 2017/04/25
- [Qemu-arm] [PATCH 03/13] arm: Use different ARMMMUIdx values for M profile, Peter Maydell, 2017/04/25
- [Qemu-arm] [PATCH 05/13] arm: Don't clear ARM_FEATURE_PMSA for no-mpu configs, Peter Maydell, 2017/04/25
- [Qemu-arm] [PATCH 02/13] arm: Add support for M profile CPUs having different MMU index semantics, Peter Maydell, 2017/04/25
- [Qemu-arm] [PATCH 01/13] arm: Use the mmu_idx we're passed in arm_cpu_do_unaligned_access(), Peter Maydell, 2017/04/25
- [Qemu-arm] [PATCH 04/13] arm: Clean up handling of no-MPU PMSA CPUs, Peter Maydell, 2017/04/25
- [Qemu-arm] [PATCH 09/13] armv7m: Implement M profile default memory map, Peter Maydell, 2017/04/25