]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
x86/msr: Offer CPUID Faulting to PVH control domains
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 13 Sep 2019 13:45:40 +0000 (14:45 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 26 Sep 2019 12:40:18 +0000 (13:40 +0100)
The control domain exclusion for CPUID Faulting predates dom0 PVH, but the
reason for the exclusion (to allow the domain builder to see host CPUID
values) isn't applicable.

The domain builder *is* broken in PVH control domains, and restricting the use
of CPUID Faulting doesn't make it any less broken.  Tweak the logic to only
exclude PV control domains.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/cpu/common.c
xen/arch/x86/msr.c

index 937d8e82a89e06701bffb8958a256da263779825..4bf852c948f963ecaa8f23878dedb25514828277 100644 (file)
@@ -169,7 +169,7 @@ void ctxt_switch_levelling(const struct vcpu *next)
                if (nextd && is_idle_domain(nextd))
                        return;
                /*
-                * We *should* be enabling faulting for the control domain.
+                * We *should* be enabling faulting for PV control domains.
                 *
                 * Unfortunately, the domain builder (having only ever been a
                 * PV guest) expects to be able to see host cpuid state in a
@@ -184,7 +184,8 @@ void ctxt_switch_levelling(const struct vcpu *next)
                 * generating the maximum full cpuid policy into Xen, at which
                 * this problem will disappear.
                 */
-               set_cpuid_faulting(nextd && !is_control_domain(nextd) &&
+               set_cpuid_faulting(nextd && (!is_control_domain(nextd) ||
+                                            !is_pv_domain(nextd)) &&
                                   (is_pv_domain(nextd) ||
                                    next->arch.msrs->
                                    misc_features_enables.cpuid_faulting));
index e65961fccb00739d6bf860615bf9c32db0c6febc..a6c8cc7627e6305f93d0036724b6706455319fc7 100644 (file)
@@ -91,8 +91,8 @@ int init_domain_msr_policy(struct domain *d)
     if ( !mp )
         return -ENOMEM;
 
-    /* See comment in intel_ctxt_switch_levelling() */
-    if ( is_control_domain(d) )
+    /* See comment in ctxt_switch_levelling() */
+    if ( is_control_domain(d) && is_pv_domain(d) )
         mp->platform_info.cpuid_faulting = false;
 
     d->arch.msr = mp;