From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>, f4bug@amsat.org
Cc: qemu-devel@nongnu.org, pavel.dovgalyuk@ispras.ru
Subject: Re: [PATCH 1/3] target/mips: Set CP0St_{KX, SX, UX} for Loongson-2F
Date: Sat, 29 Oct 2022 19:44:00 +0200 [thread overview]
Message-ID: <5101ed53-5138-d40e-559e-1a3fd76a8c94@linaro.org> (raw)
In-Reply-To: <20221029020030.13936-2-jiaxun.yang@flygoat.com>
On 29/10/22 04:00, Jiaxun Yang wrote:
> As per "Loongson-2F processor user manual", CP0St_{KX, SX, UX}
> should is not writeable and hardcoded to 1.
>
> Without those bits set, kernel is unable to access XKPHYS address
> segmant. So just set them up on CPU reset.
>
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
> target/mips/cpu.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/target/mips/cpu.c b/target/mips/cpu.c
> index d0a76b95f7..a870901bfa 100644
> --- a/target/mips/cpu.c
> +++ b/target/mips/cpu.c
> @@ -304,6 +304,12 @@ static void mips_cpu_reset(DeviceState *dev)
> env->CP0_EntryHi_ASID_mask = (env->CP0_Config5 & (1 << CP0C5_MI)) ?
> 0x0 : (env->CP0_Config4 & (1 << CP0C4_AE)) ? 0x3ff : 0xff;
> env->CP0_Status = (1 << CP0St_BEV) | (1 << CP0St_ERL);
> + if (env->insn_flags & INSN_LOONGSON2F) {
> + /* Loongson-2F has those bits hardcoded to 1 */
> + env->CP0_Status |= (1 << CP0St_KX) | (1 << CP0St_SX) |
> + (1 << CP0St_UX);
> + }
Don't we want to update CP0_Status_rw_bitmask in Loongson-2F
entry in mips_defs[] instead?
next prev parent reply other threads:[~2022-10-29 17:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-29 2:00 [PATCH 0/3] MIPS system emulation miscellaneous fixes Jiaxun Yang
2022-10-29 2:00 ` [PATCH 1/3] target/mips: Set CP0St_{KX, SX, UX} for Loongson-2F Jiaxun Yang
2022-10-29 17:44 ` Philippe Mathieu-Daudé [this message]
2022-10-29 19:50 ` Jiaxun Yang
2022-10-29 23:19 ` Philippe Mathieu-Daudé
2022-10-30 0:05 ` Jiaxun Yang
2022-10-31 0:04 ` Richard Henderson
2022-10-29 2:00 ` [PATCH 2/3] target/mips: Cast offset field of Octeon BBIT to int16_t Jiaxun Yang
2022-10-29 17:48 ` Philippe Mathieu-Daudé
2022-10-29 2:00 ` [PATCH 3/3] target/mips: Disable DSP ASE for Octeon68XX Jiaxun Yang
2022-10-31 0:05 ` 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=5101ed53-5138-d40e-559e-1a3fd76a8c94@linaro.org \
--to=philmd@linaro.org \
--cc=f4bug@amsat.org \
--cc=jiaxun.yang@flygoat.com \
--cc=pavel.dovgalyuk@ispras.ru \
--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).