HV: return virtual lapic id in vcpuid 0b leaf

Currently vlapic id of SOS VM is virtualized, it is indexed by vcpuid in
physical APIC id sequence, but CPUID 0BH leaf still report physical
APIC ID. In SDC/INDUSTRY scenario they are identical mapping so no issue
occured. In hybrid mode this would be a problem because vAPIC ID might
be different with pAPIC ID. We need to make the APIC ID which returned from
CPUID consistent with the one returned from LAPIC register.

Tracked-On: #3214

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Victor Sun 2019-06-04 19:24:26 +08:00 committed by ACRN System Integration
parent 0a748fedac
commit 04d82e5c0f
1 changed files with 1 additions and 1 deletions

View File

@ -425,7 +425,6 @@ static void guest_cpuid_0bh(struct acrn_vcpu *vcpu, uint32_t *eax, uint32_t *ebx
cpuid_subleaf(leaf, subleaf, eax, ebx, ecx, edx); cpuid_subleaf(leaf, subleaf, eax, ebx, ecx, edx);
} else { } else {
*ecx = subleaf & 0xFFU; *ecx = subleaf & 0xFFU;
*edx = vlapic_get_apicid(vcpu_vlapic(vcpu));
/* No HT emulation for UOS */ /* No HT emulation for UOS */
switch (subleaf) { switch (subleaf) {
case 0U: case 0U:
@ -449,6 +448,7 @@ static void guest_cpuid_0bh(struct acrn_vcpu *vcpu, uint32_t *eax, uint32_t *ebx
break; break;
} }
} }
*edx = vlapic_get_apicid(vcpu_vlapic(vcpu));
} }
static void guest_cpuid_0dh(__unused struct acrn_vcpu *vcpu, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) static void guest_cpuid_0dh(__unused struct acrn_vcpu *vcpu, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)