nested EPT: fix the handling of nested EPT.
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.
Reported-by Tim Deegan <[email protected]>
Signed-off-by Liang Li <[email protected]>
Signed-off-by Yang Zhang <[email protected]>
--- xen/arch/x86/mm/p2m-ept.c | 4 ++++ 1 file changed, 4 insertions(+)
xen/arch/x86/mm/p2m-ept.c +4 -0
@@ -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
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