From 61bd49b1e5b880e07753af09f26889015def93fd Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Fri, 24 Nov 2017 15:34:07 +0000 Subject: [PATCH] x86/pv-shim: Force CPUID faulting in pv-shim mode This is necessary to prevent the PV guest seeing HVM Xen leaves via native cpuid. Signed-off-by: Andrew Cooper --- 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 #include #include /* for XEN_INVALID_{SOCKET,CORE}_ID */ +#include #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.39.5