From: "Jan Beulich" Subject: Re: [PATCH v4 1/4] Nested VMX: check VMX capability before read VMX related MSRs Date: Mon, 23 Sep 2013 15:52:35 +0100 Message-ID: <524071D302000078000F599C@nat28.tlf.novell.com> References: <52402E3202000078000F5665@nat28.tlf.novell.com> <52402FA702000078000F568C@nat28.tlf.novell.com> <52405533.6000805@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VO7Un-0004yf-T3 for xen-devel@lists.xenproject.org; Mon, 23 Sep 2013 14:52:18 +0000 In-Reply-To: <52405533.6000805@oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Boris Ostrovsky Cc: Yang Z Zhang , xen-devel , Eddie Dong , Jun Nakajima List-Id: xen-devel@lists.xenproject.org >>> On 23.09.13 at 16:50, Boris Ostrovsky wrote: > On 09/23/2013 06:10 AM, Jan Beulich wrote: >> --- a/xen/arch/x86/hvm/vmx/vvmx.c >> +++ b/xen/arch/x86/hvm/vmx/vvmx.c >> @@ -1813,12 +1813,33 @@ int nvmx_handle_invvpid(struct cpu_user_ >> int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content) >> { >> struct vcpu *v = current; >> + unsigned int ecx, dummy; >> u64 data = 0, host_data = 0; >> int r = 1; >> >> if ( !nestedhvm_enabled(v->domain) ) >> return 0; >> >> + /* VMX capablity MSRs are available only when guest supports VMX. */ >> + hvm_cpuid(0x1, &dummy, &dummy, &ecx, &dummy); > > Depending on order in which you are going to commit patches you could > change hvm_cpuid() dummy arguments to NULLs to make use of your "make > hvm_cpuid() ..." patch. In [3/4] as well. That last patch in the series does just that. Jan