This fixes a livelock in hvmloader with credit2 scheduler, whereby an
AP can be brought online, do its work, and shut itself down, before
the BSP re-emulates the VLAPIC write that sent the SIPI. BSP then ends
up in an endless re-emulation work where it sees the target vcpu is
down, therefore schedules a tasklet, which does no work because the
vcpu is already initialised. The fix is to check v->is_initialised
rather than VPF_down, before scheduling the tasklet.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
break;
case APIC_DM_STARTUP:
- /* Nothing to do if the VCPU is not on its way down. */
- if ( !test_bit(_VPF_down, &v->pause_flags) )
+ /* Nothing to do if the VCPU is already initialised. */
+ if ( v->is_initialised )
break;
rc = vlapic_schedule_init_sipi_tasklet(v, icr_low);
break;