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

Roger Pau Monne posted 1 patch 4 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20200103172935.66137-1-roger.pau@citrix.com
tools/libxc/xc_cpuid_x86.c | 11 +++++++++++
1 file changed, 11 insertions(+)
[Xen-devel] [PATCH] tools/libxc: disable x2APIC when using nested virtualization
Posted by Roger Pau Monne 4 years, 2 months ago
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@citrix.com>
---
 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@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] tools/libxc: disable x2APIC when using nested virtualization
Posted by Wei Liu 4 years, 2 months ago
On Fri, Jan 03, 2020 at 06:29:35PM +0100, Roger Pau Monne wrote:
> 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/

Putting a link here is probably not very useful because it will be gone
in no time.

If you have serial logs that would be great.

> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Wei Liu <wl@xen.org>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] tools/libxc: disable x2APIC when using nested virtualization
Posted by Andrew Cooper 4 years, 2 months ago
On 03/01/2020 17:29, Roger Pau Monne wrote:
> 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@citrix.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

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