summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2026-06-24 12:01:36 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2026-06-25 11:32:09 +0200
commita204badd8432f93b7e862e7dac6db0fe3d65f370 (patch)
tree9af92c6972ae850fc1721bb1b1ad9496aa846403 /tools/testing
parent50406d35f5635e1cc523e61409d57e851b5f5df8 (diff)
parent216b1a47e80c586193f323290a6baf38b487594b (diff)
downloadlinux-next-a204badd8432f93b7e862e7dac6db0fe3d65f370.tar.gz
linux-next-a204badd8432f93b7e862e7dac6db0fe3d65f370.zip
Merge branch 'kvm-chainsaw' into HEAD
The kvm_mmu is a "god data structure" that includes three different tasks: describing the guest page table's format, walking the guest page tables and building the page tables. This means that the (already poorly named) nested_mmu is only used in part, since it has no page tables to construct. Furthermore, some parts are reused across guest and host page tables (such as the reserved bits detector) but others are not; for example permission_fault is replaced by simplified code such as is_executable_pte(). This series cleans this up by splitting kvm_mmu in three parts: - kvm_pagewalk is the page table walker. There are two of them per vCPU, gva_walk and ngpa_walk. walk_mmu is *always* replaced by a single gva_walk no matter if running an L1 or L2 guest, unlike in the current code that moves it between root_mmu and nested_mmu. - kvm_mmu retains the page table building functionality. It uses a page table walker to build shadow pages; that is always gva_walk for root_mmu or ngpa_walk for guest_mmu. - kvm_page_format allows KVM to operate on PTEs that already exist, and merges the code around permission_mask() with the pre-existing struct rsvd_bits_validate. Both kvm_pagewalk and kvm_mmu have their own kvm_page_format, just like struct kvm_mmu had two instances of struct rsvd_bits_validate for gPTE and SPTE reserved bit checks. The cleanup alone already does something useful, which is to reduce the confusion between guest_mmu and nested_mmu. nested_mmu came to exist long before the introduction of guest_mmu and stole the obvious name, resulting in comments like "Exempt nested MMUs" where the code actually exempts guest_mmu. Renaming guest_mmu could be the next step, though the RFC had multiple opinions about how to do this. However, the last patch also shows the code reuse benefits can be used for new features too. By adapting the permission_fault() machinery and using it to test SPTEs against struct kvm_page_fault, it makes it possible to support SPTEs that have XS!=XU; these were not supported yet by KVM, but could now be added via memory attributes. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing')
0 files changed, 0 insertions, 0 deletions