@@ -1994,14 +1994,18 @@ static int
nested_vmx_handle_enlightened_vmptrld(struct kvm_vcpu *vcpu,
void nested_sync_vmcs12_to_shadow(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
+ int idx;
/*
* hv_evmcs may end up being not mapped after migration (when
* L2 was running), map it here to make sure vmcs12 changes are
* properly reflected.
*/
- if (vmx->nested.enlightened_vmcs_enabled && !vmx->nested.hv_evmcs)
+ if (vmx->nested.enlightened_vmcs_enabled && !vmx->nested.hv_evmcs) {
+ idx = srcu_read_lock(&vcpu->kvm->srcu);
nested_vmx_handle_enlightened_vmptrld(vcpu, false);
+ srcu_read_unlock(&vcpu->kvm->srcu, idx);
+ }
if (vmx->nested.hv_evmcs) {