All of lore.kernel.org
 help / color / mirror / Atom feed
* The vcpu won't be wakened for a long time
@ 2021-12-14 13:55 Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
  2021-12-14 17:36 ` Sean Christopherson
  0 siblings, 1 reply; 11+ messages in thread
From: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) @ 2021-12-14 13:55 UTC (permalink / raw)
  To: pbonzini, kvm
  Cc: Gonglei (Arei),
	Huangzhichao, seanjc, Wanpeng Li, Vitaly Kuznetsov, Jim Mattson,
	Joerg Roedel, linux-kernel

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.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-12-22 15:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 13:55 The vcpu won't be wakened for a long time Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
2021-12-14 17:36 ` Sean Christopherson
2021-12-16 14:03   ` Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
2021-12-16 15:42     ` Sean Christopherson
2021-12-17  2:11       ` Wanpeng Li
2021-12-17  5:51         ` Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
2021-12-18  9:08       ` Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
2021-12-21 15:27         ` Sean Christopherson
2021-12-21 15:34           ` Paolo Bonzini
2021-12-22  6:07           ` Chao Gao
2021-12-22 15:44             ` Sean Christopherson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.