From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Avi Kivity To: stable@vger.kernel.org Cc: Marcelo Tosatti , kvm@vger.kernel.org Subject: [PATCH 09/11] KVM: VMX: vmx_set_cr0 expects kvm->srcu locked Date: Wed, 9 May 2012 16:10:45 +0300 Message-Id: <1336569047-23576-10-git-send-email-avi@redhat.com> In-Reply-To: <1336569047-23576-1-git-send-email-avi@redhat.com> References: <1336569047-23576-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: From: Marcelo Tosatti vmx_set_cr0 is called from vcpu run context, therefore it expects kvm->srcu to be held (for setting up the real-mode TSS). Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity (cherry picked from commit 7a4f5ad051e02139a9f1c0f7f4b1acb88915852b) --- arch/x86/kvm/vmx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 5d1b0c7..7f33e33 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -3918,7 +3918,9 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu) vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->vpid); vmx->vcpu.arch.cr0 = X86_CR0_NW | X86_CR0_CD | X86_CR0_ET; + vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); vmx_set_cr0(&vmx->vcpu, kvm_read_cr0(vcpu)); /* enter rmode */ + srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); vmx_set_cr4(&vmx->vcpu, 0); vmx_set_efer(&vmx->vcpu, 0); vmx_fpu_activate(&vmx->vcpu); -- 1.7.10.1