From: "Jan Beulich" Subject: Re: [V11 PATCH 09/21] PVH xen: domain create, context switch related code changes Date: Fri, 23 Aug 2013 09:12:41 +0100 Message-ID: <5217359902000078000EDEDA@nat28.tlf.novell.com> References: <1377220750-19514-1-git-send-email-mukesh.rathor@oracle.com> <1377220750-19514-10-git-send-email-mukesh.rathor@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VCmU8-0001IT-Hv for xen-devel@lists.xenproject.org; Fri, 23 Aug 2013 08:12:44 +0000 In-Reply-To: <1377220750-19514-10-git-send-email-mukesh.rathor@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: Mukesh Rathor Cc: xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 23.08.13 at 03:18, Mukesh Rathor wrote: > Changes in V11: > - set cr3 to page_to_maddr and not page_to_mfn. > - reject non-zero cr1 value for pvh. > - Do not check for pvh in destroy_gdt, but put the check in callers. > - Set _VPF_in_reset for PVH also. These are clearly too many changes to retain... > Reviewed-by: Jan Beulich > Acked-by: Keir Fraser > Reviewed-by: Andrew Cooper > Reviewed-by: Tim Deegan > PV-HVM-Regression-Tested-by: Andrew Cooper ... all these tags. This practice of yours was already questionable on one or two earlier patches, but I guess we can tolerate it there. > @@ -892,8 +896,19 @@ int arch_set_info_guest( > /* handled below */; > else if ( !compat ) > { > + /* PVH 32bitfixme. */ > + if ( is_pvh_vcpu(v) ) > + { > + v->arch.cr3 = page_to_maddr(cr3_page); > + v->arch.hvm_vcpu.guest_cr[3] = c.nat->ctrlreg[3]; > + } > + > v->arch.guest_table = pagetable_from_page(cr3_page); > - if ( c.nat->ctrlreg[1] ) > + > + if ( c.nat->ctrlreg[1] && is_pvh_vcpu(v) ) > + rc = -EINVAL; > + > + if ( c.nat->ctrlreg[1] && is_pv_vcpu(v) ) > { > cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[1]); > cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC); To many changes to if() conditions. I think it could be brought down to else if ( !compat ) { v->arch.guest_table = pagetable_from_page(cr3_page); /* PVH 32bitfixme. */ if ( is_pvh_vcpu(v) ) { v->arch.cr3 = page_to_maddr(cr3_page); v->arch.hvm_vcpu.guest_cr[3] = c.nat->ctrlreg[3]; if ( c.nat->ctrlreg[1] ) rc = -EINVAL; } else if ( c.nat->ctrlreg[1] ) { cr3_gfn = xen_cr3_to_pfn(c.nat->ctrlreg[1]); cr3_page = get_page_from_gfn(d, cr3_gfn, NULL, P2M_ALLOC); making the flow much more clear (at least to me). > @@ -953,6 +969,13 @@ int arch_set_info_guest( > > update_cr3(v); > > + if ( is_pvh_vcpu(v) ) > + { > + /* Set VMCS fields. */ > + if ( (rc = pvh_vcpu_boot_set_info(v, c.nat)) != 0 ) > + return rc; > + } Combine the two if()-s and drop or generalize the VMX-specific comment. Jan