mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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>
This commit is contained in:
parent
09aaa1602f
commit
4c0960c0c4
8 changed files with 34 additions and 21 deletions
8
kvm.h
8
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue