KVM: VMX: Cache IA32_DEBUGCTL in memory
authorWanpeng Li <wanpeng.li@hotmail.com>
Wed, 29 Nov 2017 09:31:20 +0000 (01:31 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 14 Dec 2017 08:26:47 +0000 (09:26 +0100)
commit74c55931c71352317ae0f5736ee9e4ca07ba4238
tree74f88584fdc28674e27d3a0785c1167f9e476370
parent276c796cfef5bdaf9aae055f520b8857eaa3fa19
KVM: VMX: Cache IA32_DEBUGCTL in memory

MSR_IA32_DEBUGCTLMSR is zeroed on VMEXIT, so it is saved/restored each
time during world switch.  This patch caches the host IA32_DEBUGCTL MSR
and saves/restores the host IA32_DEBUGCTL msr when guest/host switches
to avoid to save/restore each time during world switch.  This saves
about 100 clock cycles per vmexit.

Suggested-by: Jim Mattson <jmattson@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Jim Mattson <jmattson@google.com>
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/vmx.c