]> xenbits.xensource.com Git - xen.git/commitdiff
tools/libxc: disable x2APIC when using nested virtualization
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 3 Jan 2020 17:29:35 +0000 (18:29 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 3 Jan 2020 18:37:25 +0000 (18:37 +0000)
There are issues as reported by osstest when Xen is running nested on
itself and the L1 Xen is using x2APIC. While those are being
investigated, disable announcing the x2APIC feature in CPUID when nested
HVM mode is enabled.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wl@xen.org>
tools/libxc/xc_cpuid_x86.c

index 2540aa1e1c3070f85b4dc63fad4e39c864564e24..ac38c1406e0a853a6ffdf9257762a5ef641dca25 100644 (file)
@@ -653,6 +653,17 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid,
         p->extd.itsc = true;
         p->basic.vmx = true;
         p->extd.svm = true;
+
+        /*
+         * BODGE: don't announce x2APIC mode when using nested virtualization,
+         * as it doesn't work properly. This should be removed once the
+         * underlying bug(s) are fixed.
+         */
+        rc = xc_hvm_param_get(xch, domid, HVM_PARAM_NESTEDHVM, &val);
+        if ( rc )
+            goto out;
+        if ( val )
+            p->basic.x2apic = false;
     }
 
     rc = x86_cpuid_copy_to_buffer(p, leaves, &nr_leaves);