Seperate tm_sync from tm_commit, add tm_sync to the first tm_unsync_commit

Seperate the synchronize progress from tm_commit to tm_sync.
Use tm_sync to sync the first commit of unsync preemption.

Signed-off-by: Arthur Chunqi Li <yzt356@gmail.com>
Merge disable process in tm_commit and tm_unsync_commit

Add tm_disable to handle record disable process.

Signed-off-by: Arthur Chunqi Li <yzt356@gmail.com>
Add kvm_record_separate_mem for separate memory control

Add variable kvm_record_separate_mem, indicating whether open
the separate memory facility or not.
Add <separate_memory> trigger to record_ctrl.c to control the
separate memory facility.
Now vcpu will trap when it first tries to write to a page for each
quantum. These all are the infrastructures for separate memory.

Signed-off-by: Arthur Chunqi Li <yzt356@gmail.com>
Add kvm_record_memory_cow() and tm_memory_commit() for separate memory

kvm_record_memory_cow() will new a new apge and replace the spte with it.
tm_memory_commit() will copy data from private page to the original page
and replace the spte with it.
Bug: Now there are no error messages in kern.log but the vm will crash.

Signed-off-by: Arthur Chunqi Li <yzt356@gmail.com>
Bug fix and some other changes for seperate memory

1. Add kvm_mmu_flush_tlb after memory cow in __direct_map
2. Disable SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES
3. Change the first parameter of kvm_read_guest and kvm_write_guest, from kvm to vcpu.
Adapt all caller functions to this change.
4. Split kvm_write_guest_page to two version, one with the first parameter kvm and the
other vcpu
5. Add function gfn_to_kaddr_ept to translate vcpu to kaddr via EPT
6. Change kvm_read_guest and kvm_write_guest to use EPT for gva access
7. In the first trap of record, flush EPT instead of crush the whole EPT
8. Change kvm_write_guest_cached to fit record. If kvm_record is on, directly use
kvm_write_guest instead of the cached process.
9. Add some printings in codes, but most of them are commented. Ignore them.

Signed-off-by: Arthur Chunqi Li <yzt356@gmail.com>