From: David Matlack <dmatlack@google.com>
To: kvm@vger.kernel.org
Cc: Ben Gardon <bgardon@google.com>, Joerg Roedel <joro@8bytes.org>,
Jim Mattson <jmattson@google.com>,
Wanpeng Li <wanpengli@tencent.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Junaid Shahid <junaids@google.com>,
David Matlack <dmatlack@google.com>
Subject: [PATCH 0/5] KVM: x86/mmu: Clean up is_tdp_mmu_root and root_hpa checks
Date: Thu, 17 Jun 2021 23:19:44 +0000 [thread overview]
Message-ID: <20210617231948.2591431-1-dmatlack@google.com> (raw)
This series is spun off from Sean's suggestions on [PATCH 1/8] of my TDP
MMU Fast Page Fault series [1].
Patches 1-2 and 4 cleans up some redundant code in the page fault handling path:
- Redundant checks for TDP MMU enablement.
- Redundant checks for root_hpa validity.
Patch 3 refactors is_tdp_mmu_root into a simpler function prototype.
Note to reviewers: I purposely opted not to remove the root_hpa check
from is_tdp_mmu even though it is theoretically redundant in the current
code. My rational is that it could be called from outside the page fault
handling code in the future where root_hpa can be invalid. This seems
more likely to happen than with the other functions since is_tdp_mmu()
is not inherently tied to page fault handling.
The cost of getting this wrong is high since the result would be we end
up calling executing pfn_to_page(-1 >> PAGE_SHIFT)->private in
to_shadow_page. A better solution might be to move the VALID_PAGE check
into to_shadow_page but I did not want to expand the scope of this
series.
To test this series I ran all kvm-unit-tests and KVM selftests on an
Intel Cascade Lake machine.
[1] https://lore.kernel.org/kvm/YMepDK40DLkD4DSy@google.com/
David Matlack (4):
KVM: x86/mmu: Remove redundant is_tdp_mmu_root check
KVM: x86/mmu: Remove redundant is_tdp_mmu_enabled check
KVM: x86/mmu: Refactor is_tdp_mmu_root into is_tdp_mmu
KVM: x86/mmu: Remove redundant root_hpa checks
arch/x86/kvm/mmu/mmu.c | 19 ++++++-------------
arch/x86/kvm/mmu/tdp_mmu.c | 5 -----
arch/x86/kvm/mmu/tdp_mmu.h | 5 ++---
3 files changed, 8 insertions(+), 21 deletions(-)
--
2.32.0.288.g62a8d224e6-goog
next reply other threads:[~2021-06-17 23:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-17 23:19 David Matlack [this message]
2021-06-17 23:19 ` [PATCH 1/4] KVM: x86/mmu: Remove redundant is_tdp_mmu_root check David Matlack
2021-06-17 23:19 ` [PATCH 2/4] KVM: x86/mmu: Remove redundant is_tdp_mmu_enabled check David Matlack
2021-06-18 7:17 ` kernel test robot
2021-06-18 7:17 ` kernel test robot
2021-06-18 10:42 ` Paolo Bonzini
2021-06-18 10:42 ` Paolo Bonzini
2021-06-18 16:47 ` David Matlack
2021-06-18 16:47 ` David Matlack
2021-06-18 16:55 ` Paolo Bonzini
2021-06-18 16:55 ` Paolo Bonzini
2021-06-17 23:19 ` [PATCH 3/4] KVM: x86/mmu: Refactor is_tdp_mmu_root into is_tdp_mmu David Matlack
2021-06-17 23:19 ` [PATCH 4/4] KVM: x86/mmu: Remove redundant root_hpa checks David Matlack
2021-06-18 10:45 ` [PATCH 0/5] KVM: x86/mmu: Clean up is_tdp_mmu_root and " 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=20210617231948.2591431-1-dmatlack@google.com \
--to=dmatlack@google.com \
--cc=bgardon@google.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=junaids@google.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.