Re: [PATCH 02/22] KVM: x86: move pdptrs out of the MMU

From: Paolo Bonzini

Date: Tue May 12 2026 - 12:37:20 EST


On 5/11/26 17:06, Paolo Bonzini wrote:
PDPTRs are part of the CPU state. A bit unconventionally, they are
reached via vcpu->arch.walk_mmu instead of being stored in vcpu->arch
directly. That is nice in principle---it would allow TDP shadow paging
to have its own PDPTRs---but it is not necessary, because EPT has no
PDPTRs and NPT does not cache them.

Since kvm_pdptr_read does not otherwise need the MMU, drop the pdptrs
from the MMU altogether. There is however a negative effect, in that
they are now not stored separately in root_mmu and nested_mmu for L1
and L2 guests. This means that they are overwritten by nested VM entry
and exit, and need to be manually marked dirty.

Note that page table PDPTRs are not affected, since they are stored
in pae_root.

The vmx/nested.c and svm/nested.c changes here are untested and completely broken - I mentioned this in the cover letter but should have done it here too in case anyone reviews this. But there are some cleanup opportunities now that I looked at it more closely.

Paolo