From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: [V11 PATCH 19/21] PVH xen: VMX support of PVH guest creation/destruction Date: Thu, 22 Aug 2013 18:19:08 -0700 Message-ID: <1377220750-19514-20-git-send-email-mukesh.rathor@oracle.com> References: <1377220750-19514-1-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: <1377220750-19514-1-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: Xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This patch implements the vmx portion of the guest create, ie vcpu and domain initialization. Some changes to support the destroy path. Change in V10: - Don't call vmx_domain_initialise / vmx_domain_destroy for PVH. - Do not set hvm_vcpu.guest_efer here in vmx.c. Change in V11: - Remove vmx_update_pvh_cr() and make it part of vmx_update_guest_cr Signed-off-by: Mukesh Rathor Acked-by: Keir Fraser Reviewed-by: Andrew Cooper Reviewed-by: Tim Deegan PV-HVM-Regression-Tested-by: Andrew Cooper --- xen/arch/x86/hvm/vmx/vmx.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 9056a3f..93775dd 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -1095,6 +1095,18 @@ void vmx_update_debug_state(struct vcpu *v) static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr) { + /* + * PVH guest never causes CR3 write vmexit. This is called during the guest + * setup. + */ + if ( is_pvh_vcpu(v) && cr != 3 ) + { + printk(XENLOG_G_ERR + "PVH: d%d v%d unexpected cr%d update at rip:%lx\n", + v->domain->domain_id, v->vcpu_id, cr, __vmread(GUEST_RIP)); + return; + } + vmx_vmcs_enter(v); switch ( cr ) @@ -1183,7 +1195,7 @@ static void vmx_update_guest_cr(struct vcpu *v, unsigned int cr) /* CR2 is updated in exit stub. */ break; case 3: - if ( paging_mode_hap(v->domain) ) + if ( paging_mode_hap(v->domain) && !is_pvh_vcpu(v) ) { if ( !hvm_paging_enabled(v) ) v->arch.hvm_vcpu.hw_cr[3] = -- 1.7.2.3