mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 17:58:30 +00:00
hv:fix rtvm hang with maxcpus=0/1 in bootargs
RTVM (with lapic PT) boots hang when maxcpus is assigned a value less than the CPU number configured in hypervisor. In this case, vlapic_state(per VM) is left in TRANSITION state after BSP boot, which blocks interupts to be injected to this UOS. Tracked-On: #4803 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> Reviewed-by: Li, Fei <fei1.li@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -801,9 +801,6 @@ void launch_vms(uint16_t pcpu_id)
|
||||
* VM_VLAPIC_DISABLED - All the online vCPUs/vLAPICs of this VM are in Disabled mode
|
||||
* VM_VLAPIC_TRANSITION - Online vCPUs/vLAPICs of this VM are in between transistion
|
||||
*
|
||||
* TODO: offline_vcpu need to call this API to reflect the status of rest of the
|
||||
* vLAPICs that are online.
|
||||
*
|
||||
* @pre vm != NULL
|
||||
*/
|
||||
void update_vm_vlapic_state(struct acrn_vm *vm)
|
||||
@@ -817,14 +814,17 @@ void update_vm_vlapic_state(struct acrn_vm *vm)
|
||||
vcpus_in_xapic = 0U;
|
||||
spinlock_obtain(&vm->vm_lock);
|
||||
foreach_vcpu(i, vm, vcpu) {
|
||||
if (is_x2apic_enabled(vcpu_vlapic(vcpu))) {
|
||||
vcpus_in_x2apic++;
|
||||
} else if (is_xapic_enabled(vcpu_vlapic(vcpu))) {
|
||||
vcpus_in_xapic++;
|
||||
} else {
|
||||
/*
|
||||
* vCPU is using vLAPIC in Disabled mode
|
||||
*/
|
||||
/* Skip vCPU in state outside of VCPU_RUNNING as it may be offline. */
|
||||
if (vcpu->state == VCPU_RUNNING) {
|
||||
if (is_x2apic_enabled(vcpu_vlapic(vcpu))) {
|
||||
vcpus_in_x2apic++;
|
||||
} else if (is_xapic_enabled(vcpu_vlapic(vcpu))) {
|
||||
vcpus_in_xapic++;
|
||||
} else {
|
||||
/*
|
||||
* vCPU is using vLAPIC in Disabled mode
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user