Re: [RFC 11/19] KVM: x86/mmu: Factor shadow_zero_check out of make_spte

From: Paolo Bonzini
Date: Thu Nov 18 2021 - 13:07:44 EST


On 11/18/21 19:02, Sean Christopherson wrote:
but that's not a great name because the former is used also when shadowing
EPT/NPT. I'm thinking of standardizing on "shadow" and "TDP" (it's not
perfect because of the 32-bit and tdp_mmu=0 cases, but it's a start). Maybe
even split parts of mmu.c out into shadow_mmu.c.
But shadow is flat out wrong until EPT and NPT support is ripped out of the "legacy"
MMU.

Yeah, that's true. "full" MMU? :)

- the two walkers (I'm quite convinced of splitting that part out of struct
kvm_mmu and getting rid of walk_mmu/nested_mmu): that's easy, it can be
walk01 and walk12 with "walk" pointing to one of them

I am all in favor of walk01 and walk12, the guest_mmu vs. nested_mmu confusion
is painful.

- the two MMUs: with nested_mmu gone, root_mmu and guest_mmu are much less
confusing and we can keep those names.

I would prefer root_mmu and nested_tdp_mmu. guest_mmu is misleading because its
not used for all cases of sp->role.guest_mode=1, i.e. when L1 is not using TDP
then guest_mode=1 but KVM isn't using guest_mmu.

Ok, that sounds good too.

Paolo