From: Mukesh Rathor Subject: Re: [V10 PATCH 19/23] PVH xen: vmcs related changes Date: Fri, 9 Aug 2013 17:23:41 -0700 Message-ID: <20130809172341.76bddc6c@mantra.us.oracle.com> References: <1374631171-15224-1-git-send-email-mukesh.rathor@oracle.com> <1374631171-15224-20-git-send-email-mukesh.rathor@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: 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: George Dunlap Cc: "xen-devel@lists.xensource.com" , "keir.xen@gmail.com" List-Id: xen-devel@lists.xenproject.org On Fri, 9 Aug 2013 11:25:36 +0100 George Dunlap wrote: > On Wed, Jul 24, 2013 at 2:59 AM, Mukesh Rathor > wrote: > > This patch contains vmcs changes related for PVH, mainly creating a > > VMCS for PVH guest. ..... > > + v->arch.hvm_vmx.vmx_realmode = 0; > > + > > + ept->asr = pagetable_get_pfn(p2m_get_pagetable(p2m)); > > + __vmwrite(EPT_POINTER, ept_get_eptp(ept)); > > + > > + rdmsrl(MSR_IA32_CR_PAT, host_pat); > > + __vmwrite(HOST_PAT, host_pat); > > + __vmwrite(GUEST_PAT, MSR_IA32_CR_PAT_RESET); > > + > > + /* The paging mode is updated for PVH by > > arch_set_info_guest(). */ + > > + return 0; > > +} > > The majority of this function seems to be duplicating code in > construct_vmcs(), but in a different order so that it's very difficult > to tell which is which. Wouldn't it be better to just sprinkle > if(is_pvh_domain()) around consrtuct_vmcs? Nah, just makes the function extremely messy! Other maintainers I consulted with were OK with making it a separate function. The function is mostly orderded by vmx sections in the intel SDM. mukesh