hv: Modify vlapic_get_apicid for x2APIC mode of vLAPIC

This patch adds support to return APIC ID if guest uses vLAPIC
in x2APIC mode.

Tracked-On: #1626
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
Reviewed-by: Xu Anthony <anthony.xu@intel.com>
This commit is contained in:
Sainath Grandhi
2018-11-01 15:12:39 -07:00
committed by lijinxia
parent 80b6e62735
commit cf4d191272
3 changed files with 11 additions and 13 deletions

View File

@@ -327,10 +327,10 @@ void guest_cpuid(struct vcpu *vcpu,
case 0x01U:
{
cpuid(leaf, eax, ebx, ecx, edx);
uint32_t apicid = vlapic_get_id(vcpu_vlapic(vcpu));
uint32_t apicid = vlapic_get_apicid(vcpu_vlapic(vcpu));
/* Patching initial APIC ID */
*ebx &= ~APIC_ID_MASK;
*ebx |= (apicid & APIC_ID_MASK);
*ebx |= (apicid << APIC_ID_SHIFT);
#ifndef CONFIG_MTRR_ENABLED
/* mask mtrr */