]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: vmx: speed up MSR bitmap merge
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 13 Dec 2017 13:16:30 +0000 (14:16 +0100)
committerRadim Krčmář <rkrcmar@redhat.com>
Tue, 16 Jan 2018 15:52:52 +0000 (16:52 +0100)
commit424113db115f1612793b0fc76f5709248d898e27
tree60f91e72baf56050435eccd642b4e04067e8bbb9
parent6deb0d63f88d5f59d503381e388911189faa4741
KVM: vmx: speed up MSR bitmap merge

The bulk of the MSR bitmap is either immutable, or can be copied from
the L1 bitmap.  By initializing it at VMXON time, and copying the mutable
parts one long at a time on vmentry (rather than one bit), about 4000
clock cycles (30%) can be saved on a nested VMLAUNCH/VMRESUME.

The resulting for loop only has four iterations, so it is cheap enough
to reinitialize the MSR write bitmaps on every iteration, and it makes
the code simpler.

Suggested-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/vmx.c