lkml.org 
[lkml]   [2021]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectThe vcpu won't be wakened for a long time
Date
Hi guys,

We find a problem in kvm_vcpu_block().

The testcase is:
- VM configured with 1 vcpu and 1 VF (using vfio-pci passthrough)
- the vfio interrupt and the vcpu are bound to the same pcpu
- using remapped mode IRTE, NOT posted mode

The bug was triggered when the vcpu executed HLT instruction:

kvm_vcpu_block:
prepare_to_rcuwait(&vcpu->wait);
for (;;) {
set_current_state(TASK_INTERRUPTIBLE);

if (kvm_vcpu_check_block(vcpu) < 0)
break;
<------------ (*)
waited = true;
schedule();
}
finish_rcuwait(&vcpu->wait);

The vcpu will go to sleep even if an interrupt from the VF is fired at (*) and
the PIR and ON bit will be set ( in vmx_deliver_posted_interrupt ), so the vcpu
won't be wakened by subsequent interrupts.

Any suggestions ? Thanks.

\
 
 \ /
  Last update: 2021-12-14 14:56    [W:0.136 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site