[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] tools/libxc: disable x2APIC when using nested virtualization


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Fri, 3 Jan 2020 18:29:35 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@xxxxxxxxxx; spf=Pass smtp.mailfrom=roger.pau@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 03 Jan 2020 17:30:17 +0000
  • Ironport-sdr: IaLQSt9RImIozNB9QW4ZE4v9z68u4PtzaGc925fnfCSF5jNUER9viQAIcYT5cGd3iTRZsfEVdd i9yrcdMod9/rs2mplL2VAWWHb5zEUd0heyKjlLEVNNLJv2gsOKH3OwQginYpSwGeR8u1rE2/NH 1uW4moCvptuOzoIdiC/3U0pUpBkpx2UCvwQ1zaXmufJ1mDMuQPUBoWbqdrRENXQ9zfj3D7oM/f 3yS3+rwasVSrgfnq3/f57d4OyIg6GaxnfaPh+fg7abtkGQa7pih0AL58lv2PjemyPXqmtV+92k 6dc=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

There are issues (as reported by osstest [0]) 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.

[0] http://logs.test-lab.xenproject.org/osstest/logs/145509/

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 tools/libxc/xc_cpuid_x86.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index 2540aa1e1c..ac38c1406e 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -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);
-- 
2.24.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.