lkml.org 
[lkml]   [2022]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 10/23] KVM: MMU: split cpu_role from mmu_role
From
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

\
 
 \ /
  Last update: 2022-02-05 15:50    [W:0.123 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site