File 19606-hvm-x2apic-cpuid.patch of Package xen

# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1242692759 -3600
# Node ID f71c5e3ac2523a96d1b91901e8d5ee16a04dbc7d
# Parent  c1340cda65fb5859acc48e3a9aba55b52adc5347
x86 hvm: Provide x2APIC identifier in CPUID leaf 0xb.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>

--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1662,13 +1662,19 @@ void hvm_cpuid(unsigned int input, unsig
 
     domain_cpuid(v->domain, input, *ecx, eax, ebx, ecx, edx);
 
-    if ( input == 0x00000001 )
+    switch ( input )
     {
+    case 0x1:
         /* Fix up VLAPIC details. */
         *ebx &= 0x00FFFFFFu;
         *ebx |= (v->vcpu_id * 2) << 24;
         if ( vlapic_hw_disabled(vcpu_vlapic(v)) )
             __clear_bit(X86_FEATURE_APIC & 31, edx);
+        break;
+    case 0xb:
+        /* Fix the x2APIC identifier. */
+        *edx = v->vcpu_id * 2;
+        break;
     }
 }
 
openSUSE Build Service is sponsored by