lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211222060735.GA22521@gao-cwp>
Date:   Wed, 22 Dec 2021 14:07:36 +0800
From:   Chao Gao <chao.gao@...el.com>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     "Longpeng (Mike, Cloud Infrastructure Service Product Dept.)" 
        <longpeng2@...wei.com>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "Gonglei (Arei)" <arei.gonglei@...wei.com>,
        Huangzhichao <huangzhichao@...wei.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: The vcpu won't be wakened for a long time

On Tue, Dec 21, 2021 at 03:27:01PM +0000, Sean Christopherson wrote:
>On Sat, Dec 18, 2021, Longpeng (Mike, Cloud Infrastructure Service Product Dept.) wrote:
>> > Hmm, that strongly suggests the "vcpu != kvm_get_running_vcpu()" is at fault.
>> > Can you try running with the below commit?  It's currently sitting in kvm/queue,
>> > but not marked for stable because I didn't think it was possible for the check
>> > to a cause a missed wake event in KVM's current code base.
>> > 
>> 
>> The below commit can fix the bug, we have just completed  the tests.
>> Thanks.
>
>Aha!  Somehow I missed this call chain when analyzing the change.
>
>  irqfd_wakeup()
>  |
>  |->kvm_arch_set_irq_inatomic()
>     |
>     |-> kvm_irq_delivery_to_apic_fast()
>         |
>	 |-> kvm_apic_set_irq()
>
>
>Paolo, can the changelog be amended to the below, and maybe even pull the commit
>into 5.16?
>
>
>KVM: VMX: Wake vCPU when delivering posted IRQ even if vCPU == this vCPU
>
>Drop a check that guards triggering a posted interrupt on the currently
>running vCPU,

Can we move (add) this check to kvm_vcpu_trigger_posted_interrupt()?

	if (vcpu->mode == IN_GUEST_MODE) {
[...]
-		apic->send_IPI_mask(get_cpu_mask(vcpu->cpu), pi_vec);
+		if (vcpu != kvm_get_running_vcpu())
+			apic->send_IPI_mask(get_cpu_mask(vcpu->cpu), pi_vec);
 		return true;

It can achieve the purpose of the original patch without (re-)introducing
this bug.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ