KVM: Move KVM context switch into own function