vvmx: fix ept_sync() for nested p2m
authorSergey Dyasli <sergey.dyasli@citrix.com>
Wed, 28 Jun 2017 09:35:45 +0000 (10:35 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 30 Jun 2017 10:27:51 +0000 (11:27 +0100)
commit6b792e28bca8301e04d7f0f0dd7033410ea941b5
tree98705625f810b49990fe1808c33e938badfebe8b
parent46c3acb308bf0cd044b114e637aacaf18b957618
vvmx: fix ept_sync() for nested p2m

If ept_sync_domain() is called for np2m, the following happens:

    1. *np2m*::ept_data::invalidate cpumask is updated
    2. IPIs are sent for CPUs in domain_dirty_cpumask forcing vmexits
    3. vmx_vmenter_helper() checks *hostp2m*::ept_data::invalidate
       and does nothing

Which is clearly a bug. Make ept_sync_domain() to update hostp2m's
invalidate mask in nested p2m case and make vmx_vmenter_helper() to
invalidate EPT translations for all EPTPs if nested virt is enabled.

Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/mm/p2m-ept.c