kvm: run cpu state synchronization on target vcpu thread
commitc8e2085d8e7a64d753eb2a43e4aeae674a99d2ff
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Wed, 20 Aug 2014 12:55:25 +0000 (20 14:55 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 20 Aug 2014 13:21:00 +0000 (20 15:21 +0200)
treecd7c2fe8661029a5701622aac30788acd9714207
parent2656eb7c599e306b95bad82b1372fc49ba3088f6
kvm: run cpu state synchronization on target vcpu thread

As already done for kvm_cpu_synchronize_state(), let's trigger
kvm_arch_put_registers() via run_on_cpu() for kvm_cpu_synchronize_post_reset()
and kvm_cpu_synchronize_post_init().

This way, we make sure that the register synchronizing ioctls are
called from the proper vcpu thread; this avoids calls to
synchronize_rcu() in the kernel.

Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
kvm-all.c