Re: [PATCH 17/22] KVM: x86/mmu: pull struct kvm_pagewalk out of struct kvm_mmu

From: Sean Christopherson

Date: Thu May 21 2026 - 15:50:31 EST


On Thu, May 21, 2026, Sean Christopherson wrote:
> On Tue, May 19, 2026, Paolo Bonzini wrote:
> > Il mer 13 mag 2026, 23:36 Yosry Ahmed <yosry@xxxxxxxxxx> ha scritto:
> > guest_mmu is not L2 MMU if L1 does not use two-dimensional paging, so
> > l1_mmu and l2_mmu does not cut it entirely. And root_mmu can be either
> > GVA->HPA or GPA->HPA, therefore applying the idea above (e.g., gpa_mmu
> > and ngpa_mmu) would not work well.
> >
> > I suppose guest_mmu could be ngpa_mmu or shadow_tdp_mmu, but another
> > possibility/refactoring would be to adjust the code and call the two
> > MMUs direct_mmu and shadow_mmu. I haven't looked into what this means
> > for the code but it would definitely make for the clearest naming.
>
> I'm not a fan of "direct". Even if we deal with the CR0.PG=0 case, there's still
> the direct shadow pages wrinkle.
>
> I do like the idea of reworking the code so that there's an MMU for non-nested TDP
> and a shadow MMU for everything else. Given that the only thing standing in our
> way of having tdp_mmu and shadow_mmu is the existence of TDP support in the shadow
> MMU, what if we finally drop that? Then we can have tdp_mmu, which is literally
> the TDP MMU, and shadow_mmu.

And then I remembered the TDP MMU is 64-bit only. But, I saw you posted 32-bit
nested tests for KUT. Maybe this could be the motivation to invest more in that
test coverage, and be the juicy carrot that we need to finally kill off 32-bit
KVM x86?