]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
x86/p2m: Drop erroneous #VE-enabled check in ept_set_entry()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 22 Jan 2019 18:58:56 +0000 (18:58 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 29 Jan 2019 11:28:11 +0000 (11:28 +0000)
Code clearing the "Suppress VE" bit in an EPT entry isn't nececsserily running
in current context.  In ALTP2M_external mode, it definitely is not, and in PV
context, vcpu_altp2m(current) acts upon the HVM union.

Even if we could sensibly resolve the target vCPU, it may legitimately not be
fully set up at this point, so rejecting the EPT modification would be buggy.

There is a path in hvm_hap_nested_page_fault() which explicitly emulates #VE
in the cpu_has_vmx_virt_exceptions case, so the -EOPNOTSUPP part of this
condition is also wrong.

Drop the !sve check entirely.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/mm/p2m-ept.c

index 2b2bf31aada7ffd7ddfeecfb9832e913d8dc9669..bb562607f7e7fac99dc6664be6fdfa0c6b912f33 100644 (file)
@@ -702,16 +702,6 @@ ept_set_entry(struct p2m_domain *p2m, gfn_t gfn_, mfn_t mfn,
 
     ASSERT(ept);
 
-    if ( !sve )
-    {
-        if ( !cpu_has_vmx_virt_exceptions )
-            return -EOPNOTSUPP;
-
-        /* #VE should be enabled for this vcpu. */
-        if ( gfn_eq(vcpu_altp2m(current).veinfo_gfn, INVALID_GFN) )
-            return -ENXIO;
-    }
-
     /*
      * the caller must make sure:
      * 1. passing valid gfn and mfn at order boundary.