From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH] Nested VMX: CR emulation fix up Date: Thu, 10 Oct 2013 09:25:08 -0400 Message-ID: <5256AAB4.5020309@oracle.com> References: <1381217398-16449-1-git-send-email-yang.z.zhang@intel.com> <5253DEFB02000078000F97A4@nat28.tlf.novell.com> <525428C8.1050502@oracle.com> <52555203.1060001@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VUGCM-0002HG-Tr for xen-devel@lists.xenproject.org; Thu, 10 Oct 2013 13:22:39 +0000 In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Zhang, Yang Z" Cc: "Dong, Eddie" , Jacob Shin , "suravee.suthikulpanit@amd.com" , Jan Beulich , xen-devel List-Id: xen-devel@lists.xenproject.org On 10/09/2013 08:31 PM, Zhang, Yang Z wrote: > Boris Ostrovsky wrote on 2013-10-09: >> On 10/09/2013 03:28 AM, Zhang, Yang Z wrote: >>> Boris Ostrovsky wrote on 2013-10-08: >>>> On 10/08/2013 04:31 AM, Jan Beulich wrote: >>>> >>>>> Considering that this touches code common with nested SVM, I'd >>>>> expect the SVM maintainers to have to approve of the change in any case. >>>>> >>>>> In particular I wonder whether this addition isn't obsoleting >>>>> SVM's ns_cr0. >>>>> >>>> I am not sure whether ns_cr0 (replaced with nv_guest_cr[0]) would >>>> then be updated in paths where it currently is not. >>>> >>>> For example in nsvm_vmcb_prepare4vmrun(): >>>> >>>> /* CR0 */ svm->ns_cr0 = v->arch.hvm_vcpu.guest_cr[0]; cr0 = >>>> nestedsvm_fpu_vmentry(svm->ns_cr0, ns_vmcb, n1vmcb, n2vmcb); >>>> v->arch.hvm_vcpu.guest_cr[0] = ns_vmcb->_cr0; rc = >>>> hvm_set_cr0(cr0); <------ nv_guest_cr[0] will get set here. >>> I am not familiar with SVM code. If you think this change may impact >>> the >> nested SVM. Then I will move the change to VMX specific code. >> >> No, it doesn't affect SVM code. I was responding to Jan's suggestion >> to replace SVM's ns_cr0 with the new guest_cr[0]. > So is it ok to change the code according Jan's suggestion? No. My point was that there may be unintended consequences to the change and you should leave ns_cr0 alone. -boris