Change the logics of the synchronization before recording

Add tm_unsync_pre_record to do the synchronization before enabling record.
Move all the synchronization logic out from vmx_check_rr_commit and
tm_unsync_commit. Note that when beginning recording, we should first handle
exit, then sync, then make a checkpoint and switch into the guest at last.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
Change to GFP_ATOMIC in kvm_record_memory_cow

In kvm_record_memory_cow, change the parameter of kmalloc from GFP_KERNEL to
GFP_ATOMIC, because this function will be called while holding a spinlock.
This fixes the bug that when running with too many cores the vm will crash
because of deadlock.

Signed-off-by: Le Tan <tamlokveer@gmail.com>