Nested VMX: load current_vmcs only when it exists

There may not have valid vmcs on current CPU. So only load it when it exists.

This original fixing is from Edmud <edmund.h.white@intel.com>.

Signed-off-by: Edmund H White <edmund.h.white@intel.com>
Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 99c03bc6a1
master date: 2014-05-12 11:59:19 +0200
This commit is contained in:
Edmund H White authored and Jan Beulich committed 2014-05-23 15:29:43 +02:00
1 parent 2dc6658490
commit ecc692b21b
1 file changed
+5 -1
+5 -1
View File
@@ -818,8 +818,12 @@ void virtual_vmcs_enter(void *vvmcs)
void virtual_vmcs_exit(void *vvmcs)
{
struct vmcs_struct *cur = this_cpu(current_vmcs);
__vmpclear(pfn_to_paddr(domain_page_map_to_mfn(vvmcs)));
__vmptrld(virt_to_maddr(this_cpu(current_vmcs)));
if ( cur )
__vmptrld(virt_to_maddr(cur));
}
u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.