]> xenbits.xensource.com Git - xen.git/commitdiff
x86/traps: Don't call hvm_hypervisor_cpuid_leaf() for PV guests
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 14 Nov 2016 10:18:00 +0000 (10:18 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 16 Nov 2016 10:33:18 +0000 (10:33 +0000)
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 <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
xen/arch/x86/traps.c

index 14abb62a4d0852777b3532fe9fca7cd1644cfac9..d56d76ead887f3ece96f505dfafe584833991d71 100644 (file)
@@ -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;