From 4c0960c0c483fffc5f8e1dab169d946ac295bf44 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 17 Aug 2009 23:19:53 +0300 Subject: kvm: Simplify cpu_synchronize_state() cpu_synchronize_state() is a little unreadable since the 'modified' argument isn't self-explanatory. Simplify it by making it always synchronize the kernel state into qemu, and automatically flush the registers back to the kernel if they've been synchronized on this exit. Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori --- target-ppc/machine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'target-ppc') diff --git a/target-ppc/machine.c b/target-ppc/machine.c index deb2e2d801..4897c8a4d3 100644 --- a/target-ppc/machine.c +++ b/target-ppc/machine.c @@ -7,7 +7,7 @@ void cpu_save(QEMUFile *f, void *opaque) CPUState *env = (CPUState *)opaque; unsigned int i, j; - cpu_synchronize_state(env, 0); + cpu_synchronize_state(env); for (i = 0; i < 32; i++) qemu_put_betls(f, &env->gpr[i]); @@ -96,6 +96,8 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) CPUState *env = (CPUState *)opaque; unsigned int i, j; + cpu_synchronize_state(env); + for (i = 0; i < 32; i++) qemu_get_betls(f, &env->gpr[i]); #if !defined(TARGET_PPC64) @@ -177,7 +179,5 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id) qemu_get_sbe32s(f, &env->mmu_idx); qemu_get_sbe32s(f, &env->power_mode); - cpu_synchronize_state(env, 1); - return 0; } -- cgit v1.2.3