Skip to contentSkip to conversation

nested EPT: fix the handling of nested EPT.

PATCH Superseded Liang Li 2 participants 2 messages Jun 2, 2015

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Liang Li

author
#0 lore raw

PATCH 1/1 nested EPT: fix the handling of nested EPT.

If the host EPT entry is changed, the nested EPT should be updated. The current code does not do this, and it's wrong.

---
 xen/arch/x86/mm/p2m-ept.c | 4 ++++
 1 file changed, 4 insertions(+)
xen/arch/x86/mm/p2m-ept.c +4 -0
index 5133eb6..a8ee949 100644
@@ -26,6 +26,7 @@
 #include <asm/p2m.h>
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/hvm/vmx/vmcs.h>
+#include <asm/hvm/nestedhvm.h>
 #include <xen/iommu.h>
 #include <asm/mtrr.h>
 #include <asm/hvm/cacheattr.h>
@@ -1074,6 +1075,9 @@ void ept_sync_domain(struct p2m_domain *p2m)
     if ( !paging_mode_hap(d) || !d->vcpu || !d->vcpu[0] )
         return;
 
+    if ( nestedhvm_enabled(d) )
+        p2m_flush_nestedp2m(d);
+
     ASSERT(local_irq_is_enabled());
 
     /*
Signature · 1 line
1.9.1
#1 lore raw

xen/arch/x86/mm/p2m-ept.c void ept_sync_domain(struct p2m_domain *p2m) · line 1083

Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 02.06.15 at 19:41, <[email protected]> wrote:
xen/arch/x86/mm/p2m-ept.c +3 -0
@@ -1074,6 +1075,9 @@ void ept_sync_domain(struct p2m_domain *p2m)
     if ( !paging_mode_hap(d) || !d->vcpu || !d->vcpu[0] )
         return;
 
+    if ( nestedhvm_enabled(d) )
+        p2m_flush_nestedp2m(d);
+
     ASSERT(local_irq_is_enabled());
 
     /*

Looks plausible, but I think the addition would better go after the ASSERT().

Jan