All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] nested EPT: fix the handling of nested EPT.
  2015-06-02 17:41 [PATCH] nested EPT: fix the handling of nested EPT Liang Li
@ 2015-06-02  9:06 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2015-06-02  9:06 UTC (permalink / raw)
  To: Liang Li; +Cc: kevin.tian, keir, andrew.cooper3, tim, xen-devel, Yang Zhang

>>> On 02.06.15 at 19:41, <liang.z.li@intel.com> wrote:
> @@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] nested EPT: fix the handling of nested EPT.
@ 2015-06-02 17:41 Liang Li
  2015-06-02  9:06 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Liang Li @ 2015-06-02 17:41 UTC (permalink / raw)
  To: xen-devel
  Cc: kevin.tian, keir, andrew.cooper3, Liang Li, tim, jbeulich, Yang Zhang

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

Reported-by: Tim Deegan <tim@xen.org>
Signed-off-by: Liang Li <liang.z.li@intel.com>
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/arch/x86/mm/p2m-ept.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 5133eb6..a8ee949 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -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());
 
     /*
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-02 17:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-02 17:41 [PATCH] nested EPT: fix the handling of nested EPT Liang Li
2015-06-02  9:06 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.