From: Andrew Cooper <andrew.coop...@citrix.com>

This is necessary to prevent the PV guest seeing HVM Xen leaves via native
cpuid.

Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
---
 xen/arch/x86/cpu/common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index a1f1a04776..6543690988 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -12,6 +12,7 @@
 #include <mach_apic.h>
 #include <asm/setup.h>
 #include <public/sysctl.h> /* for XEN_INVALID_{SOCKET,CORE}_ID */
+#include <asm/guest.h>
 
 #include "cpu.h"
 
@@ -177,7 +178,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 &&
+                                  (pv_shim || !is_control_domain(nextd)) &&
                                   (is_pv_domain(nextd) ||
                                    next->arch.msr->
                                    misc_features_enables.cpuid_faulting));
-- 
2.11.0


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

Reply via email to