Re: [Qemu-devel] [PATCH 02/12] target-mips: update cpu_save/cpu_load to support KScratch registers

2014-07-08 Thread Leon Alrae
On 19/06/2014 18:43, Richard Henderson wrote:
 You must update CPU_SAVE_VERSION when you change the contents of the save 
 data.
 
 For extra credit, consider updating target-mips to VMStateDescription 
 structure(s).
 
 
 r~
 

v2 contains updated CPU_SAVE_VERSION.

VMStateDescription structures sound like nice to have in target-mips -
at the moment I'm not able to look at this, but I'll keep that in mind.

Thanks,
Leon




[Qemu-devel] [PATCH 02/12] target-mips: update cpu_save/cpu_load to support KScratch registers

2014-06-19 Thread Leon Alrae

Signed-off-by: Leon Alrae leon.al...@imgtec.com
---
 target-mips/machine.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/target-mips/machine.c b/target-mips/machine.c
index 0496faa..966c5ef 100644
--- a/target-mips/machine.c
+++ b/target-mips/machine.c
@@ -144,6 +144,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++)
@@ -301,6 +304,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 = 4) {
+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++) {
-- 
1.7.5.4




Re: [Qemu-devel] [PATCH 02/12] target-mips: update cpu_save/cpu_load to support KScratch registers

2014-06-19 Thread Richard Henderson
You must update CPU_SAVE_VERSION when you change the contents of the save data.

For extra credit, consider updating target-mips to VMStateDescription 
structure(s).


r~