From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Song Gao <gaosong@loongson.cn>, qemu-devel@nongnu.org
Cc: richard.henderson@linaro.org, maobibo@loongson.cn
Subject: Re: [PATCH 1/5] target/loongarch: Add a new cpu_type la664
Date: Thu, 5 Sep 2024 12:32:48 +0200 [thread overview]
Message-ID: <297a595b-bbfa-47f8-a958-04d0140579af@linaro.org> (raw)
In-Reply-To: <20240729013939.1807982-2-gaosong@loongson.cn>
Hi,
On 29/7/24 03:39, Song Gao wrote:
> Add a new LoongArch cpu type la664. The la664 has many new features,
> such as new atomic instructions, hardware page table walk, etc.
> We will implement them later.
>
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> ---
> target/loongarch/cpu.c | 48 +++++++++++++++++++++++++++++++-----------
> 1 file changed, 36 insertions(+), 12 deletions(-)
> +static void loongarch_la664_initfn(Object *obj)
> +{
> + LoongArchCPU *cpu = LOONGARCH_CPU(obj);
> + CPULoongArchState *env = &cpu->env;
> + int i;
> +
> + for (i = 0; i < 21; i++) {
In order to remove the '21' magic value, can we use:
for (unsigned i = 0; i < ARRAY_SIZE(env->cpucfg); i++) {
> + env->cpucfg[i] = 0x0;
> + }
> +
> + cpu->dtb_compatible = "loongarch,Loongson-3A6000";
> + env->cpucfg[0] = 0x14d000; /* PRID */
> +
> + loongarch_common_initfn(env, obj);
> +}
> +
> +static void loongarch_la464_initfn(Object *obj)
> +{
> + LoongArchCPU *cpu = LOONGARCH_CPU(obj);
> + CPULoongArchState *env = &cpu->env;
> + int i;
> +
> + for (i = 0; i < 21; i++) {
Ditto.
> + env->cpucfg[i] = 0x0;
> + }
> +
> + cpu->dtb_compatible = "loongarch,Loongson-3A5000";
> + env->cpucfg[0] = 0x14c010; /* PRID */
> +
> + loongarch_common_initfn(env, obj);
> +}
next prev parent reply other threads:[~2024-09-05 10:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-29 1:39 [PATCH 0/5] LoongArch/tcg: Add hardware page table walker support Song Gao
2024-07-29 1:39 ` [PATCH 1/5] target/loongarch: Add a new cpu_type la664 Song Gao
2024-09-05 10:32 ` Philippe Mathieu-Daudé [this message]
2024-09-05 12:29 ` gaosong
2024-07-29 1:39 ` [PATCH 2/5] target/loongarch: Add do_lddir/ldpte() Song Gao
2024-07-29 1:39 ` [PATCH 3/5] target/loongarch: Add do_fill_tlb_entry() Song Gao
2024-07-29 1:39 ` [PATCH 4/5] target/loongarch: Add get_random_tlb_index() Song Gao
2024-07-29 1:39 ` [PATCH 5/5] target/loongarch/tcg: Add hardware page table walker support Song Gao
2024-07-29 3:57 ` Richard Henderson
2024-09-05 8:27 ` gaosong
2024-09-05 19:39 ` Richard Henderson
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=297a595b-bbfa-47f8-a958-04d0140579af@linaro.org \
--to=philmd@linaro.org \
--cc=gaosong@loongson.cn \
--cc=maobibo@loongson.cn \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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).