[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] nEPT: fix EPT pointer setting for L2 guest


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Wed, 06 Feb 2013 10:00:09 +0000
  • Delivery-date: Wed, 06 Feb 2013 10:00:19 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Dongxiao Xu <dongxiao.xu@xxxxxxxxx>
# Date 1359976054 -3600
# Node ID 90525fcb0982f2bc370e3ab1f38f5b1119e40fcc
# Parent  69398345c10e7c06f9b5a2725b4d9518307b4fb0
nEPT: fix EPT pointer setting for L2 guest

Each time in virtual_vmentry(), the code needs to cover both EPT
and shadow mode for L2 guest, updating different EPT pointer to
shadow VMCS.

This fixes the issue that, launch a guest with EPT, then kill it
and launch a second guest with shadow, the second guest will hang
at the startup screen.

Signed-off-by: Dongxiao Xu <dongxiao.xu@xxxxxxxxx>
Acked by: Eddie Dong <eddie.dong@xxxxxxxxx>
Committed-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r 69398345c10e -r 90525fcb0982 xen/arch/x86/hvm/vmx/vvmx.c
--- a/xen/arch/x86/hvm/vmx/vvmx.c       Mon Feb 04 12:03:38 2013 +0100
+++ b/xen/arch/x86/hvm/vmx/vvmx.c       Mon Feb 04 12:07:34 2013 +0100
@@ -1076,6 +1076,14 @@ uint64_t get_shadow_eptp(struct vcpu *v)
     return ept_get_eptp(ept);
 }
 
+static uint64_t get_host_eptp(struct vcpu *v)
+{
+    struct domain *d = v->domain;
+    struct ept_data *ept_data = &p2m_get_hostp2m(d)->ept;
+
+    return ept_get_eptp(ept_data);
+}
+
 static bool_t nvmx_vpid_enabled(struct nestedvcpu *nvcpu)
 {
     uint32_t second_cntl;
@@ -1159,6 +1167,8 @@ static void virtual_vmentry(struct cpu_u
     /* Setup virtual ETP for L2 guest*/
     if ( nestedhvm_paging_mode_hap(v) )
         __vmwrite(EPT_POINTER, get_shadow_eptp(v));
+    else
+        __vmwrite(EPT_POINTER, get_host_eptp(v));
 
     /* nested VPID support! */
     if ( cpu_has_vmx_vpid && nvmx_vpid_enabled(nvcpu) )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.