x86/vmx: introduce vmx_find_msr()
authorSergey Dyasli <sergey.dyasli@citrix.com>
Thu, 23 Feb 2017 09:33:25 +0000 (09:33 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 27 Feb 2017 10:22:12 +0000 (10:22 +0000)
commit9b93c6b3695b4d09ad0505d183aa6106b8156e34
treefe6777a511101d35e9b585c4f021bab37d5bf0c3
parent4f888208147432d6f7cc0a1f8d5445c927549d7b
x86/vmx: introduce vmx_find_msr()

Modify vmx_add_msr() to use a variation of insertion sort algorithm:
find a place for the new entry and shift all subsequent elements before
insertion.

The new vmx_find_msr() exploits the fact that MSR list is now sorted
and reuses the existing code for binary search.

Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vmcs.c
xen/include/asm-x86/hvm/vmx/vmcs.h