From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Mingwei Zhang <mizhang@google.com>
Subject: [PATCH 0/4] Huge page related cleanups
Date: Fri, 15 Jul 2022 23:21:03 +0000 [thread overview]
Message-ID: <20220715232107.3775620-1-seanjc@google.com> (raw)
Simplify (hopefully it's simpler) zapping collapsible SPTEs by first
simplifying retrieving the host mapping level. KVM currently requires
memory be backed by a refcounted struct page in order to be mapped as
a huge page. This requires KVM to acquire the pfn that corresponds to
the gfn/hva before checking whether or not the gfn/hva can be mapped
huge.
Dropping that requirement allow the "zap collapsible" path to detect
that a shadow page can be zapped without having to first bottom out on
leaf entries. This could theoretically be a minor performance win,
e.g. then KVM doesn't need to walk all not-present leaf SPTEs to find
out that a shadow page has no children. In basic testing I didn't see
any meaningful difference (the actual zapping dominates).
There are also potential use cases for allow any mappings to be huge,
e.g. GPU buffers (IIUC). Dropping the struct page requirement makes
KVM play nice with those.
This is most definitely post-5.20 material.
Sean Christopherson (4):
KVM: x86/mmu: Don't require refcounted "struct page" to create huge
SPTEs
KVM: x86/mmu: Document the "rules" for using host_pfn_mapping_level()
KVM: x86/mmu: Don't bottom out on leafs when zapping collapsible SPTEs
KVM: selftests: Add an option to run vCPUs while disabling dirty
logging
arch/x86/kvm/mmu/mmu.c | 65 ++++++++++++-------
arch/x86/kvm/mmu/mmu_internal.h | 2 +-
arch/x86/kvm/mmu/tdp_iter.c | 9 ---
arch/x86/kvm/mmu/tdp_iter.h | 1 -
arch/x86/kvm/mmu/tdp_mmu.c | 61 ++++++++---------
.../selftests/kvm/dirty_log_perf_test.c | 30 ++++++++-
6 files changed, 94 insertions(+), 74 deletions(-)
base-commit: 8031d87aa9953ddeb047a5356ebd0b240c30f233
--
2.37.0.170.g444d1eabd0-goog
next reply other threads:[~2022-07-15 23:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-15 23:21 Sean Christopherson [this message]
2022-07-15 23:21 ` [PATCH 1/4] KVM: x86/mmu: Don't require refcounted "struct page" to create huge SPTEs Sean Christopherson
2022-07-16 5:53 ` Mingwei Zhang
2022-07-15 23:21 ` [PATCH 2/4] KVM: x86/mmu: Document the "rules" for using host_pfn_mapping_level() Sean Christopherson
2022-07-16 18:51 ` Mingwei Zhang
2022-07-18 16:50 ` Sean Christopherson
2022-07-18 20:48 ` Mingwei Zhang
2022-07-15 23:21 ` [PATCH 3/4] KVM: x86/mmu: Don't bottom out on leafs when zapping collapsible SPTEs Sean Christopherson
2022-07-15 23:21 ` [PATCH 4/4] KVM: selftests: Add an option to run vCPUs while disabling dirty logging Sean Christopherson
2022-07-19 18:02 ` [PATCH 0/4] Huge page related cleanups 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=20220715232107.3775620-1-seanjc@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mizhang@google.com \
--cc=pbonzini@redhat.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
all inboxes | Powered by JetHome®