From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, patches@linaro.org,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] target/arm: Make Cortex-M3 and M4 default to 8 PMSA regions
Date: Tue, 11 Jul 2017 13:18:58 -0400 (EDT) [thread overview]
Message-ID: <1572293529.49604420.1499793538326.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <1499788408-10096-4-git-send-email-peter.maydell@linaro.org>
Hi
----- Original Message -----
> The Cortex-M3 and M4 CPUs always have 8 PMSA MPU regions (this isn't
> a configurable option for the hardware). Make the default value of
> the pmsav7-dregion property be set per-cpu, so we don't need to have
> every user of these CPUs set it manually. (The existing default of
> 16 is correct for the other PMSAv7 core, the Cortex-R5.)
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
So until now that value was wrong for m3/m4 if I understand correctly.
> ---
> target/arm/cpu.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/target/arm/cpu.c b/target/arm/cpu.c
> index 28a9141..96d1f84 100644
> --- a/target/arm/cpu.c
> +++ b/target/arm/cpu.c
> @@ -543,8 +543,15 @@ static Property arm_cpu_has_pmu_property =
> static Property arm_cpu_has_mpu_property =
> DEFINE_PROP_BOOL("has-mpu", ARMCPU, has_mpu, true);
>
> +/* This is like DEFINE_PROP_UINT32 but it doesn't set the default value,
> + * because the CPU initfn will have already set cpu->pmsav7_dregion to
> + * the right value for that particular CPU type, and we don't want
> + * to override that with an incorrect constant value.
> + */
> static Property arm_cpu_pmsav7_dregion_property =
> - DEFINE_PROP_UINT32("pmsav7-dregion", ARMCPU, pmsav7_dregion,
> 16);
> + DEFINE_PROP_UNSIGNED_NODEFAULT("pmsav7-dregion", ARMCPU,
> + pmsav7_dregion,
> + qdev_prop_uint32, uint32_t);
>
> static void arm_cpu_post_init(Object *obj)
> {
> @@ -1054,6 +1061,7 @@ static void cortex_m3_initfn(Object *obj)
> set_feature(&cpu->env, ARM_FEATURE_V7);
> set_feature(&cpu->env, ARM_FEATURE_M);
> cpu->midr = 0x410fc231;
> + cpu->pmsav7_dregion = 8;
> }
>
> static void cortex_m4_initfn(Object *obj)
> @@ -1064,6 +1072,7 @@ static void cortex_m4_initfn(Object *obj)
> set_feature(&cpu->env, ARM_FEATURE_M);
> set_feature(&cpu->env, ARM_FEATURE_THUMB_DSP);
> cpu->midr = 0x410fc240; /* r0p0 */
> + cpu->pmsav7_dregion = 8;
> }
> static void arm_v7m_class_init(ObjectClass *oc, void *data)
> {
> @@ -1112,6 +1121,7 @@ static void cortex_r5_initfn(Object *obj)
> cpu->id_isar4 = 0x0010142;
> cpu->id_isar5 = 0x0;
> cpu->mp_is_up = true;
> + cpu->pmsav7_dregion = 16;
> define_arm_cp_regs(cpu, cortexr5_cp_reginfo);
> }
>
> --
> 2.7.4
>
>
next prev parent reply other threads:[~2017-07-11 17:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 15:53 [Qemu-devel] [PATCH 0/3] Allow int props with no default, use them in ARM Peter Maydell
2017-07-11 15:53 ` [Qemu-devel] [PATCH 1/3] qdev-properties.h: Explicitly set the default value for arraylen properties Peter Maydell
2017-07-11 16:46 ` Marc-André Lureau
2017-07-13 14:11 ` Markus Armbruster
2017-07-13 14:26 ` Peter Maydell
2017-07-13 16:21 ` Markus Armbruster
2017-07-11 15:53 ` [Qemu-devel] [PATCH 2/3] qdev: support properties which don't set a default value Peter Maydell
2017-07-11 17:15 ` Marc-André Lureau
2017-07-11 17:25 ` Peter Maydell
2017-07-12 11:22 ` Markus Armbruster
2017-07-12 12:27 ` Peter Maydell
2017-07-13 15:38 ` Peter Maydell
2017-07-13 17:10 ` Markus Armbruster
2017-07-13 17:18 ` Peter Maydell
2017-07-13 18:25 ` Markus Armbruster
2017-07-11 15:53 ` [Qemu-devel] [PATCH 3/3] target/arm: Make Cortex-M3 and M4 default to 8 PMSA regions Peter Maydell
2017-07-11 17:18 ` Marc-André Lureau [this message]
2017-07-11 17:27 ` Peter Maydell
2017-07-11 17:30 ` Marc-André Lureau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1572293529.49604420.1499793538326.JavaMail.zimbra@redhat.com \
--to=marcandre.lureau@redhat.com \
--cc=armbru@redhat.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).