From: Yongbok Kim <yongbok.kim@imgtec.com>
To: Leon Alrae <leon.alrae@imgtec.com>, qemu-devel@nongnu.org
Cc: aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH v2 9/9] target-mips: update cpu_save/cpu_load to support new registers
Date: Thu, 16 Oct 2014 14:06:36 +0100 [thread overview]
Message-ID: <543FC2DC.8040700@imgtec.com> (raw)
In-Reply-To: <1404806257-28048-10-git-send-email-leon.alrae@imgtec.com>
EHINV bit from TLB also required to be saved/ restored.
Regards,
Yongbok
On 08/07/2014 08:57, Leon Alrae wrote:
> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
> ---
> target-mips/cpu.h | 2 +-
> target-mips/machine.c | 14 ++++++++++++++
> 2 files changed, 15 insertions(+), 1 deletions(-)
>
> diff --git a/target-mips/cpu.h b/target-mips/cpu.h
> index 656f5ca..23bb22c 100644
> --- a/target-mips/cpu.h
> +++ b/target-mips/cpu.h
> @@ -557,7 +557,7 @@ void mips_cpu_list (FILE *f, fprintf_function cpu_fprintf);
> extern void cpu_wrdsp(uint32_t rs, uint32_t mask_num, CPUMIPSState *env);
> extern uint32_t cpu_rddsp(uint32_t mask_num, CPUMIPSState *env);
>
> -#define CPU_SAVE_VERSION 4
> +#define CPU_SAVE_VERSION 5
>
> /* MMU modes definitions. We carefully match the indices with our
> hflags layout. */
> diff --git a/target-mips/machine.c b/target-mips/machine.c
> index 0496faa..576dc10 100644
> --- a/target-mips/machine.c
> +++ b/target-mips/machine.c
> @@ -26,6 +26,8 @@ static void save_tc(QEMUFile *f, TCState *tc)
> qemu_put_betls(f, &tc->CP0_TCScheFBack);
> qemu_put_sbe32s(f, &tc->CP0_Debug_tcstatus);
> qemu_put_betls(f, &tc->CP0_UserLocal);
> + qemu_put_be32s(f, &tc->CP0_BadInstr);
> + qemu_put_be32s(f, &tc->CP0_BadInstrP);
> }
>
> static void save_fpu(QEMUFile *f, CPUMIPSFPUContext *fpu)
> @@ -144,6 +146,9 @@ void cpu_save(QEMUFile *f, void *opaque)
> qemu_put_sbe32s(f, &env->CP0_DataHi);
> qemu_put_betls(f, &env->CP0_ErrorEPC);
> qemu_put_sbe32s(f, &env->CP0_DESAVE);
> + for (i = 0; i < MIPS_KSCRATCH_NUM; i++) {
> + qemu_put_betls(f, &env->CP0_KScratch[i]);
> + }
>
> /* Save inactive TC state */
> for (i = 0; i < MIPS_SHADOW_SET_MAX; i++)
> @@ -177,6 +182,10 @@ static void load_tc(QEMUFile *f, TCState *tc, int version_id)
> if (version_id >= 4) {
> qemu_get_betls(f, &tc->CP0_UserLocal);
> }
> + if (version_id >= 5) {
> + qemu_get_be32s(f, &tc->CP0_BadInstr);
> + qemu_get_be32s(f, &tc->CP0_BadInstrP);
> + }
> }
>
> static void load_fpu(QEMUFile *f, CPUMIPSFPUContext *fpu)
> @@ -301,6 +310,11 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
> qemu_get_sbe32s(f, &env->CP0_DataHi);
> qemu_get_betls(f, &env->CP0_ErrorEPC);
> qemu_get_sbe32s(f, &env->CP0_DESAVE);
> + if (version_id >= 5) {
> + for (i = 0; i < MIPS_KSCRATCH_NUM; i++) {
> + qemu_get_betls(f, &env->CP0_KScratch[i]);
> + }
> + }
>
> /* Load inactive TC state */
> for (i = 0; i < MIPS_SHADOW_SET_MAX; i++) {
prev parent reply other threads:[~2014-10-16 13:06 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-08 7:57 [Qemu-devel] [PATCH v2 0/9] target-mips: implement features required in MIPS64 Release 6 Leon Alrae
2014-07-08 7:57 ` [Qemu-devel] [PATCH v2 1/9] target-mips: add KScratch registers Leon Alrae
2014-10-14 13:59 ` Yongbok Kim
2014-10-20 12:54 ` Leon Alrae
2014-07-08 7:57 ` [Qemu-devel] [PATCH v2 2/9] softmmu: provide softmmu access type enum Leon Alrae
2014-07-08 13:00 ` Peter Maydell
2014-07-08 16:08 ` Leon Alrae
2014-07-08 16:12 ` Peter Maydell
2014-07-08 7:57 ` [Qemu-devel] [PATCH v2 3/9] target-mips: distinguish between data load and instruction fetch Leon Alrae
2014-10-14 15:55 ` Yongbok Kim
2014-07-08 7:57 ` [Qemu-devel] [PATCH v2 4/9] target-mips: add RI and XI fields to TLB entry Leon Alrae
2014-10-15 12:24 ` Yongbok Kim
2014-10-24 14:16 ` Leon Alrae
2014-10-24 14:27 ` Yongbok Kim
2014-07-08 7:57 ` [Qemu-devel] [PATCH v2 5/9] target-mips: update PageGrain and m{t, f}c0 EntryLo{0, 1} Leon Alrae
2014-10-15 15:20 ` Yongbok Kim
2014-07-08 7:57 ` [Qemu-devel] [PATCH v2 6/9] target-mips: add new Read-Inhibit and Execute-Inhibit exceptions Leon Alrae
2014-10-15 15:39 ` Yongbok Kim
2014-07-08 7:57 ` [Qemu-devel] [PATCH v2 7/9] target-mips: add TLBINV support Leon Alrae
2014-10-16 10:52 ` Yongbok Kim
2014-10-16 13:03 ` Leon Alrae
2014-07-08 7:57 ` [Qemu-devel] [PATCH v2 8/9] target-mips: add BadInstr and BadInstrP support Leon Alrae
2014-07-08 12:44 ` James Hogan
2014-07-08 15:56 ` Leon Alrae
2014-07-08 7:57 ` [Qemu-devel] [PATCH v2 9/9] target-mips: update cpu_save/cpu_load to support new registers Leon Alrae
2014-10-16 13:06 ` Yongbok Kim [this message]
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=543FC2DC.8040700@imgtec.com \
--to=yongbok.kim@imgtec.com \
--cc=aurelien@aurel32.net \
--cc=leon.alrae@imgtec.com \
--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).