On 2/4/22 22:57, David Matlack wrote:
+ vcpu->arch.root_mmu.cpu_role.base.level = 0;
+ vcpu->arch.guest_mmu.cpu_role.base.level = 0;
+ vcpu->arch.nested_mmu.cpu_role.base.level = 0;
Will cpu_role.base.level already be 0 if CR0.PG=0 && !tdp_enabled? i.e.
setting cpu_role.base.level to 0 might not have the desired effect.
It might not matter in practice since the shadow_mmu_init_context() and
kvm_calc_mmu_role_common() check both the mmu_role and cpu_role, but does
make this reset code confusing.
Good point. The (still unrealized) purpose of this series is to be able
to check mmu_role only, so for now I'll just keep the valid bit in the
ext part of the cpu_role. The mmu_role's level however is never zero,
so I can already use the level when I remove the ext part from the mmu_role.
I'll remove the valid bit of the ext part only after the cpu_role check
is removed, because then it can trivially go.
Paolo