diff mbox series

[10/13] arm: All M profile cores are PMSA

Message ID 1493122030-32191-11-git-send-email-peter.maydell@linaro.org
State Superseded
Headers show
Series armv7m: Implement MPU support | expand

Commit Message

Peter Maydell April 25, 2017, 12:07 p.m. UTC
All M profile CPUs are PMSA, so set the feature bit.
(We haven't actually implemented the M profile MPU register
interface yet, but setting this feature bit gives us closer
to correct behaviour for the MPU-disabled case.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

---
 target/arm/cpu.c | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.7.4

Comments

Philippe Mathieu-Daudé May 13, 2017, 10:40 p.m. UTC | #1
On 04/25/2017 09:07 AM, Peter Maydell wrote:
> All M profile CPUs are PMSA, so set the feature bit.

> (We haven't actually implemented the M profile MPU register

> interface yet, but setting this feature bit gives us closer

> to correct behaviour for the MPU-disabled case.)

>

> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


> ---

>  target/arm/cpu.c | 8 ++++++++

>  1 file changed, 8 insertions(+)

>

> diff --git a/target/arm/cpu.c b/target/arm/cpu.c

> index 8e57498..df8b835 100644

> --- a/target/arm/cpu.c

> +++ b/target/arm/cpu.c

> @@ -543,6 +543,14 @@ static void arm_cpu_post_init(Object *obj)

>  {

>      ARMCPU *cpu = ARM_CPU(obj);

>

> +    /* M profile implies PMSA. We have to do this here rather than

> +     * in realize with the other feature-implication checks because

> +     * we look at the PMSA bit to see if we should add some properties.

> +     */

> +    if (arm_feature(&cpu->env, ARM_FEATURE_M)) {

> +        set_feature(&cpu->env, ARM_FEATURE_PMSA);

> +    }

> +

>      if (arm_feature(&cpu->env, ARM_FEATURE_CBAR) ||

>          arm_feature(&cpu->env, ARM_FEATURE_CBAR_RO)) {

>          qdev_property_add_static(DEVICE(obj), &arm_cpu_reset_cbar_property,

>
diff mbox series

Patch

diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 8e57498..df8b835 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -543,6 +543,14 @@  static void arm_cpu_post_init(Object *obj)
 {
     ARMCPU *cpu = ARM_CPU(obj);
 
+    /* M profile implies PMSA. We have to do this here rather than
+     * in realize with the other feature-implication checks because
+     * we look at the PMSA bit to see if we should add some properties.
+     */
+    if (arm_feature(&cpu->env, ARM_FEATURE_M)) {
+        set_feature(&cpu->env, ARM_FEATURE_PMSA);
+    }
+
     if (arm_feature(&cpu->env, ARM_FEATURE_CBAR) ||
         arm_feature(&cpu->env, ARM_FEATURE_CBAR_RO)) {
         qdev_property_add_static(DEVICE(obj), &arm_cpu_reset_cbar_property,