From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>,
Vitaly Kuznetsov <vkuznets@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: [PATCH v2 0/3] KVM: x86/mmu: Fix TLB flushing bugs in TDP MMU
Date: Thu, 25 Mar 2021 13:01:16 -0700 [thread overview]
Message-ID: <20210325200119.1359384-1-seanjc@google.com> (raw)
Two bug fixes and a clean up involving the TDP MMU, found by inspection.
Patch 1 fixes a bug where KVM yields, e.g. due to lock contention, without
performing a pending TLB flush that was required from a previous root.
Patch 2 fixes a much more egregious bug where it fails to handle TDP MMU
flushes in NX huge page recovery.
Patch 3 explicitly disallows yielding in the TDP MMU to prevent a similar
bug to patch 1 from sneaking in.
v2:
- Collect a review. [Ben]
- Disallowing yielding instead of feeding "flush" into the TDP MMU. [Ben]
- Move the yielding logic to a separate patch since it's not strictly a
bug fix and it's standalone anyways (the flush feedback loop was not).
v1:
- https://lkml.kernel.org/r/20210319232006.3468382-1-seanjc@google.com
Sean Christopherson (3):
KVM: x86/mmu: Ensure TLBs are flushed when yielding during GFN range
zap
KVM: x86/mmu: Ensure TLBs are flushed for TDP MMU during NX zapping
KVM: x86/mmu: Don't allow TDP MMU to yield when recovering NX pages
arch/x86/kvm/mmu/mmu.c | 9 +++++----
arch/x86/kvm/mmu/tdp_mmu.c | 26 ++++++++++++++------------
arch/x86/kvm/mmu/tdp_mmu.h | 23 ++++++++++++++++++++++-
3 files changed, 41 insertions(+), 17 deletions(-)
--
2.31.0.291.g576ba9dcdaf-goog
next reply other threads:[~2021-03-25 20:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-25 20:01 Sean Christopherson [this message]
2021-03-25 20:01 ` [PATCH v2 1/3] KVM: x86/mmu: Ensure TLBs are flushed when yielding during GFN range zap Sean Christopherson
2021-03-25 20:01 ` [PATCH v2 2/3] KVM: x86/mmu: Ensure TLBs are flushed for TDP MMU during NX zapping Sean Christopherson
2021-03-25 21:47 ` Ben Gardon
2021-03-25 20:01 ` [PATCH v2 3/3] KVM: x86/mmu: Don't allow TDP MMU to yield when recovering NX pages Sean Christopherson
2021-03-25 21:46 ` Ben Gardon
2021-03-25 22:25 ` Sean Christopherson
2021-03-25 22:45 ` Ben Gardon
2021-03-26 17:11 ` Paolo Bonzini
2021-03-26 17:12 ` Paolo Bonzini
2021-03-30 17:18 ` 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=20210325200119.1359384-1-seanjc@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