Change check commit code path

Change check commit code path to vcpu_enter_guest, to support more types of
commitment check.

Signed-off-by: Arthur Chunqi Li <yzt356@gmail.com>
Add commit and rollback with bugs

Signed-off-by: Arthur Chunqi Li <yzt356@gmail.com>
Add invalid_page check in __gfn_to_kaddr_ept() to fix a bug

Add invalid_page check in __gfn_to_kaddr_ept() when walking the mmu. Now kvm
will not crash after qemu reset the system.

Signed-off-by: Arthur Chunqi Li <yzt356@gmail.com>
Bug Fix & Print All Checkpoint Details

Bug fix No.1, also write beck arch.apic->highest_isr_cache when doing rollback.
Bug fix No.2, need to recalculate the number of the msrs when we need to rollback them.

Signed-off-by: Shiru <renshiru2000@gamil.com>
Found a Bug

get a invalid page before VM shutdown.
XELATEX - kvm_write_guest_page get INVALID_PAGE, gfn=0x1fc13, offset=0x900, memslot_id=8

Signed-off-by: Shiru <renshiru2000@gamil.com>
BUG FIX: Deadlock & MMU Reload

MMU reload: set_sregs lead to destroy mmu which will be used in set_msrs
, so reload it before set_msrs

Deadlock: move mutex_lock(&(vcpu->events_list_lock)) behind vcpu_rollback

Signed-off-by: Shiru <renshiru2000@gamil.com>
clean up codes.

Delete useless comment and codes.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
memory: fix memory commit issues in io emulation using cow

Add memory mirror and check function.
In gfn_to_kaddr_ept(), it will return NULL if the write permission is not given
and then go to tdp_page_fault() to fix it and cow.
Now it seems that memory after rollback is identical to last commit.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
Clean up codes and fix some minor issues

1. Remove unnecessary warning messages in kvm_write_guest_page_kvm() and so on;
2. Use kvm_x86_ops->tlb_flush() instead of kvm_mmu_flush_tlb() to make it
valid immediately;
3. All exit reasons but EPT_VIOLATION will cut a quantum;
4. Change the test pattern to rollback once every 99 commits;
5. Do a second memory commit for each commit regardless of its exit reason;

Now it works fine without the floating points but will results in errors
when calculating floating points.

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