From: Andrew Cooper Date: Mon, 14 Nov 2016 10:18:00 +0000 (+0000) Subject: x86/traps: Don't call hvm_hypervisor_cpuid_leaf() for PV guests X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~94 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0f43883193da76fc928e836e319c3172f394e0f3;p=xen.git x86/traps: Don't call hvm_hypervisor_cpuid_leaf() for PV guests Luckily, hvm_hypervisor_cpuid_leaf() and vmx_hypervisor_cpuid_leaf() are safe to execute in the context of a PV guest, but HVM-specific feature flags shouldn't be visible to PV guests. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Release-acked-by: Wei Liu --- diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 14abb62a4d..d56d76ead8 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -928,6 +928,11 @@ int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx, break; case 4: + if ( !has_hvm_container_domain(currd) ) + { + *eax = *ebx = *ecx = *edx = 0; + break; + } hvm_hypervisor_cpuid_leaf(sub_idx, eax, ebx, ecx, edx); break;