From: Sean Christopherson <seanjc@google.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Ben Gardon <bgardon@google.com>
Subject: Re: [PATCH] KVM: x86/mmu: Zap only TDP MMU leafs in zap range and mmu_notifier unmap
Date: Mon, 28 Mar 2022 14:52:56 +0000 [thread overview]
Message-ID: <YkHLyP1LvH0MYN25@google.com> (raw)
In-Reply-To: <87lewuo4ge.fsf@redhat.com>
On Mon, Mar 28, 2022, Vitaly Kuznetsov wrote:
> Sean Christopherson <seanjc@google.com> writes:
>
> > Re-introduce zapping only leaf SPTEs in kvm_zap_gfn_range() and
> > kvm_tdp_mmu_unmap_gfn_range(), this time without losing a pending TLB
> > flush when processing multiple roots (including nested TDP shadow roots).
> > Dropping the TLB flush resulted in random crashes when running Hyper-V
> > Server 2019 in a guest with KSM enabled in the host (or any source of
> > mmu_notifier invalidations, KSM is just the easiest to force).
> >
> > This effectively revert commits 873dd122172f8cce329113cfb0dfe3d2344d80c0
> > and fcb93eb6d09dd302cbef22bd95a5858af75e4156, and thus restores commit
> > cf3e26427c08ad9015956293ab389004ac6a338e, plus this delta on top:
> >
> > bool kvm_tdp_mmu_zap_leafs(struct kvm *kvm, int as_id, gfn_t start, gfn_t end,
> > struct kvm_mmu_page *root;
> >
> > for_each_tdp_mmu_root_yield_safe(kvm, root, as_id)
> > - flush = tdp_mmu_zap_leafs(kvm, root, start, end, can_yield, false);
> > + flush = tdp_mmu_zap_leafs(kvm, root, start, end, can_yield, flush);
> >
> > return flush;
> > }
> >
>
> I confirm this fixes the issue I was seeing, thanks!
>
> Tested-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Phew! I think I would have cried were that not the case :-) Thanks for testing!
next prev parent reply other threads:[~2022-03-28 14:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-25 23:03 [PATCH] KVM: x86/mmu: Zap only TDP MMU leafs in zap range and mmu_notifier unmap Sean Christopherson
2022-03-28 8:40 ` Vitaly Kuznetsov
2022-03-28 14:52 ` Sean Christopherson [this message]
2022-03-29 17:03 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YkHLyP1LvH0MYN25@google.com \
--to=seanjc@google.com \
--cc=bgardon@google.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox