[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YiI4AmYkm2oiuiio@google.com>
Date: Fri, 4 Mar 2022 16:02:10 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
David Hildenbrand <david@...hat.com>,
David Matlack <dmatlack@...gle.com>,
Ben Gardon <bgardon@...gle.com>,
Mingwei Zhang <mizhang@...gle.com>
Subject: Re: [PATCH v4 21/30] KVM: x86/mmu: Zap invalidated roots via
asynchronous worker
On Fri, Mar 04, 2022, Paolo Bonzini wrote:
> On 3/3/22 22:32, Sean Christopherson wrote:
> I didn't remove the paragraph from the commit message, but I think it's
> unnecessary now. The workqueue is flushed in kvm_mmu_zap_all_fast() and
> kvm_mmu_uninit_tdp_mmu(), unlike the buggy patch, so it doesn't need to take
> a reference to the VM.
>
> I think I don't even need to check kvm->users_count in the defunct root
> case, as long as kvm_mmu_uninit_tdp_mmu() flushes and destroys the workqueue
> before it checks that the lists are empty.
Yes, that should work. IIRC, the WARN_ONs will tell us/you quite quickly if
we're wrong :-) mmu_notifier_unregister() will call the "slow" kvm_mmu_zap_all()
and thus ensure all non-root pages zapped, but "leaking" a worker will trigger
the WARN_ON that there are no roots on the list.
Powered by blists - more mailing lists