From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>, qemu-devel@nongnu.org
Cc: yangxiaojuan@loongson.cn, gaosong@loongson.cn, chenhuacai@kernel.org
Subject: Re: [PATCH 1/2] target/mips: Implement Loongson CSR instructions
Date: Mon, 10 Jul 2023 13:03:02 +0200 [thread overview]
Message-ID: <62d0d9d2-f802-60d4-8e67-645ce1290a68@linaro.org> (raw)
In-Reply-To: <9b8fcbe7-af56-7265-75ea-817460dbf6e8@linaro.org>
On 22/5/23 08:00, Philippe Mathieu-Daudé wrote:
> Hi Jiaxun,
>
> On 21/5/23 23:48, Jiaxun Yang wrote:
>> Loongson introduced CSR instructions since 3A4000, which looks
>> similar to IOCSR and CPUCFG instructions we seen in LoongArch.
>>
>> Unfortunately we don't have much document about those instructions,
>> bit fields of CPUCFG instructions and IOCSR registers can be found
>> at 3A4000's user manual, while instruction encodings can be found
>> at arch/mips/include/asm/mach-loongson64/loongson_regs.h from
>> Linux Kernel.
>>
>> Our predefined CPUCFG bits are differ from actual 3A4000, since
>> we can't emulate all CPUCFG features present in 3A4000 for now,
>> we just enable bits for what we have in TCG.
>>
>> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
>> ---
>> target/mips/cpu-defs.c.inc | 9 ++++
>> target/mips/cpu.c | 8 ++++
>> target/mips/cpu.h | 40 ++++++++++++++++
>> target/mips/helper.h | 4 ++
>> target/mips/internal.h | 2 +
>> target/mips/tcg/lcsr.decode | 17 +++++++
>> target/mips/tcg/lcsr_translate.c | 69 ++++++++++++++++++++++++++++
>> target/mips/tcg/meson.build | 2 +
>> target/mips/tcg/op_helper.c | 16 +++++++
>> target/mips/tcg/sysemu/lcsr_helper.c | 45 ++++++++++++++++++
>> target/mips/tcg/sysemu/meson.build | 4 ++
>> target/mips/tcg/sysemu_helper.h.inc | 8 ++++
>> target/mips/tcg/translate.c | 3 ++
>> target/mips/tcg/translate.h | 7 +++
>> 14 files changed, 234 insertions(+)
>> create mode 100644 target/mips/tcg/lcsr.decode
>> create mode 100644 target/mips/tcg/lcsr_translate.c
>> create mode 100644 target/mips/tcg/sysemu/lcsr_helper.c
>> @@ -1281,6 +1315,12 @@ static inline bool
>> ase_msa_available(CPUMIPSState *env)
>> return env->CP0_Config3 & (1 << CP0C3_MSAP);
>> }
>> +/* Check presence of Loongson CSR instructions */
>> +static inline bool ase_lcsr_available(CPUMIPSState *env)
>> +{
>> + return env->lcsr_cpucfg1 & (1 << CPUCFG2_LCSRP);
>
> You are checking CPUCFG1_ITLBT. Surely you want lcsr_cpucfg2 instead.
Ping?
Anyhow:
Applying: target/mips: Implement Loongson CSR instructions
error: patch failed: target/mips/cpu.c:507
error: target/mips/cpu.c: patch does not apply
error: patch failed: target/mips/cpu.h:1162
error: target/mips/cpu.h: patch does not apply
Patch failed at 0001 target/mips: Implement Loongson CSR instructions
next prev parent reply other threads:[~2023-07-10 11:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-21 21:48 [PATCH 0/2] MIPS: Enable Loongson-3A4000 TCG for system emulation Jiaxun Yang
2023-05-21 21:48 ` [PATCH 1/2] target/mips: Implement Loongson CSR instructions Jiaxun Yang
2023-05-22 6:00 ` Philippe Mathieu-Daudé
2023-07-10 11:03 ` Philippe Mathieu-Daudé [this message]
2023-07-10 20:00 ` Philippe Mathieu-Daudé
2023-07-10 20:11 ` Philippe Mathieu-Daudé
2023-07-10 21:34 ` Philippe Mathieu-Daudé
2023-05-21 21:48 ` [PATCH 2/2] hw/mips/loongson3_virt: Remove CPU restrictions for TCG Jiaxun Yang
2023-05-22 6:03 ` Philippe Mathieu-Daudé
2023-05-22 12:08 ` Philippe Mathieu-Daudé
2023-05-22 12:43 ` Jiaxun Yang
2023-07-10 19:54 ` [PATCH 0/2] MIPS: Enable Loongson-3A4000 TCG for system emulation Philippe Mathieu-Daudé
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=62d0d9d2-f802-60d4-8e67-645ce1290a68@linaro.org \
--to=philmd@linaro.org \
--cc=chenhuacai@kernel.org \
--cc=gaosong@loongson.cn \
--cc=jiaxun.yang@flygoat.com \
--cc=qemu-devel@nongnu.org \
--cc=yangxiaojuan@loongson.cn \
/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).