{"id":785916,"date":"2026-07-26T18:45:13","date_gmt":"2026-07-26T18:45:13","guid":{"rendered":"https:\/\/www.newsbeep.com\/us\/785916\/"},"modified":"2026-07-26T18:45:13","modified_gmt":"2026-07-26T18:45:13","slug":"kvm-chainsaw-expected-to-hit-linux-7-3-for-dealing-with-god-data-structure","status":"publish","type":"post","link":"https:\/\/www.newsbeep.com\/us\/785916\/","title":{"rendered":"&#8220;KVM Chainsaw&#8221; Expected To Hit Linux 7.3 For Dealing With God Data Structure"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" alt=\"VIRTUALIZATION\" src=\"https:\/\/www.phoronix.com\/assets\/categories\/virtualization.webp\" width=\"100\" height=\"100\"\/><br \/>\nA patch series that appears destined for the upcoming Linux 7.3 merge window is what&#8217;s dubbed the &#8220;KVM Chainsaw&#8221; as a major code clean-up in dealing with the kvm_mmu &#8220;god data structure&#8221;.<\/p>\n<p>Red Hat engineer and KVM maintainer Paolo Bonzini has merged the kvm-chainsaw branch to KVM&#8217;s &#8220;next&#8221; Git branch. With this KVM Chainsaw work now in the next branch, it should be submitted for the upcoming Linux 7.3 cycle.&#13;<\/p>\n<p align=\"center\"><img decoding=\"async\" src=\"https:\/\/www.newsbeep.com\/us\/wp-content\/uploads\/2026\/07\/1785091513_68_image.webp\" alt=\"KVM chainsaw\"\/><\/p>\n<p>The KVM Chainsaw work deals with the kvm_mmu structure being overloaded with multiple uses and splits it down into three parts for better handling current KVM usage. Paolo explains of KVM Chainsaw with <a href=\"https:\/\/git.kernel.org\/pub\/scm\/virt\/kvm\/kvm.git\/commit\/?id=a204badd8432f93b7e862e7dac6db0fe3d65f370\" rel=\"nofollow noopener\" target=\"_blank\">the merge<\/a> to the KVM.git next branch:<br \/>\n<br \/>&#8220;The kvm_mmu is a &#8220;god data structure&#8221; that includes three different tasks: describing the guest page table&#8217;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.&#13;<\/p>\n<p>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().&#13;<\/p>\n<p>This series cleans this up by splitting kvm_mmu in three parts:&#13;<\/p>\n<p>&#8211; 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.&#13;<\/p>\n<p>&#8211; 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.&#13;<\/p>\n<p>&#8211; 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.&#13;<\/p>\n<p>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 &#8220;Exempt nested MMUs&#8221; 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.&#13;<\/p>\n<p>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.&#8221;<\/p>\n<p>Look for this and a lot more with Linux 7.3, with the merge window opening up during the back half of August.<\/p>\n","protected":false},"excerpt":{"rendered":"A patch series that appears destined for the upcoming Linux 7.3 merge window is what&#8217;s dubbed the &#8220;KVM&hellip;\n","protected":false},"author":2,"featured_media":785917,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[7278,7277,7275,7274,7281,7279,7276,7280,7273,7284,74,7282,7283],"class_list":["post-785916","post","type-post","status-publish","format-standard","has-post-thumbnail","category-technology","tag-desktop-linux","tag-linux-benchmarking","tag-linux-hardware-benchmarks","tag-linux-hardware-reviews","tag-linux-how-to","tag-linux-performance","tag-linux-server-benchmarks","tag-open-source-graphics","tag-phoronix","tag-phoronix-test-suite","tag-technology","tag-ubuntu-benchmarks","tag-ubuntu-hardware"],"_links":{"self":[{"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/posts\/785916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/comments?post=785916"}],"version-history":[{"count":0,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/posts\/785916\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/media\/785917"}],"wp:attachment":[{"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/media?parent=785916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/categories?post=785916"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newsbeep.com\/us\/wp-json\/wp\/v2\/tags?post=785916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}