From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 4/4 v3] KVM: VMX: VMXON/VMXOFF usage changes. Date: Tue, 11 May 2010 12:05:51 +0300 Message-ID: <4BE91DEF.3080903@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" , Marcelo Tosatti , Alexander Graf To: "Xu, Dongxiao" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:31042 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756024Ab0EKJFz (ORCPT ); Tue, 11 May 2010 05:05:55 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 05/07/2010 05:43 AM, Xu, Dongxiao wrote: > From: Dongxiao Xu > > SDM suggests VMXON should be called before VMPTRLD, and VMXOFF > should be called after doing VMCLEAR. > > Therefore in vmm coexistence case, we should firstly call VMXON > before any VMCS operation, and then call VMXOFF after the > operation is done. > > > @@ -4118,7 +4143,10 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu) > struct kvm_cpuid_entry2 *best; > struct vcpu_vmx *vmx = to_vmx(vcpu); > u32 exec_control; > + int cpu; > > + cpu = get_cpu(); > + vmx_vcpu_load(&vmx->vcpu, cpu); > vmx->rdtscp_enabled = false; > if (vmx_rdtscp_supported()) { > exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL); > @@ -4133,6 +4161,9 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu) > } > } > } > + vmx_vcpu_put(&vmx->vcpu); > + put_cpu(); > + > } > > static void vmx_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry) > I'm not sure why this is needed. vmx_cpuid_update() is called from a vcpu ioctl which should have called vcpu_load() before. Apart from that, everything looks good for merging. -- error compiling committee.c: too many arguments to function