Skip to content

Commit 04d82e5

Browse files
jsun26intelacrnsi
authored andcommitted
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>
1 parent 0a748fe commit 04d82e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hypervisor/arch/x86/guest/vcpuid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ static void guest_cpuid_0bh(struct acrn_vcpu *vcpu, uint32_t *eax, uint32_t *ebx
425425
cpuid_subleaf(leaf, subleaf, eax, ebx, ecx, edx);
426426
} else {
427427
*ecx = subleaf & 0xFFU;
428-
*edx = vlapic_get_apicid(vcpu_vlapic(vcpu));
429428
/* No HT emulation for UOS */
430429
switch (subleaf) {
431430
case 0U:
@@ -449,6 +448,7 @@ static void guest_cpuid_0bh(struct acrn_vcpu *vcpu, uint32_t *eax, uint32_t *ebx
449448
break;
450449
}
451450
}
451+
*edx = vlapic_get_apicid(vcpu_vlapic(vcpu));
452452
}
453453

454454
static void guest_cpuid_0dh(__unused struct acrn_vcpu *vcpu, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)

0 commit comments

Comments
 (0)