aboutsummaryrefslogtreecommitdiff
path: root/kvm.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-08-17 23:19:53 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 20:35:30 -0500
commit4c0960c0c483fffc5f8e1dab169d946ac295bf44 (patch)
tree1dd3a77d60b3aa96132741326bdb3a8e66fa95c8 /kvm.h
parent09aaa1602f9381c0e0fb539390b1793e51bdfc7b (diff)
downloadqemu-4c0960c0c483fffc5f8e1dab169d946ac295bf44.zip
qemu-4c0960c0c483fffc5f8e1dab169d946ac295bf44.tar.gz
qemu-4c0960c0c483fffc5f8e1dab169d946ac295bf44.tar.bz2
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 <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'kvm.h')
-rw-r--r--kvm.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/kvm.h b/kvm.h
index 0d4dd53..dbe825f 100644
--- a/kvm.h
+++ b/kvm.h
@@ -128,16 +128,14 @@ int kvm_check_extension(KVMState *s, unsigned int extension);
uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function,
int reg);
+void kvm_cpu_synchronize_state(CPUState *env);
/* generic hooks - to be moved/refactored once there are more users */
-static inline void cpu_synchronize_state(CPUState *env, int modified)
+static inline void cpu_synchronize_state(CPUState *env)
{
if (kvm_enabled()) {
- if (modified)
- kvm_arch_put_registers(env);
- else
- kvm_arch_get_registers(env);
+ kvm_cpu_synchronize_state(env);
}
}