summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-08-30 15:52:09 +0300
committerAvi Kivity <avi@redhat.com>2009-08-30 15:52:09 +0300
commit9c1257ac640c0e0ddd39d578666f36cac6f04e69 (patch)
treec7196c1f339563687d762182b5d9b82ddae383b7 /kvm-all.c
parentMerge commit '09aaa1602f9381c0e0fb539390b1793e51bdfc7b' into upstream-merge (diff)
parentkvm: Simplify cpu_synchronize_state() (diff)
downloadqemu-kvm-9c1257ac640c0e0ddd39d578666f36cac6f04e69.tar.gz
qemu-kvm-9c1257ac640c0e0ddd39d578666f36cac6f04e69.tar.bz2
qemu-kvm-9c1257ac640c0e0ddd39d578666f36cac6f04e69.zip
Merge commit '4c0960c0c483fffc5f8e1dab169d946ac295bf44' into upstream-merge
* commit '4c0960c0c483fffc5f8e1dab169d946ac295bf44': kvm: Simplify cpu_synchronize_state() Conflicts: hw/apic.c target-i386/machine.c Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/kvm-all.c b/kvm-all.c
index 794ac2c0a..d5bf7ae1b 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -579,6 +579,14 @@ static void kvm_run_coalesced_mmio(CPUState *env, struct kvm_run *run)
#endif
}
+void kvm_cpu_synchronize_state(CPUState *env)
+{
+ if (!env->kvm_state->regs_modified) {
+ kvm_arch_get_registers(env);
+ env->kvm_state->regs_modified = 1;
+ }
+}
+
int kvm_cpu_exec(CPUState *env)
{
struct kvm_run *run = env->kvm_run;
@@ -593,6 +601,11 @@ int kvm_cpu_exec(CPUState *env)
break;
}
+ if (env->kvm_state->regs_modified) {
+ kvm_arch_put_registers(env);
+ env->kvm_state->regs_modified = 0;
+ }
+
kvm_arch_pre_run(env, run);
ret = kvm_vcpu_ioctl(env, KVM_RUN, 0);
kvm_arch_post_run(env, run);