From: Peter Maydell <peter.maydell@linaro.org>
To: Pavel Fedin <p.fedin@samsung.com>
Cc: Shlomo Pongratz <shlomo.pongratz@huawei.com>,
Shlomo Pongratz <shlomopongratz@gmail.com>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v4] Use Aff1 with mpidr
Date: Fri, 12 Jun 2015 16:16:49 +0100 [thread overview]
Message-ID: <CAFEAcA_XSZruYsKLHZCu4NoebxJEaQCUVvGeAWa9XctEC9SD8A@mail.gmail.com> (raw)
In-Reply-To: <02f601d0a1e6$90c7d630$b2578290$@samsung.com>
On 8 June 2015 at 13:28, Pavel Fedin <p.fedin@samsung.com> wrote:
> +extern int arm_cpus_per_cluster;
> +
> #define TYPE_AARCH64_CPU "aarch64-cpu"
> #define AARCH64_CPU_CLASS(klass) \
> OBJECT_CLASS_CHECK(AArch64CPUClass, (klass), TYPE_AARCH64_CPU)
> diff --git a/target-arm/cpu.c b/target-arm/cpu.c
> index 4a888ab..fa9f1c0 100644
> --- a/target-arm/cpu.c
> +++ b/target-arm/cpu.c
> @@ -383,17 +383,29 @@ static inline void unset_feature(CPUARMState *env, int feature)
> env->features &= ~(1ULL << feature);
> }
>
> +int arm_cpus_per_cluster = 8;
This doesn't need to be global, it doesn't need to be exposed in
a header file, and it definitely doesn't need to be non-constant.
I suggest
#define ARM_CPUS_PER_CLUSTER 8
> +
> static void arm_cpu_initfn(Object *obj)
> {
> CPUState *cs = CPU(obj);
> ARMCPU *cpu = ARM_CPU(obj);
> static bool inited;
> + uint32_t Aff1, Aff0;
>
> cs->env_ptr = &cpu->env;
> cpu_exec_init(&cpu->env);
> cpu->cp_regs = g_hash_table_new_full(g_int_hash, g_int_equal,
> g_free, g_free);
>
> + /*
> + * We don't support setting cluster ID ([16..23]) (known as Aff2
> + * in later ARM ARM versions), or any of the higher affinity level fields,
> + * so these bits always RAZ.
> + */
> + Aff1 = cs->cpu_index / arm_cpus_per_cluster;
> + Aff0 = cs->cpu_index % arm_cpus_per_cluster;
> + cpu->mp_affinity = (Aff1 << 8) | Aff0;
Worth also mentioning in the comment that KVM will override this.
These are minor nits so I plan to just fix them as I apply
this to target-arm.next, unless you object.
thanks
-- PMM
next prev parent reply other threads:[~2015-06-12 15:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-08 12:28 [Qemu-devel] [PATCH v4] Use Aff1 with mpidr Pavel Fedin
2015-06-12 15:16 ` Peter Maydell [this message]
2015-06-15 7:13 ` Pavel Fedin
2015-06-15 7:40 ` Peter Maydell
2015-06-15 8:13 ` Pavel Fedin
2015-06-15 9:03 ` Igor Mammedov
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=CAFEAcA_XSZruYsKLHZCu4NoebxJEaQCUVvGeAWa9XctEC9SD8A@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=p.fedin@samsung.com \
--cc=qemu-devel@nongnu.org \
--cc=shlomo.pongratz@huawei.com \
--cc=shlomopongratz@gmail.com \
/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).