]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
x86/pv-shim: Force CPUID faulting in pv-shim mode
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 24 Nov 2017 15:34:07 +0000 (15:34 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 7 Dec 2017 16:40:40 +0000 (16:40 +0000)
This is necessary to prevent the PV guest seeing HVM Xen leaves via native
cpuid.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/cpu/common.c

index a1f1a047769cd2a409ef15e9fe4e7f8661722936..65436909889b87c7d1ecc7823a5c757961726a3f 100644 (file)
@@ -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));