From: Tim Deegan Subject: Re: [V10 PATCH 10/23] PVH xen: domain create, context switch related code changes Date: Thu, 25 Jul 2013 15:01:57 +0100 Message-ID: <20130725140157.GC87903@ocelot.phlegethon.org> References: <1374631171-15224-1-git-send-email-mukesh.rathor@oracle.com> <1374631171-15224-11-git-send-email-mukesh.rathor@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1374631171-15224-11-git-send-email-mukesh.rathor@oracle.com> 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@lists.xensource.com, keir.xen@gmail.com List-Id: xen-devel@lists.xenproject.org At 18:59 -0700 on 23 Jul (1374605958), Mukesh Rathor wrote: > @@ -861,7 +865,7 @@ int arch_set_info_guest( > > if ( !cr3_page ) > rc = -EINVAL; > - else if ( paging_mode_refcounts(d) ) > + else if ( paging_mode_refcounts(d) || is_pvh_vcpu(v) ) Isn't paging_mode_refcounts() true for all PVH vcpus/domains? (This code is OK - I just want to check that I've understood what's going on.) > /* nothing */; > else if ( cr3_page == v->arch.old_guest_table ) > { > @@ -893,8 +897,15 @@ int arch_set_info_guest( > /* handled below */; > else if ( !compat ) > { > + /* PVH 32bitfixme. */ > + if ( is_pvh_vcpu(v) ) > + { > + v->arch.cr3 = page_to_mfn(cr3_page); Not page_to_maddr()? I guess that with paging_mode_translate(), arch.cr3 doesn't actually get used. > + 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) ) If you're respinning this patch, maybe use is_pv_vcpu() here? Tim.