Remove non-relevant comments and fix first sync

Signed-off-by: Chunqi Li
Bug fix: vcpus use same EPT paging structure (root_hpa)

Didn't split EPT paging structure when tm_unsync_init, thus all the
vcpus use the same EPT paging structure (root_hpa) for the established
EPT paging structure.

Increase mmu_vcpu_valid_gen and reload mmu in tm_unsync_init.

Signed-off-by: Chunqi Li
Move tm_memory_commit into tm_unsync_commit within tm_lock and add limits to the number of continuous rollbacks

1. Move vcpu->need_memory_commit=1 into KVM_RR_COMMIT case;
2. Move tm_memory_commit into tm_unsync_commit within tm_lock;
3. Add limits to the number of continuous rollback and that vcpu will commit
for sure if it rollbacked too many times.

Now it seems to work fine with 2 cores but still have something wrong with
4 cores.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
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>